Skip to content
This repository has been archived by the owner on Mar 11, 2024. It is now read-only.

Initializing Repo Instrucitons - Geth & Truffle #5

Open
j0xhn opened this issue Apr 3, 2017 · 6 comments
Open

Initializing Repo Instrucitons - Geth & Truffle #5

j0xhn opened this issue Apr 3, 2017 · 6 comments

Comments

@j0xhn
Copy link

j0xhn commented Apr 3, 2017

I tried to get this repo up and running. I could get npm to install and run on my local machine but was given these errors when I tried to run the truffle compile / truffle migrate commands:

Error: Using 'babel-preset-react-app' requires that you specify 'NODE_ENV' or 'BABEL_ENV' environment variables. Valid values are "development", "test", and "production". Instead, received: undefined. (While processing preset: "/Users/john/Dev/projects/temp/truffle-box/node_modules/babel-preset-react-app/index.js")

I fixed this by adding the variable in front of my command:

NODE_ENV=test truffle compile
NODE_ENV=test truffle migrate

Then I got this error:

Error: Invalid JSON RPC response: "Error: connect ECONNREFUSED 127.0.0.1:8545\n    at Object.exports._errnoException (util.js:1022:11)\n    at exports._exceptionWithHostPort (util.js:1045:20)\n    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1090:14)"

So I opened up another terminal, opened a geth console, and executed this command to get it working:

geth console
admin.startRPC("127.0.0.1", 8545, "*", "web3,db,net,eth")

After that, the compile worked just fine but the migration did not. I got this error:

                 ^
ReferenceError: artifacts is not defined```

This however, I'm not sure what the intention is.  I can re-map it to ./contracts/Migrations.sol and the same for the SimpleStore.sol file, but not sure what artifacts is, and the metacoin file also includes a missing a wrong "./MetaCoin.sol" when I believe you're really trying to reach the ./TestMetacoin.sol file.  Not sure if the intention is to use https://github.com/trufflesuite/truffle-artifactor... just looking for some clarification.  I've included a pull request here (https://github.com/truffle-box/truffle-box-uport/pull/4) to fix some of these issues, but not exactly sure where to go in order to resolve all the artifact stuff.  
@rinaldorossi
Copy link

Try to use an nvm version > 6

@j0xhn
Copy link
Author

j0xhn commented Apr 5, 2017

@rinaldorossi Thanks for getting back to me. I tried nvm version and node -v and they both gave me v7.4.0 - What am I supposed to be seeing as a difference in my code by having nvm > 6?

Also there are pointers to .sol files that have been moved like
var Migrations = require("../contracts/Migrations.sol"); instead of var Migrations = artifacts.require("./Migrations.sol");

How is that supposed to work anyways with the artifacts.require placed at the top of the page? In that file artifacts is treated like a global variable. Where is it put on the global namespace? The only artifact related npm that I could find was truffle-artifactor -- is that supposed to be present in my node_modules? I found ether-pudding, but the APIs for the two didn't seem to match up completely.

I apologize now if my arrogance is annoying you, just trying to make sense of this stuff and get it working. Thanks for your time, I appreciate your help.

@rinaldorossi
Copy link

Could you share your repo?

@j0xhn
Copy link
Author

j0xhn commented Apr 6, 2017

My branch is a fork: https://github.com/johndangerstorey/truffle-box-uport
and I have a PR here: #4

@OnlyOneJMJQ
Copy link
Contributor

@johndangerstorey Still having difficulties? Prior to running the RPC with Geth, was ethereumjs-testrpc not working?

@j0xhn
Copy link
Author

j0xhn commented Jul 11, 2017

@DiscRiskandBisque I haven't tried recently. I can try again in a bit though and let ya know. If my memory serves me, I think I figured out the issue before was because all my "artifacts" errors came from me not installing truffle globally.... but again, that was months ago, so I'm not certain. If I have more issues I'll let you know.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants