Skip to content

Commit

Permalink
[CORE-715] require bridge daemon eth rpc endpoint flag in start comma…
Browse files Browse the repository at this point in the history
…nd (#710)

* require bridge daemon eth rpc endpoint flag in start command

(cherry picked from commit b6f48a3)
  • Loading branch information
tqin7 authored and mergify[bot] committed Oct 26, 2023
1 parent ff6cc42 commit b80dde8
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 3 deletions.
1 change: 1 addition & 0 deletions protocol/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ETH_RPC_ENDPOINT=https://eth-sepolia.g.alchemy.com/v2/demo
6 changes: 5 additions & 1 deletion protocol/daemons/flags/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func GetDefaultDaemonFlags() DaemonFlags {
Bridge: BridgeFlags{
Enabled: true,
LoopDelayMs: 30_000,
EthRpcEndpoint: "https://eth-sepolia.g.alchemy.com/v2/demo",
EthRpcEndpoint: "",
},
Liquidation: LiquidationFlags{
Enabled: true,
Expand Down Expand Up @@ -129,6 +129,10 @@ func AddDaemonFlagsToCmd(
df.Bridge.EthRpcEndpoint,
"Ethereum Node Rpc Endpoint",
)
// Require bridge daemon eth RPC endpoint flag.
if err := cmd.MarkFlagRequired(FlagBridgeDaemonEthRpcEndpoint); err != nil {
panic(err)
}

// Liquidation Daemon.
cmd.Flags().Bool(
Expand Down
10 changes: 9 additions & 1 deletion protocol/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ services:
- /dydxprotocol/chain/.alice
- --p2p.persistent_peers
- "17e5e45691f0d01449c84fd4ae87279578cdd7ec@dydxprotocold0:26656,b69182310be02559483e42c77b7b104352713166@dydxprotocold1:26656,47539956aaa8e624e0f1d926040e54908ad0eb44@dydxprotocold2:26656,5882428984d83b03d0c907c1f0af343534987052@dydxprotocold3:26656"
- --bridge-daemon-eth-rpc-endpoint
- "${ETH_RPC_ENDPOINT}"
environment:
# See https://docs.datadoghq.com/profiler/enabling/go/ for DD_ specific environment variables
- DD_ENV=localnet_${USER}
Expand All @@ -39,6 +41,8 @@ services:
- /dydxprotocol/chain/.bob
- --p2p.persistent_peers
- "17e5e45691f0d01449c84fd4ae87279578cdd7ec@dydxprotocold0:26656,b69182310be02559483e42c77b7b104352713166@dydxprotocold1:26656,47539956aaa8e624e0f1d926040e54908ad0eb44@dydxprotocold2:26656,5882428984d83b03d0c907c1f0af343534987052@dydxprotocold3:26656"
- --bridge-daemon-eth-rpc-endpoint
- "${ETH_RPC_ENDPOINT}"
environment:
# See https://docs.datadoghq.com/profiler/enabling/go/ for DD_ specific environment variables
- DD_ENV=localnet_${USER}
Expand All @@ -59,8 +63,10 @@ services:
- error
- --home
- /dydxprotocol/chain/.carl
- --p2p.persistent_peers
- --p2p.persistent_peers
- "17e5e45691f0d01449c84fd4ae87279578cdd7ec@dydxprotocold0:26656,b69182310be02559483e42c77b7b104352713166@dydxprotocold1:26656,47539956aaa8e624e0f1d926040e54908ad0eb44@dydxprotocold2:26656,5882428984d83b03d0c907c1f0af343534987052@dydxprotocold3:26656"
- --bridge-daemon-eth-rpc-endpoint
- "${ETH_RPC_ENDPOINT}"
environment:
# See https://docs.datadoghq.com/profiler/enabling/go/ for DD_ specific environment variables
- DD_ENV=localnet_${USER}
Expand All @@ -81,6 +87,8 @@ services:
- /dydxprotocol/chain/.dave
- --p2p.persistent_peers
- "17e5e45691f0d01449c84fd4ae87279578cdd7ec@dydxprotocold0:26656,b69182310be02559483e42c77b7b104352713166@dydxprotocold1:26656,47539956aaa8e624e0f1d926040e54908ad0eb44@dydxprotocold2:26656,5882428984d83b03d0c907c1f0af343534987052@dydxprotocold3:26656"
- --bridge-daemon-eth-rpc-endpoint
- "${ETH_RPC_ENDPOINT}"
environment:
# See https://docs.datadoghq.com/profiler/enabling/go/ for DD_ specific environment variables
- DD_ENV=localnet_${USER}
Expand Down
2 changes: 2 additions & 0 deletions protocol/testing/containertest/testnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ func (t *Testnet) initializeNode(moniker string) (*Node, error) {
fmt.Sprintf("/dydxprotocol/chain/.%s", moniker),
"--p2p.persistent_peers",
persistentPeers,
"--bridge-daemon-eth-rpc-endpoint",
"https://eth-sepolia.g.alchemy.com/v2/demo",
},
ExtraHosts: []string{
fmt.Sprintf("%s:host-gateway", testexchange.TestExchangeHost),
Expand Down
3 changes: 2 additions & 1 deletion protocol/testing/snapshotting/snapshot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ setup_cosmovisor
# TODO: add metrics around snapshot upload latency/frequency/success rate
while true; do
# p2p.seeds taken from --p2p.persistent_peers flag of full node
cosmovisor run start --log_level info --home /dydxprotocol/chain/local_node --p2p.seeds "${p2p_seeds}" --non-validating-full-node=true &
cosmovisor run start --log_level info --home /dydxprotocol/chain/local_node --p2p.seeds "${p2p_seeds}" \
--bridge-daemon-eth-rpc-endpoint "https://eth-sepolia.g.alchemy.com/v2/demo" --non-validating-full-node=true &

sleep ${upload_period}
kill -TERM $(pidof cosmovisor)
Expand Down

0 comments on commit b80dde8

Please sign in to comment.