mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-31 09:21:39 +00:00
add regtest support (#4242)
* add regtest support * set default regtest ssl and tcp ports to 51002 and 51002 * regtest inherits parameters from testnet
This commit is contained in:
parent
b68f5645cb
commit
b4d71e651b
6 changed files with 28 additions and 0 deletions
2
electrum
2
electrum
|
@ -401,6 +401,8 @@ if __name__ == '__main__':
|
|||
|
||||
if config.get('testnet'):
|
||||
constants.set_testnet()
|
||||
elif config.get('regtest'):
|
||||
constants.set_regtest()
|
||||
|
||||
# run non-RPC commands separately
|
||||
if cmdname in ['create', 'restore']:
|
||||
|
|
|
@ -817,6 +817,7 @@ def add_global_options(parser):
|
|||
group.add_argument("-P", "--portable", action="store_true", dest="portable", default=False, help="Use local 'electrum_data' directory")
|
||||
group.add_argument("-w", "--wallet", dest="wallet_path", help="wallet path")
|
||||
group.add_argument("--testnet", action="store_true", dest="testnet", default=False, help="Use Testnet")
|
||||
group.add_argument("--regtest", action="store_true", dest="regtest", default=False, help="Use Regtest")
|
||||
|
||||
def get_parser():
|
||||
# create main parser
|
||||
|
|
|
@ -93,6 +93,14 @@ class BitcoinTestnet:
|
|||
}
|
||||
|
||||
|
||||
class BitcoinRegtest(BitcoinTestnet):
|
||||
|
||||
SEGWIT_HRP = "bcrt"
|
||||
GENESIS = "0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206"
|
||||
DEFAULT_SERVERS = read_json('servers_regtest.json', {})
|
||||
CHECKPOINTS = []
|
||||
|
||||
|
||||
# don't import net directly, import the module instead (so that net is singleton)
|
||||
net = BitcoinMainnet
|
||||
|
||||
|
@ -105,3 +113,8 @@ def set_mainnet():
|
|||
def set_testnet():
|
||||
global net
|
||||
net = BitcoinTestnet
|
||||
|
||||
|
||||
def set_regtest():
|
||||
global net
|
||||
net = BitcoinRegtest
|
||||
|
|
8
lib/servers_regtest.json
Normal file
8
lib/servers_regtest.json
Normal file
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"127.0.0.1": {
|
||||
"pruning": "-",
|
||||
"s": "51002",
|
||||
"t": "51001",
|
||||
"version": "1.2"
|
||||
}
|
||||
}
|
|
@ -115,6 +115,9 @@ class SimpleConfig(PrintError):
|
|||
if self.get('testnet'):
|
||||
path = os.path.join(path, 'testnet')
|
||||
make_dir(path)
|
||||
elif self.get('regtest'):
|
||||
path = os.path.join(path, 'regtest')
|
||||
make_dir(path)
|
||||
|
||||
self.print_error("electrum directory", path)
|
||||
return path
|
||||
|
|
1
setup.py
1
setup.py
|
@ -74,6 +74,7 @@ setup(
|
|||
'electrum': [
|
||||
'servers.json',
|
||||
'servers_testnet.json',
|
||||
'servers_regtest.json',
|
||||
'currencies.json',
|
||||
'checkpoints.json',
|
||||
'checkpoints_testnet.json',
|
||||
|
|
Loading…
Add table
Reference in a new issue