Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion clients/besu/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ RUN chmod +x /hive-bin/enode.sh
RUN ./bin/besu --version > /version.txt

# Export the usual networking ports to allow outside access to the node
EXPOSE 8545 8546 30303 30303/udp
EXPOSE 8545 8546 8551 30303 30303/udp

ENTRYPOINT ["/opt/besu/bin/besu-hive.sh"]
36 changes: 21 additions & 15 deletions clients/besu/besu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,15 @@ if [ -d /blocks ]; then
IMPORTFLAGS="$IMPORTFLAGS $blocks"
fi

# For clique mining, besu uses the node key as the block signing key.
if [ "$HIVE_CLIQUE_PRIVATEKEY" != "" ]; then
echo "Importing clique signing key as node key..."
echo "$HIVE_CLIQUE_PRIVATEKEY" > /opt/besu/key
fi

# Configure mining.
if [ "$HIVE_MINER" != "" ]; then
FLAGS="$FLAGS --miner-enabled --miner-coinbase=$HIVE_MINER"
# For clique mining, besu uses the node key as the block signing key.
if [ "$HIVE_CLIQUE_PRIVATEKEY" != "" ]; then
echo "Importing clique signing key as node key..."
echo "$HIVE_CLIQUE_PRIVATEKEY" > /opt/besu/key
fi
fi
if [ "$HIVE_MINER_EXTRA" != "" ]; then
FLAGS="$FLAGS --miner-extra-data=$HIVE_MINER_EXTRA"
Expand All @@ -124,25 +124,31 @@ else
FLAGS="$FLAGS --network-id=1337"
fi

# Sync mode.
case "$HIVE_NODETYPE" in
"" | "full")
FLAGS="$FLAGS --sync-mode=FAST --fast-sync-min-peers=1 --Xsynchronizer-fast-sync-pivot-distance=0" ;;
"light")
echo "Ignoring HIVE_NODETYPE == light: besu does not support light client" ;;
esac
# Sync mode, must only be changed for non merge related tests.
if [ "$HIVE_TERMINAL_TOTAL_DIFFICULTY" == "" ]; then
if [ "$HIVE_NODETYPE" == "light" ]; then
echo "Ignoring HIVE_NODETYPE == light: besu does not support light client"
else
FLAGS="$FLAGS --sync-mode=FAST --fast-sync-min-peers=1 --Xsynchronizer-fast-sync-pivot-distance=0"
fi
fi

# Configure RPC.
RPCFLAGS="--host-whitelist=*"
RPCFLAGS="--host-allowlist=*"
if [ "$HIVE_GRAPHQL_ENABLED" == "" ]; then
RPCFLAGS="$RPCFLAGS --rpc-http-enabled --rpc-http-api=ETH,NET,WEB3,ADMIN --rpc-http-host=0.0.0.0"
else
RPCFLAGS="$RPCFLAGS --rpc-http-port=8550" # work around duplicate port error
RPCFLAGS="$RPCFLAGS --graphql-http-enabled --graphql-http-host=0.0.0.0 --graphql-http-port=8545"
fi

# Enable WebSocket.
RPCFLAGS="$RPCFLAGS --rpc-ws-enabled --rpc-ws-api=ETH,NET,WEB3,ADMIN --rpc-ws-host=0.0.0.0"
#RPCFLAGS="$RPCFLAGS --rpc-ws-enabled --rpc-ws-api=ETH,NET,WEB3,ADMIN --rpc-ws-host=0.0.0.0"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No WebSocket anymore?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Websocket is still in place for the "main" stack. Only the engine api is on a combined http stack that upgrades from http to websockets.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh, so --rpc-ws-enabled is not needed anymore to enable it? I was just wondering why you commented out this flag here.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have tested this, and WebSocket is no longer enabled on besu with this change.


# Enable merge support if needed
if [ "$HIVE_TERMINAL_TOTAL_DIFFICULTY" != "" ]; then
RPCFLAGS="$RPCFLAGS --engine-host-allowlist=* --Xmerge-support true --engine-rpc-enabled"
FLAGS="$FLAGS --sync-mode=FULL"
fi

# Start Besu.
if [ -z "$HAS_IMPORT" ]; then
Expand Down
2 changes: 2 additions & 0 deletions clients/besu/mapper.jq
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,7 @@ def to_int:
"muirGlacierBlock": env.HIVE_FORK_MUIR_GLACIER|to_int,
"berlinBlock": env.HIVE_FORK_BERLIN|to_int,
"londonBlock": env.HIVE_FORK_LONDON|to_int,
"parisBlock": env.HIVE_MERGE_BLOCK_ID|to_int,
"terminalTotalDifficulty": env.HIVE_TERMINAL_TOTAL_DIFFICULTY|to_int,
}|remove_empty
}