Skip to content

Commit 0f658b4

Browse files
committed
Update topic prefixes with versions
1 parent 922a292 commit 0f658b4

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

params.go

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ var (
3939
// stnPowLimit is the highest proof of work value a Bitcoin block can
4040
// have for the scaling test network. It is value 2^224-1.
4141
stnPowLimit = new(big.Int).Sub(new(big.Int).Lsh(bigOne, 224), bigOne)
42+
43+
// protocolVersion is the version of the protocol used for libp2p topics
44+
protocolVersion = "1.0.0"
4245
)
4346

4447
const (
@@ -248,7 +251,7 @@ type Params struct {
248251
var MainNetParams = Params{
249252
Name: "mainnet",
250253
Net: wire.MainNet,
251-
TopicPrefix: "bitcoin/mainnet",
254+
TopicPrefix: fmt.Sprintf("teranode/bitcoin/%s/mainnet", protocolVersion),
252255
DefaultPort: "8333",
253256
DNSSeeds: []DNSSeed{
254257
{"seed.bitcoinsv.io", true},
@@ -363,7 +366,7 @@ var MainNetParams = Params{
363366
var StnParams = Params{
364367
Name: "stn",
365368
Net: wire.STN,
366-
TopicPrefix: "bitcoin/stn",
369+
TopicPrefix: fmt.Sprintf("teranode/bitcoin/%s/stn", protocolVersion),
367370
DefaultPort: "9333",
368371
DNSSeeds: []DNSSeed{},
369372

@@ -444,7 +447,7 @@ var StnParams = Params{
444447
var RegressionNetParams = Params{
445448
Name: "regtest",
446449
Net: wire.RegTestNet,
447-
TopicPrefix: "bitcoin/regtest",
450+
TopicPrefix: fmt.Sprintf("teranode/bitcoin/%s/regtest", protocolVersion),
448451
DefaultPort: "18444",
449452
DNSSeeds: []DNSSeed{},
450453

@@ -525,7 +528,7 @@ var RegressionNetParams = Params{
525528
var TestNetParams = Params{
526529
Name: "testnet",
527530
Net: wire.TestNet,
528-
TopicPrefix: "bitcoin/testnet",
531+
TopicPrefix: fmt.Sprintf("teranode/bitcoin/%s/testnet", protocolVersion),
529532
DefaultPort: "18333",
530533
DNSSeeds: []DNSSeed{
531534
{"testnet-seed.bitcoinsv.io", true},
@@ -624,7 +627,7 @@ var TestNetParams = Params{
624627
var TeraTestNetParams = Params{
625628
Name: "teratestnet",
626629
Net: wire.TeraTestNet,
627-
TopicPrefix: "bitcoin/teratestnet",
630+
TopicPrefix: fmt.Sprintf("teranode/bitcoin/%s/teratestnet", protocolVersion),
628631
DefaultPort: "18333",
629632

630633
// Chain parameters
@@ -697,7 +700,7 @@ var TeraTestNetParams = Params{
697700
var TeraScalingTestNetParams = Params{
698701
Name: "tstn",
699702
Net: wire.TeraScalingTestNet,
700-
TopicPrefix: "bitcoin/tstn",
703+
TopicPrefix: fmt.Sprintf("teranode/bitcoin/%s/tstn", protocolVersion),
701704
DefaultPort: "18333",
702705

703706
// Chain parameters

0 commit comments

Comments
 (0)