diff --git a/README.md b/README.md index dc518c0..78dda85 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ All truffle boxes come with Truffle, Webpack and React. This box adds react-rout ## Installation -1. Install truffle and an ethereum client. For local development, try EthereumJS TestRPC. +1. Install geth, truffle and an ethereum client. For local development, try EthereumJS TestRPC. Geth might take a while, but instructions can be found here: https://github.com/ethereum/go-ethereum/wiki/Installation-Instructions-for-Mac -- then after that install truffle: ```javascript npm install -g truffle // Version 3.0.5+ required. npm install -g ethereumjs-testrpc @@ -19,19 +19,24 @@ All truffle boxes come with Truffle, Webpack and React. This box adds react-rout ```javascript npm install ``` +4. Start geth console, and open a port on your local machine + ```javascript + geth console + admin.startRPC("127.0.0.1", 8545, "*", "web3,db,net,eth") + ``` -4. Compile and migrate the contracts. +5. Compile and migrate the contracts. ```javascript - truffle compile - truffle migrate + NODE_ENV=test truffle compile + NODE_ENV=test truffle migrate ``` -5. Run the webpack server for front-end hot reloading. For now, smart contract changes must be manually recompiled and migrated. +6. Run the webpack server for front-end hot reloading. For now, smart contract changes must be manually recompiled and migrated. ```javascript npm run start ``` -6. Jest is included for testing React components and Truffle's own suite is incldued for smart contracts. Be sure you've compile your contracts before running jest, or you'll receive some file not found errors. +7. Jest is included for testing React components and Truffle's own suite is incldued for smart contracts. Be sure you've compile your contracts before running jest, or you'll receive some file not found errors. ```javascript // Runs Jest for component tests. npm run test @@ -40,7 +45,7 @@ All truffle boxes come with Truffle, Webpack and React. This box adds react-rout truffle test ``` -7. To build the application for production, use the build command. A production build will be in the build_webpack folder. +8. To build the application for production, use the build command. A production build will be in the build_webpack folder. ```javascript npm run build ``` diff --git a/migrations/1_initial_migration.js b/migrations/1_initial_migration.js index 4d5f3f9..37fdba3 100644 --- a/migrations/1_initial_migration.js +++ b/migrations/1_initial_migration.js @@ -1,5 +1,9 @@ -var Migrations = artifacts.require("./Migrations.sol"); +var Migrations = require("../contracts/Migrations.sol"); +var artifactor = require("truffle-artifactor"); module.exports = function(deployer) { - deployer.deploy(Migrations); + artifactor.save({}, Migrations).then(()=> { + console.log('made it here') + deployer.deploy(Migrations); + }) }; diff --git a/migrations/2_deploy_contracts.js b/migrations/2_deploy_contracts.js index 71ffad9..1ac85b3 100644 --- a/migrations/2_deploy_contracts.js +++ b/migrations/2_deploy_contracts.js @@ -1,5 +1,9 @@ -var SimpleStorage = artifacts.require("./SimpleStorage.sol"); +var SimpleStorage = require("../contracts/SimpleStorage.sol"); +var artifactor = require("truffle-artifactor"); module.exports = function(deployer) { - deployer.deploy(SimpleStorage); + artifactor.save({}, SimpleStorage).then(()=> { + console.log('made it SimpleStorage') + deployer.deploy(SimpleStorage); + }) }; diff --git a/package.json b/package.json index 7fd0c09..2c4480a 100644 --- a/package.json +++ b/package.json @@ -41,6 +41,7 @@ "recursive-readdir": "2.1.0", "strip-ansi": "3.0.1", "style-loader": "0.13.1", + "truffle-artifactor": "^1.0.2", "truffle-contract": "^1.1.8", "truffle-solidity-loader": "0.0.8", "url-loader": "0.5.7", diff --git a/test/metacoin.js b/test/metacoin.js index 826d1d5..12e24bb 100644 --- a/test/metacoin.js +++ b/test/metacoin.js @@ -1,4 +1,4 @@ -var MetaCoin = artifacts.require("./MetaCoin.sol"); +var MetaCoin = require("./TestMetacoin.sol"); contract('MetaCoin', function(accounts) { it("should put 10000 MetaCoin in the first account", function() {