bitcoin core – How does bitcoind choose its data directory?

Sorry, no question, I'm new to everything Linux related. I have managed to properly set up the Bitcoin core on my Raspberry Pi 4, and I have an external hard drive that I want to use as a data directory for around 250 GB blocks (this is not my main memory from which I boot).

The problem is, I have absolutely no idea how the Bitcoind program decides on its data directory. I have run 3 or 4 times and I have 3 or 4 different data directories, none of which are on the hard drive. How do I tell where to save the data? Where do I put the bitcoin.conf file because it doesn't seem to be found? I pre-installed most of the blockchain from my Windows PC on my hard drive, so I would ideally use the same directory. However, if this is not possible, I would at least want it on my hard drive. I followed several instructions and so far nothing has worked for me. I appreciate your time for all the answers!

bitcoin core – use of bitcoind "walletnotify" only for unique transactions

While using bitcoind "walletnotify" my curl command gets 3 hits, which generates 3 unique transaction hashes. For unique transactions, however, it only needs to be executed once.

I heard about walletnotifynew from: – "https://www.multichain.com/qa/9566/how-can-i-use-walletnotify-command-to-get-notification"
but it doesn't work.

My bitcon.config file

rpcuser=root
rpcpassword=root
testnet=1
test.rpcport=8332
rpcallowip=127.0.0.1
server=1
rpcbind=127.0.0.1
walletnotifynew=/home/scripts/transaction.sh %s
#walletnotify=curl -d "txid=$1" http://127.0.0.1:8888/api/v1/listen-transaction %s  

Database entry I transferred the three incoming with the same wallet, but there should only be one outgoing entry

select * from transaction;
+-------+--------------+------------+-------------------------------------+-------------------------------------+---------+------------------------------------------------------------------+----------+--------+
| tx_id | amount       | made_on    | sent_from_address                   | sent_to_address                     | success | transaction_hash                                                 | tx_type  | userid |
+-------+--------------+------------+-------------------------------------+-------------------------------------+---------+------------------------------------------------------------------+----------+--------+
|    53 | 0.0000000000 | 2020-02-17 | NULL                                | 2NFgnEMcE4kvvCLXK6uiEgb3dZuVLGUK75v |       1 | 11acce71f3d10330e10d70f5ee974abe5d216ec188309b61d1f751a1615d439d | INCOMING |   NULL |
|    52 | 0.0000000000 | 2020-02-17 | NULL                                | 2NFgnEMcE4kvvCLXK6uiEgb3dZuVLGUK75v |       1 | bc3267ffcc44b8d526cbb1de19f653bc90aedda4dc4fc2fc9ab18a954e7347c1 | INCOMING |   NULL |
|    50 | 0.0001000000 | 2020-02-17 | 2N6MqukeqDftwXsVDBSBkDrnbvzaXoNwNhi | 2NFgnEMcE4kvvCLXK6uiEgb3dZuVLGUK75v |       1 | 9bb2ab339930a68f33ce3521bee46363cbd29a87c68b718c4ae415a3ba53b7b8 | OUTGOING |      1 |
|    51 | 0.0000000000 | 2020-02-17 | NULL                                | 2NFgnEMcE4kvvCLXK6uiEgb3dZuVLGUK75v |       1 | 2e0976cd310fe1d740227cec0ae615dae668d4efeea740e51b81cb1b89dd2a47 | INCOMING |   NULL |
+-------+--------------+------------+-------------------------------------+-------------------------------------+---------+------------------------------------------------------------------+----------+--------+


bitcoind – configuration error of the core Bitcoin test

I tried to configure the core Bitcoin test by editing the bitcoin.conf file with the required credentials.

It was a running full node before writing the test credentials.
now is the mistake

Configuration settings for rpcport are only applied in the test network if you are in the (Test) section.

(Picture uploaded for reference)Enter the image description here

bitcoind – Is it possible to process BCH transactions on Bitcoin core wallet?

If your BTC addresses are not SegWit addresses, you can use them dumpprivkey to extract your private keys and use them in a BCH wallet. You can import them into Electron Cash, wallet software, or Bitcoin Unlimited / Bitcoin ABC, which correspond to Bitcoin Core. I would advise against using BU / ABC and Core on the same computer as they both use the incoming port 8333. You may also need to commit datadir Option, otherwise they would damage Core's blockchain and wallet databases.

Bitcoin Core – Bitcoind multisig transaction is not displayed as a multisig transaction / is displayed 2: 3 as "signed"

Apparently, the way multisig transactions are created has changed. Run a node with Bitcoind v0.16.3 and another node with the latest Bitcoind (v.0.19.0.1).

The multisig transaction created on the old node can be correctly decoded by coinb.in (it is displayed as a multisig 2: 3 transaction). With the latest Bitcoind version, the transaction coinb.in cannot be displayed correctly.

Anyone involved / is there a way to use the latest version of bitcoind to create a multisig transaction that can be decoded on coinb.in (possibly using parameters when signing)?

Example with Bitcoind latest version (v.0.19.0.1).

./bitcoin-cli createmultisig 2 "("02ab224d0d8de7d5ad5568bf4f66b9c29ea7afd0f196176f9b09a311c11da6377e","037b3ccfb03f8dc58598619b2f3a91e33012444469fc69b4459760d04c20c4d69c","034254badc6cd5c4fa4e0ca10fb88d289bd7260331c5355ec2361312eafb26eb67")"
{
  "address": "3Cvczsgf3JTCHSjPgRACCia5gtyQKJWng8",
  "redeemScript": "522102ab224d0d8de7d5ad5568bf4f66b9c29ea7afd0f196176f9b09a311c11da6377e21037b3ccfb03f8dc58598619b2f3a91e33012444469fc69b4459760d04c20c4d69c21034254badc6cd5c4fa4e0ca10fb88d289bd7260331c5355ec2361312eafb26eb6753ae"
}

Now find the address with TX 63c8c68a3cbf693a2601854496ffd687334c205bcc0e52811ef9c552d0641c01

Important part with getrawtransaction:

{
  "value": 0.00053938,
  "n": 1,
  "scriptPubKey": {
    "asm": "OP_HASH160 7b3c11ea9596776b98f1d7e68ffcf891e860216f OP_EQUAL",
    "hex": "a9147b3c11ea9596776b98f1d7e68ffcf891e860216f87",
    "reqSigs": 1,
    "type": "scripthash",
    "addresses": (
      "3Cvczsgf3JTCHSjPgRACCia5gtyQKJWng8"
    )
  }

Create a transaction with the information

./bitcoin-cli createrawtransaction "({"txid":"63c8c68a3cbf693a2601854496ffd687334c205bcc0e52811ef9c552d0641c01","vout":1})" "({"1GAFEtKWhwn5wQTt53kFMgd4b7xEyCxHHg":0.00048961})"

Generated transaction (unsigned) Decode on coinb.in does not display multisig details:

0200000001011c64d052c5f91e81520ecc5b204c3387d6ff96448501263a69bf3c8ac6c8630100000000ffffffff0141bf0000000000001976a914a6498450eb421d3926fcf12366e5abe2e7dfb93688ac00000000

After signing, no details about multisig are shown coinb.inwith bitcoind v0.16.3 The transaction itself is displayed as a type multisig correctly. Any ideas on how to get the same result with the latest version of Bitcoind?

To update

Sign transaction with 1 key:

'signrawtransactionwithkey',(
            "0200000001011c64d052c5f91e81520ecc5b204c3387d6ff96448501263a69bf3c8ac6c8630100000000ffffffff0141bf0000000000001976a914a6498450eb421d3926fcf12366e5abe2e7dfb93688ac00000000",
            (
                "privkey",
            ),
            (
                "txid"              => "63c8c68a3cbf693a2601854496ffd687334c205bcc0e52811ef9c552d0641c01",
                "vout"              => 1,
                "scriptPubKey"      => "a9147b3c11ea9596776b98f1d7e68ffcf891e860216f87",
                "redeemScript"      => "522102ab224d0d8de7d5ad5568bf4f66b9c29ea7afd0f196176f9b09a311c11da6377e21037b3ccfb03f8dc58598619b2f3a91e33012444469fc69b4459760d04c20c4d69c21034254badc6cd5c4fa4e0ca10fb88d289bd7260331c5355ec2361312eafb26eb6753ae",
                "amount"            => 0.00053938,
            ),
        )

Returns:

{
"result":{
"hex":"0200000001011c64d052c5f91e81520ecc5b204c3387d6ff96448501263a69bf3c8ac6c86301000000b50047304402200e83a051845ff6d5d20fd9cab5c6e15e8ae99ab0b2ac14bcf991f4f3bad3b4a00220555c7c3d419e80165e8f42385b158ca01a125686e19bf01a522332c35e689dd701004c69522102ab224d0d8de7d5ad5568bf4f66b9c29ea7afd0f196176f9b09a311c11da6377e21037b3ccfb03f8dc58598619b2f3a91e33012444469fc69b4459760d04c20c4d69c21034254badc6cd5c4fa4e0ca10fb88d289bd7260331c5355ec2361312eafb26eb6753aeffffffff0141bf0000000000001976a914a6498450eb421d3926fcf12366e5abe2e7dfb93688ac00000000",
"complete":false,
"errors":(
{
"txid":"63c8c68a3cbf693a2601854496ffd687334c205bcc0e52811ef9c552d0641c01",
"vout":1,
"witness":(
),
"scriptSig":"0047304402200e83a051845ff6d5d20fd9cab5c6e15e8ae99ab0b2ac14bcf991f4f3bad3b4a00220555c7c3d419e80165e8f42385b158ca01a125686e19bf01a522332c35e689dd701004c69522102ab224d0d8de7d5ad5568bf4f66b9c29ea7afd0f196176f9b09a311c11da6377e21037b3ccfb03f8dc58598619b2f3a91e33012444469fc69b4459760d04c20c4d69c21034254badc6cd5c4fa4e0ca10fb88d289bd7260331c5355ec2361312eafb26eb6753ae",
"sequence":4294967295,
"error":"CHECK(MULTI)SIG failing with non-zero signature (possibly need more signatures)"
}
)
},
"error":null,
"id":null
}

Transaction can be decoded with coinb.in but it means signed by 2 parts that is certainly wrong.

Is the transaction signed correctly?

Bitcoin core – Bitcoind multisig transaction is not shown as a multisig transaction

Apparently, the way multisig transactions are created has changed. Run a node with Bitcoind v0.16.3 and another node with the latest Bitcoind (v.0.19.0.1).

The multisig transaction created on the old node can be correctly decoded by coinb.in (it is displayed as a multisig 2: 3 transaction). With the latest Bitcoind version, the transaction coinb.in cannot be displayed correctly.

Anyone involved / is there a way to use the latest version of bitcoind to create a multisig transaction that can be decoded on coinb.in (possibly using parameters when signing)?

Example with Bitcoind latest version (v.0.19.0.1).

./bitcoin-cli createmultisig 2 "("02ab224d0d8de7d5ad5568bf4f66b9c29ea7afd0f196176f9b09a311c11da6377e","037b3ccfb03f8dc58598619b2f3a91e33012444469fc69b4459760d04c20c4d69c","034254badc6cd5c4fa4e0ca10fb88d289bd7260331c5355ec2361312eafb26eb67")"
{
  "address": "3Cvczsgf3JTCHSjPgRACCia5gtyQKJWng8",
  "redeemScript": "522102ab224d0d8de7d5ad5568bf4f66b9c29ea7afd0f196176f9b09a311c11da6377e21037b3ccfb03f8dc58598619b2f3a91e33012444469fc69b4459760d04c20c4d69c21034254badc6cd5c4fa4e0ca10fb88d289bd7260331c5355ec2361312eafb26eb6753ae"
}

Now find the address with TX 63c8c68a3cbf693a2601854496ffd687334c205bcc0e52811ef9c552d0641c01

Important part with getrawtransaction:

{
  "value": 0.00053938,
  "n": 1,
  "scriptPubKey": {
    "asm": "OP_HASH160 7b3c11ea9596776b98f1d7e68ffcf891e860216f OP_EQUAL",
    "hex": "a9147b3c11ea9596776b98f1d7e68ffcf891e860216f87",
    "reqSigs": 1,
    "type": "scripthash",
    "addresses": (
      "3Cvczsgf3JTCHSjPgRACCia5gtyQKJWng8"
    )
  }

Create a transaction with the information

./bitcoin-cli createrawtransaction "({"txid":"63c8c68a3cbf693a2601854496ffd687334c205bcc0e52811ef9c552d0641c01","vout":1})" "({"1GAFEtKWhwn5wQTt53kFMgd4b7xEyCxHHg":0.00048961})"

Generated transaction (unsigned) Decode on coinb.in does not display multisig details:

0200000001011c64d052c5f91e81520ecc5b204c3387d6ff96448501263a69bf3c8ac6c8630100000000ffffffff0141bf0000000000001976a914a6498450eb421d3926fcf12366e5abe2e7dfb93688ac00000000

After signing, no details about multisig are shown coinb.inwith bitcoind v0.16.3 The transaction itself is displayed as a type multisig correctly. Any ideas on how to get the same result with the latest version of Bitcoind?

To update

Sign transaction with 1 key:

'signrawtransactionwithkey',(
            "0200000001011c64d052c5f91e81520ecc5b204c3387d6ff96448501263a69bf3c8ac6c8630100000000ffffffff0141bf0000000000001976a914a6498450eb421d3926fcf12366e5abe2e7dfb93688ac00000000",
            (
                "privkey",
            ),
            (
                "txid"              => "63c8c68a3cbf693a2601854496ffd687334c205bcc0e52811ef9c552d0641c01",
                "vout"              => 1,
                "scriptPubKey"      => "a9147b3c11ea9596776b98f1d7e68ffcf891e860216f87",
                "redeemScript"      => "522102ab224d0d8de7d5ad5568bf4f66b9c29ea7afd0f196176f9b09a311c11da6377e21037b3ccfb03f8dc58598619b2f3a91e33012444469fc69b4459760d04c20c4d69c21034254badc6cd5c4fa4e0ca10fb88d289bd7260331c5355ec2361312eafb26eb6753ae",
                "amount"            => 0.00053938,
            ),
        )

Returns:

{
"result":{
"hex":"0200000001011c64d052c5f91e81520ecc5b204c3387d6ff96448501263a69bf3c8ac6c86301000000b50047304402200e83a051845ff6d5d20fd9cab5c6e15e8ae99ab0b2ac14bcf991f4f3bad3b4a00220555c7c3d419e80165e8f42385b158ca01a125686e19bf01a522332c35e689dd701004c69522102ab224d0d8de7d5ad5568bf4f66b9c29ea7afd0f196176f9b09a311c11da6377e21037b3ccfb03f8dc58598619b2f3a91e33012444469fc69b4459760d04c20c4d69c21034254badc6cd5c4fa4e0ca10fb88d289bd7260331c5355ec2361312eafb26eb6753aeffffffff0141bf0000000000001976a914a6498450eb421d3926fcf12366e5abe2e7dfb93688ac00000000",
"complete":false,
"errors":(
{
"txid":"63c8c68a3cbf693a2601854496ffd687334c205bcc0e52811ef9c552d0641c01",
"vout":1,
"witness":(
),
"scriptSig":"0047304402200e83a051845ff6d5d20fd9cab5c6e15e8ae99ab0b2ac14bcf991f4f3bad3b4a00220555c7c3d419e80165e8f42385b158ca01a125686e19bf01a522332c35e689dd701004c69522102ab224d0d8de7d5ad5568bf4f66b9c29ea7afd0f196176f9b09a311c11da6377e21037b3ccfb03f8dc58598619b2f3a91e33012444469fc69b4459760d04c20c4d69c21034254badc6cd5c4fa4e0ca10fb88d289bd7260331c5355ec2361312eafb26eb6753ae",
"sequence":4294967295,
"error":"CHECK(MULTI)SIG failing with non-zero signature (possibly need more signatures)"
}
)
},
"error":null,
"id":null
}

Transaction can be decoded with coinb.in but it means signed by 2 parts that is certainly wrong.

Is the transaction signed correctly?

bitcoind – Why is the Bitcoin core full node so slow to synchronize?

After 12 hours the progress changed from progress=0.533751 to progress=0.541254less than 1% progress.

$ ./bitcoind
... 0 hours:
2019-10-12T17:57:11Z UpdateTip: new best=00000000000000000126b2b7fccdfa34176fa546f2fadb91894ed4d65a9bb84e height=479855 version=0x20000002 log2_work=86.909956 tx=245200772 date='2017-08-09T21:27:46Z' progress=0.533751 cache=1.2MiB(9101txo)
2019-10-12T17:57:44Z UpdateTip: new best=0000000000000000008642926c765b5b9463613e6b3ed71044f0a4299e631975 height=479856 version=0x20000002 log2_work=86.909995 tx=245203098 date='2017-08-09T21:40:43Z' progress=0.533756 cache=2.3MiB(16894txo)
2019-10-12T17:58:25Z UpdateTip: new best=000000000000000000a5ca291f556033c0025ab3759a9faa8e090c07580faff8 height=479857 version=0x20000002 log2_work=86.910034 tx=245203927 date='2017-08-09T21:44:19Z' progress=0.533758 cache=2.7MiB(20324txo)
... 12 hours:
2019-10-13T03:41:24Z UpdateTip: new best=000000000000000000e226d20ce5690f40b0ea8c53b21b5f585bdc98d6acd4ca height=481659 version=0x20000002 log2_work=86.979252 tx=248713371 date='2017-08-23T00:57:07Z' progress=0.541245 cache=594.8MiB(4457815txo)
2019-10-13T03:41:33Z UpdateTip: new best=00000000000000000073002a56f4c75f273105b3b6efa15ed4f671c2bfbe777b height=481660 version=0x20000002 log2_work=86.97929 tx=248715388 date='2017-08-23T01:01:59Z' progress=0.541249 cache=595.2MiB(4461557txo)
2019-10-13T03:41:37Z UpdateTip: new best=00000000000000000071fa18dbf2c4a08387ea31465ba8bdc20dbe3b60fd6b1a height=481661 version=0x20000002 log2_work=86.979327 tx=248717445 date='2017-08-23T01:17:05Z' progress=0.541254 cache=595.3MiB(4462014txo)

My internet connection seems to be fast enough (512 KB / s below, 128 KB / s above), but that doesn't seem to be the problem, like bitcoind Doesn't even seem to use much or no bandwidth anymore (that used to be the case, but I guess enough has been downloaded and needs to be processed now).

However, I would expect the CPU to work hard now to validate everything, but the CPU is barely busy at all.

Why is it so slow Where's the bottleneck? The process doesn't seem to hit anything solid (CPU, network, or hard drive). Why not?

bitcoind – Sendraw transaction error with lock time: 64: non-final TXID

I just ran into the same problem and the solution is almost stupid. Since the clue is nowhere to be found, I would add my two cents if others fall into the same trap.

It turns out that an attempt to issue an unconfirmed UTXO also leads to this in addition to the usual time reasons (e.g. timeout has not expired, sequence number is not set correctly, etc.) non-final Error. I didn't check the source code to see why this happened, but the misleading error message cost me a good afternoon.

Why should you ever try to spend unconfirmed expenses? Well, when you're busy testing things and gradually losing patience …

bitcoind – Bitcoin Core JSONRPC only accepts requests with 0.0.0.0 in the configuration

I had a Bitcoin core server for lunch and tried to connect via JSON-RPC.
These are my configuration settings:

server=1  
rpcuser=admin  
rpcpassword=password
rpcport=1234
rpcallowip=94.183.32.151

However, all cURL connections to this server via IP 94.183.32.151 have the same error result as:

cURL error 7: Failed to connect to 94.183.32.151 port 1234: Connection refused

I also tried adding this option, but it didn't solve the problem:
rpcbind:94.183.32.151

Only when I ask 0.0.0.0 As a Bined-RPC-IP, the Bitcoin core returns a real answer. I checked many pages but found no other suitable way to assign specific IP addresses to Bitcoind. Can you help me please?

Note: IP, port number, user name and password are changed from the actual values.

bitcoind walletnotify PHP returned 32256

I would like to receive a notification from bitcoind when I receive a payment.
Then I want to update the account balance of the user who deposited the money.

My first problem is that I can't get BitcoinCore to notify me.

My second problem and if I do it manually, how can I assign a deposit (from a Tx) to a user?

At the moment I'm using an archaic method, the user has to click a button to send a request to bitcoind to update the wallet of the balance

  • Symfony 4
  • BitcoinCore 0.19.0.1

I am open to any other method

bitcoin.conf

proxy=127.0.0.1:9050
bind=127.0.0.1
onlynet=onion

walletnotify=/Users/XXX/code/project/transaction.sh %s

server=1
rpcuser=XXX
rpcpassword=XXX
rpcallowip=127.0.0.1
rpcbind=127.0.0.1
rpcport=8332

transaction.sh

#!/bin/sh
curl -d "txid=$1" http://127.0.0.1/wallet/notify

controller:

/**
     * @Route("/wallet/notify/{txid}", name="user_notify")
     */
    public function notify($txid)
    {
        $bitcoin = new BitcoinClient('http://XXX:XX@localhost:8332/');
        echo $bitcoin->gettransaction("$txid");
        $file = fopen("new.txt", "w");
        fwrite($file, $txid);
        fclose($file);
        return $this->render('debug.html.twig');

    }

EDIT:
I looked at the logs that I found:

2020-02-05T22:19:22Z Socks5() connect to 6q726sappclov3yk.onion:8333 failed: connection refused

I deleted the connection to Tor, restarted bitcoind and carried out a new transaction. I get the error:

2020-02-05T22:46:56Z (default wallet) AddToWallet XXXXXXXTXIDXXXXXXX update
2020-02-05T22:46:56Z runCommand error: system(/Users/XXXXX/code/project/transaction.sh XXXXXXXTXIDXXXXXXX) returned 32256