-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Explore bitcoind REST interface #1558
Comments
Just going through my mentions and saw this again. I love the idea of using REST where we can. I find JSON-RPC very awkward, and don't really like the way it uses HTTP, but doesn't use HTTP verbs, headers, query parameters, status codes, and instead recreates those things in JSON. I would love to see an initial simple use of the REST API merged, default-off, so we can start exploring it. We use HTTP a lot and I expect to expose an HTTP REST API, so it makes sense to use it internally. |
rest=1
in config though. However, it still deserializes a block to CBlock
internally before sending. Ideally https://github.com/bitcoin/bitcoin/pull/26415 would be merged and this would be by far the fastest way to fetch blocks.
I don't think we need to make it an option. If the rest endpoint is responding we use it, otherwise continue with RPC. |
Most simple http libraries are async, which doesn't really work with the current architecture. I found https://github.com/oxigraph/oxhttp which seems to be what we need. Not sure if you have a better library in mind? If you'd like to see the benefits, using ApacheBench and requesting via REST vs RPC an 85kb transaction Benchmark REST:
Benchmark RPC:
REST - 1.149ms mean request time RPC also makes the CPU go up past 50% and the fan go on when I run the benchmarks, REST doesn't. |
Originally posted by @andrewtoth in https://github.com/casey/ord/issues/1502#issuecomment-1416828485
The text was updated successfully, but these errors were encountered: