From 6502e150041903b8b7e9395c27e4d1b115cff379 Mon Sep 17 00:00:00 2001 From: Wei-Ning Huang Date: Thu, 11 Oct 2018 17:04:08 +0800 Subject: core: populate dexon configuration in SetupGenesisBlock --- params/config.go | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) (limited to 'params') diff --git a/params/config.go b/params/config.go index b10a47004..0c64fb6bf 100644 --- a/params/config.go +++ b/params/config.go @@ -45,7 +45,7 @@ var ( ByzantiumBlock: big.NewInt(4370000), ConstantinopleBlock: big.NewInt(7280000), PetersburgBlock: big.NewInt(7280000), - Ethash: new(EthashConfig), + Dexcon: &DexconConfig{}, } // MainnetTrustedCheckpoint contains the light client trusted checkpoint for the main network. @@ -219,12 +219,32 @@ func (c *CliqueConfig) String() string { // DexconConfig is the consensus engine configs for DEXON consensus. type DexconConfig struct { - GovernanceContractAddress string + NumChains uint32 `json:"numChains"` + LambdaBA uint64 `json:"lambdaBA"` + LambdaDKG uint64 `json:"lambdaDKG"` + K int `json:"k"` + PhiRatio float32 `json:"phiRatio"` + NotarySetSize uint32 `json:"notarySetSize"` + DKGSetSize uint32 `json:"dkgSetSize"` + RoundInterval uint64 `json:"roundInterval"` + MinBlockInterval uint64 `json:"minBlockInterval"` + MaxBlockInterval uint64 `json:"maxBlockInterval"` } // String implements the stringer interface, returning the consensus engine details. -func (c *DexconConfig) String() string { - return "dexcon" +func (d *DexconConfig) String() string { + return fmt.Sprintf("{NumChains: %v LambdaBA: %v LambdaDKG: %v K: %v PhiRatio: %v NotarySetSize: %v DKGSetSize: %v RoundInterval: %v MinBlockInterval: %v MaxBlockInterval: %v", + d.NumChains, + d.LambdaBA, + d.LambdaDKG, + d.K, + d.PhiRatio, + d.NotarySetSize, + d.DKGSetSize, + d.RoundInterval, + d.MinBlockInterval, + d.MaxBlockInterval, + ) } // String implements the fmt.Stringer interface. -- cgit v1.2.3