Skip to content
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
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@ tests-quick:

.PHONY: tests-genesis
tests-genesis:
HATHOR_TEST_CONFIG_YAML='./hathor/conf/mainnet.yml' pytest tests/tx/test_genesis.py
HATHOR_TEST_CONFIG_YAML='./hathor/conf/testnet.yml' pytest tests/tx/test_genesis.py
HATHOR_TEST_CONFIG_YAML='./hathor/conf/mainnet.yml' pytest -n0 tests/tx/test_genesis.py
HATHOR_TEST_CONFIG_YAML='./hathor/conf/testnet.yml' pytest -n0 tests/tx/test_genesis.py
HATHOR_TEST_CONFIG_YAML='./hathor/conf/nano_testnet.yml' pytest -n0 tests/tx/test_genesis.py

.PHONY: tests-ci
tests-ci:
Expand Down
2 changes: 1 addition & 1 deletion hathor/builder/cli_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def create_manager(self, reactor: Reactor) -> HathorManager:
)

# XXX Remove this protection after Nano Contracts are launched.
if settings.NETWORK_NAME not in {'nano-testnet-alpha', 'unittests'}:
if settings.NETWORK_NAME != 'unittests' and not settings.NETWORK_NAME.startswith('nano-testnet-'):
# Add protection to prevent enabling Nano Contracts due to misconfigurations.
self.check_or_raise(not settings.ENABLE_NANO_CONTRACTS,
'configuration error: NanoContracts can only be enabled on localnets for now')
Expand Down
21 changes: 9 additions & 12 deletions hathor/conf/nano_testnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@
SETTINGS = HathorSettings(
P2PKH_VERSION_BYTE=b'\x49',
MULTISIG_VERSION_BYTE=b'\x87',
NETWORK_NAME='nano-testnet-alpha',
BOOTSTRAP_DNS=['alpha.nano-testnet.hathor.network'],
NETWORK_NAME='nano-testnet-bravo',
BOOTSTRAP_DNS=['bravo.nano-testnet.hathor.network'],
# Genesis stuff
GENESIS_OUTPUT_SCRIPT=bytes.fromhex('76a91478e804bf8aa68332c6c1ada274ac598178b972bf88ac'),
GENESIS_BLOCK_TIMESTAMP=1677601898,
GENESIS_BLOCK_NONCE=7881594,
GENESIS_BLOCK_HASH=bytes.fromhex('000003472f6a17c2199e24c481a4326c217d07376acd9598651f8413c008554d'),
GENESIS_TX1_NONCE=110,
GENESIS_TX1_HASH=bytes.fromhex('0008f0e9dbe6e4bbc3a85fce7494fee70011b9c7e72f5276daa2a235355ac013'),
GENESIS_TX2_NONCE=180,
GENESIS_TX2_HASH=bytes.fromhex('008d81d9d58a43fd9649f33483d804a4417247b4d4e4e01d64406c4177fee0c2'),
GENESIS_BLOCK_TIMESTAMP=1750978888,
GENESIS_BLOCK_NONCE=896384,
GENESIS_BLOCK_HASH=bytes.fromhex('000003076f294c2c93d8cc48f68b6c93087361ca78c54faa91daaffde84ba916'),
GENESIS_TX1_NONCE=16,
GENESIS_TX1_HASH=bytes.fromhex('001c9a3e8810bc3389b0fd3cfb118e9190f95bd5bf313a9575a4663d0a80af2d'),
GENESIS_TX2_NONCE=154,
GENESIS_TX2_HASH=bytes.fromhex('002fecfce5e78047f9b967a27b1b2436c3fea17e24c770d59421bacdcadda0ea'),
# tx weight parameters. With these settings, tx weight is always 8
MIN_TX_WEIGHT_K=0,
MIN_TX_WEIGHT_COEFFICIENT=0,
Expand All @@ -38,7 +38,4 @@
NC_ON_CHAIN_BLUEPRINT_ALLOWED_ADDRESSES=[
'WWFiNeWAFSmgtjm4ht2MydwS5GY3kMJsEK',
],
SOFT_VOIDED_TX_IDS=list(map(bytes.fromhex, [
'0000003dd5802b05f430a1f54304879173550c0944b49d74321bb9125ee727cb',
])),
)
21 changes: 9 additions & 12 deletions hathor/conf/nano_testnet.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
P2PKH_VERSION_BYTE: x49
MULTISIG_VERSION_BYTE: x87
NETWORK_NAME: nano-testnet-alpha
NETWORK_NAME: nano-testnet-bravo
BOOTSTRAP_DNS:
- alpha.nano-testnet.hathor.network
- bravo.nano-testnet.hathor.network

# Genesis stuff
GENESIS_OUTPUT_SCRIPT: 76a91478e804bf8aa68332c6c1ada274ac598178b972bf88ac
GENESIS_BLOCK_TIMESTAMP: 1677601898
GENESIS_BLOCK_NONCE: 7881594
GENESIS_BLOCK_HASH: 000003472f6a17c2199e24c481a4326c217d07376acd9598651f8413c008554d
GENESIS_TX1_NONCE: 110
GENESIS_TX1_HASH: 0008f0e9dbe6e4bbc3a85fce7494fee70011b9c7e72f5276daa2a235355ac013
GENESIS_TX2_NONCE: 180
GENESIS_TX2_HASH: 008d81d9d58a43fd9649f33483d804a4417247b4d4e4e01d64406c4177fee0c2
GENESIS_BLOCK_TIMESTAMP: 1750978888
GENESIS_BLOCK_NONCE: 896384
GENESIS_BLOCK_HASH: 000003076f294c2c93d8cc48f68b6c93087361ca78c54faa91daaffde84ba916
GENESIS_TX1_NONCE: 16
GENESIS_TX1_HASH: 001c9a3e8810bc3389b0fd3cfb118e9190f95bd5bf313a9575a4663d0a80af2d
GENESIS_TX2_NONCE: 154
GENESIS_TX2_HASH: 002fecfce5e78047f9b967a27b1b2436c3fea17e24c770d59421bacdcadda0ea

# tx weight parameters. With these settings tx weight is always 8
MIN_TX_WEIGHT_K: 0
Expand All @@ -22,6 +22,3 @@ ENABLE_NANO_CONTRACTS: true
ENABLE_ON_CHAIN_BLUEPRINTS: true
NC_ON_CHAIN_BLUEPRINT_ALLOWED_ADDRESSES:
- WWFiNeWAFSmgtjm4ht2MydwS5GY3kMJsEK

SOFT_VOIDED_TX_IDS:
- 0000003dd5802b05f430a1f54304879173550c0944b49d74321bb9125ee727cb
2 changes: 2 additions & 0 deletions tests/tx/test_genesis.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ def get_genesis_output():
address = 'WdmDUMp8KvzhWB7KLgguA2wBiKsh4Ha8eX'
elif settings.NETWORK_NAME == 'unittests':
address = 'HRXVDmLVdq8pgok1BCUKpiFWdAVAy4a5AJ'
elif settings.NETWORK_NAME.startswith('nano-testnet'):
address = 'WZhKusv57pvzotZrf4s7yt7P7PXEqyFTHk'
else:
raise ValueError('Network unknown.')

Expand Down