Skip to content

Commit

Permalink
Add testnet/mainnet to EVM gateway (#1727)
Browse files Browse the repository at this point in the history
  • Loading branch information
jribbink authored Sep 4, 2024
1 parent 46f37b0 commit d49c4cf
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions internal/evm/gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ type gatewayFlag struct {
RPCPort int `flag:"rpc-port" default:"3000" info:"port for the RPC API server"`
AccessNodeHost string `flag:"access-node-host" default:"localhost:3569" info:"host to the flow access node gRPC API"`
InitCadenceHeight uint64 `flag:"init-cadence-height" default:"0" info:"init cadence block height from where the event ingestion will start. WARNING: you should only provide this if there are no existing values in the database, otherwise an error will be thrown"`
EVMNetworkID string `flag:"evm-network-id" default:"previewnet" info:"EVM network ID (testnet, mainnet, previewnet)"`
FlowNetworkID string `flag:"flow-network-id" default:"emulator" info:"EVM network ID (emulator, previewnet)"`
EVMNetworkID string `flag:"evm-network-id" default:"testnet" info:"EVM network ID (testnet, mainnet, previewnet)"`
FlowNetworkID string `flag:"flow-network-id" default:"emulator" info:"EVM network ID (emulator, previewnet, testnet, mainnet)"`
Coinbase string `flag:"coinbase" default:"" info:"coinbase address to use for fee collection"`
GasPrice string `flag:"gas-price" default:"1" info:"static gas price used for EVM transactions"`
COAAddress string `flag:"coa-address" default:"" info:"Flow address that holds COA account used for submitting transactions"`
Expand Down Expand Up @@ -110,12 +110,16 @@ var gatewayCommand = &command.Command{
cfg.COAKey = pkey

switch flagGateway.FlowNetworkID {
case "mainnet":
cfg.FlowNetworkID = flowGo.Mainnet
case "testnet":
cfg.FlowNetworkID = flowGo.Testnet
case "previewnet":
cfg.FlowNetworkID = flowGo.Previewnet
case "emulator":
cfg.FlowNetworkID = flowGo.Emulator
default:
return nil, fmt.Errorf("flow network ID not supported, only possible to specify 'previewnet' or 'emulator'")
return nil, fmt.Errorf("flow network ID not supported, only possible to specify emulator, testnet, previewnet, mainnet")
}

switch flagGateway.EVMNetworkID {
Expand Down

0 comments on commit d49c4cf

Please sign in to comment.