Skip to content

Relase B Volta Deployment (before Monorepo)

Daniel Kmak edited this page Sep 11, 2019 · 6 revisions

Relase B Volta Deployment

First, install:

npm install

In connection-config.json change develop.web3 property to be:

https://volta-rpc.energyweb.org

At the end file should look like this:

{
    "develop": {
        "web3": "https://volta-rpc.energyweb.org",
        "deployKey": "d9066ff9f753a1898709b568119055660a77d9aae4d7a4ad677b8fb3d2a571e5"
    }
}

Start backend:

npm run start-test-backend

After you run make sure it's accessible. Open browser and go to URL: HOST:3030, you should receive following response:

Cannot GET /

Which means the server is running. If you get other message / browser error / timeout this means that you're using wrong HOST. Try to find out where your backend is running and use correct HOST.

Deploy demo:

npm run start

Install:

npm install

Now, depending if you run development version or build and distribute UI to a server change either .env.dev or .env.prod. You most likely want to use development server if you're testing.

Running UI Development Server

Modify API_BASE_URL in .env.dev to be your backend API address. For example the line should look like:

API_BASE_URL="HOST:3030"

Now you can run development server which should be accessible on HOST:3000 URL in your browser. This is command used to run development server:

npm run start

Building UI

Modify API_BASE_URL in .env.prod to be your backend API address. For example the line should look like:

API_BASE_URL="HOST:3030"

Now you can build project:

npm run build

Output files will land in dist directory, but the whole ew-origin-ui directory is required, because assets are placed outside of dist directory. This is a drawback of Release B, that we addressed with latest version of Origin when we moved to Monorepo.

In both cases remember to replace HOST with your machine address, for example HOST:3030 should become localhost:3030

Test everything together

Run frontend and pass OriginContractLookup address from deploying demo.

Make sure you have correct RPC set in MetaMask. For example, if you deployed contracts to Volta, in MetaMask add and use RPC: https://volta-rpc.energyweb.org.

Now, in your browser open following URL: HOST/ORIGIN_CONTRACT_LOOKUP_ADDRESS.

where HOST is your machine address and ORIGIN_CONTRACT_LOOKUP_ADDRESS is address you have from deploying demo

Final URL you access should look like this: http://<yourdomain.com>/0x3AF7D443E6C68d2c6bde2DdE11820137Ce1377Ed.

In this case:

  • HOST is: http://<yourdomain.com>
  • ORIGIN_CONTRACT_LOOKUP_ADDRESS is: 0x3AF7D443E6C68d2c6bde2DdE11820137Ce1377Ed

Additional note regarding HOST. When running locally it's usually localhost or 127.0.0.1.