debug – Building/running/debugging bitcoind from visual studio code

I wish to get myself familiarized with the bitcoin source code just for personal interest purposes.

Has anyone tried to build/run/debug inside visual studio code?

I just cloned the repo and followed the instructions for mac and I am able to build and run the binaries without issues.

I figure the next steps I would run the the binaries with a debugger attached inside an IDE so I could kind of trace the code paths. How would I set it up in Visual Studio Code?

How to accelerate mempool data access with bitcoind

What could I do to accelerate access to the data I get when I call for example: bitcoin-cli getblocktemplate ?

If I would like to be able to be the fisrt one who get information about all the new tx getting into the mempool in term of milliseconds is there any optimization to bitcoin.conf or hardware or node deployment or even modification to code that I could do to be the first one to get the info?

All I want to be able to do with my bitcoind would be see the mempool info coming in as fast as possible (and if possible mining). So I’m wondering if I can remove any other feature to get this faster?

Thanks in advance for any clue!

Bitcoin c-lightning node on Synology cannot connect to bitcoind

I’m trying to setup a bitcoin lightning node on my NAS (Synology), following this tutorial: https://bitcoindev.network/running-a-lightning-node-on-synology-nas/

Unfortunately I get the following error (log):

lightningd: WARNING: default network changing in 2020: please set network=testnet in config!
bcli: 
Could not connect to bitcoind using bitcoin-cli. Is bitcoind running?
    
Make sure you have bitcoind running and that bitcoin-cli is able to connect to bitcoind.

You can verify that your Bitcoin Core installation is ready for use by running:
    
        $ bitcoin-cli -testnet echo 'hello world'   

2020-06-30T19:45:20.256Z INFO plugin-bcli: Killing plugin: Plugin exited before completing handshake.
The Bitcoin backend died.
lightningd: WARNING: default network changing in 2020: please set network=testnet in config!

My lightning.conf contains the following:

alias=myalias
network=bitcoin
bitcoin-rpcuser=myusername
bitcoin-rpcpassword=mypassword
bitcoin-rpcconnect=127.0.0.1
bitcoin-rpcport=18332
log-level=io

I’ve tried several parameters for bitcoin-rpcconnect (internal ip, external ip of my bitcoin node including the right ports).

Since my bitcoin node is running on mainnet I try to setup the lightning node for mainnet as well.

So does anyone knows what I’m doing wrong?

bitcoind – Bitcoin V0.1 Not Connected

You cannot.

There have been both changes to the P2P protocol that prevent this, and changes to the way that nodes are discovered.

The method which 0.1.0 discovered new nodes was by joining the #bitcoin channel on freenode. Your IP address would be encoded in a certain way and that would be the IRC nick for your node. However this has long since been removed from the Bitcoin software and any node that does connect to the #bitcoin channel will be kicked from it (the encoding is unique and identifiable).

Since 0.1.0 can’t connect to the IRC channel to discover new nodes, it is unable to learn about nodes that it can connect to.

Furthermore, the P2P protocol has changed since 0.1.0 was released and thus 0.1.0 is unable to communicate with modern nodes. This change was to add a checksum to the end of the P2P message header. Messages without this checksum will be rejected by modern nodes.

Lastly, 0.1.0 is too old so modern nodes won’t connect to it. They have a minimum supported protocol version number, and 0.1.0’s protocol version number is far too low. So even if you could get it to connect, the connection would be dropped.


The way to deal with the node discovery issue is to manually modify the peers.dat file to have the IP address and port of nodes that you want to connect to.

The only way to deal with the P2P protocol changes (checksum and version number) is to have a shim that sits in between all of your connections and modifies the P2P messages to work with modern node software. Or you can connect to a modified node which can deal with 0.1.0 traffic.


Even if you are able to connect to the Bitcoin network with 0.1.0, you won’t be able to mine anything as the CPU mining is no longer viable, and the CPU miner implementation in 0.1.0 is not efficient. You also wouldn’t be able to even sync as it syncs too slowly. Blocks will be found faster than it is able to process them. It will run into additional issues when it receives a new block before it is able to sync the blockchain that precedes that block.

bitcoind – How do I start -testnet in -deprecatedrpc to test a script?

I hope all is well during our COVID-19 pandemic.

My question: How do I start “bitcoind -testnet” in “-deprecatedrpc=signtransaction” mode?

Do I simply start it the same way without being a test and insert “-testnet” between “bitcoind” and “deprecatedrpc” like this”bitcoind -testnet -deprecatedrpc=signrawtransaction” (I mean, I need this to make sure my script is tested before running it and it keeps saying “error: Could not connect to the server 127.0.0.1:18332 (error code 1 – “EOF reached”).

Why?

And, are we allowed to offer a contest in this forum (I mean, am I allowed to offer one whole BTC to someone who can assist me in getting my script correct on a contingency basis or not, what are the forum rules on this, I mean, I need help 🆘)?

Thanks.

bitcoind – Bitcoincore listrecievedbyaddress doesn’t work

I am trying to run bitcoin full node on testnet. I have downloaded ant started bitcoind with such config:

testnet=1
regtest=0
server=1
listen=0

I’v generated new address tb1qklst9t8rk97zmwqdq4t8s3dazk3h6rps20y32d
with “getnewaddress” command.

I`v made the transaction from Electrum testnet wallet to this address (transaction id: cefe1ca9048f2fcd42c40b1060cdf4183f98f24eca95a9c499006ee39a033d54).
I can see this transaction in Electrum testnet wallet or on tbtc.bitaps.com.
But results of commands “listreceivedbyaddress 0 true true” and “gettransaction cefe1ca9048f2fcd42c40b1060cdf4183f98f24eca95a9c499006ee39a033d54” are:

(
  {
    "address": "tb1qklst9t8rk97zmwqdq4t8s3dazk3h6rps20y32d",
    "amount": 0.00000000,
    "confirmations": 0,
    "label": "",
    "txids": (
    )
  }
)

and

error code: -5
error message:
Invalid or non-wallet transaction id

The result of “getblockchaininfo” is:

{
  "chain": "test",
  "blocks": 626786,
  "headers": 1774117,
  "bestblockhash": "0000000000007d5ba9c09c8ddfa2cc31195aea3fc6e351969bc6fe454d2c29b8",
  "difficulty": 65536,
  "mediantime": 1450388529,
  "verificationprogress": 0.4003797270985711,
  "initialblockdownload": true,
  "chainwork": "000000000000000000000000000000000000000000000007049211b48a78f895",
  "size_on_disk": 4446006159,
  "pruned": false,
  "softforks": {
    "bip34": {
      "type": "buried",
      "active": true,
      "height": 21111
    },
    "bip66": {
      "type": "buried",
      "active": true,
      "height": 330776
    },
    "bip65": {
      "type": "buried",
      "active": true,
      "height": 581885
    },
    "csv": {
      "type": "buried",
      "active": false,
      "height": 770112
    },
    "segwit": {
      "type": "buried",
      "active": false,
      "height": 834624
    }
  },
  "warnings": ""
}

Bitcoin core version is 0.20.0.
What is wrong?

bitcoind – want to recover my lost money

You are the victim of a scam by criminal conmen.

You cannot recover your money.

The bitcoin system does not allow for cancellations, reversals or refunds of transactions where payments were made due to fraud. The only person who can return your money is the person who you gave it to. Criminals almost never voluntarily return what they stole. The bitcoin system does not allow for tracing or identification of recipients, The system intentionally makes this very difficult.

You will now be contacted by other conmen claiming they can help you recover your money. They might claim to be someone who was tricked and who found someone who recovered their money for them. They will all be lying to you in order to trick you out of more money. Ignore them.

I suggest you report this fraud to the local police, but accept that your money has all gone forever and will never be recovered.


This kind of theft happens often. Here are a few similar questions:

bitcoind – bitcoin-cli “Could not connect to the server”

Brand new Raspberry Pi mainnet node following this walkthrough:

https://medium.com/@meeDamian/bitcoin-full-node-on-rbp3-revised-88bb7c8ef1d1

When I run this command:

bitcoin-cli -rpcuser=username -rpcpassword=password -rpcport=8332 getblockchaininfo

I receive the error:

error: Could not connect to the server 127.0.0.1:8332

When I tail debug.log, the node appears to be fully sync’d and picking up new blocks

My bitcoin.conf file is:

#is required for Fail2Ban
logips=1

#magic RBP optimizations
maxconnections=40
maxuploadtarget=5000

upnp=1

server=1
rpcuser='username'
rpcpassword='password'
rpcport='8332'

walletrbf=1

My apologies if my formatting is bad here, couldn’t figure out how to get the .conf to paste as a block of text. Thank you for any ideas on what I’m doing wrong!

bitcoind – Wallet.dat bitcoin cash?

I had 20 btc in 2012, and I spent it all in December 2017. I heard there was a fork for Bitcoin cash.

How do I get my 20 bitcoin cash out of my wallet.dat ?