Skip to content

Commit c1eca00

Browse files
committed
Merge petertodd#270: Make signet usable
2aad684 Make signet usable (James O'Beirne) Pull request description: Add its constant into `SelectParams`. Top commit has no ACKs. Tree-SHA512: 35edcac743a77a67d5359a4cf696582d12d2bfba1934b6a3bb01eb75a899781ad9374fa801d390fc717b08facfb1fc011234022118a6204f912fc86dc5d42fd6
2 parents 2e4bc02 + 2aad684 commit c1eca00

File tree

5 files changed

+12
-3
lines changed

5 files changed

+12
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ Do the following:
8686
import bitcoin
8787
bitcoin.SelectParams(NAME)
8888

89-
Where NAME is one of 'testnet', 'mainnet', or 'regtest'. The chain currently
89+
Where NAME is one of 'testnet', 'mainnet', 'signet', or 'regtest'. The chain currently
9090
selected is a global variable that changes behavior everywhere, just like in
9191
the Satoshi codebase.
9292

bitcoin/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ class SigNetParams(bitcoin.core.CoreSigNetParams):
5050
DEFAULT_PORT = 38333
5151
RPC_PORT = 38332
5252
DNS_SEEDS = (("signet.bitcoin.sprovoost.nl", "seed.signet.bitcoin.sprovoost.nl"))
53+
BASE58_PREFIXES = {'PUBKEY_ADDR':111,
54+
'SCRIPT_ADDR':196,
55+
'SECRET_KEY' :239}
56+
57+
BECH32_HRP = 'tb'
5358

5459
class RegTestParams(bitcoin.core.CoreRegTestParams):
5560
MESSAGE_START = b'\xfa\xbf\xb5\xda'
@@ -84,5 +89,7 @@ def SelectParams(name):
8489
params = bitcoin.core.coreparams = TestNetParams()
8590
elif name == 'regtest':
8691
params = bitcoin.core.coreparams = RegTestParams()
92+
elif name == 'signet':
93+
params = bitcoin.core.coreparams = SigNetParams()
8794
else:
8895
raise ValueError('Unknown chain %r' % name)

bitcoin/core/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -736,6 +736,8 @@ def _SelectCoreParams(name):
736736
coreparams = CoreTestNetParams()
737737
elif name == 'regtest':
738738
coreparams = CoreRegTestParams()
739+
elif name == 'signet':
740+
coreparams = CoreSigNetParams()
739741
else:
740742
raise ValueError('Unknown chain %r' % name)
741743

bitcoin/rpc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ def __init__(self,
355355
out of the file ``btc_conf_file``. If ``btc_conf_file`` is not
356356
specified, ``~/.bitcoin/bitcoin.conf`` or equivalent is used by
357357
default. The default port is set according to the chain parameters in
358-
use: mainnet, testnet, or regtest.
358+
use: mainnet, testnet, signet, or regtest.
359359
360360
Usually no arguments to ``Proxy()`` are needed; the local bitcoind will
361361
be used.

examples/make-bootstrap-rpc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
if len(sys.argv) == 3:
3030
bitcoin.SelectParams(sys.argv[2])
3131
except Exception as ex:
32-
print('Usage: %s <block-height> [network=(mainnet|testnet|regtest)] > bootstrap.dat' % sys.argv[0], file=sys.stderr)
32+
print('Usage: %s <block-height> [network=(mainnet|testnet|regtest|signet)] > bootstrap.dat' % sys.argv[0], file=sys.stderr)
3333
sys.exit(1)
3434

3535

0 commit comments

Comments
 (0)