Skip to content

Commit

Permalink
Remove --nodiscover from non bootnodes
Browse files Browse the repository at this point in the history
Signed-off-by: rodion <[email protected]>
  • Loading branch information
rodion-lim-partior committed Aug 1, 2024
1 parent 8a5b02e commit 3635acf
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions internal/blockchain/ethereum/quorum/quorum.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,14 @@ var DockerEntrypoint = "docker-entrypoint.sh"
var QuorumPort = "8545"

func CreateQuorumEntrypoint(ctx context.Context, outputDirectory, consensus, stackName string, memberIndex, chainID, blockPeriodInSeconds int, privateTransactionManager fftypes.FFEnum) error {
discoveryCmd := "BOOTNODE_CMD=\"\""
var discoveryCmd string
connectTimeout := 15
if memberIndex != 0 {
discoveryCmd = fmt.Sprintf(`bootnode=$(curl http://quorum_0:%s -s --connect-timeout %[2]d --max-time %[2]d --retry 5 --retry-connrefused --retry-delay 0 --retry-max-time 60 --fail --header "Content-Type: application/json" --data '{"jsonrpc":"2.0", "method": "admin_nodeInfo", "params": [], "id": 1}' | grep -o "enode://[a-z0-9@.:]*")
BOOTNODE_CMD="--bootnodes $bootnode"
BOOTNODE_CMD="BOOTNODE_CMD=--bootnodes $bootnode"
BOOTNODE_CMD=${BOOTNODE_CMD/127.0.0.1/quorum_0}`, QuorumPort, connectTimeout)
} else {
discoveryCmd = "BOOTNODE_CMD=--nodiscover"
}

tesseraCmd := ""
Expand Down Expand Up @@ -98,7 +100,7 @@ ADDITIONAL_ARGS=${ADDITIONAL_ARGS:-}
echo "bootnode discovery command :: $BOOTNODE_CMD"
IP_ADDR=$(cat /etc/hosts | tail -n 1 | awk '{print $1}')
exec geth --datadir /data --nat extip:$IP_ADDR --syncmode 'full' --revertreason --port 30311 --http --http.addr "0.0.0.0" --http.corsdomain="*" -http.port %[4]s --http.vhosts "*" --http.api admin,personal,eth,net,web3,txpool,miner,debug,$QUORUM_API --networkid %[5]d --miner.gasprice 0 --password /data/password --mine --allow-insecure-unlock --nodiscover --verbosity 4 $CONSENSUS_ARGS $BOOTNODE_CMD $ADDITIONAL_ARGS`, consensus, tesseraCmd, discoveryCmd, QuorumPort, chainID, blockPeriod, blockPeriodInMs)
exec geth --datadir /data --nat extip:$IP_ADDR --syncmode 'full' --revertreason --port 30311 --http --http.addr "0.0.0.0" --http.corsdomain="*" -http.port %[4]s --http.vhosts "*" --http.api admin,personal,eth,net,web3,txpool,miner,debug,$QUORUM_API --networkid %[5]d --miner.gasprice 0 --password /data/password --mine --allow-insecure-unlock --verbosity 4 $CONSENSUS_ARGS $BOOTNODE_CMD $ADDITIONAL_ARGS`, consensus, tesseraCmd, discoveryCmd, QuorumPort, chainID, blockPeriod, blockPeriodInMs)
filename := filepath.Join(outputDirectory, DockerEntrypoint)
if err := os.MkdirAll(outputDirectory, 0755); err != nil {
return err
Expand Down

0 comments on commit 3635acf

Please sign in to comment.