Questions tagged [bitcoin-cli]

The Bitcoin-Core wallet provides a Command-LIne-Interface (CLI) that can be used to retrieve information from the wallet or to perform certain actions.

This command-line interface is available in the "console" window that can be opened within the Bitcoin-Core graphical User Interface (GUI). The CLI is intended to be used interactively by a person typing commands. The CLI commands are mostly the same as the RPC commands that are available in the Remote Procedure Call (RPC) interface that is intended for use by other programs.

406 questions
15
votes
1 answer

How to generate SegWit address

How do I generate a SegWit address using Bitcoin Core CLI? Also will I be able to redeem those outputs and send them to a "legacy" address? If so, will this second transaction be accepted by older, non-SegWit clients?
Paul
  • 361
  • 1
  • 3
  • 11
14
votes
5 answers

bitcoin-cli not found on OSX

I have a Qt testnet3 node synched and running on my mac. In the terminal, when simply trying: $ bitcoin-cli getinfo or $ ./bitcoin-cli getinfo I get: -bash: bitcoin-cli: command not found Anyone know why the command could or would not be found? …
user31364
10
votes
1 answer

Can you list receiving addresses in bitcoin-cli?

In bitcoin-qt, there are interfaces for seeing "receiving addresses" which have been generated in the past. I don't see any way to do that in bitcoin-cli.
Ian Kelling
  • 271
  • 2
  • 6
10
votes
1 answer

How to sign bitcoin transaction with 'bitcoind' and non-bitcoind-wallet private key?

I want to create and sign bitcoin transaction using only 'bitcoind' and 'bitcoin-cli'. I can create a transaction using createrawtransaction RPC API, but signing it using 'signrawtransaction' fails. UPDATE: I figured it out and answered myself…
KostaZ
  • 261
  • 2
  • 7
9
votes
2 answers

How to check if node is on TestNet or MainNet via `bitcoin-cli`?

Is there a way, by using bitcoin-cli using RPC querying, if the node I'm querying is running on MainNet or TestNet? Thanks
knocte
  • 1,764
  • 1
  • 17
  • 32
9
votes
2 answers

bitcoin-cli get all tx hashes for watch-only address

does bitcoin-cli have any functionality to get all tx hashes for a given address (ie the txs that either send or receive funds from the given address). listtransactions sounds like it should do what i want, but when i run it like so then i get no…
mulllhausen
  • 1,713
  • 2
  • 14
  • 33
8
votes
2 answers

How to detect a fork with bitcoin-cli?

I'm keeping a simple log of blocks, and storing them in an array. When a new block arrives, I add it to the array. Let's say this is my block chain array: E <- tip D C B A Now, say a new block arrives, extending a branch: Z <- new tip E …
inersha
  • 2,928
  • 1
  • 17
  • 41
7
votes
3 answers

bitcoin.rpc python library problem

I am working through Master Bitcoin. I got the bitcoin client up and running. I am now trying to access the client from python. In the example, there is a line that says from bitcoin.rpc import Rawproxy. I get the error message no module named rpc.…
user2242044
  • 207
  • 2
  • 6
7
votes
1 answer

What are the hex and asm field values in the JSON decoded from a raw transactions?

I used the command line bitcoin-cli decoderawtransaction and got back a JSON output (see below). However, I noticed there are hex and asm fields that are themselves hex values (at times). I am thinking these are metadata that can further…
Jane Wayne
  • 349
  • 2
  • 9
7
votes
2 answers

How to check if an output has been spent?

Using an rpc client (e.g. bitcoin-cli), for a given transaction and index of an output of it, how can I tell if the output is currently an utxo, or if it has already been spent? In the latter case, I'd also want to know the transaction which spent…
shx2
  • 803
  • 1
  • 8
  • 14
6
votes
2 answers

Why are some Bitcoind commands comparatively slow?

For example, running bitcoin-cli getbalance
on an arbitrary, watch-only address takes around 6-7 seconds for a response. Is there any way to improve the response time? How do API services like Blockchain.info return balance details almost…
user66764
6
votes
2 answers

64: too-long-mempool-chain

I am using bitcoind json rpc api to send bitcoin to multiple bitcoin addresses. I am using sendrawtransaction. When i have 24 unconfirmed payments sent from my account, i can't send anymore because i get this error : 64: too-long-mempool-chain I…
Adrian
  • 59
  • 1
  • 3
6
votes
1 answer

What is better, pre-existing Bitcoin-core API bindings for python or custom wrapper functions

How advisable is using the following code to query the bitcoin core as compared to using some python RPC library. import os btc_prefix = 'bitcoin-cli ' def getblockcount(btc_prefix): print("in getblockcount") cmd = ' '.join([btc_prefix,…
6
votes
1 answer

How to check if my node is fully sync'ed

Using bitcoin-cli, how do I check how sync'ed my full node is?
oshirowanen
  • 175
  • 2
  • 11
  • 36
6
votes
1 answer

How do I get the private key of an address in descriptor wallets? How to dumpprivkey?

When I run dumpprivkey from Bitcoin Core 0.21.1. I get the following error message: error code: -4 error message: This type of wallet does not support this command I came across achow's explanation stating that "Descriptor Wallets store Output…
1
2 3
27 28