Archive of the libbitcoin Slack #general channel.
fees() I always get back 0, it seems that total_input_value() is always 0, my guess is that that is due to the previous output being missing for some reason. I'm testing this with the 100'000th block hex data (as found in libbitcoin's tests) auto const raw = bc::to_chunk(bc::base16_literal(
"010000007f110631052deeee06f0754a3629ad7663e56359fd5f3aa7b3e30a00"
"000000005f55996827d9712147a8eb6d7bae44175fe0bcfa967e424a25bfe9f4"
"dc118244d67fb74c9d8e2f1bea5ee82a03010000000100000000000000000000"
"00000000000000000000000000000000000000000000ffffffff07049d8e2f1b"
"0114ffffffff0100f2052a0100000043410437b36a7221bc977dce712728a954"
"e3b5d88643ed5aef46660ddcfeeec132724cd950c1fdd008ad4a2dfd354d6af0"
"ff155fc17c1ee9ef802062feb07ef1d065f0ac000000000100000001260fd102"
"fab456d6b169f6af4595965c03c2296ecf25bfd8790e7aa29b404eff01000000"
"8c493046022100c56ad717e07229eb93ecef2a32a42ad041832ffe66bd2e1485"
"dc6758073e40af022100e4ba0559a4cebbc7ccb5d14d1312634664bac46f36dd"
"d35761edaae20cefb16f01410417e418ba79380f462a60d8dd12dcef8ebfd7ab"
"1741c5c907525a69a8743465f063c1d9182eea27746aeb9f1f52583040b1bc34"
"1b31ca0388139f2f323fd59f8effffffff0200ffb2081d0000001976a914fc7b"
"44566256621affb1541cc9d59f08336d276b88ac80f0fa02000000001976a914"
"617f0609c9fabb545105f7898f36b84ec583350d88ac00000000010000000122"
"cd6da26eef232381b1a670aa08f4513e9f91a9fd129d912081a3dd138cb01301"
"0000008c4930460221009339c11b83f234b6c03ebbc4729c2633cbc8cbd0d157"
"74594bfedc45c4f99e2f022100ae0135094a7d651801539df110a028d65459d2"
"4bc752d7512bc8a9f78b4ab368014104a2e06c38dc72c4414564f190478e3b0d"
"01260f09b8520b196c2f6ec3d06239861e49507f09b7568189efe8d327c3384a"
"4e488f8c534484835f8020b3669e5aebffffffff0200ac23fc060000001976a9"
"14b9a2c9700ff9519516b21af338d28d53ddf5349388ac00743ba40b00000019"
"76a914eb675c349c474bec8dea2d79d12cff6f330ab48788ac00000000"));
bc::chain::block block100k;
block100k.from_data(raw);
block100k.transactions().fees() is 0, which I would not expect?master (and secretly also bitprim fork, but I've confirmed that part of the code is the same across both)#0 0x000055555584b400 in libbitcoin::chain::chain_state::median_time_past() const ()
#1 0x00005555556f9669 in libbitcoin::blockchain::populate_header::populate(std::shared_ptr<libbitcoin::blockchain::header_branch>, std::function<void (std::error_code const&)>&&) const ()
#2 0x00005555556e3c74 in libbitcoin::blockchain::validate_header::accept(std::shared_ptr<libbitcoin::blockchain::header_branch>, std::function<void (std::error_code const&)>) const ()
#3 0x00005555556d13e3 in libbitcoin::blockchain::header_organizer::organize(std::shared_ptr<libbitcoin::message::header const>, std::function<void (std::error_code const&)>) ()
#4 0x00005555556bf9ff in libbitcoin::blockchain::block_chain::organize(std::shared_ptr<libbitcoin::message::header const>, std::function<void (std::error_code const&)>) ()
#5 0x000055555567c106 in libbitcoin::node::protocol_header_in::store_header(unsigned long, std::shared_ptr<libbitcoin::message::headers const>) ()
#6 0x000055555567d338 in boost::asio::detail::completion_handler<std::_Bind<std::_Bind<std::_Bind<void (libbitcoin::node::protocol_header_in::*(std::shared_ptr<libbitcoin::node::protocol_header_in>, unsigned long, std::shared_ptr<libbitcoin::message::headers const>))(unsigned long, std::shared_ptr<libbitcoin::message::headers const>)> ()> ()> >::do_complete(void*, boost::asio::detail::scheduler_operation*, boost::system::error_code const&, unsigned long) ()
#7 0x000055555561a142 in boost::asio::detail::scheduler::run(boost::system::error_code&) ()
#8 0x00005555558cff1a in boost::detail::thread_data<libbitcoin::threadpool::spawn_once(libbitcoin::thread_priority)::{lambda()#1}>::run() ()
#9 0x00005555559b3b55 in thread_proxy ()
#10 0x00007ffff7988a9d in start_thread () from /usr/lib/libpthread.so.0
#11 0x00007ffff758ab23 in clone () from /usr/lib/libc.so.6!transaction is true with transaction being the object passed to my transaction handlertransaction should be a bc::transaction_const_ptradd_compiler_flag but the recommended way, I believe, is to use target-specific methods e.g target_add_compiler_flag. Is there a reason for using the other setup?add_subdirectory and just copying the library to their local set-up[requires] libbitcoin-node/0.1.0@blockport/stable fmt/5.1.0@bincrafters/stable spdlog/1.1.0@bincrafters/stable range-v3/0.3.7@blockport/stable dry_comparisons/0.1.0@blockport/stable tl_expected/0.2.1@blockport/stable [generators] cmake [imports] lib, *.so* -> ./lib lib, *.a -> ./lib
conanfile.txt and then it would pull it in and build/link everything correctly 🙂node.chain().organize(my_new_tx, [...](...){...} ) ?node.broadcast(message::transaction, channel_handler, result_handler), which sends the transaction message to all p2p peers. node::full_node inherits broadcast from network::p2p …bool protocol_transaction_in::handle_receive_transaction(const code& ec, transaction_const_ptr message) ?protocol_transaction_out be constructed by me or is there an instance I can request from somewhere or a utility method / function that will do the right thing ?error_code and log / respond somehow?node->chain().fetch_history(...) I get a segmentation fault:0x00005555558ba132 in libbitcoin::database::record_multimap<std::array<unsigned char, 20ul> >::find (this=0x9b0, key=...) at ./include/bitcoin/database/impl/record_multimap.ipp:78 78 const auto begin_address = map_.find(key)
this address is rather weird in any case 🤔miJsK8hgg2i18Gs2CKNYshDhW1qGvAE8rS ? like 0.01 btc or so?generate
generatetoaddress
# Libbitcoin Server configuration file [log] # The debug log file path, defaults to 'debug.log'. debug_file = debug.log # The error log file path, defaults to 'error.log'. error_file = error.log # The log archive directory, defaults to 'archive'. archive_directory = archive # The size at which a log is archived, defaults to 10000000 (0 disables). rotation_size = 10000000 # The minimum free space required in the archive directory, defaults to 0. minimum_free_space = 0 # The maximum combined size of archived logs, defaults to 0 (maximum). maximum_archive_size = 0 # The maximum number of logs to archive, defaults to 0 (maximum). maximum_archive_files = 0 # The address of the statistics collection server, defaults to none. statistics_server = 0.0.0.0:0 # Enable verbose logging, defaults to false. verbose = true [network] # The minimum number of threads in the network threadpool, defaults to 0 (physical cores). threads = 0 # The maximum network protocol version, defaults to 70013. protocol_maximum = 70013 # The minimum network protocol version, defaults to 31402. protocol_minimum = 31402 # The services exposed by network connections, defaults to 9 (full node, witness). services = 9 # The advertised services that cause a peer to be dropped, defaults to 176. #invalid_services = 176 # The magic number for message headers, defaults to 3652501241 (use 118034699 for testnet). identifier = 3669344250 # Validate the checksum of network messages, defaults to false. validate_checksum = false # The port for incoming connections, defaults to 8333 (use 18333 for testnet). inbound_port = 18444 # The target number of incoming network connections, defaults to 0.full file
08:25:01.054454 DEBUG [server] ================= startup Mon Oct 29 10:25:01 2018 ================== 08:25:01.054630 INFO [server] ================= startup Mon Oct 29 10:25:01 2018 ================== 08:25:01.054669 WARNING [server] ================= startup Mon Oct 29 10:25:01 2018 ================== 08:25:01.054840 ERROR [server] ================= startup Mon Oct 29 10:25:01 2018 ================== 08:25:01.054872 FATAL [server] ================= startup Mon Oct 29 10:25:01 2018 ================== 08:25:01.054896 INFO [server] Using config file: "settings.conf" 08:25:01.054917 INFO [server] Please wait while the server is starting... 08:25:01.055230 DEBUG [database] Buckets: block [650000], transaction [110000000], spend [250000000], history [107000000] 08:25:01.056425 DEBUG [database] Mapping: "blockchain/block_table" [5200177] (4096) 08:25:01.056478 DEBUG [database] Mapping: "blockchain/block_index" [12] (4096) 08:25:01.057122 DEBUG [database] Mapping: "blockchain/transaction_table" [880000267] (4096) 08:25:01.057513 DEBUG [database] Mapping: "blockchain/spend_table" [1000000008] (4096) 08:25:01.057912 DEBUG [database] Mapping: "blockchain/history_table" [428000036] (4096) 08:25:01.057963 DEBUG [database] Mapping: "blockchain/history_rows" [55] (4096) 08:25:01.058570 DEBUG [database] Mapping: "blockchain/stealth_rows" [4] (4096) 08:25:01.059084 INFO [network] Starting manual session. 08:25:01.059180 INFO [network] Not configured to populate an address pool. 08:25:01.059234 INFO [server] Seeding is complete. 08:25:01.059268 INFO [node] Node start height is (0). 08:25:01.059572 INFO [network] Not configured for accepting incoming connections. 08:25:01.059622 INFO [network] Starting outbound session. 08:25:01.059665 WARNING [network] Failure fetching new address: object does not exist 08:25:01.059770 WARNING [network] Failure fetching new address: object does not exist 08:25:01.059806 WARNING [network] Failure fetching new address: object does not exist 08:25:01.059861 WARNING [network] Failure fetching new address: object does not exist 08:25:01.059902 WARNING [network] Failure fetching new address: object does not exist 08:25:01.059932 DEBUG [network] Failure connecting outbound: object does not exist 08:25:01.059964 WARNING [network] Failure fetching new address: object does not exist 08:25:01.059995 WARNING [network] Failure fetching new address: object does not exist 08:25:01.060021 WARNING [network] Failure fetching new address: object does not exist 08:25:01.060045 WARNING [network] Failure fetching new address: object does not exist 08:25:01.060077 WARNING [network] Failure fetching new address: object does not exist 08:25:01.060121 DEBUG [network] Failure connecting outbound: object does not exist 08:25:01.061447 DEBUG [server] Applied address authentication to socket [query] 08:25:01.061561 INFO [server] Bound public query service to tcp://*:19091 08:25:01.061694 DEBUG [server] Connected public query worker to inproc://public_query 08:25:01.061830 DEBUG [server] Applied address authentication to socket [heartbeat] 08:25:01.061906 INFO [server] Bound public heartbeat service to tcp://*:19092 08:25:01.062030 DEBUG [server] Applied address authentication to socket [block] 08:25:01.062121 INFO [server] Bound public block service to tcp://*:19093full file
ERROR [network] Error seeding host addresses: unresponsive peer may be throttling which leads to the node being stopped, can this be controlled somehow? Out of 5 seed hosts I see ~3 connecting fine and 1 or 2 that have either some connection or DNS issue from time to time INFO [network] Failure contacting seed [testnet-seed.voskuil.org:18333] unable to reach remote host 😜Segwit is now always active in regtest mode by default.
bc::chain::block::from_data(...) the first thing that strikes me is that with the new regtest block is_valid_proof_of_work() returns false, the same goes for is_valid_coinbase and is_segregatedblock with witness set to false btwwitness set to true auto const raw = bc::to_chunk(bc::base16_literal(
"010000000000000000000000000000000000000000000000000000000000000000000"
"0003ba3edfd7a7b12b27ac72c3e67768f617fc81bc3888a51323a9fb8aa4b1e5e4ada"
"e5494dffff7f200200000001010000000100000000000000000000000000000000000"
"00000000000000000000000000000ffffffff4d04ffff001d0104455468652054696d"
"65732030332f4a616e2f32303039204368616e63656c6c6f72206f6e206272696e6b2"
"06f66207365636f6e64206261696c6f757420666f722062616e6b73ffffffff0100f2"
"052a01000000434104678afdb0fe5548271967f1a67130b7105cd6a828e03909a6796"
"2e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b"
"6bf11d5fac00000000"));
bc::chain::block block_regtest;
block_regtest.from_data(raw); // or with witness = true
::from_raw method it does seem to parse, given it doesn't give any error with the given HEX data{
"hash": "0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206",
"confirmations": 2,
"strippedsize": 285,
"size": 285,
"weight": 1140,
"height": 0,
"version": 1,
"versionHex": "00000001",
"merkleroot": "4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b",
"tx": [
{
"txid": "4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b",
"hash": "4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b",
"version": 1,
"size": 204,
"vsize": 204,
"weight": 816,
"locktime": 0,
"vin": [
{
"coinbase": "04ffff001d0104455468652054696d65732030332f4a616e2f32303039204368616e63656c6c6f72206f6e206272696e6b206f66207365636f6e64206261696c6f757420666f722062616e6b73",
"sequence": 4294967295
}
],
"vout": [
{
"value": 50.00000000,
"n": 0,
"scriptPubKey": {
"asm": "04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5f OP_CHECKSIG",
"hex": "4104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac",
"reqSigs": 1,
"type": "pubkey",
"addresses": [
"mpXwg4jMtRhuSpVq4xS3HFHmCmWp9NyGKt"
]
}
}
],
"hex": "01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff4d04ffff001d0104455468652054696d65732030332f4a616e2f32303039204368616e63656c6c6f72206f6e206272696e6b206f66207365636f6e64206261696c6f757420666f722062616e6b73ffffffff0100f2052a01000000434104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac00000000"
}
],
"time": 1296688602,
"mediantime": 1296688602,
"nonce": 2,
"bits": "207fffff",
"difficulty": 4.656542373906925e-10,
"chainwork": "0000000000000000000000000000000000000000000000000000000000000002",
"nTx": 1,
"nextblockhash": "29a3efe9d8edf16f00e87515efb6acb08dc1156eab6c2da80b9f0d1451b5e08c"
}extra ';', have these been address in master/version4?include/bitcoin/bitcoin/wallet/ec_public.hpp:64:27: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
...
include/bitcoin/bitcoin/impl/machine/operation.ipp:333:45: warning: comparison is always true due to limited range of data type [-Wtype-limits]
return value >= op_186 && value <= op_255;
....
include/bitcoin/bitcoin/impl/utility/pending.ipp:52:2: warning: extra ';' [-Wpedantic]
stack false, apparently some part of my TX script is not quite correct 😛cmake/ the directory containing Find<library>.cmake modules.FindDl.cmake, FindMbedtls.cmake or FindRt.cmake in that directory.