fix hive script

new hive features introduces breaking changes we need to address:
- expose engine api port 8551 in docker script
- export enode.sh file to hive-bin folder
- add terminalTotalDifficulty to mapper.jq
This commit is contained in:
jangko 2022-04-13 18:39:29 +07:00
parent 38c548f25f
commit 1534719f42
No known key found for this signature in database
GPG Key ID: 31702AE10541E6B9
3 changed files with 19 additions and 12 deletions

View File

@ -9,9 +9,9 @@ RUN apt-get update \
ENV NPROC=2
RUN git clone --depth 1 https://github.com/status-im/nimbus-eth1.git \
RUN git clone --depth 1 --branch non_blocking_startup https://github.com/status-im/nimbus-eth1.git \
&& cd nimbus-eth1 \
&& git checkout master \
&& git checkout non_blocking_startup \
&& make -j${NPROC} NIMFLAGS="--parallelBuild:${NPROC}" V=1 update
RUN cd nimbus-eth1 && \
@ -31,12 +31,19 @@ RUN apt-get update \
COPY --from=build /usr/bin/nimbus /usr/bin/nimbus
RUN usr/bin/nimbus --version > /version.txt
# Inject the startup script and helper files
COPY *.sh *.jq *.json /
# Add genesis mapper script.
ADD genesis.json /genesis.json
ADD mapper.jq /mapper.jq
# Add the startup script.
ADD nimbus.sh /nimbus.sh
RUN chmod +x /nimbus.sh
RUN chmod +x /enode.sh
# Add the enode URL retriever script.
ADD enode.sh /hive-bin/enode.sh
RUN chmod +x /hive-bin/enode.sh
# Export the usual networking ports to allow outside access to the node
EXPOSE 8545 8546 8547 30303 30303/udp
EXPOSE 8545 8546 8547 8551 30303 30303/udp
ENTRYPOINT ["/nimbus.sh"]

View File

@ -69,6 +69,6 @@ def to_bool:
"muirGlacierBlock": env.HIVE_FORK_MUIR_GLACIER|to_int,
"berlinBlock": env.HIVE_FORK_BERLIN|to_int,
"londonBlock": env.HIVE_FORK_LONDON|to_int,
"arrowGlacierBlock": env.HIVE_FORK_ARROW_GLACIER|to_int
"terminalTotalDifficulty": env.HIVE_TERMINAL_TOTAL_DIFFICULTY|to_int,
}|remove_empty
}

View File

@ -28,10 +28,9 @@
# - [x] HIVE_FORK_CONSTANTINOPLE block number for Constantinople transition
# - [x] HIVE_FORK_PETERSBURG block number for ConstantinopleFix/PetersBurg transition
# - [x] HIVE_FORK_ISTANBUL block number for Istanbul transition
# - [x] HIVE_FORK_MUIR_GLACIER block number for Muir Glacier transition
# - [x] HIVE_FORK_MUIRGLACIER block number for Muir Glacier transition
# - [x] HIVE_FORK_BERLIN block number for Berlin transition
# - [x] HIVE_FORK_LONDON block number for London transition
# - [x] HIVE_FORK_ARROW_GLACIER block number for Arrow Glacier transition
#
# Clique PoA:
#
@ -69,10 +68,10 @@ if [ "$HIVE_CLIQUE_PRIVATEKEY" != "" ]; then
# -n will prevent newline when echoing something
echo -n "$HIVE_CLIQUE_PRIVATEKEY" > private.key
FLAGS="$FLAGS --import-key:private.key"
fi
if [ "$HIVE_MINER" != "" ]; then
FLAGS="$FLAGS --engine-signer:$HIVE_MINER"
if [ "$HIVE_MINER" != "" ]; then
FLAGS="$FLAGS --engine-signer:$HIVE_MINER"
fi
fi
# Configure the genesis chain and use it as start block and dump it to stdout
@ -109,6 +108,7 @@ if [ "$HIVE_GRAPHQL_ENABLED" != "" ]; then
else
FLAGS="$FLAGS --rpc --rpc-api:eth,debug --rpc-address:0.0.0.0 --rpc-port:8545"
FLAGS="$FLAGS --ws --ws-api:eth,debug --ws-address:0.0.0.0 --ws-port:8546"
FLAGS="$FLAGS --engine-api:true --engine-api-address:0.0.0.0 --engine-api-port:8551"
fi
echo "Running nimbus with flags $FLAGS"