Workers Auto Approve
Make setting up & testing locally easy
Currently, it is not easy to set this app up locally. While we have scripts for building the app.zip we need for development and production, these do not cater for local deployment and testing.
From the root directory, you can run `./node_modules/.bin/embark build` (which defaults to `localhost` and deploys contracts locally), change the `_ipfsConnection.id() -> .version()` at L125 of `src/embarkArtifacts/embarkjs.js` yourself, and `npm run start` to get things going. However, the app will fail to connect to `http://localhost/metadata/all` - the endpoint it is expecting to fetch metadata from (because `npm run start` only sets up the frontend).
See the `error Error: "Request failed with status code 404"` in the web console, go to the Network tab to see the `404` failing at http://localhost:3000/metadata/all. This is because the back-end is not running, obviously.
1. I would create another ENV variable - `localhost` - in the Makefile so that the build script can also build locally (it can use the same mnemonic and pswd as `development` does).
2. Skip the app.zip step if `localhost` is set - that is only need for ElasticBeanstalk (dev and prod)
3. The Makefile creates a `full-build` directory - you need to `cd` into it, `npm install` the necessary packages and make sure that `node server.js` runs correctly and allows you to develop and test locally without issues.
4. Make sure you can submit a DApp successfully.
5. Document your changes in the README
**Actually**, it's gonna be hack to `npm install` every time you want to rebuild with changes, so if `process.node.ENV == localhost` then don't delete the `full-build` dir, just replace what is in there leaving `node_modules` intact. There must be a better way to do this... Let's see what Jakub says when he is around, because I am invariably wrong about these things...
There's another problem: in order to submit to a contract running locally, you'll actually need to have Embark running, rather than just building and pointing to a specific contract on Ropsten or Mainnet (as we do for dev or prod builds). You would need to connect MM or Status to your localhost, and make sure tokens are generated in an account you can access there. This is a lot of work, and doesn't make getting set up easier.
I have a potential hack. For local deployment:
1. We still target Ropsten and `STT` (because anyone can get it easily from simpledapp.eth), but we deploy a new Discover contract so as not to mess with the one on dev.dap.ps. To do this, change the [config/contracts.js](https://github.com/dap-ps/discover/blob/master/config/contracts.js) using `args: ['$MiniMeToken']` as the param for `Discover` for local development. The current wallet has some Ropsten ETH, or developers can create their own WALLET_MNEMONIC env variable with rETH in it.
2. This means you you can still just `embark build` for `localhost` and exit that process. No funny stuff with MM/Status either. Just connect to Ropsten and get STT from simpledapp.eth
3. We still need to set up the `metadata/all` endpoint (i.e. run the back-end)
Setup your profile
Tell us a little about you:
No results found for
Type to search skills..
Required [[totalcharacter]] / 240
Are you currently looking for work?
[[ option.string ]]
Setup your profile
Our tools are based on the principles of earn (💰), learn (📖), and meet (💬).
Select the ones you are interested in. You can change it later in your settings.
I'm also an organization manager looking for a great community.
Enable your organization profile
Gitcoin products can help grow community around your brand. Create your tribe, events, and incentivize your community with bounties. Announce new and upcoming events using townsquare. Find top-quality hackers and fund them to work with you on a grant.
These are the organizations you own. If you don't see your organization here please be sure that information is public on your GitHub profile. Gitcoin will sync this information for you.
Select the products you are interested in:
Out of the box you will receive Tribes Lite for your organization. Please provide us with a contact email: