<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://en.zaoniao.it/index.php?action=history&amp;feed=atom&amp;title=Libbitcoin_Network</id>
	<title>Libbitcoin Network - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://en.zaoniao.it/index.php?action=history&amp;feed=atom&amp;title=Libbitcoin_Network"/>
	<link rel="alternate" type="text/html" href="http://en.zaoniao.it/index.php?title=Libbitcoin_Network&amp;action=history"/>
	<updated>2026-05-15T09:29:00Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.32.0</generator>
	<entry>
		<id>http://en.zaoniao.it/index.php?title=Libbitcoin_Network&amp;diff=5698&amp;oldid=prev</id>
		<title>Admin: Created page with &quot;The [https://github.com/libbitcoin/libbitcoin-network libbitcoin-network] library is a partial implementation of the Bitcoin P2P network protocol. E...&quot;</title>
		<link rel="alternate" type="text/html" href="http://en.zaoniao.it/index.php?title=Libbitcoin_Network&amp;diff=5698&amp;oldid=prev"/>
		<updated>2019-06-09T13:26:27Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;The [https://github.com/libbitcoin/libbitcoin-network libbitcoin-network] library is a partial implementation of the &lt;a href=&quot;/Protocol_documentation&quot; title=&quot;Protocol documentation&quot;&gt;Bitcoin P2P network protocol&lt;/a&gt;. E...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;The [https://github.com/libbitcoin/libbitcoin-network libbitcoin-network] library is a partial implementation of the [[Protocol_documentation|Bitcoin P2P network protocol]]. Excluded are all sub-protocols that require access to a blockchain. The [[Libbitcoin_Node|libbitcoin-node]] library extends this P2P networking capability and incorporates [[Libbitcoin_Blockchain|libbitcoin-blockchain]] in order to implement a [[Full_node|full node]]. The [[Libbitcoin_Explorer|libbitcoin-explorer]] library uses the P2P networking capability to post transactions to the P2P network.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
 #include &amp;amp;lt;future&amp;amp;gt;&lt;br /&gt;
 #include &amp;amp;lt;bitcoin/network.hpp&amp;amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 // Send a transaction to a single P2P node.&lt;br /&gt;
 int main(int argc, char* argv[])&lt;br /&gt;
 {&lt;br /&gt;
 // Decode a base16-encoded Bitcoin transaction. &lt;br /&gt;
 bc::data_chunk decoded;&lt;br /&gt;
 if (argc &amp;amp;lt; 1 || !bc::decode_base16(decoded, argv[0]))&lt;br /&gt;
 return -1;&lt;br /&gt;
 &lt;br /&gt;
 // Parse the decoded transaction.&lt;br /&gt;
 const auto tx = bc::chain::transaction::factory_from_data(decoded);&lt;br /&gt;
 &lt;br /&gt;
 // Configure the P2P network session for best performance.&lt;br /&gt;
 auto settings = bc::network::settings(bc::config::settings::mainnet);&lt;br /&gt;
 settings.outbound_connections = 0;&lt;br /&gt;
 settings.manual_attempt_limit = 3;&lt;br /&gt;
 &lt;br /&gt;
 // Start a network session.&lt;br /&gt;
 bc::network::p2p network(settings);&lt;br /&gt;
 &lt;br /&gt;
 // Declare completion signal.&lt;br /&gt;
 std::promise&amp;amp;lt;bc::code&amp;amp;gt; complete;&lt;br /&gt;
 &lt;br /&gt;
 const auto send_handler = [&amp;amp;complete](const bc::code&amp;amp; ec)&lt;br /&gt;
 {&lt;br /&gt;
 complete.set_value(ec);&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 const auto connect_handler = [&amp;amp;complete, &amp;amp;tx, &amp;amp;send_handler](&lt;br /&gt;
 const bc::code&amp;amp; ec, bc::network::channel::ptr node)&lt;br /&gt;
 {&lt;br /&gt;
 if (ec)&lt;br /&gt;
 complete.set_value(ec);&lt;br /&gt;
 else&lt;br /&gt;
 node-&amp;amp;gt;send(tx, send_handler);&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 // Connect to the one specified host with retry.&lt;br /&gt;
 network.connect(&amp;quot;localhost&amp;quot;, 8333, connect_handler);&lt;br /&gt;
 &lt;br /&gt;
 // Wait for completion and return result.&lt;br /&gt;
 return complete.get_future().get() ? -1 : 0;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
* The P2P protocol was originally contained within the [[Libbitcoin_Common|libbitcoin]] library.&lt;br /&gt;
&lt;br /&gt;
* In late 2014 [[William_Swanson|William Swanson]] reorganized libbitcoin sources in accordance with the roadmap agreed in Toronto earlier that year. Later sources were moved into the libbitcoin::network namespace.&lt;br /&gt;
&lt;br /&gt;
* By early 2016 [[Eric_Voskuil|Eric Voskuil]] completed the version 3 redesign to improve reliability, performance and readability. The namespace was forked into its own repository and integrated with dependent repositories.&lt;br /&gt;
&lt;br /&gt;
==Dependencies==&lt;br /&gt;
* [http://www.boost.org boost]&lt;br /&gt;
* [[Libbitcoin_Common|libbitcoin]]&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
* [[Libbitcoin]]&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
&lt;br /&gt;
[http://bitcoin.it/ http://bitcoin.it/]&lt;br /&gt;
[[Category:Open source]]&lt;br /&gt;
[[Category:Software]]&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
		
	</entry>
</feed>