-
Notifications
You must be signed in to change notification settings - Fork 43
/
chainparams.go
31 lines (23 loc) · 1.04 KB
/
chainparams.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package main
const (
ChainConsensusPoA = 0
ChainConsensusPoW = 1
)
// ChainParams holds blockchain configuration
type ChainParams struct {
// GenesisBlockHash is the SHA256 hash of the genesis block payload
GenesisBlockHash string `json:"genesis_block_hash"`
// GenesisBlockHashSignature is the signature of the genesis block's hash, with the key in the genesis block
GenesisBlockHashSignature string `json:"genesis_block_hash_signature"`
// GenesisBlockTimestamp is the timestamp of the genesis block
GenesisBlockTimestamp string `json:"genesis_block_timestamp"`
Creator string `json:"creator"`
CreatorPublicKey string `json:"creator_public_key"`
// List of host:port string specifying default peers for this blockchain. If empty, the defaults are used.
BootstrapPeers []string `json:"bootstrap_peers"`
// Consensus algorithm used: "PoA", "PoW"
ConsensusTypeString string `json:"consensus_type"`
ConsensusType int `json:"-"`
// Description of the blockchain (e.g. its purpose)
Description string `json:"description"`
}