Bitcoin full node and query server

Oct 9, 2024

View in context in the libbitcoin Slack #general mirror.

C
cguida22:32
hi libbitcoin people! I installed libbitcoin-node, and I'm looking for how to control/access it. does it have some kind of GUI perhaps, like bitcoin-qt, or a CLI like bitcoin-cli? the docs for libbitcoin-node seem to suggest there's no CLI https://github.com/libbitcoin/libbitcoin-node/wiki but i'm also not seeing a GUI
39 replies · pmienk, cguida, evoskuil · last Oct 10, 2024
pmienk22:57
bn operates as a bitcoin node supporting the peer to peer protocol. It's configuration controls its operation. What specifically are you seeking to do?
C
cguida22:58
just want to watch its progress, was hoping for something like bitcoin-cli getblockchaininfo
(edited)
C
cguida22:59
for now
C
cguida22:59
i'd just like to look at a list of rpc commands and see what the node can do
C
cguida22:59
don't know much about libbitcoin yet
pmienk22:59
The logging settings will provide information as to what is happening, syncing, etc.
pmienk23:02
bn does not accept rpc commands. This project is not structured in an identical manner to the prototype bitcoin client. bn is a node and supports the p2p protocol. If you're looking for query support, bs - bitcoin server, combines the node with an additional client-server protocol over zmq
pmienk23:05
bx - bitcoin explorer provides a command line tool which implements the client protocol for executing queries against bitcoin-server as well as implementing a variety of p2p queries which can be executed against any bitcoin node implementation
pmienk23:08
Please see the documentation for libbitcoin-explorer for a breakdown of which queries are available and which protocol they rely upon. There are additionally many data manipulation commands available therein
C
cguida23:13
ok so bn does nothing except run?
C
cguida23:13
sounds like i need to install bs and bx instead... but maybe i can tweak my logging settings to see what % of the chain is currently synced?
C
cguida23:19
how can i change the logging settings?
C
cguida23:20
i tried making bn.cfg and passing it in via -c but i get
$ ~/libbitcoin/bin/bn -c bitcoin/bn.cfg 
Error: unrecognised option 'verbose'
C
cguida23:23
file looks like verbose = 1
pmienk23:51
Well, bs instead gets you the additional client-server protocol. bx in addition to either simulate a peer connection or play client to the server.
C
cguida23:53
i really just want to watch sync progress. evoskuil claims that the new version of libbitcoin syncs the chain much faster than bitcoind and i wanted to see for myself!
pmienk23:53
If you're running master instead of version3 branches, the documentation will be incorrect.
C
cguida23:54
yes, i saw that, that's why i'm in here
pmienk23:56
Well, master does not have updates to server or explorer, so node is the proper starting point. Without providing your intention I have been working under the assumption you were interested in production work.
pmienk23:58
Without additional information related to your configuration file, I would assume you're missing the section header for [log]
C
cguida23:59
ah cool yes, i may have deleted that
pmienk23:59
For additional settings, I would suggest reading the code related to configuration parsing.
C
cguida23:59
no i just want to benchmark ibd
C
cguida23:59
sounds good, got a file i can look at for config parsing? i'll see if i can find it..
pmienk00:00
Working from my phone here. I do not have the bandwidth to locate the file at the moment.
C
cguida00:00
no worries, thanks for your help so far!
C
cguida00:02
hmm verbose mode does not appear to be reporting synced block height... guess i'll dig into the code..
C
cguida00:09
cguida
just want to watch its progress, was hoping for something like bitcoin-cli getblockchaininfo
pmienk00:14
Without additional context, the response to pursue libbitcoin-explorer was correct. The context that you wished to evaluate work in progress was not specified.
(edited)
C
cguida00:15
gotcha, yes, i should have specified i had built from master
evoskuil03:40
The node has various log contexts, sent both to a rotating pair of log files and the console. Each log context can be toggled on and off with initial values defaulted and controllable via the config file.
evoskuil03:42
Blocks are not downloaded in order, it is highly concurrent. You can see what blocks are being downloaded using the protocol log context, but this will slow down sync, which is much faster than the console. The console does not block the node, but it does consume resources.
evoskuil03:44
There is also a high speed event system. We use this to track download status. By default blocks are downloaded in 50k groups. By observing the quantity of entries in the event log you can see the number of blocks downloaded.
(edited)
evoskuil03:45
Downloading will slow as the 50k group is closing out, and then accelerate again. The group size is configurable.
evoskuil03:45
The first couple 50k groups of blocks should take just a few seconds.
C
cguida18:27
Ok, thanks for the info. What would be the most straightforward way to gauge how long the sync will take to complete, without just starting the node and wait till it stops syncing. Is there even a message that indicates when the node has finished syncing?
C
cguida18:28
Sounds like maybe this "high speed event system" will generate a log every time 50k blocks is downloaded? Is there some special configuration to turn that on?
evoskuil22:55
The number of lines in the event log tells you the number of blocks. You can also use a compand line option to view table stats while running (or not). The number of tx table rows is fairly linear in total time as is byte size. I can get back to you with tx counts at each 50k interval.
evoskuil22:56
The event system is always on. It writes events as they occur (ie each block), not waiting to 50k increments.
👍 1