mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
mobile: allow for returning the goerli spec
This commit is contained in:
parent
e0c35d7e97
commit
b482bebec3
2 changed files with 15 additions and 6 deletions
|
|
@ -146,9 +146,9 @@ func NewNode(datadir string, config *NodeConfig) (stack *Node, _ error) {
|
|||
if err := json.Unmarshal([]byte(config.EthereumGenesis), genesis); err != nil {
|
||||
return nil, fmt.Errorf("invalid genesis spec: %v", err)
|
||||
}
|
||||
// If we have the testnet, hard code the chain configs too
|
||||
if config.EthereumGenesis == TestnetGenesis() {
|
||||
genesis.Config = params.TestnetChainConfig
|
||||
// If we have the Ropsten testnet, hard code the chain configs too
|
||||
if config.EthereumGenesis == RopstenGenesis() {
|
||||
genesis.Config = params.RopstenChainConfig
|
||||
if config.EthereumNetworkID == 1 {
|
||||
config.EthereumNetworkID = 3
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,9 +32,9 @@ func MainnetGenesis() string {
|
|||
return ""
|
||||
}
|
||||
|
||||
// TestnetGenesis returns the JSON spec to use for the Ethereum test network.
|
||||
func TestnetGenesis() string {
|
||||
enc, err := json.Marshal(core.DefaultTestnetGenesisBlock())
|
||||
// RopstenGenesis returns the JSON spec to use for the Ropsten test network.
|
||||
func RopstenGenesis() string {
|
||||
enc, err := json.Marshal(core.DefaultRopstenGenesisBlock())
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
|
@ -50,6 +50,15 @@ func RinkebyGenesis() string {
|
|||
return string(enc)
|
||||
}
|
||||
|
||||
// GoerliGenesis returns the JSON spec to use for the Goerli test network
|
||||
func GoerliGenesis() string {
|
||||
enc, err := json.Marshal(core.DefaultGoerliGenesisBlock())
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return string(enc)
|
||||
}
|
||||
|
||||
// FoundationBootnodes returns the enode URLs of the P2P bootstrap nodes operated
|
||||
// by the foundation running the V5 discovery protocol.
|
||||
func FoundationBootnodes() *Enodes {
|
||||
|
|
|
|||
Loading…
Reference in a new issue