bitcoin/contrib
MarcoFalke 718d9f2f77
Merge bitcoin/bitcoin#22660: contrib: catch bitcoin-cli RPC call errors in getcoins.py
42dbd9025a contrib: return non-zero status if getcoins.py errors (Sebastian Falbesoner)
8c203cf0e1 contrib: catch bitcoin-cli RPC call errors in getcoins.py (Sebastian Falbesoner)
0eca5ebace contrib: refactor: introduce bitcoin-cli RPC call helper in getcoins.py (Sebastian Falbesoner)

Pull request description:

  This PR is based on #22565 ("[script] signet's getcoins.py improvements"), which should be reviewed first.

  The signet faucet script `contrib/signet/getcoins.py` currently issues bitcoin-cli RPC calls without catching errors -- the only case tackled is if there is no `bitcoin-cli` file found. Instead of crashing with a stack-trace on a failed RPC call, the changes in this PR aim to produce a more user-friendly output (see also https://github.com/bitcoin/bitcoin/pull/22565#discussion_r683754875). Additionally, in case of any error, a non-zero status is now returned (instead of 0, indicating success), which could be useful for other scripts taking use of signet faucet script.

  The most straight-forward way to test this is invoking the script without a `bitcoind` running on signet:

  PR22565 branch:
  ```
  $ ./contrib/signet/getcoins.py
  error: Could not connect to the server 127.0.0.1:8332

  Make sure the bitcoind server is running and that you are connecting to the correct RPC port.
  Traceback (most recent call last):
    File "./contrib/signet/getcoins.py", line 26, in <module>
      curr_signet_hash = subprocess.check_output([args.cmd] + args.bitcoin_cli_args + ['getblockhash', '1']).strip().decode()
    File "/usr/local/lib/python3.8/subprocess.py", line 415, in check_output
      return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
    File "/usr/local/lib/python3.8/subprocess.py", line 516, in run
      raise CalledProcessError(retcode, process.args,
  subprocess.CalledProcessError: Command '['bitcoin-cli', 'getblockhash', '1']' returned non-zero exit status 1.
  ```

  this PR branch:
  ```
  $ ./contrib/signet/getcoins.py
  error: Could not connect to the server 127.0.0.1:38332

  Make sure the bitcoind server is running and that you are connecting to the correct RPC port.
  -----
  Error while calling "bitcoin-cli -signet getblockhash 1" (see output above).
  ```

ACKs for top commit:
  kallewoof:
    Code ACK 42dbd9025a
  Zero-1729:
    tACK 42dbd90 🧪

Tree-SHA512: 912240a4ed03c87035e370602f4095c7ffe26806421bbbd6cf86588126f2310a01a6a61606e9e2918fb2c1a0debdd0ce768c69ba2e4b8e7750fa3474a56d01a0
2021-08-26 10:04:57 +02:00
..
builder-keys contrib: use hkps://keys.openpgp.org to retrieve builder keys 2021-08-17 08:59:04 +08:00
debian doc: Fix external links (IRC, ...) 2021-05-31 17:27:57 +02:00
devtools scripts: prevent GCC optimising test symbols in test-symbol-check 2021-08-09 13:59:48 +08:00
gitian-descriptors Merge bitcoin/bitcoin#21871: scripts: add checks for minimum required OS versions 2021-06-18 15:21:47 +08:00
guix guix: Don't include directory name in SHA256SUMS 2021-08-18 20:07:32 -04:00
init Merge #21418: contrib: Make systemd invoke dependencies only when ready 2021-03-22 15:15:14 +01:00
linearize refactor: replace remaining binascii method calls 2021-08-16 19:30:56 +01:00
macdeploy macdeploy: alternative info to download the macOS SDK 2021-07-29 10:59:14 +02:00
message-capture Add documentation to contrib folder 2021-01-23 16:15:05 -05:00
qos test: fix file permissions on various scripts 2021-04-23 17:13:28 -07:00
seeds contrib, p2p: update I2P hardcoded seeds 2021-07-30 11:03:44 +02:00
shell guix: Add source-able bash prelude and utils 2021-04-05 11:00:21 -04:00
signet Merge bitcoin/bitcoin#22660: contrib: catch bitcoin-cli RPC call errors in getcoins.py 2021-08-26 10:04:57 +02:00
testgen bugfix: fix bech32_encode calls in gen_key_io_test_vectors.py 2021-03-18 14:28:46 -07:00
tracing tracing: Tracepoint for connected blocks 2021-07-27 17:12:38 +02:00
verify-commits contrib: use hkps://keys.openpgp.org to retrieve builder keys 2021-08-17 08:59:04 +08:00
verifybinaries Fix typo in comment 2021-07-27 14:01:08 +07:00
windeploy Merge bitcoin/bitcoin#22017: Update Windows code signing certificate 2021-05-27 21:51:58 +02:00
zmq refactor: replace remaining binascii method calls 2021-08-16 19:30:56 +01:00
bitcoin-cli.bash-completion scripted-diff: Bump copyright of files changed in 2019 2019-12-30 10:42:20 +13:00
bitcoin-tx.bash-completion bash-completion: Adapt for 0.12 and 0.13 2016-07-07 07:52:59 -04:00
bitcoind.bash-completion scripted-diff: Bump copyright of files changed in 2019 2019-12-30 10:42:20 +13:00
filter-lcov.py scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
gitian-build.py build: Xcode 12.1, macOS SDK 10.15.6 2021-05-01 13:39:45 +08:00
install_db4.sh contrib: use newer config.guess & config.sub in install_db4.sh 2021-07-22 14:49:21 +08:00
README.md tree-wide: Rename gitian-keys to builder-keys 2021-07-08 11:29:54 -04:00
valgrind.supp contrib: Fixup valgrind suppressions file 2020-08-05 16:43:30 +02:00

Repository Tools

Developer tools

Specific tools for developers working on this repository. Additional tools, including the github-merge.py script, are available in the maintainer-tools repository.

Verify-Commits

Tool to verify that every merge commit was signed by a developer using the github-merge.py script.

Linearize

Construct a linear, no-fork, best version of the blockchain.

Qos

A Linux bash script that will set up traffic control (tc) to limit the outgoing bandwidth for connections to the Bitcoin network. This means one can have an always-on bitcoind instance running, and another local bitcoind/bitcoin-qt instance which connects to this node and receives blocks from it.

Seeds

Utility to generate the pnSeed[] array that is compiled into the client.

Build Tools and Keys

Packaging

The Debian subfolder contains the copyright file.

All other packaging related files can be found in the bitcoin-core/packaging repository.

Gitian-descriptors

Files used during the gitian build process. For more information about gitian, see the the Bitcoin Core documentation repository.

Builder keys

PGP keys used for signing Bitcoin Core release results.

MacDeploy

Scripts and notes for Mac builds.

Gitian-build

Script for running full Gitian builds.

Test and Verify Tools

TestGen

Utilities to generate test vectors for the data-driven Bitcoin tests.

Verify Binaries

This script attempts to download and verify the signature file SHA256SUMS.asc from bitcoin.org.