Skip to content

Commit 6c1df81

Browse files
authored
Merge pull request #8 from dappnode/marc/prepare-for-generic
prepare dvt_lds tools for generic packages
2 parents 3852cc1 + b31944b commit 6c1df81

File tree

1 file changed

+8
-56
lines changed

1 file changed

+8
-56
lines changed

scripts/dvt_lsd_tools.sh

Lines changed: 8 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,32 @@
11
#!/bin/sh
22

3-
# TODO: Remove this function in favour of http://execution.${NETWORK}.dncore.dappnode:8545
4-
# Returns the execution RPC API URL based on the network and supported networks
5-
#
3+
# Returns the execution RPC API URL based on the network
64
# Arguments:
75
# $1: Network
8-
# $2: Supported networks (space-separated list)
96
get_execution_rpc_api_url_from_global_env() {
107
network=$1
11-
supported_networks=$2
12-
13-
execution_alias=$(_get_execution_alias "$network" "$supported_networks")
14-
15-
execution_rpc_api_url="http://${execution_alias}:8545"
16-
8+
execution_rpc_api_url="http://execution.${network}.dncore.dappnode:8545"
179
echo "[INFO - entrypoint] Execution RPC API URL is: $execution_rpc_api_url" >&2
18-
1910
echo "$execution_rpc_api_url"
2011
}
2112

22-
# TODO: Remove this function in favour of ws://execution.${NETWORK}.dncore.dappnode:8546 (ONLY when all clients expose WS on 8546)
13+
# Returns the execution WebSocket URL based on the network
14+
# Arguments:
15+
# $1: Network
2316
get_execution_ws_url_from_global_env() {
2417
network=$1
25-
supported_networks=$2
26-
port=8546
27-
28-
execution_dnp=$(get_value_from_global_env "EXECUTION_CLIENT" "$network")
29-
30-
# TODO: Set all execution clients WS port to 8546
31-
if [ "$execution_dnp" = "holesky-erigon.dnp.dappnode.eth" ] || [ "$execution_dnp" = "nethermind.public.dappnode.eth" ] || [ "$execution_dnp" = "nethermind-xdai.dnp.dappnode.eth" ]; then
32-
port=8545
33-
fi
34-
35-
execution_alias=$(_get_execution_alias "$network" "$supported_networks")
36-
37-
execution_ws_url="ws://${execution_alias}:${port}"
38-
18+
execution_ws_url="ws://execution.${network}.dncore.dappnode:8546"
3919
echo "[INFO - entrypoint] Execution WS URL is: $execution_ws_url" >&2
40-
4120
echo "$execution_ws_url"
4221
}
4322

44-
# TODO: Remove this function in favour of http://beacon-chain.holesky.dncore.dappnode:3500 (ONLY when nimbus client has been published with 2 services)
45-
# Returns the beacon API URL based on the network and supported networks
46-
#
23+
# Returns the beacon API URL based on the network
4724
# Arguments:
4825
# $1: Network
49-
# $2: Supported networks (space-separated list)
5026
get_beacon_api_url_from_global_env() {
5127
network=$1
52-
supported_networks=$2
53-
54-
_verify_network_support "$network" "$supported_networks"
55-
56-
consensus_dnp=$(get_value_from_global_env "CONSENSUS_CLIENT" "$network")
57-
58-
consensus_alias=$(get_client_network_alias "$consensus_dnp")
59-
60-
if [ -z "$consensus_alias" ]; then
61-
echo "[ERROR - entrypoint] Beacon endpoint could not be determined" >&2
62-
exit 1
63-
fi
64-
65-
# If consensus client is nimbus, the beacon service is beacon-validator
66-
if echo "$consensus_dnp" | grep -q "nimbus"; then
67-
beacon_service="beacon-validator"
68-
beacon_port="4500"
69-
else
70-
beacon_service="beacon-chain"
71-
beacon_port="3500"
72-
fi
73-
74-
beacon_api_url="http://${beacon_service}.${consensus_alias}:${beacon_port}"
75-
28+
beacon_api_url="http://beacon-chain.${network}.dncore.dappnode:3500"
7629
echo "[INFO - entrypoint] Beacon API URL is: $beacon_api_url" >&2
77-
7830
echo "$beacon_api_url"
7931
}
8032

0 commit comments

Comments
 (0)