makoto / blockparty

NO BLOCK NO PARTY
MIT License
164 stars 41 forks source link

Added NETWORK env variables #33

Closed jefflau closed 7 years ago

jefflau commented 7 years ago

This adds two new npm scripts:

npm run start:testnet and npm run start:mainnet will both set variables under process.env.NETWORK which can be accessed within the app.

npm start will now have a default process.env.NETWORK === 'testrpc'. We can add more if and when we need it for say read only from augur etc...

makoto commented 7 years ago

Can you add the documentation of how you compile , deploy, build, and serve depending on each network somewhere around https://github.com/makoto/blockparty#running-locally so that I can test out whether it works in all the environment ?

jefflau commented 7 years ago

It won't deploy to every network. I've only setup the environment variables in a way that will allow you to use the correct network. We'll still need to do some work like we discussed before by creating a config.js to alter the address of the node

makoto commented 7 years ago

How do I deploy this app? Currently I am uploading files under build into s3 bucket. Can I still use the same method or do I have to deploy to node.js aware paas platform?

makoto commented 7 years ago

I was guessing that NETWORK=testnet node scripts/build.js will work but it's blowing up (even when I create build/contracts directory. Does it not write concatenated files as outputs?

17:54:48-makoto~/work/blockparty (networkVariables)$ NETWORK=testnet node scripts/build.js 
17:55:00-makoto~/work/blockparty (networkVariables)$ node scripts/build.js 
fs.js:951
  return binding.readdir(pathModule._makeLong(path), options.encoding);
                 ^

Error: ENOENT: no such file or directory, scandir './build/contracts'
makoto commented 7 years ago

Given that build is for separate PR, signed off by @makoto

makoto commented 7 years ago

This PR may be now obsolete after https://github.com/makoto/blockparty/pull/34 . Will double check after deploying to mainnet