Skip to content

Commit

Permalink
Deploy Monad testnet
Browse files Browse the repository at this point in the history
  • Loading branch information
bruce-riley committed Jan 13, 2025
1 parent 83224c5 commit 12798b5
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 0 deletions.
14 changes: 14 additions & 0 deletions ethereum/env/.env.monad.testnet
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Monad testnet env
# Rename to .env

# Common config for forge deployment
RPC_URL=public_url

# Wormhole Core Migrations
INIT_SIGNERS=["0x13947Bd48b18E53fdAeEe77F3473391aC727C638"]
INIT_CHAIN_ID=48
INIT_GOV_CHAIN_ID=0x1
INIT_GOV_CONTRACT=0x0000000000000000000000000000000000000000000000000000000000000004
INIT_EVM_CHAIN_ID=10143

# Not deploying the token bridge at this time.
20 changes: 20 additions & 0 deletions node/cmd/guardiand/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,9 @@ var (
worldchainRPC *string
worldchainContract *string

monadRPC *string
monadContract *string

monadDevnetRPC *string
monadDevnetContract *string

Expand Down Expand Up @@ -431,6 +434,9 @@ func init() {
hyperEvmRPC = node.RegisterFlagWithValidationOrFail(NodeCmd, "hyperEvmRPC", "HyperEVM RPC URL", "ws://eth-devnet:8545", []string{"ws", "wss"})
hyperEvmContract = NodeCmd.Flags().String("hyperEvmContract", "", "HyperEVM contract address")

monadRPC = node.RegisterFlagWithValidationOrFail(NodeCmd, "monadRPC", "Monad RPC URL", "ws://eth-devnet:8545", []string{"ws", "wss"})
monadContract = NodeCmd.Flags().String("monadContract", "", "Monad contract address")

seiEvmRPC = node.RegisterFlagWithValidationOrFail(NodeCmd, "seiEvmRPC", "SeiEVM RPC URL", "ws://eth-devnet:8545", []string{"ws", "wss"})
seiEvmContract = NodeCmd.Flags().String("seiEvmContract", "", "SeiEVM contract address")

Expand Down Expand Up @@ -825,6 +831,7 @@ func runNode(cmd *cobra.Command, args []string) {
*worldchainContract = checkEvmArgs(logger, *worldchainRPC, *worldchainContract, "worldchain", true)
*inkContract = checkEvmArgs(logger, *inkRPC, *inkContract, "ink", false)
*hyperEvmContract = checkEvmArgs(logger, *hyperEvmRPC, *hyperEvmContract, "hyperEvm", false)
*monadContract = checkEvmArgs(logger, *monadRPC, *monadContract, "monad", false)
*seiEvmContract = checkEvmArgs(logger, *seiEvmRPC, *seiEvmContract, "seiEvm", false)

// These chains will only ever be testnet / devnet.
Expand Down Expand Up @@ -953,6 +960,7 @@ func runNode(cmd *cobra.Command, args []string) {
rpcMap["klaytnRPC"] = *klaytnRPC
rpcMap["lineaRPC"] = *lineaRPC
rpcMap["mantleRPC"] = *mantleRPC
rpcMap["monadRPC"] = *monadRPC
rpcMap["moonbeamRPC"] = *moonbeamRPC
rpcMap["nearRPC"] = *nearRPC
rpcMap["oasisRPC"] = *oasisRPC
Expand Down Expand Up @@ -1457,6 +1465,18 @@ func runNode(cmd *cobra.Command, args []string) {
watcherConfigs = append(watcherConfigs, wc)
}

if shouldStart(monadRPC) {
wc := &evm.WatcherConfig{
NetworkID: "monad",
ChainID: vaa.ChainIDMonad,
Rpc: *monadRPC,
Contract: *monadContract,
CcqBackfillCache: *ccqBackfillCache,
}

watcherConfigs = append(watcherConfigs, wc)
}

if shouldStart(seiEvmRPC) {
wc := &evm.WatcherConfig{
NetworkID: "seievm",
Expand Down
1 change: 1 addition & 0 deletions node/pkg/query/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ var perChainConfig = map[vaa.ChainID]PerChainConfig{
vaa.ChainIDPolygonSepolia: {NumWorkers: 1, TimestampCacheSupported: true},
vaa.ChainIDMonadDevnet: {NumWorkers: 1, TimestampCacheSupported: true},
vaa.ChainIDHyperEVM: {NumWorkers: 1, TimestampCacheSupported: true},
vaa.ChainIDMonad: {NumWorkers: 1, TimestampCacheSupported: true},
vaa.ChainIDSeiEVM: {NumWorkers: 1, TimestampCacheSupported: true},
}

Expand Down
1 change: 1 addition & 0 deletions node/pkg/watchers/evm/watcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -715,6 +715,7 @@ func (w *Watcher) getFinality(ctx context.Context) (bool, bool, error) {
w.chainID == vaa.ChainIDInk ||
w.chainID == vaa.ChainIDKarura ||
w.chainID == vaa.ChainIDMantle ||
w.chainID == vaa.ChainIDMonad ||
w.chainID == vaa.ChainIDMonadDevnet ||
w.chainID == vaa.ChainIDMoonbeam ||
w.chainID == vaa.ChainIDOptimism ||
Expand Down
7 changes: 7 additions & 0 deletions sdk/vaa/structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,8 @@ func (c ChainID) String() string {
return "ink"
case ChainIDHyperEVM:
return "hyperevm"
case ChainIDMonad:
return "monad"
case ChainIDCosmoshub:
return "cosmoshub"
case ChainIDEvmos:
Expand Down Expand Up @@ -346,6 +348,8 @@ func ChainIDFromString(s string) (ChainID, error) {
return ChainIDInk, nil
case "hyperevm":
return ChainIDHyperEVM, nil
case "monad":
return ChainIDMonad, nil
case "cosmoshub":
return ChainIDCosmoshub, nil
case "seievm":
Expand Down Expand Up @@ -430,6 +434,7 @@ func GetAllNetworkIDs() []ChainID {
ChainIDWorldchain,
ChainIDInk,
ChainIDHyperEVM,
ChainIDMonad,
ChainIDWormchain,
ChainIDCosmoshub,
ChainIDEvmos,
Expand Down Expand Up @@ -538,6 +543,8 @@ const (
ChainIDInk ChainID = 46
// ChainIDHyperEVM is the ChainID of HyperEVM
ChainIDHyperEVM ChainID = 47
// ChainIDMonad is the ChainID of Monad
ChainIDMonad ChainID = 48
//ChainIDWormchain is the ChainID of Wormchain
ChainIDWormchain ChainID = 3104
// ChainIDCosmoshub is the ChainID of Cosmoshub
Expand Down
2 changes: 2 additions & 0 deletions sdk/vaa/structs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ func TestChainIDFromString(t *testing.T) {
{input: "worldchain", output: ChainIDWorldchain},
{input: "ink", output: ChainIDInk},
{input: "hyperevm", output: ChainIDHyperEVM},
{input: "monad", output: ChainIDMonad},
{input: "seievm", output: ChainIDSeiEVM},
{input: "wormchain", output: ChainIDWormchain},
{input: "cosmoshub", output: ChainIDCosmoshub},
Expand Down Expand Up @@ -131,6 +132,7 @@ func TestChainIDFromString(t *testing.T) {
{input: "Worldchain", output: ChainIDWorldchain},
{input: "Ink", output: ChainIDInk},
{input: "HyperEVM", output: ChainIDHyperEVM},
{input: "Monad", output: ChainIDMonad},
{input: "SeiEVM", output: ChainIDSeiEVM},
{input: "Wormchain", output: ChainIDWormchain},
{input: "Cosmoshub", output: ChainIDCosmoshub},
Expand Down

0 comments on commit 12798b5

Please sign in to comment.