Bitcoin full node and query server

Nov 14, 2025

View in context in the libbitcoin Slack #general mirror.

evoskuil03:24
I burned like a full day on this one issue of clean option syntax, totally dumb but I couldn't let it go 😐. Not totally satisfied, but it's pretty close, eg:
static constexpr std::tuple methods
{
    method<"getbestblockhash">{},
    method<"getblockhash", double>{ "height" },
    method<"getblock", string_t, option<1.0>>{ "blockhash", "verbosity" },
    method<"getblockheader", string_t, option<true>>{ "blockhash", "verbose" },
    method<"getblockstats", string_t, array_t>{ "hash_or_height", "stats" },
    method<"getchaintxstats", option<42.0>, option<"hello"_t>>{ "nblocks", "blockhash" },
};
It's the option<""_t> - couldn't get it down to just option<""> but the use of the existing text array conversion _t will at least will let me sleep well tonight. :? So for rpc default value types, the default is provided and the type is inferred. option<1.0> - requires the decimal, since these are doubles (json), and option<true> true or false. array_t and object_t don't have defaults, as they can just be empty collections.
(edited)