diff --git a/config/default.js b/config/default.js index ec1d3561b..61ebcf02a 100644 --- a/config/default.js +++ b/config/default.js @@ -33,6 +33,7 @@ module.exports = { USE_INFURA: process.env.USE_INFURA === 'true', ETH_PRIVATE_KEY: process.env.ETH_PRIVATE_KEY, // owner's/deployer's private key ETH_ADDRESS: process.env.ETH_ADDRESS, + USE_HOSTED_GETH: process.env.USE_HOSTED_GETH === 'true', OPTIMIST_HOST: process.env.OPTIMIST_HOST || 'optimist', OPTIMIST_PORT: process.env.OPTIMIST_PORT || 80, clientBaseUrl: `http://${process.env.CLIENT_HOST}:${process.env.CLIENT_PORT}`, diff --git a/docker-compose.hosted.geth.yml b/docker-compose.hosted.geth.yml new file mode 100644 index 000000000..196fe8904 --- /dev/null +++ b/docker-compose.hosted.geth.yml @@ -0,0 +1,38 @@ +version: '3.5' +# Use this script for running up nightfall_3 in 'ropsten' mode with local +# Use it as an override file for docker-compose.yml +# See the readme for more information. +services: + client1: + environment: + BLOCKCHAIN_URL: 'wss://ropsten1-ws.testnet.nightfall3.com' + USE_HOSTED_GETH: 'true' + AUTOSTART_RETRIES: 600 + + client2: + environment: + BLOCKCHAIN_URL: 'wss://ropsten1-ws.testnet.nightfall3.com' + USE_HOSTED_GETH: 'true' + AUTOSTART_RETRIES: 600 + + deployer: + environment: + # ETH_NETWORK sets the network selected by Truffle from truffle-config.js + # startup routines will wait for a blockchain client to be reachable on this network + ETH_NETWORK: ropsten + BLOCKCHAIN_URL: 'wss://ropsten1-ws.testnet.nightfall3.com' + USE_HOSTED_GETH: 'true' + FROM_ADDRESS: '0x29100E7E3dA6654BF63d9E7804ADe518aCc5AaA5' + ETH_PRIVATE_KEY: $ETH_PRIVATE_KEY + + optimist1: + environment: + BLOCKCHAIN_URL: 'wss://ropsten1-ws.testnet.nightfall3.com' + USE_HOSTED_GETH: 'true' + AUTOSTART_RETRIES: 600 + + optimist2: + environment: + BLOCKCHAIN_URL: 'wss://ropsten1-ws.testnet.nightfall3.com' + USE_HOSTED_GETH: 'true' + AUTOSTART_RETRIES: 600 diff --git a/nightfall-deployer/entrypoint.sh b/nightfall-deployer/entrypoint.sh index 5eeb45dee..bbd6b6738 100755 --- a/nightfall-deployer/entrypoint.sh +++ b/nightfall-deployer/entrypoint.sh @@ -2,7 +2,7 @@ set -o errexit set -o pipefail -if [ -z "${USE_INFURA}" ] && [ -z "${ETH_PRIVATE_KEY}" ]; then +if [ -z "${USE_INFURA}" ] && [ -z "${ETH_PRIVATE_KEY}" ] && [ -z "${USE_HOSTED_GETH}" ]; then # wait until there's a blockchain client up while ! nc -z ${BLOCKCHAIN_WS_HOST} ${BLOCKCHAIN_PORT}; do sleep 3; done fi diff --git a/nightfall-deployer/migrations/4_test_tokens_migration.js b/nightfall-deployer/migrations/4_test_tokens_migration.js index 1bd13237b..1b608a67d 100644 --- a/nightfall-deployer/migrations/4_test_tokens_migration.js +++ b/nightfall-deployer/migrations/4_test_tokens_migration.js @@ -45,4 +45,4 @@ module.exports = function (deployer, _, accounts) { } } }); -}; +}; \ No newline at end of file diff --git a/nightfall-deployer/src/circuit-setup.mjs b/nightfall-deployer/src/circuit-setup.mjs index 8662ba5af..30f8f423f 100644 --- a/nightfall-deployer/src/circuit-setup.mjs +++ b/nightfall-deployer/src/circuit-setup.mjs @@ -134,7 +134,7 @@ async function setupCircuits() { // when deploying on infura - do serial tx execution to avoid nonce issue // when using a private key, we shouldn't assume an unlocked account and we sign the transaction directly - if (config.USE_INFURA || config.ETH_PRIVATE_KEY) { + if (config.USE_INFURA || config.ETH_PRIVATE_KEY || config.USE_HOSTED_GETH) { await Web3.submitRawTransaction(await tx.encodeABI(), keyRegistryAddress); } else await tx.send(); } catch (err) { diff --git a/nightfall-deployer/src/contract-setup.mjs b/nightfall-deployer/src/contract-setup.mjs index 1a10bf5f0..20c8c67c5 100644 --- a/nightfall-deployer/src/contract-setup.mjs +++ b/nightfall-deployer/src/contract-setup.mjs @@ -15,7 +15,7 @@ async function setupCircuits() { // when deploying on infura // do serial registration to predict nonce // or, if we have the owner's private key, sign with that, rather than use an unlocked account - if (config.USE_INFURA || config.ETH_PRIVATE_KEY) { + if (config.USE_INFURA || config.ETH_PRIVATE_KEY || config.USE_HOSTED_GETH) { await Web3.submitRawTransaction( (await waitForContract('Proposers')).methods .setStateContract(stateInstance.options.address)