Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set ropsten endpoint configuration #6

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
MNEMONIC="onther eth pls kevin zoe carl jace jason thomas jake aiden jin"
INFURA_API_KEY="ff28995e0d5d43d48f19e8356e77dded"

OPERATOR_PRIV_KEY="b71c71a67e1177ad4e901695e1b4b9ee17ae16c6668d313eac2f96dbcda3f291"

ADDR0="0x5df7107c960320b90a3d7ed9a83203d1f98a811d";
Expand Down
2 changes: 0 additions & 2 deletions migrations/2_deploy_ether_token.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ const MintableToken = artifacts.require('MintableToken.sol');
const EtherToken = artifacts.require('EtherToken.sol');

const development = process.env.NODE_ENV !== 'production';

const baseTokenAddress = process.env.BASE_TOKEN || '0x0000000000000000000000000000000000000000';

const swapEnabled = true;

module.exports = function (deployer) {
Expand Down
29 changes: 16 additions & 13 deletions migrations/3_deploy_rootchain.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
const MintableToken = artifacts.require('MintableToken.sol');
const EtherToken = artifacts.require('EtherToken.sol');
const EpochHandler = artifacts.require('EpochHandler.sol');
const RootChain = artifacts.require('RootChain.sol');
const EtherToken = artifacts.require('EtherToken.sol');

const swapEnabled = true;
const development = process.env.NODE_ENV !== 'production';

const NRBEpochLength = process.env.NRB_EPOCH_LENGTH || 2;
const statesRoot = '0xdb431b544b2f5468e3f771d7843d9c5df3b4edcf8bc1c599f18f0b4ea8709bc3';
const transactionsRoot = '0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421';
const receiptsRoot = '0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421';

module.exports = function (deployer) {
deployer.deploy(EpochHandler)
.then((epochHandler) => deployer.deploy(
RootChain,
epochHandler.address,
EtherToken.address,
development,
NRBEpochLength,
statesRoot,
transactionsRoot,
receiptsRoot))
.catch(e => { throw e; });
deployer.deploy(MintableToken)
.then(token => deployer.deploy(EtherToken, development, token.address, swapEnabled)
.then(etherToken => deployer.deploy(EpochHandler)
.then(epochHandler => deployer.deploy(
RootChain,
epochHandler.address,
etherToken.address,
development,
NRBEpochLength,
statesRoot,
transactionsRoot,
receiptsRoot))
.catch(e => { throw e; })));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MintableToken and EtherTOken are deployed in 2_deploy_ether_token.js.

};
45 changes: 29 additions & 16 deletions truffle-config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
require('dotenv').config();

const HDWalletProvider = require('truffle-hdwallet-provider');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

git add modified packages.json

const ropstenProviderUrl = `https://ropsten.infura.io/v3/${process.env.INFURA_API_KEY}`;
const ropstenProvider = new HDWalletProvider(`${process.env.MNEMONIC}`, ropstenProviderUrl, 0, 50);

module.exports = {
networks: {
development: {
Expand All @@ -24,22 +28,31 @@ module.exports = {
gasPrice: 1e9,
network_id: '*', // eslint-disable-line camelcase
},
// ropsten: {
// provider: ropstenProvider,
// network_id: 3, // eslint-disable-line camelcase
// },
// coverage: {
// host: 'localhost',
// network_id: '*', // eslint-disable-line camelcase
// port: 8555,
// gas: 0xfffffffffff,
// gasPrice: 0x01,
// },
// ganache: {
// host: 'localhost',
// port: 8545,
// network_id: '*', // eslint-disable-line camelcase
// },
docker: {
host: '192.168.0.8',
port: 8545,
gas: 7500000,
gasPrice: 1e9,
network_id: '*', // eslint-disable-line camelcase
websocket: true,
},
ropsten: {
provider: ropstenProvider,
network_id: 3, // eslint-disable-line camelcase
gas: 7500000,
},
coverage: {
host: 'localhost',
network_id: '*', // eslint-disable-line camelcase
port: 8555,
gas: 0xfffffffffff,
gasPrice: 0x01,
},
ganache: {
host: 'localhost',
port: 8545,
network_id: '*', // eslint-disable-line camelcase
},
},
mocha: {
reporter: 'eth-gas-reporter',
Expand Down