-
Notifications
You must be signed in to change notification settings - Fork 45
feat(nano): miscellaneous changes [part 8] #1285
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -69,6 +69,7 @@ def create_parser(cls) -> ArgumentParser: | |
| """ | ||
| from hathor.cli.util import create_parser | ||
| from hathor.feature_activation.feature import Feature | ||
| from hathor.nanocontracts.nc_exec_logs import NCLogConfig | ||
| parser = create_parser(prefix=cls.env_vars_prefix) | ||
|
|
||
| parser.add_argument('--hostname', help='Hostname used to be accessed by other peers') | ||
|
|
@@ -115,6 +116,9 @@ def create_parser(cls) -> ArgumentParser: | |
| help='Create an index of transactions by address and allow searching queries') | ||
| parser.add_argument('--utxo-index', action='store_true', | ||
| help='Create an index of UTXOs by token/address/amount and allow searching queries') | ||
| parser.add_argument('--nc-history-index', action='store_true', help=SUPPRESS) # moved to --nc-indices | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Postponed thread. |
||
| parser.add_argument('--nc-indices', action='store_true', | ||
| help='Enable indices related to nano contracts') | ||
|
Comment on lines
+120
to
+121
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. While "indices" is technically correct, "indexes" is also correct, I'd rather use that since it's what we've been using before, there's also this style guide which opts for indexes too.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Postponed thread. |
||
| parser.add_argument('--prometheus', action='store_true', help='Send metric data to Prometheus') | ||
| parser.add_argument('--prometheus-prefix', default='', | ||
| help='A prefix that will be added in all Prometheus metrics') | ||
|
|
@@ -165,6 +169,9 @@ def create_parser(cls) -> ArgumentParser: | |
| help='Enables listening on IPv6 interface and connecting to IPv6 peers') | ||
| parser.add_argument('--x-disable-ipv4', action='store_true', | ||
| help='Disables connecting to IPv4 peers') | ||
| possible_nc_exec_logs = [config.value for config in NCLogConfig] | ||
| parser.add_argument('--nc-exec-logs', default=NCLogConfig.NONE, choices=possible_nc_exec_logs, | ||
| help=f'Enable saving Nano Contracts execution logs. One of {possible_nc_exec_logs}') | ||
| return parser | ||
|
|
||
| def prepare(self, *, register_resources: bool = True) -> None: | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,6 +17,7 @@ | |
| from pydantic import Extra | ||
|
|
||
| from hathor.feature_activation.feature import Feature # skip-cli-import-custom-check | ||
| from hathor.nanocontracts.nc_exec_logs import NCLogConfig # skip-cli-import-custom-check | ||
| from hathor.utils.pydantic import BaseModel # skip-cli-import-custom-check | ||
|
|
||
|
|
||
|
|
@@ -87,3 +88,6 @@ class RunNodeArgs(BaseModel, extra=Extra.allow): | |
| x_enable_ipv6: bool | ||
| x_disable_ipv4: bool | ||
| localnet: bool | ||
| nc_history_index: bool | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Postponed thread. |
||
| nc_indices: bool | ||
| nc_exec_logs: NCLogConfig | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,7 +18,7 @@ | |
| P2PKH_VERSION_BYTE=b'\x49', | ||
| MULTISIG_VERSION_BYTE=b'\x87', | ||
| NETWORK_NAME='nano-testnet-alpha', | ||
| BOOTSTRAP_DNS=[], | ||
| BOOTSTRAP_DNS=['alpha.nano-testnet.hathor.network'], | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it going to be
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Postponed thread. |
||
| # Genesis stuff | ||
| GENESIS_OUTPUT_SCRIPT=bytes.fromhex('76a91478e804bf8aa68332c6c1ada274ac598178b972bf88ac'), | ||
| GENESIS_BLOCK_TIMESTAMP=1677601898, | ||
|
|
@@ -34,5 +34,14 @@ | |
| MIN_TX_WEIGHT=8, | ||
| CHECKPOINTS=[], | ||
| ENABLE_NANO_CONTRACTS=True, | ||
| BLUEPRINTS={}, | ||
| ENABLE_ON_CHAIN_BLUEPRINTS=True, | ||
| NC_ON_CHAIN_BLUEPRINT_ALLOWED_ADDRESSES=[ | ||
| 'WWFiNeWAFSmgtjm4ht2MydwS5GY3kMJsEK', | ||
| ], | ||
| BLUEPRINTS={ | ||
| bytes.fromhex('3cb032600bdf7db784800e4ea911b10676fa2f67591f82bb62628c234e771595'): 'Bet', | ||
| }, | ||
| SOFT_VOIDED_TX_IDS=list(map(bytes.fromhex, [ | ||
| '0000003dd5802b05f430a1f54304879173550c0944b49d74321bb9125ee727cb', | ||
| ])), | ||
| ) | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can just remove this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Postponed thread.