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