Bitcoin full node and query server

December 2017

Archive of the libbitcoin Slack #general channel.

Friday, December 1, 2017

neillm01:13
nice :-)

Thursday, December 7, 2017

evoskuil19:45
Back in libbitcoin v2 we used to maintain unconfirmed txs in a "memory pool". That led to problems during the "spam attacks" when we started seeing upwards of 20,000 txs in the pool. As a result v3 eliminated the memory pool, storing validated but unconfirmed txs on disk. Eventually most txs get mined, and we have already validated and stored them, so there is no extra cost - it's actually a great performance improvement. Now with well over 200,000 txs in the tx pool we are humming along with zero performance degradation. I noticed that blockchain.info has had a little trouble today with their mempool but cancoin's voyager https://voyager.cancoin.co has been solid. Nice work!
voyager.cancoin.co
A bitcoin block explorer API powered by libbitcoin.
@Ty has joined the channel20:17
Hi everyone! I'm Ty, I work with libbitcoin mostly using the Elixir programming language. I've built a client library and a high performance libbitcoin helper library, both of which were used to make the 'voyager' block explorer. You can see all the code here: https://github.com/cancoin
GitHub
GitHub is where people build software. More than 26 million people use GitHub to discover, fork, and contribute to over 73 million projects.
evoskuil20:32
And IIRC voyager passes websocket calls directly to the zeromq APIs for libbitcoin-server right?
Yes, websocket calls get passed directly to the zeromq API.
evoskuil20:34
I've been looking at providing a light weight websocket interface in the library, using mongoose. I'd really like to get your thoughts on it.
Another heavy libbitcoin user has already done this in a fork...
The performance doesn't appear to match voyager, but it may be a great firewall issue.
I think a light weight websocket interface would be a cool addition. I was thinking of using binary websockets and doing all decoding client side at one point.
Essentially just pass the zmq response to the websocket client
evoskuil20:40
We could easily provide different encodings. My main initial issue with mongoose was whether it would support push notifications.
(edited)
The metaverse implementation doesn't integrate that. They say that it can, but I wasn't able to easily find it in the mongoose docs/code.
We use a lot of HTTP EventSource sockets for our app's push notifications.
evoskuil20:44
I'm also planning Electrum wallet and mining integration. I spoke with Thomas about it and he seemed to prefer using ZeroMQ in the client, but this will be a tough sell on the miner side. So probably going to have to integrate stratum at some point as well 😕
Right, and we want to make sure that BS can emit those evens, but not sure if mongoose can support it.
I could imagine ZeroMQ being a tough sell on the miner side.
evoskuil20:47
A client-side dependency that's not C is a bit of an issue, but we should probably just create a miner client library at some point 🙂.
But it would make sense for them to use a more efficient protocol than JSON over TCP.
evoskuil20:47
exactly
ZeroMQ cannot be beat for performance.
A miner client library that speaks to bs via ZeroMQ would be pretty good. That could be used to re-broadcast via stratum or whatever.
@shawncc has joined the channel20:49
evoskuil20:49
Right, client-side proxy is what has been recommended. Still not optimal, but then you work your way out of the proxy and go native eventually.
And Thomas seems happy to go straight to ZeroMQ in Electrum, which would be a boon for server.
Wow, ZeroMQ in Electrum would be great for bs!
evoskuil20:51
BS is becoming a high performance mining pool platform. IOW one BS server will be able to run the entire pool, emitting accounting data over a notification endpoint.
(edited)
It's got the fastest block validation out there as far as I know.
I bet it will be the platform of choice!
evoskuil20:55
Yeah, in v4 server is getting some pretty significant upgrades to initial block download, validation performance (and compact blocks for low latency), and index space reduction...
We will also be incorporating a miner subscription endpoint (like address subscription) so that we can broadcast work and receive share info.
We already have the CurveCP integration for client-server authentication, so we can strongly account for work.
One downside to websockets is you have to fall back to SSL vs. CurveCP for security.
And then there's stratum :<
Websockets are a can of worms, that's for sure
Here is the websocket library we use: https://github.com/ninenines/cowboy , It's in Erlang, so not something that can be integrated into bs.
GitHub
cowboy - Small, fast, modern HTTP server for Erlang/OTP.
evoskuil21:09
Yeah, nice, but...
I know, not much help. But it's good at handling millions of near-idol connections. http://phoenixframework.org/blog/the-road-to-2-million-websocket-connections
phoenixframework.org
Productive. Reliable. Fast. A productive web framework that does not compromise speed and maintainability
evoskuil21:53
I'd like to know what our limit is on native zeromq. Are you using an in-process, local or remote binding to zeromq?
We are using local bindings for zeromq. I bet on the right server bs would do the same! I think they were limited by ulimit in the end.
evoskuil22:18
metaverse used the inproc zeromq binding, which I think makes sense for integration of mongoose.
(edited)
Our zeromq query service implementation will distribute work form the endpoint to any number of workers (1 or more threads as configured). Binding the web server to that endpoint in process eliminates overhead while shifting the socket management entirely to the web server.
Then the question of performance comes down to how efficient is the web server. All work is handled on the worker thread(s) and distribution of the work managed by zeromq routing.
(edited)
I'm assuming that the mongoose web server is fine on the main thread (just as our zeromq (C/S) and boost asio (P2P) listeners).
I wonder if libbitcoin-client could be integrated into Nginx as a module. That's gotta be one of the most efficient web servers around.
evoskuil22:38
Client needs a bit of an overhaul.... it should be mostly using the new work in libbitcoin-protocol, which would make it a lot simpler and a little more efficient.
Oh ok, I don't actually use the client for anything ATM
(edited)
evoskuil22:40
It would simplify implementation of the web server though, vs writing it directly in zeromq.
I'd just like to have a light/integrated BS websocket interface that allows for web apps to be written directly against a personal/local server.
A two tier implementation makes more sense for a robust web service like voyager.
I agree, it would be incredibly useful. You could have a personal/local block explorer with one HTML file.
evoskuil23:16
exactly

Friday, December 8, 2017

@kkdao has joined the channel17:26

Wednesday, December 13, 2017

evoskuil02:48
Libbitcoin version 3.4.0 has been tagged for release.
This includes configurable support for segregated witness and regtest, as well as several fixes.
neillm04:11
👍
evoskuil21:35
I've completed a full validation of mainnet with segwit forks enabled.

Friday, December 15, 2017

neillm12:24
mainnet1/testnet1 and mainnet2/testnet2 going down for some extended downtime starting today
evoskuil18:35
Okay, bitprim is supposed to be resyncing with 3.4.0
evoskuil23:33
Once these are up I'll transition the default (mainnet/testnet) DNS names to them.

Saturday, December 16, 2017

neillm02:51
servers going down very shortly
evoskuil02:52
K, I'll swap dns now.
neillm02:58
thanks, hope it goes smoothly

Tuesday, December 19, 2017

M
mariano21:13
Hi eric ! ....
evoskuil21:13
Hi!
M
mariano21:14
I need an invitation to slack -> fpelliccioni@gmail.com
fpelliccioni21:28
Hello
Thanks
@evoskuil... does libbitcoin support bip44 HD wallets?
evoskuil21:29
No, mainly because Libbitcoin has no wallet store.
But I'd love to see some foundational work and support for it in bx.
evoskuil22:12
Looking forward to your pull request!
fpelliccioni22:59
I will read the Bip and see what can I do
evoskuil23:04
I'll gladly offer advice and review on implementation. Best thing is to issue PR and request a review. Should be in the bc::wallet namespace and directory structure.

Wednesday, December 20, 2017

neillm13:53
@fpelliccioni About bip44, I've got working code using libbitcoin so if you need pointers for a bx integration, or have questions about how it's done, I'm happy to help!

Saturday, December 23, 2017

skaht23:21
@fpelliccioni - Lots of BIP44 bx scripting examples are found at https://github.com/libbitcoin/libbitcoin/wiki/Altcoin-Version-Mappings#7-bitcoin-btc-bip-3944-technology-examples. I believe @neillm just added Electrum seed word support that complements native BIP44 support.
GitHub
libbitcoin - Bitcoin Cross-Platform C++ Development Toolkit

Monday, December 25, 2017

evoskuil08:22
I've patched a trivial issue in libbitcoin-network that required backport to v3. Without the fix testnet does stall and mainnet could at any future point. The problem was an incoorect max size on network messages that can affect segwit blocks and txs. I've also patched a client issue and similar issue in explorer, whereas witness data is not decoded. I cheated a bit and retagged v3.4.0 in several repositories. Also, note that v3.4 requires a resync of the chain so that witness data will be captured for earlier blocks. Finally, ensure that network.services=9 is set so that witness data will be retrieved from (and provided to) peers. Also ensure that segwit forks are set (as desired): https://github.com/libbitcoin/libbitcoin-server/wiki/Fork-Settings Although if not specified all forks except for easy_blocks are enabled by default.
(edited)

Wednesday, December 27, 2017

evoskuil05:13
Libbitcoin now has fully-generated Visual Studio projects in master, thanks @pmienk! The previous support for VS2013 is now generated from libbitcoin-build (along with all other build artifacts) for all repos. But we now also have identical generated support for VS2015 and VS2017 in all repos. This means we also support Qt 5.5 and later on Windows (VS2015/17 with static linkage).
neillm21:10
Not a windows guy, but 👍 for those that can use this!

Sunday, December 31, 2017

skaht17:16
I’m retiring shortly. This means I will have more time to muck around with the cool toys you guys have created from an OSX perspective! Have also have started to capture the attention of my brother that is a JavaScript Architect.
evoskuil17:16
Nice!
Congratulations :)
Job1 is to create an Xcode project for Libbitcoin. We can use this as a template for libbitcoin-build generation of Xcode projects for all repos.
pmienk just completed VS project generation for VS2013/15/17 and we have had autotools and CI generation for some time.
skaht17:24
Thanks:-) It will be nice to have extra time to do things that interest me. Be aware that I never was formally trained as a developer. I’m really a BSEE that became a hacker years ago. I’m still coding and comping on a Mac using old fashion UNIX commands with Homebrew. Any pointers for URLs to examine concerning Xcode IDE will be my starting point.
skaht17:30
Recently upgraded to macOS High Sierra (Version 10.13.2) and I’m in the process of reloading Xcode Version 9.2 (9C40b).
evoskuil17:57
Okay, I just assumed you were working in Xcode. An IDE can be a big productivity enhancement when debugging, especially when dealing with a high degree of concurrency. It also tends to lower the bar for beginners to use the library.
But maintaining project files for multiple environments is a real challenge. But we’ve resolved the maintenance problem using code generation.
skaht18:02
I’m an old Makefile hack for managing projects on a single platform. I need to locate reading/video material to get me up to speed more efficiently. Is your desire to have an Xcode project for each libbitcoin library?
evoskuil18:03
Just for the three binaries in the base libbitcoin repo. With that as an example we can generate it and the others.
skaht18:04
bx, bs, and ???
evoskuil18:07
just libbitcoin/libbitcoin
There is one lib and two executables (examples and test)
The other repos follow the same pattern and so can be generalized from that.
You can see the structure in the Makefile.am
skaht18:22
Thanks for the Autotools link. This [Autotools](https://www.amazon.com/Autotools-Practitioners-Autoconf-Automake-Libtool-ebook/dp/B003WUYEL6/ref=pd_cp_351_1?_encoding=UTF8&psc=1&refRID=S69RY143Y19C2AHHYCWW) resource still had much to be desired. Will focus on these: 1. libbitcoin/libbitcoin 2. libbitcoin/libbitcoin-explorer 3. libbitcoin/libbitcoin-server
amazon.com
The GNU Autotools make it easy for developers to create software that is portable across many Unix-like operating systems. Although the Autotools are used by thousands of open source software packages, they have a notoriously steep learning curve. And good luck to the beginner who wants to find a...
evoskuil18:25
Again, if you just get libbitcoin we can set up generation for all others. Getting bx and bs will require you to build all (9) repos.
skaht18:37
Setting a baby step goal of staying focused on libbitcoin/libbitcoin and using the libbitcoin/libbitcoin-explorer/blob/master/Makefile.am to drive the development of a libbitcoin.xcodeproj file.
1 reply · skaht · last Dec 31, 2017
skaht18:56
Assuming test driven development (TDD) requires WITH_TESTS to be set within Makefile.am.
evoskuil18:53
Cool!