Archive of the libbitcoin Slack #general channel.
export CPLUS_INCLUDE_PATH="/home/eynhaender/development/libbitcoin/build/release_static/include/bitcoin/network/ssl:$CPLUS_INCLUDE_PATH" export CPATH="/home/eynhaender/development/libbitcoin/build/release_static/include/bitcoin/network/ssl:$CPATH"
[native] I'm looking for?$ master/install/bin/bs -c bs.cfg.v4 Error: unrecognised option 'web.bind' $ master/install/bin/bs -c bs.cfg.v4 Error: unrecognised option 'explore.bind'
explore and web allows it to start ok, but there's no http accessnative works fine, but no http access$ master/install/bin/bs --settings > bs.cfg.v4.raw terminate called without an active exception Aborted
enum class electrum_version
{
/// Invalid version.
v0_0,
/// 2011, initial protocol negotiation.
v0_6,
/// 2012, enhanced protocol negotiation.
v0_8,
/// 2012, added pruning limits and transport indicators.
v0_9,
/// 2013, baseline for core methods in the official specification.
v0_10,
/// 2014, 1.x series, deprecations of utxo and block number methods.
v1_0,
/// 2015, updated version response and introduced scripthash methods.
v1_1,
/// 2017, added optional parameters for transactions and headers.
v1_2,
/// 2018, defaulted raw headers and introduced new block methods.
v1_3,
/// 2019, removed deserialized headers and added merkle proof features.
v1_4,
/// 2019, modifications for auxiliary proof-of-work handling.
v1_4_1,
/// 2020, added scripthash unsubscribe functionality.
v1_4_2,
/// 2022, updated response formats and added fee estimation modes.
v1_6
};network::protocol
├── [server:protocol_stratum_v2]
├── protocol_rpc<Channel>
│ └── [server::protocol_rpc<Channel>]
├── protocol_http
│ ├── [protocol_bitcoind_rpc]
│ └── protocol_ws
│ └── [server::protocol_html]
└── protocol_peer
├── [node::protocol_peer]
├── protocol_alert_311
├── protocol_reject_70002
├── protocol_seed_209
├── protocol_address_in_209
├── protocol_address_out_209
├── protocol_ping_106
│ └── protocol_ping_60001
└── protocol_version_106
└── protocol_version_70001
└── protocol_version_70002
└── protocol_version_70016
node::protocol
├── [server::protocol]
└── protocol_peer -> network::protocol_peer
├── protocol_observer
├── protocol_filter_out_70015
├── protocol_block_in_106
├── protocol_performer
│ └── protocol_block_in_31800
├── protocol_block_out_106
│ └── protocol_block_out_70012
├── protocol_header_in_31800
│ └── protocol_header_in_70012
├── protocol_header_out_31800
│ └── protocol_header_out_70012
├── protocol_transaction_in_106
└── protocol_transaction_out_106
server::protocol -> node::protocol
├── protocol_stratum_v2 -> network::protocol
├── protocol_rpc<channel_stratum_v1> -> network::protocol_rpc<channel_stratum_v1>
│ └── protocol_stratum_v1
├── protocol_rpc<channel_electrum> -> network::protocol_rpc<channel_electrum>
│ ├── protocol_electrum
│ └── protocol_electrum_version
└── protocol_http
├── protocol_html -> network::protocol_ws
│ ├── protocol_admin
│ └── protocol_native
└── protocol_bitcoind_rpc -> network::protocol_http
└── protocol_bitcoind_rest (edited)network::channel
├── [server::channel_stratum_v2]
├── channel_rpc<Interface>
│ └── [server::channel_stratum_v1]
│ └── [server::channel_electrum]
├── channel_http
│ ├── [server::channel_http]
│ └── channel_ws
│ └── [server::channel_ws]
└── channel_peer
└── [node::channel_peer]
node::channel
├── [server::channel]
└── channel_peer → network::channel_peer
server::channel → node::channel
├── channel_stratum_v2 → network::channel
├── channel_stratum_v1 → network::channel_rpc<interface::stratum_v1>
├── channel_electrum → network::channel_rpc<interface::electrum>
├── channel_http → network::channel_http
└── channel_ws → network::channel_wsnetwork::session
├── session_peer
│ ├── session_seed
│ ├── session_inbound
│ │ └── [node::session_peer<network::session_inbound>]
│ ├── session_outbound
│ │ └── [node::session_peer<network::session_outbound>]
│ └── session_manual
│ └── [node::session_peer<network::session_manual>]
└── session_server
└── [server::session_server<...Protocols>]
node::session
├── [server::session]
└── session_peer<NetworkSession> → NetworkSession
╞══ session_peer<network::session_inbound>
│ └── session_inbound
╞══ session_peer<network::session_outbound>
│ └── session_outbound
╘══ session_peer<network::session_manual>
└── session_manual
server::session → node::session
└── server::session_server<...Protocols> → network::session_server
╞══ session_admin = server::session_server<protocol_admin>
╞══ session_native = server::session_server<protocol_native>
╞══ session_bitcoind = server::session_server<protocol_bitcoind_rest>
╞══ session_stratum_v1 = server::session_server<protocol_stratum_v1>
╞══ session_stratum_v2 = server::session_server<protocol_stratum_v2>
└── server::session_handshake<...Protocols>
╘══ session_electrum = server::session_handshake<
protocol_electrum_version, protocol_electrum>admin.path (optional admin.default) it allows you to serve a site from the file system. This was working which is why we weren't seeing it, since the embedded admin site is just a stub.
[admin] path = m:/server default = bikers.html
53.8 min to block 900,000 on maxi, within typical variation from the record time of 51.9 min.handle_blockchain_block_header() and handle_blockchain_block_headers() methods. This was a little more than expected because version 1.4 added a checkpointing scheme designed to minimize header download at clients. Headers are small, and this feature introduces additional trust beyond SPV (trust of header checkpoints embedded in the wallet code).
Implementing this requires computing a unique merkle tree of all block hashes up to the given block - for any block on demand. This requires caching partial merkle root computations at fixed intervals across the full chain. The caching is fast and very small, and the query computations are reasonable. But it was a lot of moving parts to organize and test.
It is controllable via config, and we'd want it off unless supporting electrum. A large depth effectively precludes the cache, since it's cached on block height intervals of 2^depth. The cache is associated to blocks vs. heights (reorg safe) and append-only in the txs table. This should set to 11 (caching one merkle subtree root hash for every 2048 blocks) when serving electrum. Otherwise checkpointed header queries produce a merkle tree spanning the entire header chain (O(n) where n is the number of blocks) and will take some time.
[database] interval_depth = 255(edited)
[electrum] maximum_headers = 20160
52.3 mins, with database.interval_depth = 11, and cache space < 14kb, so we can safely consider the electrum caching cost to be inconsequential. 4,802,912,942 (cache)
- 4,802,898,894 (no cache)
14,048 bytesfloor(900,001 blocks / 2^11 blocks/interval) = 439 intervals 439 intervals * 32 bytes/interval = 14,048 bytes
53.2 mins, which is just 1.3 mins off the record (within typical deviation).sigops property. Sigops can be computed directly via query, just like I've done with fees. I'll probably do that eventually, at least when we get to candidate block generations. sigops and fees were originally intended for caching, but the requirement for prevouts precludes caching during archival, and to preserve the performance of milestone sync, we don't want to compel validation queries just for this. Since these cached values are not used in validation, the query performance is more than sufficient. In the mean time I may drop the sigops field from the native REST queries in order to get the performance benefit of avoiding the full block/tx queries just for this one property.{
"segregated": true,
"coinbase": false,
"nominal": 772,
"maximal": 1533,
"weight": 3849,
"virtual": 963,
"value": 7285048621,
"spend": 7284659165,
"fee": 389456,
"confirmed":
{
"height": 500000,
"position": 42
}
}{
"hash": "00000000000000000024fb37364cbf81fd49cc2d51c09c75c35433c3a1945d04",
"height": 500000,
"count": 2701,
"segregated": true,
"nominal": 981404,
"maximal": 1048581,
"weight": 3992793,
"virtual": 998199,
"value": 1402076969679,
"fees": 339351625,
"subsidy": 1250000000,
"reward": 1589351625,
"claim": 1589351625
} /// Bucket depth sizing parameters (number of blocks).
enum horizon : size_t
{
/// 2 hrs × 60 mins/hr / 10 mins/block = 12 blocks.
small = 12,
/// 8 hrs × 60 mins/hr / 10 mins/block = 48 blocks.
medium = 48,
/// 7 days * 24 hrs/day × 60 mins/hr / 10 mins/block = 1008 blocks.
large = 1008
};test_electrum.py::test_blockchain_block_headers >>> {"jsonrpc": "2.0", "id": 0, "method": "blockchain.block.headers", "params": [9000, 5, 0]}
<<< {"jsonrpc":"2.0","id":0,"result":{"max":2.016E4,"headers":["01000000632a1b699754e40b9140d32191c89286c0184098a9c17d12d356d39800000000882dc97ea4bfbadb281c1d1181df2033aa20d3f4b691b4a61fa0cd4c0b1af7a5a63cce49ffff001d2407559e","01000000b5a5110084cc6f6997b64868ce2f95e5145416a329ed543e0f7a5c4100000000820147ccdf83e6c8a32e9cc21fb189604edf27bbcd2e619c3fc12e2601a9299a353fce49ffff001d3873aec6","0100000016b2f2560640da0c58031c7a56fa6857783a9e76ef552aa821527503000000004707a4b853c8785fb385f5e548ce4f66b846c533894a13b316093ce3cc022922e43fce49ffff001d137f0304","01000000458df161b46a9b44ef54d3e327fd1d013f81a64e6bf6c8e4f2012c9a00000000c539c674e5ee6ca324b0ce0b3abdc84b10e66d72ed132acb584061bbd68b0e0fa542ce49ffff001dd6c1b205","010000009e2d02f749d322731e9d3dc53c1774bb65629cc0460d1700ab0d4f5400000000d72d89d4810566abde0ccf84437c48f962843c4bf75151728db23613d461f5197d44ce49ffff001d1f0ea6c9"],"count":5E0}}
<<< parsed: {
"jsonrpc": "2.0",
"id": 0,
"result": {
"max": 20160.0,
"headers": [
"01000000632a1b699754e40b9140d32191c89286c0184098a9c17d12d356d39800000000882dc97ea4bfbadb281c1d1181df2033aa20d3f4b691b4a61fa0cd4c0b1af7a5a63cce49ffff001d2407559e",
"01000000b5a5110084cc6f6997b64868ce2f95e5145416a329ed543e0f7a5c4100000000820147ccdf83e6c8a32e9cc21fb189604edf27bbcd2e619c3fc12e2601a9299a353fce49ffff001d3873aec6",
"0100000016b2f2560640da0c58031c7a56fa6857783a9e76ef552aa821527503000000004707a4b853c8785fb385f5e548ce4f66b846c533894a13b316093ce3cc022922e43fce49ffff001d137f0304",
"01000000458df161b46a9b44ef54d3e327fd1d013f81a64e6bf6c8e4f2012c9a00000000c539c674e5ee6ca324b0ce0b3abdc84b10e66d72ed132acb584061bbd68b0e0fa542ce49ffff001dd6c1b205",
"010000009e2d02f749d322731e9d3dc53c1774bb65629cc0460d1700ab0d4f5400000000d72d89d4810566abde0ccf84437c48f962843c4bf75151728db23613d461f5197d44ce49ffff001d1f0ea6c9"
],
"count": 5.0
}
}
PASSED
test_electrum.py::test_blockchain_block_headers_with_cp_single >>> {"jsonrpc": "2.0", "id": 0, "method": "blockchain.block.headers", "params": [9000, 1, 9010]}
<<< {"jsonrpc":"2.0","id":0,"result":{"branch":["16b2f2560640da0c58031c7a56fa6857783a9e76ef552aa82152750300000000","af67b874c777601fb1997dbc7e3560814b7a07938846494f28ffbfd0453793c8","19ba225cde8397b132baa72169fcf3879d02ed6b9762267f11251c9551415940","ade0e2d88b8b211e0c8199cba24e79df45438bb6a125f45cdd59f01f0d48dac1","ef1d1c2daa471e6addb3c5cc30e59873e4ade283094fe1c39cf7b9ddeba21f8c","b9d0f914675e08f905186fc7d7c3aa63494ff4392e516279e209a86cea2e8949","61ff014347f8675fe3f18e058b6450a0edda5934f50066009954ce9da9c6a105","2445f9beccdcd53e6936155b81ec3f3f0398a7b9f8e685902a59aa35def5ce5d","e4659700b0385b875e2140ccaadf8dd3acb8f968203889eaca3d58b7db0d4b68"],"root":"af5f46d9b7665d18ebc6ae5a79533e8894ca4dcafa322b43ffb898e9ba703ac6","max":2.016E4,"headers":["01000000632a1b699754e40b9140d32191c89286c0184098a9c17d12d356d39800000000882dc97ea4bfbadb281c1d1181df2033aa20d3f4b691b4a61fa0cd4c0b1af7a5a63cce49ffff001d2407559e"],"count":1E0}}
<<< parsed: {
"jsonrpc": "2.0",
"id": 0,
"result": {
"branch": [
"16b2f2560640da0c58031c7a56fa6857783a9e76ef552aa82152750300000000",
"af67b874c777601fb1997dbc7e3560814b7a07938846494f28ffbfd0453793c8",
"19ba225cde8397b132baa72169fcf3879d02ed6b9762267f11251c9551415940",
"ade0e2d88b8b211e0c8199cba24e79df45438bb6a125f45cdd59f01f0d48dac1",
"ef1d1c2daa471e6addb3c5cc30e59873e4ade283094fe1c39cf7b9ddeba21f8c",
"b9d0f914675e08f905186fc7d7c3aa63494ff4392e516279e209a86cea2e8949",
"61ff014347f8675fe3f18e058b6450a0edda5934f50066009954ce9da9c6a105",
"2445f9beccdcd53e6936155b81ec3f3f0398a7b9f8e685902a59aa35def5ce5d",
"e4659700b0385b875e2140ccaadf8dd3acb8f968203889eaca3d58b7db0d4b68"
],
"root": "af5f46d9b7665d18ebc6ae5a79533e8894ca4dcafa322b43ffb898e9ba703ac6",
"max": 20160.0,
"headers": [
"01000000632a1b699754e40b9140d32191c89286c0184098a9c17d12d356d39800000000882dc97ea4bfbadb281c1d1181df2033aa20d3f4b691b4a61fa0cd4c0b1af7a5a63cce49ffff001d2407559e"
],
"count": 1.0
}
}
PASSED
test_electrum.py::test_blockchain_block_headers_with_cp_multiple >>> {"jsonrpc": "2.0", "id": 0, "method": "blockchain.block.headers", "params": [9000, 5, 9020]}
<<< {"jsonrpc":"2.0","id":0,"result":{"branch":["7f3510be609d64b91f03dd5b5cd9c5b600cf70d5517b4d83eb54c88400000000","ce4fca3c41bbb9d99a9b51d0b8af01530bb53df66dc307864cea4ead6d7c672a","33ffd7862fd75b61faea4a93b1e0b24174cf3037e417ed8d97a8b3a11d36ae3b","ade0e2d88b8b211e0c8199cba24e79df45438bb6a125f45cdd59f01f0d48dac1","605b77e30ec358cc6413ea8ab6506380048bad8adc0974a3130aa06bac805047","b9d0f914675e08f905186fc7d7c3aa63494ff4392e516279e209a86cea2e8949","61ff014347f8675fe3f18e058b6450a0edda5934f50066009954ce9da9c6a105","2445f9beccdcd53e6936155b81ec3f3f0398a7b9f8e685902a59aa35def5ce5d","e4659700b0385b875e2140ccaadf8dd3acb8f968203889eaca3d58b7db0d4b68"],"root":"57e9f7ae00b1865b84ca9d0ffed55384ac65f6227924aa4a0229a78bf86a4d18","max":2.016E4,"headers":["01000000632a1b699754e40b9140d32191c89286c0184098a9c17d12d356d39800000000882dc97ea4bfbadb281c1d1181df2033aa20d3f4b691b4a61fa0cd4c0b1af7a5a63cce49ffff001d2407559e","01000000b5a5110084cc6f6997b64868ce2f95e5145416a329ed543e0f7a5c4100000000820147ccdf83e6c8a32e9cc21fb189604edf27bbcd2e619c3fc12e2601a9299a353fce49ffff001d3873aec6","0100000016b2f2560640da0c58031c7a56fa6857783a9e76ef552aa821527503000000004707a4b853c8785fb385f5e548ce4f66b846c533894a13b316093ce3cc022922e43fce49ffff001d137f0304","01000000458df161b46a9b44ef54d3e327fd1d013f81a64e6bf6c8e4f2012c9a00000000c539c674e5ee6ca324b0ce0b3abdc84b10e66d72ed132acb584061bbd68b0e0fa542ce49ffff001dd6c1b205","010000009e2d02f749d322731e9d3dc53c1774bb65629cc0460d1700ab0d4f5400000000d72d89d4810566abde0ccf84437c48f962843c4bf75151728db23613d461f5197d44ce49ffff001d1f0ea6c9"],"count":5E0}}
<<< parsed: {
"jsonrpc": "2.0",
"id": 0,
"result": {
"branch": [
"7f3510be609d64b91f03dd5b5cd9c5b600cf70d5517b4d83eb54c88400000000",
"ce4fca3c41bbb9d99a9b51d0b8af01530bb53df66dc307864cea4ead6d7c672a",
"33ffd7862fd75b61faea4a93b1e0b24174cf3037e417ed8d97a8b3a11d36ae3b",
"ade0e2d88b8b211e0c8199cba24e79df45438bb6a125f45cdd59f01f0d48dac1",
"605b77e30ec358cc6413ea8ab6506380048bad8adc0974a3130aa06bac805047",
"b9d0f914675e08f905186fc7d7c3aa63494ff4392e516279e209a86cea2e8949",
"61ff014347f8675fe3f18e058b6450a0edda5934f50066009954ce9da9c6a105",
"2445f9beccdcd53e6936155b81ec3f3f0398a7b9f8e685902a59aa35def5ce5d",
"e4659700b0385b875e2140ccaadf8dd3acb8f968203889eaca3d58b7db0d4b68"
],
"root": "57e9f7ae00b1865b84ca9d0ffed55384ac65f6227924aa4a0229a78bf86a4d18",
"max": 20160.0,
"headers": [
"01000000632a1b699754e40b9140d32191c89286c0184098a9c17d12d356d39800000000882dc97ea4bfbadb281c1d1181df2033aa20d3f4b691b4a61fa0cd4c0b1af7a5a63cce49ffff001d2407559e",
"01000000b5a5110084cc6f6997b64868ce2f95e5145416a329ed543e0f7a5c4100000000820147ccdf83e6c8a32e9cc21fb189604edf27bbcd2e619c3fc12e2601a9299a353fce49ffff001d3873aec6",
"0100000016b2f2560640da0c58031c7a56fa6857783a9e76ef552aa821527503000000004707a4b853c8785fb385f5e548ce4f66b846c533894a13b316093ce3cc022922e43fce49ffff001d137f0304",
"01000000458df161b46a9b44ef54d3e327fd1d013f81a64e6bf6c8e4f2012c9a00000000c539c674e5ee6ca324b0ce0b3abdc84b10e66d72ed132acb584061bbd68b0e0fa542ce49ffff001dd6c1b205",
"010000009e2d02f749d322731e9d3dc53c1774bb65629cc0460d1700ab0d4f5400000000d72d89d4810566abde0ccf84437c48f962843c4bf75151728db23613d461f5197d44ce49ffff001d1f0ea6c9"
],
"count": 5.0
}
}
PASSED