Skip to content

Commit

Permalink
Deploy Ink testnet
Browse files Browse the repository at this point in the history
  • Loading branch information
bruce-riley authored and evan-gray committed Nov 12, 2024
1 parent 3dfb7f9 commit b0eb131
Show file tree
Hide file tree
Showing 10 changed files with 167 additions and 108 deletions.
20 changes: 20 additions & 0 deletions ethereum/env/.env.ink.testnet
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Ink testnet env
# Rename to .env

# Common config for forge deployment
RPC_URL=https://rpc-qnd-sepolia.inkonchain.com

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

# Bridge Migrations
BRIDGE_INIT_CHAIN_ID=46
BRIDGE_INIT_GOV_CHAIN_ID=0x1
BRIDGE_INIT_GOV_CONTRACT=0x0000000000000000000000000000000000000000000000000000000000000004
BRIDGE_INIT_FINALITY=1
# Ink is an OP Stack chain so it uses the standard WETH.
BRIDGE_INIT_WETH=0x4200000000000000000000000000000000000006
1 change: 1 addition & 0 deletions node/cmd/guardiand/adminnodes.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ func runListNodes(cmd *cobra.Command, args []string) {
{"Xpla", vaa.ChainIDXpla},
{"Btc", vaa.ChainIDBtc},
{"Injective", vaa.ChainIDInjective},
{"Ink", vaa.ChainIDInk},
{"Base", vaa.ChainIDBase},
{"Sei", vaa.ChainIDSei},
{"Scroll", vaa.ChainIDScroll},
Expand Down
20 changes: 20 additions & 0 deletions node/cmd/guardiand/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,9 @@ var (
monadDevnetRPC *string
monadDevnetContract *string

inkRPC *string
inkContract *string

sepoliaRPC *string
sepoliaContract *string

Expand Down Expand Up @@ -415,6 +418,9 @@ func init() {
baseRPC = node.RegisterFlagWithValidationOrFail(NodeCmd, "baseRPC", "Base RPC URL", "ws://eth-devnet:8545", []string{"ws", "wss"})
baseContract = NodeCmd.Flags().String("baseContract", "", "Base contract address")

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

arbitrumSepoliaRPC = node.RegisterFlagWithValidationOrFail(NodeCmd, "arbitrumSepoliaRPC", "Arbitrum on Sepolia RPC URL", "ws://eth-devnet:8545", []string{"ws", "wss"})
arbitrumSepoliaContract = NodeCmd.Flags().String("arbitrumSepoliaContract", "", "Arbitrum on Sepolia contract address")

Expand Down Expand Up @@ -799,6 +805,7 @@ func runNode(cmd *cobra.Command, args []string) {
*snaxchainContract = checkEvmArgs(logger, *snaxchainRPC, *snaxchainContract, "snaxchain", true)
*unichainContract = checkEvmArgs(logger, *unichainRPC, *unichainContract, "unichain", false)
*worldchainContract = checkEvmArgs(logger, *worldchainRPC, *worldchainContract, "worldchain", true)
*inkContract = checkEvmArgs(logger, *inkRPC, *inkContract, "ink", false)

// These chains will only ever be testnet / devnet.
*sepoliaContract = checkEvmArgs(logger, *sepoliaRPC, *sepoliaContract, "sepolia", false)
Expand Down Expand Up @@ -916,6 +923,7 @@ func runNode(cmd *cobra.Command, args []string) {
rpcMap["ibcWS"] = *ibcWS
rpcMap["injectiveLCD"] = *injectiveLCD
rpcMap["injectiveWS"] = *injectiveWS
rpcMap["inkRPC"] = *inkRPC
rpcMap["karuraRPC"] = *karuraRPC
rpcMap["klaytnRPC"] = *klaytnRPC
rpcMap["lineaRPC"] = *lineaRPC
Expand Down Expand Up @@ -1403,6 +1411,18 @@ func runNode(cmd *cobra.Command, args []string) {
watcherConfigs = append(watcherConfigs, wc)
}

if shouldStart(inkRPC) {
wc := &evm.WatcherConfig{
NetworkID: "ink",
ChainID: vaa.ChainIDInk,
Rpc: *inkRPC,
Contract: *inkContract,
CcqBackfillCache: *ccqBackfillCache,
}

watcherConfigs = append(watcherConfigs, wc)
}

if shouldStart(terraWS) {
wc := &cosmwasm.WatcherConfig{
NetworkID: "terra",
Expand Down
220 changes: 112 additions & 108 deletions node/pkg/proto/publicrpc/v1/publicrpc.pb.go

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions node/pkg/query/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ var perChainConfig = map[vaa.ChainID]PerChainConfig{
vaa.ChainIDSnaxchain: {NumWorkers: 1, TimestampCacheSupported: true},
vaa.ChainIDUnichain: {NumWorkers: 1, TimestampCacheSupported: true},
vaa.ChainIDWorldchain: {NumWorkers: 1, TimestampCacheSupported: true},
vaa.ChainIDInk: {NumWorkers: 1, TimestampCacheSupported: true},
vaa.ChainIDSepolia: {NumWorkers: 1, TimestampCacheSupported: true},
vaa.ChainIDHolesky: {NumWorkers: 1, TimestampCacheSupported: true},
vaa.ChainIDArbitrumSepolia: {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 @@ -720,6 +720,7 @@ func (w *Watcher) getFinality(ctx context.Context) (bool, bool, error) {
w.chainID == vaa.ChainIDBSC ||
w.chainID == vaa.ChainIDEthereum ||
w.chainID == vaa.ChainIDHolesky ||
w.chainID == vaa.ChainIDInk ||
w.chainID == vaa.ChainIDKarura ||
w.chainID == vaa.ChainIDMantle ||
w.chainID == vaa.ChainIDMonadDevnet ||
Expand Down
1 change: 1 addition & 0 deletions proto/publicrpc/v1/publicrpc.proto
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ enum ChainID {
CHAIN_ID_SNAXCHAIN = 43;
CHAIN_ID_UNICHAIN = 44;
CHAIN_ID_WORLDCHAIN = 45;
CHAIN_ID_INK = 46;
CHAIN_ID_WORMCHAIN = 3104;
CHAIN_ID_COSMOSHUB = 4000;
CHAIN_ID_EVMOS = 4001;
Expand Down
1 change: 1 addition & 0 deletions sdk/testnet_consts.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ var knownTestnetTokenbridgeEmitters = map[vaa.ChainID]string{
vaa.ChainIDSnaxchain: "000000000000000000000000a10f2eF61dE1f19f586ab8B6F2EbA89bACE63F7a",
vaa.ChainIDUnichain: "000000000000000000000000a10f2eF61dE1f19f586ab8B6F2EbA89bACE63F7a",
vaa.ChainIDWorldchain: "000000000000000000000000430855B4D43b8AEB9D2B9869B74d58dda79C0dB2",
vaa.ChainIDInk: "000000000000000000000000376428e7f26D5867e69201b275553C45B09EE090",
vaa.ChainIDSepolia: "000000000000000000000000DB5492265f6038831E89f495670FF909aDe94bd9",
vaa.ChainIDHolesky: "00000000000000000000000076d093BbaE4529a342080546cAFEec4AcbA59EC6",
vaa.ChainIDArbitrumSepolia: "000000000000000000000000C7A204bDBFe983FCD8d8E61D02b475D4073fF97e",
Expand Down
7 changes: 7 additions & 0 deletions sdk/vaa/structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,8 @@ func (c ChainID) String() string {
return "unichain"
case ChainIDWorldchain:
return "worldchain"
case ChainIDInk:
return "ink"
case ChainIDCosmoshub:
return "cosmoshub"
case ChainIDEvmos:
Expand Down Expand Up @@ -336,6 +338,8 @@ func ChainIDFromString(s string) (ChainID, error) {
return ChainIDUnichain, nil
case "worldchain":
return ChainIDWorldchain, nil
case "ink":
return ChainIDInk, nil
case "cosmoshub":
return ChainIDCosmoshub, nil
case "seievm":
Expand Down Expand Up @@ -416,6 +420,7 @@ func GetAllNetworkIDs() []ChainID {
ChainIDSnaxchain,
ChainIDUnichain,
ChainIDWorldchain,
ChainIDInk,
ChainIDWormchain,
ChainIDCosmoshub,
ChainIDEvmos,
Expand Down Expand Up @@ -519,6 +524,8 @@ const (
ChainIDUnichain ChainID = 44
// ChainIDWorldchain is the ChainID of Worldchain
ChainIDWorldchain ChainID = 45
// ChainIDInk is the ChainID of Ink
ChainIDInk ChainID = 46
//ChainIDWormchain is the ChainID of Wormchain
ChainIDWormchain ChainID = 3104
// ChainIDCosmoshub is the ChainID of Cosmoshub
Expand Down
3 changes: 3 additions & 0 deletions sdk/vaa/structs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ func TestChainIDFromString(t *testing.T) {
{input: "snaxchain", output: ChainIDSnaxchain},
{input: "unichain", output: ChainIDUnichain},
{input: "worldchain", output: ChainIDWorldchain},
{input: "ink", output: ChainIDInk},
{input: "seievm", output: ChainIDSeiEVM},
{input: "wormchain", output: ChainIDWormchain},
{input: "cosmoshub", output: ChainIDCosmoshub},
Expand Down Expand Up @@ -126,6 +127,7 @@ func TestChainIDFromString(t *testing.T) {
{input: "Snaxchain", output: ChainIDSnaxchain},
{input: "Unichain", output: ChainIDUnichain},
{input: "Worldchain", output: ChainIDWorldchain},
{input: "Ink", output: ChainIDInk},
{input: "SeiEVM", output: ChainIDSeiEVM},
{input: "Wormchain", output: ChainIDWormchain},
{input: "Cosmoshub", output: ChainIDCosmoshub},
Expand Down Expand Up @@ -325,6 +327,7 @@ func TestChainId_String(t *testing.T) {
{input: 43, output: "snaxchain"},
{input: 44, output: "unichain"},
{input: 45, output: "worldchain"},
{input: 46, output: "ink"},
{input: 3104, output: "wormchain"},
{input: 4000, output: "cosmoshub"},
{input: 4001, output: "evmos"},
Expand Down

0 comments on commit b0eb131

Please sign in to comment.