Skip to content

Commit

Permalink
Merge devnet4 config (#3769)
Browse files Browse the repository at this point in the history
  • Loading branch information
g11tech authored Feb 18, 2022
1 parent 69e55f0 commit 2a530d8
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 4 deletions.
15 changes: 15 additions & 0 deletions kiln/devnets/devnet4.vars
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
DEVNET_NAME=devnet4

GETH_IMAGE=parithoshj/geth:merge-8f408a2
NETHERMIND_IMAGE=nethermindeth/nethermind:kiln_0.1
LODESTAR_IMAGE=chainsafe/lodestar:next

CONFIG_GIT_DIR=merge-devnet-4

LODESTAR_EXTRA_ARGS="--eth1.providerUrls http://127.0.0.1:8545 --execution.urls http://127.0.0.1:8545 api.rest.enabled: true api.rest.host: 0.0.0.0"

NETHERMIND_EXTRA_ARGS="--config kiln --Init.WebSocketsEnabled=true --JsonRpc.Enabled=true --JsonRpc.EnabledModules=net,eth,consensus,engine,subscribe,web3 --JsonRpc.Port=8545 --JsonRpc.WebSocketsPort=8546 --JsonRpc.Host=0.0.0.0 --Network.DiscoveryPort=30303 --Network.P2PPort=30303 --Merge.Enabled=true --Merge.TerminalTotalDifficulty=5000000000 --Init.DiagnosticMode=None"

GETH_EXTRA_ARGS="--http --http.api engine,net,eth --http.port 8545 --ws --ws.api net,eth,engine --ws.port=8546 --ws.addr 0.0.0.0 --allow-insecure-unlock --networkid 1337752"

EXTRA_BOOTNODES=""
15 changes: 11 additions & 4 deletions kiln/devnets/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ nethermindImage=$NETHERMIND_IMAGE
if [ ! -n "$dataDir" ] || [ ! -n "$devnetVars" ] || ([ "$elClient" != "geth" ] && [ "$elClient" != "nethermind" ])
then
echo "usage: ./setup.sh --dataDir <data dir> --elClient <geth | nethermind> --devetVars <devnet vars file> [--dockerWithSudo --withTerminal \"gnome-terminal --disable-factory --\"]"
echo "example: ./setup.sh --dataDir kintsugi-data --elClient nethermind --devnetVars ./kintsugi.vars --dockerWithSudo --withTerminal \"gnome-terminal --disable-factory --\""
echo "example: ./setup.sh --dataDir devnet4-data --elClient nethermind --devnetVars ./devnet4.vars --dockerWithSudo --withTerminal \"gnome-terminal --disable-factory --\""
exit;
fi

Expand Down Expand Up @@ -69,31 +69,38 @@ fi;


bootNode=$(cat $dataDir/$configGitDir/el_bootnode.txt)
bootNode=($bootNode)
bootNode=$(IFS=, ; echo "${bootNode[*]}")
if [ "$elClient" == "geth" ]
then
echo "gethImage: $GETH_IMAGE"
$dockerExec pull $GETH_IMAGE

elName="$DEVNET_NAME-geth"
if [ ! -n "$(ls -A $dataDir/geth)" ]
then
echo "setting up geth directory"
$dockerExec run --rm -v $currentDir/$dataDir/$configGitDir:/config -v $currentDir/$dataDir/geth:/data $GETH_IMAGE --catalyst --datadir /data init /config/genesis.json
$dockerExec run --rm -v $currentDir/$dataDir/$configGitDir:/config -v $currentDir/$dataDir/geth:/data $GETH_IMAGE --datadir /data init /config/genesis.json
fi;
elCmd="$dockerCmd --rm --name $elName --network host -v $currentDir/$dataDir/geth:/data $GETH_IMAGE --bootnodes $EXTRA_BOOTNODES$bootNode --datadir /data $GETH_EXTRA_ARGS"
elif [ "$elClient" == "nethermind" ]
then
echo "nethermindImage: $NETHERMIND_IMAGE"
$dockerExec pull $NETHERMIND_IMAGE

elName="$DEVNET_NAME-nethermind"
elCmd="$dockerCmd --rm --name $elName --network host -v $currentDir/$dataDir/$configGitDir:/config -v $currentDir/$dataDir/nethermind:/data $NETHERMIND_IMAGE --datadir /data --Init.ChainSpecPath=/config/nethermind_genesis.json $NETHERMIND_EXTRA_ARGS --Discovery.Bootnodes $EXTRA_BOOTNODES$bootNode"
fi

echo "lodestarImage: $LODESTAR_IMAGE"
$dockerExec pull $LODESTAR_IMAGE

bootEnr=$(cat $dataDir/$configGitDir/bootstrap_nodes.txt)
#bootEnr=($bootEnr)
#bootEnr=$(IFS=" " ; echo "${bootEnr[*]}")
depositContractDeployBlock=$(cat $dataDir/$configGitDir/deposit_contract_block.txt)
clName="$DEVNET_NAME-lodestar"
clCmd="$dockerCmd --rm --name $clName --network host -v $currentDir/$dataDir/$configGitDir:/config -v $currentDir/$dataDir/lodestar:/data $LODESTAR_IMAGE beacon --rootDir /data --paramsFile /config/config.yaml --genesisStateFile /config/genesis.ssz --network.discv5.bootEnrs $bootEnr --network.connectToDiscv5Bootnodes --network.discv5.enabled true --eth1.enabled true --eth1.disableEth1DepositDataTracker true $LODESTAR_EXTRA_ARGS"

clCmd="$dockerCmd --rm --name $clName --network host -v $currentDir/$dataDir/$configGitDir:/config -v $currentDir/$dataDir/lodestar:/data $LODESTAR_IMAGE beacon --rootDir /data --paramsFile /config/config.yaml --genesisStateFile /config/genesis.ssz --network.connectToDiscv5Bootnodes --network.discv5.enabled true --eth1.enabled true --eth1.depositContractDeployBlock $depositContractDeployBlock $LODESTAR_EXTRA_ARGS --network.discv5.bootEnrs ${bootEnr[0]}"

run_cmd "$elCmd"
elPid=$!
Expand Down

0 comments on commit 2a530d8

Please sign in to comment.