chaincfg: introduce Seeder

Seeder identifies the hostname as a seeder.
This commit is contained in:
David Hill 2019-12-04 13:59:45 -05:00 committed by Dave Collins
parent 97990536cf
commit 66970932bb
5 changed files with 23 additions and 0 deletions

View File

@ -347,5 +347,10 @@ func MainNetParams() *Params {
OrganizationPkScript: hexDecode("a914f5916158e3e2c4551c1796708db8367207ed13bb87"),
OrganizationPkScriptVersion: 0,
BlockOneLedger: tokenPayouts_MainNetParams(),
seeders: []string{
"mainnet-seed-1.decred.org",
"mainnet-seed-2.decred.org",
},
}
}

View File

@ -454,6 +454,10 @@ type Params struct {
// block height 1. If there are no payouts to be given, set this
// to an empty slice.
BlockOneLedger []TokenPayout
// seeders defines a list of seeders for the network that are used
// as one method to discover peers.
seeders []string
}
// HDPrivKeyVersion returns the hierarchical deterministic extended private key
@ -656,3 +660,8 @@ func (p *Params) LatestCheckpointHeight() int64 {
}
return p.Checkpoints[len(p.Checkpoints)-1].Height
}
// Seeders returns the list of HTTP seeders.
func (p *Params) Seeders() []string {
return p.seeders
}

View File

@ -353,5 +353,7 @@ func RegNetParams() *Params {
OrganizationPkScript: hexDecode("a9146913bcc838bd0087fb3f6b3c868423d5e300078d87"),
OrganizationPkScriptVersion: 0,
BlockOneLedger: tokenPayouts_RegNetParams(),
seeders: nil, // NOTE: There must NOT be any seeds.
}
}

View File

@ -210,5 +210,7 @@ func SimNetParams() *Params {
OrganizationPkScript: hexDecode("a914cbb08d6ca783b533b2c7d24a51fbca92d937bf9987"),
OrganizationPkScriptVersion: 0,
BlockOneLedger: tokenPayouts_SimNetParams(),
seeders: nil, // NOTE: There must NOT be any seeds.
}
}

View File

@ -242,5 +242,10 @@ func TestNet3Params() *Params {
OrganizationPkScript: hexDecode("a914d585cd7426d25b4ea5faf1e6987aacfeda3db94287"),
OrganizationPkScriptVersion: 0,
BlockOneLedger: tokenPayouts_TestNet3Params(),
seeders: []string{
"testnet-seed-1.decred.org",
"testnet-seed-2.decred.org",
},
}
}