|
39 | 39 | // stnPowLimit is the highest proof of work value a Bitcoin block can |
40 | 40 | // have for the scaling test network. It is value 2^224-1. |
41 | 41 | 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" |
42 | 45 | ) |
43 | 46 |
|
44 | 47 | const ( |
@@ -248,7 +251,7 @@ type Params struct { |
248 | 251 | var MainNetParams = Params{ |
249 | 252 | Name: "mainnet", |
250 | 253 | Net: wire.MainNet, |
251 | | - TopicPrefix: "bitcoin/mainnet", |
| 254 | + TopicPrefix: fmt.Sprintf("teranode/bitcoin/%s/mainnet", protocolVersion), |
252 | 255 | DefaultPort: "8333", |
253 | 256 | DNSSeeds: []DNSSeed{ |
254 | 257 | {"seed.bitcoinsv.io", true}, |
@@ -363,7 +366,7 @@ var MainNetParams = Params{ |
363 | 366 | var StnParams = Params{ |
364 | 367 | Name: "stn", |
365 | 368 | Net: wire.STN, |
366 | | - TopicPrefix: "bitcoin/stn", |
| 369 | + TopicPrefix: fmt.Sprintf("teranode/bitcoin/%s/stn", protocolVersion), |
367 | 370 | DefaultPort: "9333", |
368 | 371 | DNSSeeds: []DNSSeed{}, |
369 | 372 |
|
@@ -444,7 +447,7 @@ var StnParams = Params{ |
444 | 447 | var RegressionNetParams = Params{ |
445 | 448 | Name: "regtest", |
446 | 449 | Net: wire.RegTestNet, |
447 | | - TopicPrefix: "bitcoin/regtest", |
| 450 | + TopicPrefix: fmt.Sprintf("teranode/bitcoin/%s/regtest", protocolVersion), |
448 | 451 | DefaultPort: "18444", |
449 | 452 | DNSSeeds: []DNSSeed{}, |
450 | 453 |
|
@@ -525,7 +528,7 @@ var RegressionNetParams = Params{ |
525 | 528 | var TestNetParams = Params{ |
526 | 529 | Name: "testnet", |
527 | 530 | Net: wire.TestNet, |
528 | | - TopicPrefix: "bitcoin/testnet", |
| 531 | + TopicPrefix: fmt.Sprintf("teranode/bitcoin/%s/testnet", protocolVersion), |
529 | 532 | DefaultPort: "18333", |
530 | 533 | DNSSeeds: []DNSSeed{ |
531 | 534 | {"testnet-seed.bitcoinsv.io", true}, |
@@ -624,7 +627,7 @@ var TestNetParams = Params{ |
624 | 627 | var TeraTestNetParams = Params{ |
625 | 628 | Name: "teratestnet", |
626 | 629 | Net: wire.TeraTestNet, |
627 | | - TopicPrefix: "bitcoin/teratestnet", |
| 630 | + TopicPrefix: fmt.Sprintf("teranode/bitcoin/%s/teratestnet", protocolVersion), |
628 | 631 | DefaultPort: "18333", |
629 | 632 |
|
630 | 633 | // Chain parameters |
@@ -697,7 +700,7 @@ var TeraTestNetParams = Params{ |
697 | 700 | var TeraScalingTestNetParams = Params{ |
698 | 701 | Name: "tstn", |
699 | 702 | Net: wire.TeraScalingTestNet, |
700 | | - TopicPrefix: "bitcoin/tstn", |
| 703 | + TopicPrefix: fmt.Sprintf("teranode/bitcoin/%s/tstn", protocolVersion), |
701 | 704 | DefaultPort: "18333", |
702 | 705 |
|
703 | 706 | // Chain parameters |
|
0 commit comments