Skip to content

Make signet usable #270

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ Do the following:
import bitcoin
bitcoin.SelectParams(NAME)

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

Expand Down
7 changes: 7 additions & 0 deletions bitcoin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ class SigNetParams(bitcoin.core.CoreSigNetParams):
DEFAULT_PORT = 38333
RPC_PORT = 38332
DNS_SEEDS = (("signet.bitcoin.sprovoost.nl", "seed.signet.bitcoin.sprovoost.nl"))
BASE58_PREFIXES = {'PUBKEY_ADDR':111,
'SCRIPT_ADDR':196,
'SECRET_KEY' :239}

BECH32_HRP = 'tb'

class RegTestParams(bitcoin.core.CoreRegTestParams):
MESSAGE_START = b'\xfa\xbf\xb5\xda'
Expand Down Expand Up @@ -84,5 +89,7 @@ def SelectParams(name):
params = bitcoin.core.coreparams = TestNetParams()
elif name == 'regtest':
params = bitcoin.core.coreparams = RegTestParams()
elif name == 'signet':
params = bitcoin.core.coreparams = SigNetParams()
else:
raise ValueError('Unknown chain %r' % name)
2 changes: 2 additions & 0 deletions bitcoin/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -736,6 +736,8 @@ def _SelectCoreParams(name):
coreparams = CoreTestNetParams()
elif name == 'regtest':
coreparams = CoreRegTestParams()
elif name == 'signet':
coreparams = CoreSigNetParams()
else:
raise ValueError('Unknown chain %r' % name)

Expand Down
2 changes: 1 addition & 1 deletion bitcoin/rpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ def __init__(self,
out of the file ``btc_conf_file``. If ``btc_conf_file`` is not
specified, ``~/.bitcoin/bitcoin.conf`` or equivalent is used by
default. The default port is set according to the chain parameters in
use: mainnet, testnet, or regtest.
use: mainnet, testnet, signet, or regtest.

Usually no arguments to ``Proxy()`` are needed; the local bitcoind will
be used.
Expand Down
2 changes: 1 addition & 1 deletion examples/make-bootstrap-rpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
if len(sys.argv) == 3:
bitcoin.SelectParams(sys.argv[2])
except Exception as ex:
print('Usage: %s <block-height> [network=(mainnet|testnet|regtest)] > bootstrap.dat' % sys.argv[0], file=sys.stderr)
print('Usage: %s <block-height> [network=(mainnet|testnet|regtest|signet)] > bootstrap.dat' % sys.argv[0], file=sys.stderr)
sys.exit(1)


Expand Down