|
1 | 1 | #!/bin/sh |
2 | 2 |
|
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 |
6 | 4 | # Arguments: |
7 | 5 | # $1: Network |
8 | | -# $2: Supported networks (space-separated list) |
9 | 6 | get_execution_rpc_api_url_from_global_env() { |
10 | 7 | 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" |
17 | 9 | echo "[INFO - entrypoint] Execution RPC API URL is: $execution_rpc_api_url" >&2 |
18 | | - |
19 | 10 | echo "$execution_rpc_api_url" |
20 | 11 | } |
21 | 12 |
|
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 |
23 | 16 | get_execution_ws_url_from_global_env() { |
24 | 17 | 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" |
39 | 19 | echo "[INFO - entrypoint] Execution WS URL is: $execution_ws_url" >&2 |
40 | | - |
41 | 20 | echo "$execution_ws_url" |
42 | 21 | } |
43 | 22 |
|
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 |
47 | 24 | # Arguments: |
48 | 25 | # $1: Network |
49 | | -# $2: Supported networks (space-separated list) |
50 | 26 | get_beacon_api_url_from_global_env() { |
51 | 27 | 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" |
76 | 29 | echo "[INFO - entrypoint] Beacon API URL is: $beacon_api_url" >&2 |
77 | | - |
78 | 30 | echo "$beacon_api_url" |
79 | 31 | } |
80 | 32 |
|
|
0 commit comments