Skip to content
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

Tweaks #1538

Merged
merged 4 commits into from
Mar 20, 2024
Merged

Tweaks #1538

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
2 changes: 1 addition & 1 deletion .github/workflows/test_book.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
cd counterparty-cli && pip install -e . && cd ..
- name: Bootstrap testnet database
run: |
counterparty-server --testnet bootstrap
counterparty-server --testnet bootstrap --no-confirm
- name: Run tests
run: |
cd counterparty-lib
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ Then wait for your node to catch up with the network. Note: this process current

# Manual Installation

Counterparty Core can be installed on most platforms but, for now, manual installation is being tested and is only officially supported on Ubuntu 22.04 and MacOS.

Dependencies:

- Bitcoin Core
Expand Down
3 changes: 2 additions & 1 deletion counterparty-cli/counterpartycli/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
[('--requests-timeout',), {'type': int, 'default': config.DEFAULT_REQUESTS_TIMEOUT, 'help': 'timeout value (in seconds) used for all HTTP requests (default: 5)'}],

[('--force',), {'action': 'store_true', 'default': False, 'help': 'skip backend check, version check, process lock (NOT FOR USE ON PRODUCTION SYSTEMS)'}],
[('--no-confirm',), {'action': 'store_true', 'default': False, 'help': 'don\'t ask for confirmation'}],
[('--database-file',), {'default': None, 'help': 'the path to the SQLite3 database file'}],
[('--log-file',), {'nargs': '?', 'const': None, 'default': False, 'help': 'log to the specified file'}],
[('--api-log-file',), {'nargs': '?', 'const': None, 'default': False, 'help': 'log API requests to the specified file'}],
Expand Down Expand Up @@ -206,7 +207,7 @@ def main():

# Bootstrapping
if args.action == 'bootstrap':
server.bootstrap()
server.bootstrap(no_confirm=args.no_confirm)

# PARSING
elif args.action == 'reparse':
Expand Down
16 changes: 14 additions & 2 deletions counterparty-lib/counterpartylib/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@
connect_to_backend()

if not os.path.exists(config.DATABASE) and catch_up == 'bootstrap':
bootstrap()
bootstrap(no_confirm=True)

db = initialise_db()

Expand Down Expand Up @@ -615,7 +615,19 @@
logger.debug('RPC: %s', cleaned_rpc_url)


def bootstrap():
def bootstrap(no_confirm=False):
warning_message = '''WARNING: `counterparty-server bootstrap` downloads a recent snapshot of a Counterparty database
from a centralized server maintained by the Counterparty Core development team.
Because this method does not involve verifying the history of Counterparty transactions yourself,
the `bootstrap` command should not be used for mission-critical, commercial or public-facing nodes.
'''
cprint(warning_message, 'yellow')

if not no_confirm:
confirmation_message = colored('Continue? (y/N): ', "magenta")
if input(confirmation_message).lower() != 'y':
exit()

Check warning

Code scanning / pylint

Consider using 'sys.exit' instead. Warning

Consider using 'sys.exit' instead.

data_dir = appdirs.user_data_dir(appauthor=config.XCP_NAME, appname=config.APP_NAME, roaming=True)

# Set Constants.
Expand Down
1 change: 1 addition & 0 deletions release-notes/release-notes-v10.0.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ Because this release includes numerous changes to the database schema, a full da
* Isolate dispenser logic in `get_dispensers_outputs()` and `get_dispensers_tx_info()`
* Activate check software version every 24H
* Add the possibility to reparse from a given block on minor version change
* Add Warning with Confirmation Dialogue to bootstrap Command and `--no-confirm` flag

# Credits
* Ouziel Slama
Expand Down
Loading