Skip to content

Commit

Permalink
fix: #318 hosted geth config configured
Browse files Browse the repository at this point in the history
  • Loading branch information
LijuJoseJJ authored and IlyasRidhuan committed Feb 20, 2022
1 parent 1e9ab91 commit 9298ae0
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 4 deletions.
1 change: 1 addition & 0 deletions config/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}`,
Expand Down
38 changes: 38 additions & 0 deletions docker-compose.hosted.geth.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion nightfall-deployer/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion nightfall-deployer/migrations/4_test_tokens_migration.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ module.exports = function (deployer, _, accounts) {
}
}
});
};
};
2 changes: 1 addition & 1 deletion nightfall-deployer/src/circuit-setup.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion nightfall-deployer/src/contract-setup.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 9298ae0

Please sign in to comment.