Skip to content
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

Implement persistent connections for HTTP RPC (JSON) #380

Closed
cculianu opened this issue Jul 7, 2020 · 2 comments · Fixed by #384
Closed

Implement persistent connections for HTTP RPC (JSON) #380

cculianu opened this issue Jul 7, 2020 · 2 comments · Fixed by #384
Labels
good first issue Good for newcomers

Comments

@cculianu
Copy link

cculianu commented Jul 7, 2020

It would be really nice if bchd's HTTP RPC server (JSON RPC) supported HTTP/1.1 persistent connections as per the RFC: https://tools.ietf.org/html/rfc2616#section-8.1

All of the other bitcoind node implementations support this. (Core, ABC, BCHN, BU, Flowee, etc).

Instead, bchd closes the connection after each request:

bchd/rpcserver.go

Line 4553 in 87e4c5c

r.Close = true

This is a deal-breaker for Fulcrum being able to support bchd properly. On block chain synch, millions of RPC commands need to be issued potentially. Being forced to re-open the connection each time severely impacts performance to the point where I don't think it's worth it to support bchd, unfortunately.

Please consider it.

@zquestz
Copy link
Contributor

zquestz commented Jul 7, 2020

The code for the rpc server is about 5 years old, and explicitly avoids using Go's http handling for persistent connections. The changes shouldn't be that large, but will require some testing to make sure we don't regress any behavior.

This would be a great item for someone to pick up that is new to bchd, but been using Go for a while. =)

@zquestz zquestz added the good first issue Good for newcomers label Jul 7, 2020
@cculianu
Copy link
Author

cculianu commented Jul 7, 2020

Thanks for being amenable to this change, man. It would make Fulcrum's life easier (and any other such similar service).

@cculianu cculianu changed the title Implement persistent connections for HTTP RPC (JSON)? Implement persistent connections for HTTP RPC (JSON) Jul 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants