mirror of
https://gitlab.com/pulsechaincom/go-pulse.git
synced 2024-12-21 11:10:35 +00:00
Add network config for Testnet-V4
This commit is contained in:
parent
6e382ac942
commit
f2634a468b
@ -115,12 +115,12 @@ use separate accounts for play and real money. Unless you manually move
|
||||
accounts, `geth` will by default correctly separate the two networks and will not make any
|
||||
accounts available between them.*
|
||||
|
||||
### **Full node on PulseChain Testnet V3**
|
||||
### **Full node on PulseChain Testnet V4**
|
||||
|
||||
To connect to the PulseChain Testnet V3:
|
||||
To connect to the PulseChain Testnet V4:
|
||||
|
||||
```shell
|
||||
$ geth --pulsechain-testnet-v3 console
|
||||
$ geth --pulsechain-testnet-v4 console
|
||||
```
|
||||
|
||||
### Configuration
|
||||
@ -149,7 +149,7 @@ Docker:
|
||||
```shell
|
||||
docker run -d --name pulsechain-execution-node -v /Users/alice/pulse:/root \
|
||||
-p 8545:8545 -p 30303:30303 \
|
||||
registry.gitlab.com/pulsechaincom/go-pulse --pulsechain-testnet-v3
|
||||
registry.gitlab.com/pulsechaincom/go-pulse --pulsechain-testnet-v4
|
||||
```
|
||||
|
||||
This will start `geth` in snap-sync mode with a DB memory allowance of 1GB, as the
|
||||
|
@ -232,8 +232,8 @@ func ethFilter(args []string) (nodeFilter, error) {
|
||||
filter = forkid.NewStaticFilter(params.MainnetChainConfig, core.DefaultGenesisBlock().ToBlock())
|
||||
case "PulseChain":
|
||||
filter = forkid.NewStaticFilter(params.PulseChainConfig, core.DefaultGenesisBlock().ToBlock())
|
||||
case "PulseChainTestnetV3":
|
||||
filter = forkid.NewStaticFilter(params.PulseChainTestnetV3Config, core.DefaultGenesisBlock().ToBlock())
|
||||
case "PulseChainTestnetV4":
|
||||
filter = forkid.NewStaticFilter(params.PulseChainTestnetV4Config, core.DefaultGenesisBlock().ToBlock())
|
||||
case "goerli":
|
||||
filter = forkid.NewStaticFilter(params.GoerliChainConfig, core.DefaultGoerliGenesisBlock().ToBlock())
|
||||
case "sepolia":
|
||||
|
@ -290,8 +290,8 @@ func prepare(ctx *cli.Context) {
|
||||
case ctx.IsSet(utils.HoleskyFlag.Name):
|
||||
log.Info("Starting Geth on Holesky testnet...")
|
||||
|
||||
case ctx.IsSet(utils.PulseChainTestnetV3Flag.Name):
|
||||
log.Info("Starting Geth on PulseChain Testnet V3...")
|
||||
case ctx.IsSet(utils.PulseChainTestnetV4Flag.Name):
|
||||
log.Info("Starting Geth on PulseChain Testnet V4...")
|
||||
|
||||
case ctx.IsSet(utils.DeveloperFlag.Name):
|
||||
log.Info("Starting Geth in ephemeral dev mode...")
|
||||
|
@ -159,9 +159,9 @@ var (
|
||||
Usage: "Holesky network: pre-configured proof-of-stake test network",
|
||||
Category: flags.EthCategory,
|
||||
}
|
||||
PulseChainTestnetV3Flag = &cli.BoolFlag{
|
||||
Name: "pulsechain-testnet-v3",
|
||||
Usage: "PulseChain Testnet V3: pre-configured proof-of-stake test network",
|
||||
PulseChainTestnetV4Flag = &cli.BoolFlag{
|
||||
Name: "pulsechain-testnet-v4",
|
||||
Usage: "PulseChain Testnet V4: pre-configured proof-of-stake test network",
|
||||
}
|
||||
|
||||
// Dev mode
|
||||
@ -925,7 +925,7 @@ var (
|
||||
GoerliFlag,
|
||||
SepoliaFlag,
|
||||
HoleskyFlag,
|
||||
PulseChainTestnetV3Flag,
|
||||
PulseChainTestnetV4Flag,
|
||||
}
|
||||
// NetworkFlags is the flag group of all built-in supported networks.
|
||||
NetworkFlags = append([]cli.Flag{
|
||||
@ -961,8 +961,8 @@ func MakeDataDir(ctx *cli.Context) string {
|
||||
if ctx.Bool(HoleskyFlag.Name) {
|
||||
return filepath.Join(path, "holesky")
|
||||
}
|
||||
if ctx.Bool(PulseChainTestnetV3Flag.Name) {
|
||||
return filepath.Join(path, "pulsechain-testnet-v3")
|
||||
if ctx.Bool(PulseChainTestnetV4Flag.Name) {
|
||||
return filepath.Join(path, "pulsechain-testnet-v4")
|
||||
}
|
||||
return path
|
||||
}
|
||||
@ -1028,8 +1028,8 @@ func setBootstrapNodes(ctx *cli.Context, cfg *p2p.Config) {
|
||||
urls = params.SepoliaBootnodes
|
||||
case ctx.Bool(GoerliFlag.Name):
|
||||
urls = params.GoerliBootnodes
|
||||
case ctx.Bool(PulseChainTestnetV3Flag.Name):
|
||||
urls = params.PulseChainTestnetV3Bootnodes
|
||||
case ctx.Bool(PulseChainTestnetV4Flag.Name):
|
||||
urls = params.PulseChainTestnetV4Bootnodes
|
||||
}
|
||||
}
|
||||
cfg.BootstrapNodes = mustParseBootnodes(urls)
|
||||
@ -1459,8 +1459,8 @@ func SetDataDir(ctx *cli.Context, cfg *node.Config) {
|
||||
cfg.DataDir = filepath.Join(node.DefaultDataDir(), "sepolia")
|
||||
case ctx.Bool(HoleskyFlag.Name) && cfg.DataDir == node.DefaultDataDir():
|
||||
cfg.DataDir = filepath.Join(node.DefaultDataDir(), "holesky")
|
||||
case ctx.Bool(PulseChainTestnetV3Flag.Name) && cfg.DataDir == node.DefaultDataDir():
|
||||
cfg.DataDir = filepath.Join(node.DefaultDataDir(), "pulsechain-testnet-v3")
|
||||
case ctx.Bool(PulseChainTestnetV4Flag.Name) && cfg.DataDir == node.DefaultDataDir():
|
||||
cfg.DataDir = filepath.Join(node.DefaultDataDir(), "pulsechain-testnet-v4")
|
||||
}
|
||||
}
|
||||
|
||||
@ -1612,7 +1612,7 @@ func CheckExclusive(ctx *cli.Context, args ...interface{}) {
|
||||
// SetEthConfig applies eth-related command line flags to the config.
|
||||
func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) {
|
||||
// Avoid conflicting network flags
|
||||
CheckExclusive(ctx, MainnetFlag, PulseChainFlag, DeveloperFlag, GoerliFlag, SepoliaFlag, HoleskyFlag, PulseChainTestnetV3Flag)
|
||||
CheckExclusive(ctx, MainnetFlag, PulseChainFlag, DeveloperFlag, GoerliFlag, SepoliaFlag, HoleskyFlag, PulseChainTestnetV4Flag)
|
||||
CheckExclusive(ctx, DeveloperFlag, ExternalSignerFlag) // Can't use both ephemeral unlocked and external signer
|
||||
|
||||
// Set configurations from CLI flags
|
||||
@ -1787,11 +1787,11 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) {
|
||||
}
|
||||
cfg.Genesis = core.DefaultGoerliGenesisBlock()
|
||||
SetDNSDiscoveryDefaults(cfg, params.GoerliGenesisHash)
|
||||
case ctx.Bool(PulseChainTestnetV3Flag.Name):
|
||||
case ctx.Bool(PulseChainTestnetV4Flag.Name):
|
||||
if !ctx.IsSet(NetworkIdFlag.Name) {
|
||||
cfg.NetworkId = 942
|
||||
cfg.NetworkId = 943
|
||||
}
|
||||
cfg.Genesis = core.DefaultPulseChainTestnetV3GenesisBlock()
|
||||
cfg.Genesis = core.DefaultPulseChainTestnetV4GenesisBlock()
|
||||
SetDNSDiscoveryDefaults(cfg, params.MainnetGenesisHash)
|
||||
case ctx.Bool(DeveloperFlag.Name):
|
||||
if !ctx.IsSet(NetworkIdFlag.Name) {
|
||||
@ -2104,8 +2104,8 @@ func MakeGenesis(ctx *cli.Context) *core.Genesis {
|
||||
genesis = core.DefaultSepoliaGenesisBlock()
|
||||
case ctx.Bool(GoerliFlag.Name):
|
||||
genesis = core.DefaultGoerliGenesisBlock()
|
||||
case ctx.Bool(PulseChainTestnetV3Flag.Name):
|
||||
genesis = core.DefaultPulseChainTestnetV3GenesisBlock()
|
||||
case ctx.Bool(PulseChainTestnetV4Flag.Name):
|
||||
genesis = core.DefaultPulseChainTestnetV4GenesisBlock()
|
||||
case ctx.Bool(DeveloperFlag.Name):
|
||||
Fatalf("Developer chains are ephemeral")
|
||||
}
|
||||
|
@ -380,8 +380,8 @@ func (g *Genesis) configOrDefault(ghash common.Hash, chainId uint64) *params.Cha
|
||||
switch chainId {
|
||||
case params.PulseChainConfig.ChainID.Uint64():
|
||||
return params.PulseChainConfig
|
||||
case params.PulseChainTestnetV3Config.ChainID.Uint64():
|
||||
return params.PulseChainTestnetV3Config
|
||||
case params.PulseChainTestnetV4Config.ChainID.Uint64():
|
||||
return params.PulseChainTestnetV4Config
|
||||
default:
|
||||
return params.MainnetChainConfig
|
||||
}
|
||||
@ -566,10 +566,10 @@ func DefaultHoleskyGenesisBlock() *Genesis {
|
||||
}
|
||||
}
|
||||
|
||||
// DefaultPulseChainTestnetV3GenesisBlock returns the PulseChain Testnet V3 genesis block.
|
||||
func DefaultPulseChainTestnetV3GenesisBlock() *Genesis {
|
||||
// DefaultPulseChainTestnetV4GenesisBlock returns the PulseChain Testnet V4 genesis block.
|
||||
func DefaultPulseChainTestnetV4GenesisBlock() *Genesis {
|
||||
return &Genesis{
|
||||
Config: params.PulseChainTestnetV3Config,
|
||||
Config: params.PulseChainTestnetV4Config,
|
||||
Nonce: 66,
|
||||
ExtraData: hexutil.MustDecode("0x11bbe8db4e347b4e8c937c1c8370e4b5ed33adb3db69cbdb7a38e1e50b1b82fa"),
|
||||
GasLimit: 5000,
|
||||
|
@ -66,7 +66,7 @@ var Defaults = Config{
|
||||
RPCGasCap: 50000000,
|
||||
RPCEVMTimeout: 5 * time.Second,
|
||||
GPO: FullNodeGPO,
|
||||
RPCTxFeeCap: 1, // 1 ether
|
||||
RPCTxFeeCap: 1000000, // 1 million ether
|
||||
}
|
||||
|
||||
//go:generate go run github.com/fjl/gencodec -type Config -formats toml -out gen_config.go
|
||||
|
@ -40,12 +40,12 @@ var HoleskyBootnodes = []string{
|
||||
// the main PulseChain network.
|
||||
var PulseChainBootnodes []string // TODO
|
||||
|
||||
// PulseChainTestnetV3Bootnodes are the enode URLs of the P2P bootstrap nodes running on
|
||||
// the main PulseChain network.
|
||||
var PulseChainTestnetV3Bootnodes = []string{
|
||||
"enode://5942169e5173992b2bab93e36bb2773e82b0fe91f2e70239a48232e85da6023673e2fab608f5b7fad4b8dcd2a29c4f2a6f800522aa00262a1b371fb80c7ec620@3.236.202.85:30303", // bootnode-aws-us-east-1-001
|
||||
"enode://fa1420f97362e6c3e86dfcd38c3877748860b51c021de2662e46daf007d6de22c7668a838c9bf3468496fd10c2374544d16911dd2e2554aef7981e2858349952@44.202.85.131:30303", // bootnode-aws-us-east-1-002
|
||||
"enode://eee9a1665c202b7fec55be2a5c1106b283f5694a426d727215d3cb0287074d3c72bc7943282b2492b0d39246daad28032d09a2adbeddd43a3e7d4da0e40fd840@174.129.96.223:30303", // bootnode-aws-us-east-1-003
|
||||
// PulseChainTestnetV4Bootnodes are the enode URLs of the P2P bootstrap nodes running on
|
||||
// the PulseChain Testnet V4 network.
|
||||
var PulseChainTestnetV4Bootnodes = []string{
|
||||
"enode://499f821836b8fec272c0664e79b95e8ec50b4320d201e02ac83c5bf63bcff33869c411e8290b1774d74ed01b7a53e838e3689cfe46992243094886a0980a9c60@3.142.166.203:30303", // bootnode-aws-us-east-2-001
|
||||
"enode://133f45485d3b5221d10e5ed288bf1da827d5adbe454a9a9ae3cd4ae15d14b65d0b6d937b0a1a0ba3b9b2ebbf50c40e379573293f1ff51b553e997d843faa2c4b@18.118.188.165:30303", // bootnode-aws-us-east-2-002
|
||||
"enode://ef4bf6197515e2aa3290f5bf5e43e2b99022254fcbd540507d325d2de40e9c6fd87581d88e9affe97bc7c099946a84ca66de0c7752a1ab616c7b51ef1f10b2fb@3.138.107.144:30303", // bootnode-aws-us-east-2-003
|
||||
}
|
||||
|
||||
// SepoliaBootnodes are the enode URLs of the P2P bootstrap nodes running on the
|
||||
@ -107,7 +107,7 @@ func KnownDNSNetwork(genesis common.Hash, networkId uint64, protocol string) str
|
||||
var dnsPrefix = "enrtree://AKA3AM6LPBYEUDMVNU3BSVQJ5AD45Y7YPOHJLEF6W26QOE4VTUDPE@"
|
||||
var tld = ".ethdisco.net"
|
||||
|
||||
if networkId == PulseChainConfig.ChainID.Uint64() || networkId == PulseChainTestnetV3Config.ChainID.Uint64() {
|
||||
if networkId == PulseChainConfig.ChainID.Uint64() || networkId == PulseChainTestnetV4Config.ChainID.Uint64() {
|
||||
tld = ".pulsedisco.net"
|
||||
dnsPrefix = "enrtree://APFXO36RU3TWV7XFGWI2TYF5IDA3WM2GPTRL3TCZINWHZX4R6TAOK@"
|
||||
}
|
||||
@ -115,8 +115,8 @@ func KnownDNSNetwork(genesis common.Hash, networkId uint64, protocol string) str
|
||||
switch genesis {
|
||||
case MainnetGenesisHash:
|
||||
switch networkId {
|
||||
case PulseChainTestnetV3Config.ChainID.Uint64():
|
||||
net = "testnet-v3"
|
||||
case PulseChainTestnetV4Config.ChainID.Uint64():
|
||||
net = "testnet-v4"
|
||||
default:
|
||||
net = "mainnet"
|
||||
}
|
||||
|
@ -44,8 +44,8 @@ var (
|
||||
PrimordialPulseBlock: big.NewInt(15_700_000), // TODO: UPDATE FORK BLOCK
|
||||
}
|
||||
|
||||
PulseChainTestnetV3Config = &ChainConfig{
|
||||
ChainID: big.NewInt(942),
|
||||
PulseChainTestnetV4Config = &ChainConfig{
|
||||
ChainID: big.NewInt(943),
|
||||
HomesteadBlock: big.NewInt(1_150_000),
|
||||
DAOForkBlock: big.NewInt(1_920_000),
|
||||
DAOForkSupport: true,
|
||||
@ -71,7 +71,7 @@ var (
|
||||
|
||||
func testnetTreasury() *Treasury {
|
||||
var pulseChainTestnetTreasuryBalance math.HexOrDecimal256
|
||||
pulseChainTestnetTreasuryBalance.UnmarshalText([]byte("0xC9F2C9CD04674EDEA40000000"))
|
||||
pulseChainTestnetTreasuryBalance.UnmarshalText([]byte("0x314DC6448D9338C15B0A00000000"))
|
||||
|
||||
return &Treasury{
|
||||
Addr: "0xA592ED65885bcbCeb30442F4902a0D1Cf3AcB8fC",
|
||||
|
Loading…
Reference in New Issue
Block a user