crystal-love (OP)
Newbie
Offline
Activity: 16
Merit: 5
|
|
January 11, 2021, 05:41:40 PM |
|
Is there any log for bitcoin core? As you can see below, when i check connection count for the first time, it says 9. But trying the same command after ±20min. it says that core is not running. Where should i look for the errors?
user@ubuntu:~$ bitcoin-cli getconnectioncount 9 user@ubuntu:~$ bitcoin-cli getconnectioncount error: Could not connect to the server 127.0.0.1:8332
Make sure the bitcoind server is running and that you are connecting to the correct RPC port.
|
|
|
|
|
|
Be very wary of relying on JavaScript for security on crypto sites. The site can change the JavaScript at any time unless you take unusual precautions, and browsers are not generally known for their airtight security.
|
|
|
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
|
|
|
BitMaxz
Legendary
Offline
Activity: 3248
Merit: 2970
Block halving is coming.
|
|
January 11, 2021, 06:52:13 PM |
|
It seems your bitcoin.conf file is not properly setup that's why you get that error sometimes. Can you check your bitcoin.conf file and share it here or if you don't have bitcoin.conf file make a new one and add these codes below as samples. Sample of bitcoin.conf config: rpcuser=user rpcpassword=pass rpcallowip=127.0.0.1 rpcport=8332 rpcthreads=10 server=1 Another sample. # Connection settings rpcallowip=127.0.0.1 rpcuser=[USER] rpcpassword=[PASSWORD] rpcport=8332 rpcbind=127.0.0.1:8332
Then reboot and run bitcoind manually and test it again.
|
|
|
|
crystal-love (OP)
Newbie
Offline
Activity: 16
Merit: 5
|
|
January 11, 2021, 08:39:44 PM |
|
It seems your bitcoin.conf file is not properly setup that's why you get that error sometimes.
You right. There was no conf file at all. Created, pasted your first example, looks like it is working now Thank you. time for lightning now...
|
|
|
|
crystal-love (OP)
Newbie
Offline
Activity: 16
Merit: 5
|
|
January 12, 2021, 12:53:39 PM |
|
It seems your bitcoin.conf file is not properly setup that's why you get that error sometimes.
Can you check your bitcoin.conf file and share it here or if you don't have bitcoin.conf file make a new one and add these codes below as samples.
Hello once again, Tried both of your config samples, but for some reason daemon still crashing. user@ubuntu:~$ bitcoind -daemon Bitcoin Core starting user@ubuntu:~$ bitcoin-cli getconnectioncount error: Could not connect to the server 127.0.0.1:8332 Make sure the bitcoind server is running and that you are connecting to the correct RPC port. user@ubuntu:~$ Any ideas? :|
|
|
|
|
BitMaxz
Legendary
Offline
Activity: 3248
Merit: 2970
Block halving is coming.
|
|
January 12, 2021, 10:57:31 PM Last edit: January 12, 2021, 11:15:22 PM by BitMaxz |
|
Hello once again, Tried both of your config samples, but for some reason daemon still crashing.
user@ubuntu:~$ bitcoind -daemon Bitcoin Core starting user@ubuntu:~$ bitcoin-cli getconnectioncount error: Could not connect to the server 127.0.0.1:8332
Make sure the bitcoind server is running and that you are connecting to the correct RPC port. user@ubuntu:~$
Any ideas? :|
According to the error, it can't connect to 8332 RPCport what I think is your bitcoind still not running. Can you try this command instead of bitcoind -daemon add extra - to daemon it looks like this Then try some RPC commands again. What I remember is you should run Bitcoind again two times to make them work. Can you try this command the above still don't work bitcoin-cli -rpcuser=user -rpcpassword=pass -rpcport=8332 getinfo Wait for a few minutes and try that again.
|
|
|
|
crystal-love (OP)
Newbie
Offline
Activity: 16
Merit: 5
|
|
January 12, 2021, 11:45:32 PM |
|
Can you try this command instead of bitcoind -daemon add extra - to daemon it looks like this Can you try this command the above still don't work bitcoin-cli -rpcuser=user -rpcpassword=pass -rpcport=8332 getinfo The first command managed to start the program, that's great! But the second, gives the error: user@ubuntu:~$ bitcoin-cli -rpcuser=user -rpcpassword=pass -rpcport=8332 getinfo error: Authorization failed: Incorrect rpcuser or rpcpassword This program never asked for the user or password, so i've never enter or change it.
|
|
|
|
achow101
Moderator
Legendary
Offline
Activity: 3388
Merit: 6635
Just writing some code
|
|
January 13, 2021, 12:33:42 AM |
|
Please post the contents of the debug.log file. This file can be found in the same directory as your bitcoin.conf file. The first command managed to start the program, that's great!
But the second, gives the error:
user@ubuntu:~$ bitcoin-cli -rpcuser=user -rpcpassword=pass -rpcport=8332 getinfo error: Authorization failed: Incorrect rpcuser or rpcpassword
This program never asked for the user or password, so i've never enter or change it.
There is no need to use -rpcuser or -rpcpassword. bitcoin-cli will determine these itself.
|
|
|
|
HCP
Legendary
Offline
Activity: 2086
Merit: 4316
<insert witty quote here>
|
|
January 13, 2021, 06:40:26 AM |
|
Is there any log for bitcoin core?
Look for the debug.log file in your ~/.bitcoin directory (as achow101 mentioned, it should be in the same location as where you put your bitcoin.conf file) Also, you'll probably find the contents of this log file are way too long for the character limit for a post here. I'd recommend using a service like https://pastebin.com/ You just need to copy/paste the contents of debug.log to pastebin, then click the "create new paste" button, this will generate a unique URL that you can post here without worrying about character limits for posts
|
|
|
|
crystal-love (OP)
Newbie
Offline
Activity: 16
Merit: 5
|
|
January 15, 2021, 07:29:01 PM |
|
Can you try this command instead of bitcoind -daemon add extra - to daemon it looks like this Can you try this command the above still don't work bitcoin-cli -rpcuser=user -rpcpassword=pass -rpcport=8332 getinfo 1. The first command with two "--" before daemon - worked out. It started and never crashed! Thank you. By the way, what is the diference between: bitcoind -daemon and bitcoind --daemon 2. Where do i set/change "-rpcuser=user -rpcpassword=pass " these credentials?
|
|
|
|
achow101
Moderator
Legendary
Offline
Activity: 3388
Merit: 6635
Just writing some code
|
|
January 15, 2021, 08:44:06 PM |
|
1. The first command with two "--" before daemon - worked out. It started and never crashed! Thank you. By the way, what is the diference between:
bitcoind -daemon and bitcoind --daemon
There is no difference. It will probably crash and you should still check the debug.log file. 2. Where do i set/change "-rpcuser=user -rpcpassword=pass " these credentials?
These are set in the bitcoin.conf file and bitcoin-cli will find them automatically. There is no need to use them in your bitcoin-cli command. Additionally, there is no need to set these in your bitcoin.conf file. These options are deprecated; there are other ways for bitcoin-cli to authenticate without these options, but you don't need to concern yourself with what those are or how they work.
|
|
|
|
HCP
Legendary
Offline
Activity: 2086
Merit: 4316
<insert witty quote here>
|
|
January 15, 2021, 08:52:40 PM |
|
2. Where do i set/change "-rpcuser=user -rpcpassword=pass " these credentials?
You don't need to use -rpcuser and -rpcpassword (and they're being deprecated)... You can simply use the "cookie" method. When you run bitcoind, you will find a .cookie file is created in your Bitcoin data directory (eg. in your ~\.bitcoin directory) with a randomly generated password. The contents of the .cookie file will look something like this: __cookie__:a14191e6892facf70686a397b126423
Where: - "__cookie__" is effectively the rpcuser value and "a14191e6892facf70686a397b126423" is the rpcpassword value Note: every time bitcoind starts, this file will be regenerated with a new password. When you run bitcoin-cli it will automatically look for this .cookie in the default location and use the credentials stored in there... if you have set bitcoind to use a "custom" data directory (ie. not ~/.bitcoin), then you can simply invoke bitcoin-cli with the -datadir option so it can still find the .cookie file. bitcoin-cli -datadir=/path/to/your/bitcoin/datadir <other commands>
... there are other ways for bitcoin-cli to authenticate without these options, but you don't need to concern yourself with what those are or how they work.
EDIT: or just ignore it all like achow101 says and it will just magically work
|
|
|
|
crystal-love (OP)
Newbie
Offline
Activity: 16
Merit: 5
|
|
January 20, 2021, 03:14:51 PM |
|
Thank you for your help, but i can't see cookies file inside .bitcoin folder. I see only these files:
/home/user/.bitcoin$ ls banlist.dat bitcoin.conf bitcoind.pid blocks chainstate debug.log fee_estimates.dat mempool.dat peers.dat testnet3 wallets
Also was trying to run with any user/passw, but got this error:
$ lnd --bitcoin.active --bitcoin.testnet --debuglevel=debug --bitcoin.node=bitcoind --bitcoind.rpcuser=hello --bitcoind.rpcpass=world --externalip=x.x.x.x
unable to load RPC credentials for bitcoind: please set all or none of bitcoind.rpcuser, bitcoind.rpcpass, bitcoind.zmqpubrawblock, bitcoind.zmqpubrawtx
trying to paste to pastebin, but it's also not working:
pastebinit -i debug.log Failed to contact the server: HTTP Error 502: Bad Gateway
|
|
|
|
HCP
Legendary
Offline
Activity: 2086
Merit: 4316
<insert witty quote here>
|
|
January 20, 2021, 07:46:07 PM |
|
Thank you for your help, but i can't see cookies file inside .bitcoin folder. I see only these files:
/home/user/.bitcoin$ ls
try to seach in the .bitcoin directory using this command: By default... any file/directory that starts with a '.' is "hidden" and won't be shown with the standard ls command... you're looking for .cookie file, so you need to show hidden files/folders using the -a switch.
|
|
|
|
crystal-love (OP)
Newbie
Offline
Activity: 16
Merit: 5
|
|
January 24, 2021, 07:44:51 PM |
|
Thank you, all clear. I found cookie file, but...
How should properly look this command? Should there be option (--bitcoind.rpcuser=REPLACEME --bitcoind.rpcpass=REPLACEME) ??
lnd --bitcoin.active --bitcoin.testnet --debuglevel=debug --bitcoin.node=bitcoind --bitcoind.rpcuser=REPLACEME --bitcoind.rpcpass=REPLACEME --externalip=X.X.X.X --noencryptwallet --bitcoind.zmqpath=tcp://127.0.0.1:28332
When i try to run, it gives me these errors:
unknown flag `noencryptwallet'
(i removed this command at all and tried again). Then i've got this error:
unknown flag `bitcoind.zmqpath'
(i removed this command at all and tried again). Then i've got this error:
unable to load RPC credentials for bitcoind: please set all or none of bitcoind.rpcuser, bitcoind.rpcpass, bitcoind.zmqpubrawblock, bitcoind.zmqpubrawtx
But i'm starting this command in the same folder, as i have .cookie (/home/user/.bitcoin)
Then i removed command "rpcuser and rpcpass" and got this:
Attempting automatic RPC configuration to bitcoind unable to load RPC credentials for bitcoind: unable to extract RPC credentials: unable to find zmqpubrawblock in config, cannot start w/o RPC connection
so, just deleting them, did not helped.
any ideas? how to sort it out?
|
|
|
|
HCP
Legendary
Offline
Activity: 2086
Merit: 4316
<insert witty quote here>
|
|
January 24, 2021, 09:55:47 PM |
|
Then i've got this error: unable to load RPC credentials for bitcoind: please set all or none of bitcoind.rpcuser, bitcoind.rpcpass, bitcoind.zmqpubrawblock, bitcoind.zmqpubrawtx
Not sure why you're using bitcoind.zmqpath? the options required are: bitcoind.zmqpubrawblock and bitcoind.zmqpubrawtx as per the error message you are seeing. What is the contents of your bitcoin.conf file in the the /home/user/.bitcoin directory? Then i removed command "rpcuser and rpcpass" and got this:
Attempting automatic RPC configuration to bitcoind unable to load RPC credentials for bitcoind: unable to extract RPC credentials: unable to find zmqpubrawblock in config, cannot start w/o RPC connection
As for rpcuser and rpcpass, if you pass the bitcoind.dir to lnd, it should automatically find the .cookie file and use those credentials
|
|
|
|
crystal-love (OP)
Newbie
Offline
Activity: 16
Merit: 5
|
|
January 25, 2021, 10:51:56 AM Last edit: January 25, 2021, 01:30:27 PM by crystal-love |
|
To be honest with you, I have no idea what is zmqpath as well as what is zmqpubrawblock. I was just trying to setup reading this tutorial: https://gist.github.com/bretton/1a72e9fea94405be449edbd379a1ce57Content of bitcoin.conf is empty. I suppose to add the text bellow, but except my external IP, i have no idea how to change it so it would use .cookie instead of rpcuser/rpcpassword. server=1 testnet=1 txindex=1 daemon=1 externalip=X.X.X.X maxconnections=10 rpcuser=REPLACEME rpcpassword=REPLACEME zmqpubrawblock=tcp://127.0.0.1:28332 zmqpubrawtx=tcp://127.0.0.1:28332
|
|
|
|
HCP
Legendary
Offline
Activity: 2086
Merit: 4316
<insert witty quote here>
|
|
January 26, 2021, 08:23:15 PM |
|
To utilise .cookie auth... you just need to comment out or remove the rpcuser and rpcpassword lines from your bitcoin.conf file, then Bitcoin Core will automagically default to .cookie authentication
|
|
|
|
crystal-love (OP)
Newbie
Offline
Activity: 16
Merit: 5
|
|
January 27, 2021, 02:23:19 PM |
|
Thank you, I believe it worked out. I've modified bitcoin.conf by commenting these two lines. It looks like it is started and running. Is there any way to check it? Except looking it to "bitcoin-cli getconnectioncount" ?
Also what does it mean "testnet = 1" ? Is my node running in some "test" mode?
server=1 testnet=1 txindex=1 daemon=1 externalip=X.X.X.X maxconnections=45 #rpcuser=REPLACEME #rpcpassword=REPLACEME zmqpubrawblock=tcp://127.0.0.1:28332 zmqpubrawtx=tcp://127.0.0.1:28332
|
|
|
|
nc50lc
Legendary
Offline
Activity: 2408
Merit: 5594
Self-proclaimed Genius
|
|
January 27, 2021, 02:44:04 PM |
|
Also what does it mean "testnet = 1" ? Is my node running in some "test" mode?
Yes, that's to set Bitcoin Core to run on the testnet instead of the main network. Note that testnet has a separate blockchain and data directory from the mainnet and shouldn't be treated with monetary value. More info: https://developer.bitcoin.org/examples/testing.html
|
. .HUGE. | | | | | | █▀▀▀▀ █ █ █ █ █ █ █ █ █ █ █ █▄▄▄▄ | ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀ . CASINO & SPORTSBOOK ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ | ▀▀▀▀█ █ █ █ █ █ █ █ █ █ █ █ ▄▄▄▄█ | | |
|
|
|
crystal-love (OP)
Newbie
Offline
Activity: 16
Merit: 5
|
|
January 27, 2021, 03:27:43 PM |
|
What is the reason for this testnet? I want to have a real node, doing real things. Why do i need this testnet?
And of course the last question, how to switch to main blockchain?
|
|
|
|
|