Bitcoin Core Advanced Discussion

Hey folks,

I´m having troubles with setting up my wallet too.

I had the same issue as Tomic where it said No wallet is loaded.
Then created a wallet with createwallet “walletname”

But now I get the following errormessage:

PS D:\Bitcoin\daemon> ./bitcoin-cli -regtest getbalance
error: Could not connect to the server 127.0.0.1:18443 (error code 1 - “EOF reached”)

Make sure the bitcoind server is running and that you are connecting to the correct RPC port.

BTW: Bitcoind is definetly running in the background.

Edit: As far as I can tell, I´d have to open the 8332 and 8333 ports. Can someone confirm that ?

If you’re running locally you don’t have to open any ports. It seems you’re running the daemon in mainnet and trying to interact with regtest. You have to run the daemon in regtest mode as well. :slight_smile:

1 Like

Seems I´ve missed that part somehow.

Thanks mate :grin:

Question about the IT Infrastructure lecture.

I’m not sure if I got this correctly (but think so)…

  • Websites uses Bitcoin-Cli program to send request to BitcoinD for informations?

  • If a Full Node is stored on a server that other websites would then be able to get information from.
    Will these websites then need a bitcoin-cli program stored on their servers that will then send the request (from a user) to the BitcoinD program on the Full Node server (hope this is understandable)?

Thanks,
Bjarni

For some reason it still doesn’t work?? Please help! Thanks in advance.

Have you tried using quotations for the number? -fallbackfee='0.00001'

1 Like

No websites can also use the daemons RPC commands to interact with it. These are basically the same commands can do with the CLI tool but can be done using a network, in fact CLI uses RPC to interact with the daemon. You’ll notice this if you start the daemon on a different port than default.

https://developer.bitcoin.org/reference/rpc/

If you want to have multiple websites from different servers to interact with the daemon then you will obviously have to open ports to the network since by default they are open only on localhost. You can use a config file for this so you don’t have to input a long console command with all the required configuration. :slight_smile:

https://github.com/bitcoin/bitcoin/blob/master/share/examples/bitcoin.conf#L126

1 Like

Thank you! That worked :slight_smile: Thanks so much for the help!

Thanks for the explanation and the links :+1:

Hello Guys,
I am using Bitcoin Core 0.21.1 and being a new user I think I need some guidance.
The ./bitcoin-cli getnewaddress is often giving an error: "No wallet is loaded. Load a wallet using loadwallet or create a new one with createwallet. (Note: A default wallet is no longer automatically created) "
Though I managed to generate new addresses for the testnet. and the mainet, I am not able to figure out how to work it out for the regtest.
I have tried
./bitcoind -regtest -deprecatedrpc=generate
it ran perfectly. But no improvement with the cli.
could someone look into it. I have been trying to the whole day and now I am stuck with the course as I can not generate the 101 blockchain.
Also when I uninstalled the Bitcoin core and re-installed it. The previous setting were restored. Is there a way to make a clean re-install?

waiting for response. Thanks

1 Also In the Bitcoin Core 0.21.1, I get these 2 different Bitcoin-apps in my start up menu. Though there is only 1 bitcoin-qt in the program files

You don’t have t run the daemon with deprecated rpc. Did you also use the -regtest flag for bitcoin-cli? You have to append this flag with both commands.

This is fine because its just a UI and you will not need it. As long as you can start the chain in regtest mode, you’re good to go. :slight_smile:

2

./bitcoind -regtest -printtoconsole in the top window. Not working yet. Any suggestions?

Hello Tomic, I am facing the same issue. Did you manage to fix it?

The daemon seems to be working fine, you’re trying to use a command that doesn’t exist in cli.

3
Hi,
Can you let me know where i am going wrong?
./bitcoind -regtest -printtoconsole on the top.
I followed up with the other reply -createwallet. But I do not know the exact syntax hence I failed.
Please suggest. Thank you for being patient.

You can use

bitcoin-cli --regtest createwallet "wallet_name"

You can always check any command using the help command:

bitcoin-cli --regtest help createwallet

Thanks. This is working perfect for me. It has solved my issues.

Hi,

I am running bitcoind and I was prompted to run the –reindex argument i.e. ./bitcoind –reindex. After 24 hours my HDD run out of space. The reindexing process took about 200GB of space and it was uncompleted.

I am running bitcoind on the following hardware specifications: 250GB HDD; 4GB RAM; 4.20GHz processor.

  1. How much extra space do I need to run bitcoind comfortably, if 200GB seems not enough?

  2. Is there a way to compress old data blocks/ transactions in order to free more space? If yes, how do I go about it?

  3. Just running ./bitcoind -printtoconsole. Error message “disk space is too low”. See print screen below:
    Capture2

  4. Alternatively, how can I run bitcoind without using too much of my local hardware as I do not intent to run a full node on the mainnet yet. Is there a light version for regtest mode?

Many thanks

For fellows using Ubuntu (14 or >), you have here under the steps to install bicoin core:

Open terminal and update your apt repositories:

sudo apt update && sudo apt upgrade -y

Install Bitcoin core with snap (snap is already installed, its a kind of apple store or android app store and it seems to be the new way to install bitcoin-core)

sudo snap install bitcoin-core

Where do you need to place the bitcoin.conf file?

The file doesn’t exist yet so you need to create it.

touch ~/snap/bitcoin-core/common/.bitcoin/bitcoin.conf

Restrict the right only to you on this conf file for security reasons

chmod 0600 ~/snap/bitcoin-core/common/.bitcoin/bitcoin.conf

Then you can add you desired conf parameters like your pwd, the rpc port, which env (testnet, regtest, …) all cmd options you don’t want to type in your shell command for better confort.
don’t forget to restart the dameon each time you update this conf file (it seems that the gui, cli & daemon share the same conf file)

Here is my bitcoin.conf file as example:

vim ~/snap/bitcoin-core/common/.bitcoin/bitcoin.conf

rpcpassword=ivan4ever
test.rpcport=8332
#testnet=1
#regtest=1
#rpcport=8332
test.rpcallowip=127.0.0.1
test.rpcbind=127.0.0.1:8332
regtest.rpcport=8332
regtest.rpcallowip=127.0.0.1
regtest.rpcbind=127.0.0.1:8332

You can now run the deamon with these commands:

bitcoin-core.daemon -regtest -printtoconsole

or

bitcoin-core.daemon -testnet -printtoconsole

or

bitcoin-core.daemon -regtest -daemon

if you run the core as daemon you can shutdown it with this command otherwise a simple “ctrl+c” on the terminal.

a. First find the process id

ps -e | grep bitcoin
7370 ?        00:00:00 bitcoind

b. Finally kill it
sudo kill -9 7370

Remarks: in order to follow the Ivan training you need to create a wallet (it is not anymore automatically created by default). So i had to create a wallet before in order to be able to follow the course.

bitcoin-core.cli -regtest createwallet "itcl_wallet_testnet"
{
  "name": "itcl_wallet_testnet",
  "warning": ""
}

Then retry some commands teached by Ivan in the video

`bitcoin-core.cli -regtest getbalance`
0
bitcoin-core.cli -regtest generate 101
error code: -1
error message:
generate
has been replaced by the -generate cli option. Refer to -help for more information.

Arf! again, a new diff between old and new version of the cli

So try with a dash

bitcoin-core.cli -regtest -generate 101
{
  "address": "bcrt1q96varc3tjux9e0kw8eydy7vw6r7fx7hvvhh80e",
  "blocks": [
    "2f860dbc526e44ce4a5cc71418e9721b39739d11537f9f0dcb46bed10c57ca09",
     "..."
  ]
}

Get the balance:

bitcoin-core.cli -regtest getbalance
50.00000000

Yeah papy! it seems to work like a charm

References:
https://bitcoin.org/en/full-node#what-is-a-full-node
https://snapcraft.io/bitcoin-core
https://github.com/Stadicus/RaspiBolt/issues/486
https://stackoverflow.com/questions/65971466/i-can-not-connect-through-rpc-port-bitcoind

Please, let me know if you have an easier/better way to install & configure it on this os.

Hope to save your time
R. Tom

1 Like