From aa697a012d263c6402276ad5daaa81cd5b2f71b4 Mon Sep 17 00:00:00 2001 From: Zachinquarantine Date: Mon, 20 Jun 2022 04:40:06 -0400 Subject: [PATCH] cmd/faucet: add sepolia network support (#25128) --- cmd/faucet/README.md | 3 ++- cmd/faucet/faucet.go | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/cmd/faucet/README.md b/cmd/faucet/README.md index f27e94aa9e72..c31676b0dac1 100644 --- a/cmd/faucet/README.md +++ b/cmd/faucet/README.md @@ -10,9 +10,10 @@ The `faucet` is a single binary app (everything included) with all configuration First thing's first, the `faucet` needs to connect to an Ethereum network, for which it needs the necessary genesis and network infos. Each of the following flags must be set: -- `-genesis` is a path to a file containin the network `genesis.json`. or using: +- `-genesis` is a path to a file containing the network `genesis.json`. or using: - `-goerli` with the faucet with Görli network config - `-rinkeby` with the faucet with Rinkeby network config + - `-sepolia` with the faucet with Sepolia network config - `-network` is the devp2p network id used during connection - `-bootnodes` is a list of `enode://` ids to join the network through diff --git a/cmd/faucet/faucet.go b/cmd/faucet/faucet.go index 7639987b9e4b..3c3a4607a24e 100644 --- a/cmd/faucet/faucet.go +++ b/cmd/faucet/faucet.go @@ -85,6 +85,7 @@ var ( goerliFlag = flag.Bool("goerli", false, "Initializes the faucet with Görli network config") rinkebyFlag = flag.Bool("rinkeby", false, "Initializes the faucet with Rinkeby network config") + sepoliaFlag = flag.Bool("sepolia", false, "Initializes the faucet with Sepolia network config") tanenbaumFlag = flag.Bool("tanenbaum", false, "Initializes the faucet with Tanenbaum network config") syscoinFlag = flag.Bool("syscoin", false, "Initializes the faucet with Syscoin network config") NEVMPubFlag = flag.String("nevmpub", "", "NEVM ZMQ REP Endpoint") @@ -143,7 +144,7 @@ func main() { log.Crit("Failed to render the faucet template", "err", err) } // Load and parse the genesis block requested by the user - genesis, err := getGenesis(*genesisFlag, *goerliFlag, *rinkebyFlag, *tanenbaumFlag, *syscoinFlag) + genesis, err := getGenesis(*genesisFlag, *goerliFlag, *rinkebyFlag, *sepoliaFlag, *tanenbaumFlag, *syscoinFlag) if err != nil { log.Crit("Failed to parse genesis config", "err", err) } @@ -924,7 +925,7 @@ func authNoAuth(url string) (string, string, common.Address, error) { } // getGenesis returns a genesis based on input args -func getGenesis(genesisFlag string, goerliFlag bool, rinkebyFlag bool, tanenbaumFlag bool, syscoinFlag bool) (*core.Genesis, error) { +func getGenesis(genesisFlag string, goerliFlag bool, rinkebyFlag bool, sepoliaFlag bool, tanenbaumFlag bool, syscoinFlag bool) (*core.Genesis, error) { switch { case genesisFlag != "": var genesis core.Genesis @@ -938,6 +939,8 @@ func getGenesis(genesisFlag string, goerliFlag bool, rinkebyFlag bool, tanenbaum return core.DefaultTanenbaumGenesisBlock(), nil case syscoinFlag: return core.DefaultSyscoinGenesisBlock(), nil + case sepoliaFlag: + return core.DefaultSepoliaGenesisBlock(), nil default: return nil, fmt.Errorf("no genesis flag provided") }