Enable proxying and discovery of rinkeby nodes (#1172)

This commit is contained in:
Dmitry Shulyak 2018-08-27 12:32:14 +03:00 committed by GitHub
parent f150d678de
commit 5ef26596e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 3 deletions

View File

@ -720,13 +720,15 @@ func GetStatusHome() string {
}
// LesTopic returns discovery v5 topic derived from genesis of the provided network.
// 1 - mainnet, 4 - ropsten
// 1 - mainnet, 3 - ropsten, 4 - rinkeby
func LesTopic(netid int) string {
switch netid {
case 1:
return "LES2@" + common.Bytes2Hex(params.MainnetGenesisHash.Bytes()[:8])
return LESDiscoveryIdentifier + common.Bytes2Hex(params.MainnetGenesisHash.Bytes()[:8])
case 3:
return "LES2@" + common.Bytes2Hex(params.TestnetGenesisHash.Bytes()[:8])
return LESDiscoveryIdentifier + common.Bytes2Hex(params.TestnetGenesisHash.Bytes()[:8])
case 4:
return LESDiscoveryIdentifier + common.Bytes2Hex(params.RinkebyGenesisHash.Bytes()[:8])
default:
return ""
}

View File

@ -114,6 +114,9 @@ const (
// WhisperDiscv5Topic used to register and search for whisper peers using discovery v5.
WhisperDiscv5Topic = discv5.Topic("whisper")
// LESDiscoveryIdentifier is a prefix for topic used for LES peers discovery.
LESDiscoveryIdentifier = "LES2@"
)
var (