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
10 changes: 7 additions & 3 deletions hathor/cli/run_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,10 @@ def create_parser(cls) -> ArgumentParser:

netargs = parser.add_mutually_exclusive_group()
netargs.add_argument('--nano-testnet', action='store_true', help='Connect to Hathor nano-testnet')
netargs.add_argument('--testnet', action='store_true', help='Connect to Hathor testnet')
netargs.add_argument('--testnet', action='store_true', help='Connect to Hathor the default testnet'
' (currently testnet-hotel)')
netargs.add_argument('--testnet-hotel', action='store_true', help='Connect to Hathor testnet-hotel')
netargs.add_argument('--testnet-golf', action='store_true', help='Connect to Hathor testnet-golf')
netargs.add_argument('--localnet', action='store_true', help='Create a localnet with default configuration.')

parser.add_argument('--test-mode-tx-weight', action='store_true',
Expand Down Expand Up @@ -498,8 +500,8 @@ def __init__(self, *, argv=None):
from hathor.conf import (
LOCALNET_SETTINGS_FILEPATH,
NANO_TESTNET_SETTINGS_FILEPATH,
TESTNET_GOLF_SETTINGS_FILEPATH,
TESTNET_HOTEL_SETTINGS_FILEPATH,
TESTNET_SETTINGS_FILEPATH,
)
from hathor.conf.get_settings import get_global_settings
self.log = logger.new()
Expand All @@ -516,9 +518,11 @@ def __init__(self, *, argv=None):
if self._args.config_yaml:
os.environ['HATHOR_CONFIG_YAML'] = self._args.config_yaml
elif self._args.testnet:
os.environ['HATHOR_CONFIG_YAML'] = TESTNET_SETTINGS_FILEPATH
os.environ['HATHOR_CONFIG_YAML'] = TESTNET_HOTEL_SETTINGS_FILEPATH
elif self._args.testnet_hotel:
os.environ['HATHOR_CONFIG_YAML'] = TESTNET_HOTEL_SETTINGS_FILEPATH
elif self._args.testnet_golf:
os.environ['HATHOR_CONFIG_YAML'] = TESTNET_GOLF_SETTINGS_FILEPATH
elif self._args.nano_testnet:
os.environ['HATHOR_CONFIG_YAML'] = NANO_TESTNET_SETTINGS_FILEPATH
elif self._args.localnet:
Expand Down
1 change: 1 addition & 0 deletions hathor/cli/run_node_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class RunNodeArgs(BaseModel, extra=Extra.allow):
unsafe_mode: Optional[str]
testnet: bool
testnet_hotel: bool
testnet_golf: bool
test_mode_tx_weight: bool
dns: Optional[str]
peer: Optional[str]
Expand Down
6 changes: 3 additions & 3 deletions hathor/conf/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@
parent_dir = Path(__file__).parent

MAINNET_SETTINGS_FILEPATH = str(parent_dir / 'mainnet.yml')
TESTNET_SETTINGS_FILEPATH = str(parent_dir / 'testnet.yml')
TESTNET_HOTEL_SETTINGS_FILEPATH = str(parent_dir / 'testnet_hotel.yml')
TESTNET_GOLF_SETTINGS_FILEPATH = str(parent_dir / 'testnet_golf.yml')
TESTNET_HOTEL_SETTINGS_FILEPATH = str(parent_dir / 'testnet.yml')
NANO_TESTNET_SETTINGS_FILEPATH = str(parent_dir / 'nano_testnet.yml')
LOCALNET_SETTINGS_FILEPATH = str(parent_dir / 'localnet.yml')
UNITTESTS_SETTINGS_FILEPATH = str(parent_dir / 'unittests.yml')

__all__ = [
'MAINNET_SETTINGS_FILEPATH',
'TESTNET_SETTINGS_FILEPATH',
'TESTNET_GOLF_SETTINGS_FILEPATH',
'TESTNET_HOTEL_SETTINGS_FILEPATH',
'NANO_TESTNET_SETTINGS_FILEPATH',
'LOCALNET_SETTINGS_FILEPATH',
Expand Down
33 changes: 25 additions & 8 deletions hathor/conf/testnet.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
P2PKH_VERSION_BYTE: x49
MULTISIG_VERSION_BYTE: x87
NETWORK_NAME: testnet-golf
NETWORK_NAME: testnet-hotel
BOOTSTRAP_DNS:
- golf.testnet.hathor.network
- hotel.testnet.hathor.network

# Genesis stuff
GENESIS_OUTPUT_SCRIPT: 76a914a584cf48b161e4a49223ed220df30037ab740e0088ac
Expand Down Expand Up @@ -91,14 +91,31 @@ FEATURE_ACTIVATION:
version: 0.63.0
signal_support_by_default: true

COUNT_CHECKDATASIG_OP:
NANO_CONTRACTS:
bit: 0
# N = 5_120_640
# Expected to be reached around Wednesday, 2025-08-13 03:09:44 GMT
# Right now the best block is 5_102_018 at Wednesday, 2025-08-06 15:58:44 GMT
start_height: 5_120_640
timeout_height: 5_241_600 # N + 6 * 20160 (6 weeks after the start)
# N = 5_040_000
# Expected to be reached around Friday, 2025-07-18.
# Right now the best block is 5_033_266 on testnet-hotel (2025-07-16).
start_height: 5_040_000 # N
timeout_height: 5_080_320 # N + 2 * 20160 (2 weeks after the start)
minimum_activation_height: 0
lock_in_on_timeout: false
version: 0.64.0
signal_support_by_default: true

COUNT_CHECKDATASIG_OP:
bit: 1
# N = 5_100_480
# Expected to be reached around Saturday, 2025-08-09 09:31:28 GMT
# Right now the best block is 5_092_661 at Wednesday, 2025-08-06 16:21:58 GMT
start_height: 5_100_480
timeout_height: 5_221_440 # N + 6 * 20160 (6 weeks after the start)
minimum_activation_height: 0
lock_in_on_timeout: false
version: 0.64.0
signal_support_by_default: true

ENABLE_NANO_CONTRACTS: feature_activation
NC_ON_CHAIN_BLUEPRINT_ALLOWED_ADDRESSES:
- WWFiNeWAFSmgtjm4ht2MydwS5GY3kMJsEK
- WQFDxic8xWWnMLL4aE5abY2XRKPNvGhtjY
File renamed without changes.
33 changes: 8 additions & 25 deletions hathor/conf/testnet_hotel.yml → hathor/conf/testnet_golf.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
P2PKH_VERSION_BYTE: x49
MULTISIG_VERSION_BYTE: x87
NETWORK_NAME: testnet-hotel
NETWORK_NAME: testnet-golf
BOOTSTRAP_DNS:
- hotel.testnet.hathor.network
- golf.testnet.hathor.network

# Genesis stuff
GENESIS_OUTPUT_SCRIPT: 76a914a584cf48b161e4a49223ed220df30037ab740e0088ac
Expand Down Expand Up @@ -94,31 +94,14 @@ FEATURE_ACTIVATION:
version: 0.63.0
signal_support_by_default: true

NANO_CONTRACTS:
bit: 0
# N = 5_040_000
# Expected to be reached around Friday, 2025-07-18.
# Right now the best block is 5_033_266 on testnet-hotel (2025-07-16).
start_height: 5_040_000 # N
timeout_height: 5_080_320 # N + 2 * 20160 (2 weeks after the start)
minimum_activation_height: 0
lock_in_on_timeout: false
version: 0.64.0
signal_support_by_default: true

COUNT_CHECKDATASIG_OP:
bit: 1
# N = 5_100_480
# Expected to be reached around Saturday, 2025-08-09 09:31:28 GMT
# Right now the best block is 5_092_661 at Wednesday, 2025-08-06 16:21:58 GMT
start_height: 5_100_480
timeout_height: 5_221_440 # N + 6 * 20160 (6 weeks after the start)
bit: 0
# N = 5_120_640
# Expected to be reached around Wednesday, 2025-08-13 03:09:44 GMT
# Right now the best block is 5_102_018 at Wednesday, 2025-08-06 15:58:44 GMT
start_height: 5_120_640
timeout_height: 5_241_600 # N + 6 * 20160 (6 weeks after the start)
minimum_activation_height: 0
lock_in_on_timeout: false
version: 0.64.0
signal_support_by_default: true

ENABLE_NANO_CONTRACTS: feature_activation
NC_ON_CHAIN_BLUEPRINT_ALLOWED_ADDRESSES:
- WWFiNeWAFSmgtjm4ht2MydwS5GY3kMJsEK
- WQFDxic8xWWnMLL4aE5abY2XRKPNvGhtjY
8 changes: 4 additions & 4 deletions tests/others/test_hathor_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
from pydantic import ValidationError

from hathor.checkpoint import Checkpoint
from hathor.conf import MAINNET_SETTINGS_FILEPATH, TESTNET_SETTINGS_FILEPATH
from hathor.conf import MAINNET_SETTINGS_FILEPATH, TESTNET_GOLF_SETTINGS_FILEPATH
from hathor.conf.mainnet import SETTINGS as MAINNET_SETTINGS
from hathor.conf.settings import DECIMAL_PLACES, GENESIS_TOKEN_UNITS, GENESIS_TOKENS, HathorSettings
from hathor.conf.testnet import SETTINGS as TESTNET_SETTINGS
from hathor.conf.testnet_golf import SETTINGS as TESTNET_GOLF_SETTINGS


@pytest.mark.parametrize('filepath', ['fixtures/valid_hathor_settings_fixture.yml'])
Expand Down Expand Up @@ -238,5 +238,5 @@ def test_mainnet_settings_migration():
assert MAINNET_SETTINGS == HathorSettings.from_yaml(filepath=MAINNET_SETTINGS_FILEPATH)


def test_testnet_settings_migration():
assert TESTNET_SETTINGS == HathorSettings.from_yaml(filepath=TESTNET_SETTINGS_FILEPATH)
def test_testnet_golf_settings_migration():
assert TESTNET_GOLF_SETTINGS == HathorSettings.from_yaml(filepath=TESTNET_GOLF_SETTINGS_FILEPATH)
Loading