What role has bitcoin-init as a process?

0

I have set up a node on a RaspberryPi. When I check for active processes with top I see bitcoin-init occupying 50% of memory and 7% of CPU.

I can check for bitcoind and it is active:

bitcoin@raspberrypi ~ $ service bitcoind status
● bitcoind.service - Bitcoin daemon
   Loaded: loaded (/etc/systemd/system/bitcoind.service; enabled; vendor preset: enabled)
   Active: active (running) since Fri 2019-08-09 14:43:54 CEST; 2 weeks 4 days ago
  Process: 623 ExecStart=/usr/local/bin/bitcoind -conf=/home/bitcoin/.bitcoin/bitcoin.conf -pid=/home/bitcoin/.bitcoin/bitcoind.pid (cod
 Main PID: 772 (bitcoin-init)
    Tasks: 16 (limit: 4915)
   CGroup: /system.slice/bitcoind.service
           └─772 /usr/local/bin/bitcoind -conf=/home/bitcoin/.bitcoin/bitcoin.conf -pid=/home/bitcoin/.bitcoin/bitcoind.pid

According to this thread I assume that the daemon process bitcoind has been renamed to bitcoin-init but I am not sure if I understood that correctly.

My node seems to update the chain, but very slowly - 50GB after several weeks. And it is not reachable if I check my local IP via Coindance.

If I run bitcoin-cli getinfo with my usual Rasperry user pi I get

error: Could not locate RPC credentials. No authentication cookie could be found, and RPC password is not set.  See -rpcpassword and -stdinrpcpass.  Configuration file: (/home/pi/.bitcoin/bitcoin.conf)`

I have not set up a bitcoin.conf file.

If I run it with user bitcoin (not sure if that would be the right thing to do):

bitcoin@raspberrypi ~ $ bitcoin-cli getinfo
error code: -32601
error message:
Method not found

So, is bitcoin-init maybe just a startup process and my node is not working?


EDIT: The book (Antonopoulos) sais that bitcoind will give an error unless I set an rpcpassword in the configuration file. I don't have such a file, but bitcoind gives:

2019-08-28T07:27:16Z Bitcoin Core version v0.18.99.0-12fd4bbd1 (release build)
2019-08-28T07:27:16Z Assuming ancestors of block 0000000000000000000f1c54590ee18d15ec70e68c8cd4cfbadb1b4f11697eee have valid signatures.
2019-08-28T07:27:16Z Setting nMinimumChainWork=0000000000000000000000000000000000000000051dc8b82f450202ecb3d471
2019-08-28T07:27:16Z Using the 'standard' SHA256 implementation
2019-08-28T07:27:17Z Default data directory /home/pi/.bitcoin
2019-08-28T07:27:17Z Using data directory /home/pi/.bitcoin
2019-08-28T07:27:17Z Config file: /home/pi/.bitcoin/bitcoin.conf (not found, skipping)
2019-08-28T07:27:17Z Using at most 125 automatic connections (1024 file descriptors available)
2019-08-28T07:27:17Z Using 16 MiB out of 32/2 requested for signature cache, able to store 524288 elements
2019-08-28T07:27:18Z Using 16 MiB out of 32/2 requested for script execution cache, able to store 524288 elements
2019-08-28T07:27:18Z Using 4 threads for script verification
2019-08-28T07:27:18Z scheduler thread start
2019-08-28T07:27:18Z Binding RPC on address ::1 port 8332 failed.
2019-08-28T07:27:18Z Binding RPC on address 127.0.0.1 port 8332 failed.
2019-08-28T07:27:18Z Unable to bind any endpoint for RPC server
2019-08-28T07:27:18Z Error: Unable to start HTTP server. See debug log for details.
Error: Unable to start HTTP server. See debug log for details.
2019-08-28T07:27:18Z Shutdown: In progress...
2019-08-28T07:27:18Z scheduler thread interrupt
2019-08-28T07:27:18Z Shutdown: done

EDIT: I seem to have two seperate directories for .bitcoin. How can I tell bitcoind to use the other one?

Ben

Posted 2019-08-28T05:54:44.467

Reputation: 245

My node is running good again, bitcoin-cli works and the process is still called bitcoin-init while the blockchain is initially downloaded. So the process is renamed or it is called this way during initial download.Ben 2019-08-28T12:55:32.200

Answers

0

The reasons for my problems where the following:

bitcoin-init seems to be the correct process.

getinfo is no longer a method, it has been removed.

My startup skript /etc/systemd/system/bitcoind.startup was running bitcoind with user bitcoin. When I started it manually bitcoind run with another user (the active one I was using the shell with). bitcoind will then automatically set up a working directory in the home directory of this other user.

Another issue is that bitcoin-cli as a client can use password and user for authentication with bitcoind as a server (but it will be deprecated). But bitcoin-cli is also able to connect to a bitcoind server on the same machine without password/user just by a cookie. This is not the case for the class RawProxy() in python-bitcoinlib - it needs authentication. So, a command with bitcoin-cli might work without user/password while the same in a script with that library will not.

Ben

Posted 2019-08-28T05:54:44.467

Reputation: 245

1

With the order, I will try to response to your question.

According to this thread I assume that the daemon process bitcoind has been renamed to bitcoin-init but I am not sure if I understood that correctly.

I don't think the bitcoind is rewriting to bitcoin-init, but I don't have a mode for testing bitcoin-core on raspberry, so I ask you if you can post "how you have installed the bitcoin-core?", with command sudo apt install or a zip directory on Github/official site bitcoin?

My node seems to update the chain, but very slowly - 50GB after several weeks. And it is not reachable if I check my local IP via Coindance.

The answer is "depends", depends on your connection, in any case, is a little slow if you don't have an ADSL 7 mbs

EDIT: The book (Antonopoulos) sais that bitcoind will give an error unless I set an rpcpassword in the configuration file. I don't have such a file, but bitcoind gives:

Is possible to configure the node bitcoind with the file config, "bitcoin.conf", you have a complete example here and here file must be inside the directory bitcoin, if you don't change it, will be in the folder /home/yourName/.bitcoin/bitcoin.conf or you can set the bitcoind from the command line, an example bitcoind -rpcuser=vincent

I seem to have two seperate directories for .bitcoin. How can I tell bitcoind to use the other one?

If you have synchronized the bitcoin-core inside another directory (an example because you have a version bitcoin inside the external HDD) your command for bitcoin is similar this, bitcoind -datadir=/media/vincenzo/Maxtor/BitcoinCore/node if you not call the bitcoind with the daradir, the bitcoind re-synchronized the blockchain of bitcoin inside the /home/yourName/.bitcoin/ directory

If I run bitcoin-cli getinfo with my usual Rasperry user pi I get

The problem should be the datadir different from /home/yourName/.bitcoin/

vincenzopalazzo

Posted 2019-08-28T05:54:44.467

Reputation: 572

I am running version 0.18.99.0 which I compiled via git. Did you check the link I provided for finding out if bitcoind has been changed to bitcoin-init (just the process, the servicename is still bitcoind). https://github.com/bitcoin/bitcoin/issues/16007 Also, I am now running it in -printtoconsole to check if it works. Which command can I use to give bitcoind the path to my config file? -conf=... seems not to work.

Ben 2019-08-28T09:04:37.960

I have add this details inside the aswer, with -datadir=path and the bitcoin.conf must be inside the pathvincenzopalazzo 2019-08-28T09:07:23.783