Bitcoin full node and query server

Nov 19, 2020

View in context in the libbitcoin Slack #general mirror.

P
Phil14:47
Hello guys! How do I configure my LB node to [effectively] be an SPV node?
12 replies · neillm, Phil, evoskuil · last Nov 21, 2020
neillm15:02
There is no "SPV mode" in libbitcoin-node, or libbitcoin-server. If you mean, how can you find information on the chain without running a server, check libbitcoin-explorer (command line) or libbitcoin-client (API). There are plenty of query and subscription commands and community run (version3) servers that you can connect to.
neillm15:26
The v4 client adds a fetch-block-hashes command (i.e. bx fetch-block-hashes -t 100000) where you can get a properly ordered list of transactions in a block. If you needed to generate a merkle proof for a particular tx, you could use that result. This new command does work against version3 servers if you wanted to try it:
/bx fetch-block-hashes -t 100000
hashes
{
    hash 8c14f0db3df150123e6f3dbbf30f8b955a8249b62ac1d1ff16284aefa3d06d87
    hash fff2525b8931402dd09222c50775608f75787bd2b87e56995a7bdd30f79702c4
    hash 6359f0868171b1d194cbee1af2f16ea598ae8fad666d9b012c8ed2b79a236ec4
    hash e9a66845e05d5abc0ad04ec80f774a7e585c6e8db975962d069a522137b80c1d
}
neillm15:27
Of course in combination with a fetch header call:
/bx fetch-header -t 100000
header
{
    bits 453281356
    hash 000000000003ba27aa200b1cecaad478d2b00432346c3f1f3986da1afd33e506
    merkle_root f3e94742aca4b5ef85488dc37c06c3282295ffec960994b2c0d5ac2a25a95766
    nonce 274148111
    previous_block_hash 000000000002d01c1fccc21636b607dfd930d31d01c3a62104612a1719011250
    time_stamp 1293623863
    version 1
}
P
Phil16:38
Eric has been clear that you can patch LibBitcoin v4 to do header only sync, but i haven’t gone into discussion about where the logic/toggle is 🙂
P
Phil16:45
oh, actually, I’m not using the CLI, only the C++ API. I’d like to have a LB node class instance to do header sync only
P
Phil16:47
Then I’d like to navigate that header sync only block header chain via the API and embed it in a smartphone app
P
Phil18:26
@evoskuil could you check this thread?
P
Phil19:49
@neillm would you mind taking another look to this thread? I’d appreciate that
neillm21:49
I've read it. Is there a question?
evoskuil21:53
The headers protocol in v4 performs header sync. You can bind it and not the block sync protocol, in your own implementation if that’s what you want.
evoskuil21:53
If you avoid block sync then v4 is in pretty good shape.
P
Phil13:02
Wow, that’s great news! Thank you, guys!