From 3982f1975bdb6ff84579dacb1bba7a6101737833 Mon Sep 17 00:00:00 2001 From: "John D. Storey" Date: Sun, 2 Apr 2017 23:11:09 -0600 Subject: [PATCH 1/3] adds some documentation to the initial setup --- README.md | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index dc518c0..db36868 100644 --- a/README.md +++ b/README.md @@ -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 ``` From ce169ac825b11aca6ce22ffdb907a2bd6da83e30 Mon Sep 17 00:00:00 2001 From: "John D. Storey" Date: Thu, 6 Apr 2017 08:52:14 -0600 Subject: [PATCH 2/3] commit to push and share --- migrations/1_initial_migration.js | 8 ++++++-- migrations/2_deploy_contracts.js | 8 ++++++-- package.json | 1 + test/metacoin.js | 2 +- 4 files changed, 14 insertions(+), 5 deletions(-) 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() { From cad1771db50961c166aa2f075db949a0c83bf515 Mon Sep 17 00:00:00 2001 From: "John D. Storey" Date: Fri, 28 Apr 2017 18:03:07 -0600 Subject: [PATCH 3/3] updates for geth --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index db36868..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