mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-23 17:47:31 +00:00
add simnet support (#4455)
This commit is contained in:
parent
a141c69b25
commit
4f85615734
4 changed files with 17 additions and 0 deletions
2
electrum
2
electrum
|
@ -401,6 +401,8 @@ if __name__ == '__main__':
|
|||
constants.set_testnet()
|
||||
elif config.get('regtest'):
|
||||
constants.set_regtest()
|
||||
elif config.get('simnet'):
|
||||
constants.set_simnet()
|
||||
|
||||
# run non-RPC commands separately
|
||||
if cmdname in ['create', 'restore']:
|
||||
|
|
|
@ -835,6 +835,7 @@ def add_global_options(parser):
|
|||
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")
|
||||
group.add_argument("--simnet", action="store_true", dest="simnet", default=False, help="Use Simnet")
|
||||
|
||||
def get_parser():
|
||||
# create main parser
|
||||
|
|
|
@ -101,9 +101,20 @@ class BitcoinRegtest(BitcoinTestnet):
|
|||
CHECKPOINTS = []
|
||||
|
||||
|
||||
class BitcoinSimnet(BitcoinTestnet):
|
||||
|
||||
SEGWIT_HRP = "sb"
|
||||
GENESIS = "683e86bd5c6d110d91b94b97137ba6bfe02dbbdb8e3dff722a669b5d69d77af6"
|
||||
DEFAULT_SERVERS = read_json('servers_regtest.json', {})
|
||||
CHECKPOINTS = []
|
||||
|
||||
|
||||
# don't import net directly, import the module instead (so that net is singleton)
|
||||
net = BitcoinMainnet
|
||||
|
||||
def set_simnet():
|
||||
global net
|
||||
net = BitcoinSimnet
|
||||
|
||||
def set_mainnet():
|
||||
global net
|
||||
|
|
|
@ -113,6 +113,9 @@ class SimpleConfig(PrintError):
|
|||
elif self.get('regtest'):
|
||||
path = os.path.join(path, 'regtest')
|
||||
make_dir(path, allow_symlink=False)
|
||||
elif self.get('simnet'):
|
||||
path = os.path.join(path, 'simnet')
|
||||
make_dir(path, allow_symlink=False)
|
||||
|
||||
self.print_error("electrum directory", path)
|
||||
return path
|
||||
|
|
Loading…
Add table
Reference in a new issue