So I struggled with this for a while — I installed Bitcoin on a linux instance by cloning the Github repository, and running
./bitcoind -daemon -pruned=550
The only problem I found, was that I could not find Bitcoin.conf. Turns out, that sometimes bitcoind will just run without it, so you can go ahead and create it. Who knew!
From this answer on Stack Overflow
The configuration file is definitely inSven Williamson
$HOME/.bitcoin/. If you cannot see it, the most likely explanation is that you have not created it. Just use your favorite text editor to do so. As far as I can tell,
bitcoind -daemonwill run without
bitcoin.confbeing present and you will still get the message ‘Using config file /home/user/.bitcoin/bitcoin.conf’ in
debug.logeven when no file exists.
Next, you can go ahead and create the bitcoin.conf file in the ~/.bitcoin/ path.
Use vim to edit the file, and follow this answer from Stack Overflow.
I was having the same problem and just managed to fix it now. Since the file bitcoin.conf does not exist inside ~/.bitcoin, Just create one.tormuto
Here’s what did:
Enter letter ‘a’ (to edit the file). Then type:
Press the ESC key, and press ZZ to exit vi
Apparently the password that bitcoind started with is (for one reason or the other) different from the one you are trying. (i also have a feeling that bitcoind misbehaves like that because no password was defined; since there was no bitcoin.conf)
Now, even though you have changed the password, it will NOT be effective until bitcoind has been re-started. But since it won’t even accept the stop command (./bitcoin-cli stop) due to the authentication issue; You will need to kill the process, and restart bitcoind. It will work fine afterwards:
pkill -9 -f bitcoind
Hope this is helpful
Finally, you can configure your bitcoin.conf file correctly. I found this article and copied and pasted the following code:
# Expose the RPC/JSON API server=1 rpcbind= YOUR VPS IP ADDRESS HERE rpcallowip= YOUR IP ADDRESS HERE rpcport=8332 rpcuser=USER rpcpassword=PASSWORD
It wasn’t working after this, and I didn’t know why. My issue was that I had mistyped the port in my code.
You can query the bitcoin blockchain now from your local machine by following this guide and configuring as you need.