diff --git a/params/config.go b/params/config.go index adb5f44f0952..b9d116810eec 100644 --- a/params/config.go +++ b/params/config.go @@ -497,6 +497,18 @@ func (c *ChainConfig) Description() string { } else { banner += "Consensus: Beacon (proof-of-stake), merged from Clique (proof-of-authority)\n" } + case IsQngNetwork(c.ChainID): + banner += "Consensus: MeerDAG (proof-of-work)\n" + return banner + case IsAmanaNetwork(c.ChainID): + banner += "Consensus: Amana (proof-of-authority)\n" + return banner + case IsFlanaNetwork(c.ChainID): + banner += "Consensus: Flana (rollup)\n" + return banner + case IsMizanaNetwork(c.ChainID): + banner += "Consensus: Mizana (ZK rollup)\n" + return banner default: banner += "Consensus: unknown\n" } diff --git a/params/qng_config.go b/params/qng_config.go new file mode 100644 index 000000000000..2de3b0a8bd31 --- /dev/null +++ b/params/qng_config.go @@ -0,0 +1,123 @@ +package params + +import "math/big" + +type MeerChainConfig struct { + ChainID *big.Int // chainId identifies the current chain and is used for replay protection +} + +var ( + QngMainnetChainConfig = &MeerChainConfig{ + ChainID: big.NewInt(813), + } + QngTestnetChainConfig = &MeerChainConfig{ + ChainID: big.NewInt(8131), + } + QngMixnetChainConfig = &MeerChainConfig{ + ChainID: big.NewInt(8132), + } + QngPrivnetChainConfig = &MeerChainConfig{ + ChainID: big.NewInt(8133), + } + + AmanaChainConfig = &MeerChainConfig{ + ChainID: big.NewInt(8134), + } + AmanaTestnetChainConfig = &MeerChainConfig{ + ChainID: big.NewInt(81341), + } + AmanaMixnetChainConfig = &MeerChainConfig{ + ChainID: big.NewInt(81342), + } + AmanaPrivnetChainConfig = &MeerChainConfig{ + ChainID: big.NewInt(81343), + } + + FlanaChainConfig = &MeerChainConfig{ + ChainID: big.NewInt(8135), + } + FlanaTestnetChainConfig = &MeerChainConfig{ + ChainID: big.NewInt(81351), + } + FlanaMixnetChainConfig = &MeerChainConfig{ + ChainID: big.NewInt(81352), + } + FlanaPrivnetChainConfig = &MeerChainConfig{ + ChainID: big.NewInt(81353), + } + + MizanaChainConfig = &MeerChainConfig{ + ChainID: big.NewInt(8136), + } + MizanaTestnetChainConfig = &MeerChainConfig{ + ChainID: big.NewInt(81361), + } + MizanaMixnetChainConfig = &MeerChainConfig{ + ChainID: big.NewInt(81362), + } + MizanaPrivnetChainConfig = &MeerChainConfig{ + ChainID: big.NewInt(81363), + } +) + +func init() { + NetworkNames[QngMainnetChainConfig.ChainID.String()] = "qng" + NetworkNames[QngTestnetChainConfig.ChainID.String()] = "qng-test" + NetworkNames[QngMixnetChainConfig.ChainID.String()] = "qng-mix" + NetworkNames[QngPrivnetChainConfig.ChainID.String()] = "qng-priv" + + NetworkNames[AmanaChainConfig.ChainID.String()] = "amana" + NetworkNames[AmanaTestnetChainConfig.ChainID.String()] = "amana-test" + NetworkNames[AmanaMixnetChainConfig.ChainID.String()] = "amana-mix" + NetworkNames[AmanaPrivnetChainConfig.ChainID.String()] = "amana-priv" + + NetworkNames[FlanaChainConfig.ChainID.String()] = "flana" + NetworkNames[FlanaTestnetChainConfig.ChainID.String()] = "flana-test" + NetworkNames[FlanaMixnetChainConfig.ChainID.String()] = "flana-mix" + NetworkNames[FlanaPrivnetChainConfig.ChainID.String()] = "flana-priv" + + NetworkNames[MizanaChainConfig.ChainID.String()] = "mizana" + NetworkNames[MizanaTestnetChainConfig.ChainID.String()] = "mizana-test" + NetworkNames[MizanaMixnetChainConfig.ChainID.String()] = "mizana-mix" + NetworkNames[MizanaPrivnetChainConfig.ChainID.String()] = "mizana-priv" +} + +func IsQngNetwork(chainID *big.Int) bool { + if chainID == QngMainnetChainConfig.ChainID || + chainID == QngTestnetChainConfig.ChainID || + chainID == QngMixnetChainConfig.ChainID || + chainID == QngPrivnetChainConfig.ChainID { + return true + } + return false +} + +func IsAmanaNetwork(chainID *big.Int) bool { + if chainID == AmanaChainConfig.ChainID || + chainID == AmanaTestnetChainConfig.ChainID || + chainID == AmanaMixnetChainConfig.ChainID || + chainID == AmanaPrivnetChainConfig.ChainID { + return true + } + return false +} + +func IsFlanaNetwork(chainID *big.Int) bool { + if chainID == FlanaChainConfig.ChainID || + chainID == FlanaTestnetChainConfig.ChainID || + chainID == FlanaMixnetChainConfig.ChainID || + chainID == FlanaPrivnetChainConfig.ChainID { + return true + } + return false +} + +func IsMizanaNetwork(chainID *big.Int) bool { + if chainID == MizanaChainConfig.ChainID || + chainID == MizanaTestnetChainConfig.ChainID || + chainID == MizanaMixnetChainConfig.ChainID || + chainID == MizanaPrivnetChainConfig.ChainID { + return true + } + return false +}