Browse Source

Split contracts env vars to develop and test

develop
Apostolos Fanakis 4 years ago
parent
commit
6aaa585e4b
  1. 16
      packages/concordia-contracts/README.md
  2. 13
      packages/concordia-contracts/truffle-config.js

16
packages/concordia-contracts/README.md

@ -23,14 +23,14 @@ Default values are:
Linux: Linux:
```shell script ```shell script
export CHAIN_HOST="127.0.0.1" export DEVELOP_CHAIN_HOST="127.0.0.1"
export CHAIN_PORT="7545" export DEVELOP_CHAIN_PORT="7545"
``` ```
Windows: Windows:
```shell script ```shell script
SET CHAIN_HOST="127.0.0.1" SET DEVELOP_CHAIN_HOST="127.0.0.1"
SET CHAIN_PORT="7545" SET DEVELOP_CHAIN_PORT="7545"
``` ```
Migrate (using the development network here, change if necessary): Migrate (using the development network here, change if necessary):
@ -48,14 +48,14 @@ Default values are:
Linux: Linux:
```shell script ```shell script
CHAIN_HOST="127.0.0.1" TEST_CHAIN_HOST="127.0.0.1"
CHAIN_PORT="7545" TEST_CHAIN_PORT="7545"
``` ```
Windows: Windows:
```shell script ```shell script
SET CHAIN_HOST="127.0.0.1" SET TEST_CHAIN_HOST="127.0.0.1"
SET CHAIN_PORT="7545" SET TEST_CHAIN_PORT="7545"
``` ```
Test: Test:

13
packages/concordia-contracts/truffle-config.js

@ -1,8 +1,9 @@
const path = require('path'); const path = require('path');
const defaults = require('./constants/config/defaults'); const defaults = require('./constants/config/defaults');
const { CHAIN_HOST } = process.env; const {
const { CHAIN_PORT } = process.env; DEVELOP_CHAIN_HOST, DEVELOP_CHAIN_PORT, TEST_CHAIN_HOST, TEST_CHAIN_PORT,
} = process.env;
module.exports = { module.exports = {
// See <http://truffleframework.com/docs/advanced/configuration> // See <http://truffleframework.com/docs/advanced/configuration>
@ -15,13 +16,13 @@ module.exports = {
contracts_build_directory: path.join(__dirname, 'build/'), contracts_build_directory: path.join(__dirname, 'build/'),
networks: { networks: {
develop: { develop: {
host: CHAIN_HOST || defaults.develop.chainHost, host: DEVELOP_CHAIN_HOST || defaults.develop.chainHost,
port: CHAIN_PORT || defaults.develop.chainPort, port: DEVELOP_CHAIN_PORT || defaults.develop.chainPort,
network_id: '*', network_id: '*',
}, },
test: { test: {
host: CHAIN_HOST || defaults.test.chainHost, host: TEST_CHAIN_HOST || defaults.test.chainHost,
port: CHAIN_PORT || defaults.test.chainPort, port: TEST_CHAIN_PORT || defaults.test.chainPort,
network_id: '*', network_id: '*',
}, },
}, },

Loading…
Cancel
Save