We’re rewarding the question askers & reputations are being recalculated! Read more.

Questions tagged [bitcoin-cli]

should be used for questions related to the Bitcoin Core RPC client

Filter by
Sorted by
Tagged with
15
votes
1answer
11k views

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, ...
7
votes
1answer
5k views

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. ...
7
votes
1answer
7k views

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 ...
6
votes
2answers
971 views

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
6
votes
1answer
2k views

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

I used the command line bitcoin-cli decoderawtransaction <hex-value> and got back a JSON output (see below). However, I noticed there are hex and asm fields that are themselves hex values (at ...
6
votes
2answers
1k views

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 ...
6
votes
1answer
2k views

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.
5
votes
2answers
2k views

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 ...
5
votes
1answer
5k views

Why is my bitcoind daemon not listening on RPC port at 8332?

I have read a similar post which had no answer at this location. I am trying to use bitcoin-cli from a host that different from the host that runs bitcoind. I also would be happy with being able to ...
5
votes
2answers
742 views

Why are some Bitcoind commands comparatively slow?

For example, running bitcoin-cli getbalance <address> 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 ...
5
votes
2answers
2k views

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 ...
5
votes
1answer
586 views

Bitcoin Core coin control via RPC (CLI)

Bitcoin Core introduced nice Coin Control feature accessible via the GUI client. To my surprise though, I don't see any obvious way how to make use of Coin Control via RPC/bitcoin-cli. How can I pick ...
4
votes
1answer
64 views

How to have my bitcoin-cli connect to an outside fullnode

I don't want to run a full node in my laptop. I rather want to install bitcoin-cli only and configure it to connect to an external full node. Is that possible? If so, two questions: where can I get ...
3
votes
2answers
2k views

bitcoin-cli commands like createrawtransaction not working with json on command line

I am trying to create raw transaction using the createrawtransaction api on testnet using the Windows7 command line. I always get an "error parsing JSON": C:\Users\amjad>bitcoin-cli -testnet ...
3
votes
2answers
1k views

running live and test node simultaneously

it took me 4 days to fully synchronize my node, but its finally running and i can create wallets etc.. I wanted to experiment with some transactions on testnet, so need to either change my config or ...
3
votes
2answers
2k views

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'...
3
votes
1answer
508 views

Bitcoin-cli how to get balance of a wallet on different node?

I am making a bitcoin mobile application, and I an trying to get the balance of a wallet that is on the mobile phone, from a daemon that is running on a separate node. The mobile wallet is connected ...
3
votes
1answer
103 views

Why does bitcoin-cli return strange version numbers for blocks?

I've been looking at the version numbers of blocks, but I'm getting strange results from bitcoin-cli getblock. "version": 536870913 However, when I run the same command with the false option (to get ...
3
votes
1answer
414 views

Bitcoind with -txindex=1 still no mempool transactions

I'm reading through Mastering Bitcoin and trying to follow along the examples. When I first initialized bitcoind, I set txindex=1 in my bitcoin.conf file. In a later example I was unable to ...
3
votes
2answers
738 views

How to run a full node: Am I already doing so?

I've succesfully installed bitcoind and bitcoin-cli. I got some questions about it: I run bitcoind in the background by typing: bitcoind -daemon and the blockchain begins to download: By typing ...
3
votes
1answer
74 views

Why bitcoind will shutdown after encryptwallet?

As mentioned in the bitcoin-cli document for encryptwallet command, bitcoin daemon will shut down after encrypting a new or unencrypted wallet. My question is about the reason for shutting the node ...
3
votes
1answer
907 views

searchrawtransactions in bitcoin-cli returning “Method not found” error

some days ago I installed bitcoin core patched with the addrindex option ( btcdrak version ), after indexing the entire blockchain for 5 days, I tried to use the searchrawtransactions parameter on ...
3
votes
0answers
32 views

How to segregate wallet from bitcoin core | Run multiple wallets in different servers on one centralized bitcoin node

I am running bitcoin full node in a centralized server. I have many web applications running in various places. I want to connect this web applications with centralized full bitcoin node. How to ...
3
votes
0answers
5k views

bitcoin-cli - “error: couldn't connect to server” [solved as per comment]

I have bitcoind 0.13.1 running on a Raspberry Pi. I can see it on the bitcoin network using bitnodes.21.co but I can't connect to it locally with bitcoin-cli. My bitcoin.conf is: rpcuser=xxx ...
2
votes
2answers
2k views

Bitcoind error -28

The following CLI command: $ bitcoin-cli getblockcount Gives the following error message: error code: -28 error message: Activating best chain... Any idea what is error code: -28?
2
votes
2answers
173 views

Why does importmulti not support zpub and ypub?

As far as I can tell importmulti does not work with zpub/ypub. Why not? FWIW I prefer only to deal with xpubs, but I am curious.
2
votes
1answer
51 views

Why is the field 'hash' necessary in a bitcoin transaction?

Using bitcoin-cli decoderawtransaction I see results like... { "txid": "d2183b3ea763f41a30ec5ba6fbf6e5f32e0ca6a5e8761249c533fe22190f71f1", "hash": "...
2
votes
3answers
1k views

Bitcoin-tx sign/redeem p2sh transaction (Unable to sign input, invalid stack size (possibly missing key))

I'm seeking help in redeeming a p2sh transaction using the standard tools from bitcoin core, e.g., bitcoin-cli or using directly the RPC commands via curl would also be fine. Creating the P2SH ...
2
votes
1answer
3k views

How to check if my node is fully sync'ed

Using bitcoin-cli, how do I check how sync'ed my full node is?
2
votes
1answer
54 views

How do you run one daemon for multiple users?

I have installed Bitcoin v0.18.1 as user1. Everything is fine, but now I need to let user2 access the same run so he can use bitcoin-cli as well. However, once I log into the VM instance as user2 I ...
2
votes
1answer
144 views

My first full node - no bitcoin.conf

So I am in the process of downloading the blocks after installing bitcoin on my ubuntu server. I have followed the guide on https://bitcoin.org/en/full-node. Everything is working correctly. Blocks ...
2
votes
3answers
1k views

get the real last block

I have this code: from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException import logging rpc_user='-------' #User name is hidden rpc_password='-------' #Password hidden logging....
2
votes
1answer
271 views

Encrypted bitcoin private key from bitcoin-cli

Hi I need to know the command which is used to generate encrypted bitcoin private key from bitcoin-cli (for a bitcoin address) so in future when that private key is used for import address in any ...
2
votes
1answer
353 views

Why does getblocktemplate use priority for transaction selection?

I don't know how getblocktemplate works exactly, but it seems to include transactions based on priority. Selecting transactions based on priority isn't the most profitable method for building a block ...
2
votes
2answers
490 views

Interpreting results from “bitcoin-cli getmempoolinfo”

A bit of a conundrum interpreting the results from "bitcoin-cli getmempoolinfo". Straight from https://chainquery.com/bitcoin-api/getmempoolinfo: getmempoolinfo Returns details on the active state ...
2
votes
1answer
2k views

How can I set the transaction fee when creating a transaction through Bitcoin-cli commands?

I want to run the following command via bitcoin-cli: ./bitcoin-cli sendfrom "10302c02147e2948cbejd9a2bd80d9691ef08a6a4d416c2bb602143a4anj06b90e" "32cjBTQkfLBp38ixj7hdjk0cc90VPPnwhQ" 3.04384215 (...
2
votes
1answer
918 views

Error parsing JSON in bitcoin-cli signrawtransactionwithkey

I have issues trying to sign a 2/3 multisig tx with the first private key. What am I doing something wrong or am I missing something for the arg? Command format: /usr/bin/bitcoin-cli -testnet ...
2
votes
1answer
146 views

What does it mean when a confirmed transaction gets reversed?

I am using bitcoin-cli to do verification of transfer. From the wiki, it mentions that a transaction has a higher confidence in confirmation after 6 blocks deep. However, a block that is put into the ...
2
votes
1answer
1k views

Transaction fee required by bitcoin-cli keeps increasing as I increase the fee

I am using bitcoin-0.13.0 and trying to send 0.035 btc to someone. ./bitcoin-cli [auth] sendtoaddress XXX 0.035 Error: This transaction requires a transaction fee of at least 0.00150835 because of ...
2
votes
2answers
2k views

How can I import an existing Blockchain.info wallet to bitcoin-cli?

I manage several accounts which I created via Blockchain.info for my webapp. I'm migrating to bitcoin-cli instead of using their API due to the high amount of calls I have to make. I'm a bitcoin-cli ...
2
votes
1answer
3k views

How to find bitcoin balance via command line

I'm wondering how to find the balance a wallet for a full node on a command-line only linux box. bitcoin-cli doesn't seem to help here, and I'm not sure what else to try.
2
votes
1answer
2k views

Manually banning nodes through CLI

I cant find this info: How can I ban through CLI a peer connected to my full node? I like how can I do it in the 0.12.0 GUI just with right-click and choosing for how much time I want to ban the peer....
2
votes
1answer
19 views

-fallbackfee option in sendtoaddress

I'm trying to send some bitcoins using bitcoin-cli API, but bitcoin core tells me that Fallbackfee is disabled. How can I set a value for fallbackfee? I've tried to specify it like bitcoin-cli ...
2
votes
2answers
735 views

Bitcoin sendfrom and sendtoaddress

I am using bitcoin daemon in my system to get and pass btc to users. So now I want to pass some btc to another users but I can not understand what is the difference between sendfrom and sendtoaddress. ...
2
votes
1answer
134 views

Dump results from bitcoin-qt debug console to file

I would like to issue some commands in the Bitcoin-qt console and save their output to a text file (ideally, filter it before saving). Is there a way to do that, similar to how I would use grep and &...
2
votes
3answers
589 views

Bitcoind running on external HDD trying to resolve cookie from default datadir

On Elementary OS Loki 0.4.1 I've downloaded and installed bitcoind as per the official guide from bitcoin.org . However, I in my case I don't have enough space on my internal SSD to store the whole ...
2
votes
1answer
1k views

What Do SegWit Addresses Look Like?

Probably a question that has been asked a lot before, but how do I know if an address I generate with bitcoind and bitcoin-cli is SegWit? I take the following steps to (attempt to) generate a SegWit ...
2
votes
1answer
502 views

createrawtransaction online

createrawtransaction is a bitcoin-cli command that generates a raw transaction given one ore more transaction ids and a list of Outputs, which are the destination amounts that will receive the funds. ...
2
votes
3answers
448 views

Most efficient way to calculate fee from getrawtransaction?

I would to get the fee when I search for a transaction using getrawtransaction, but the JSON-RPC does not return this. https://chainquery.com/bitcoin-api/getrawtransaction So to achieve this, my ...
2
votes
2answers
3k views

How to send btc from the specific address using bitcoin api?

I'd like to send bitcoin from the specific address to a address using bitcoin api. I used 'sendfrom' as follows. Each address "mqXhhivMPjeVvdVMR239EVDJiRGQUYcbDZ" and "...