redmaner / go-nimiq-rpc Goto Github PK
View Code? Open in Web Editor NEWNimiq RPC client library written in Go
License: Apache License 2.0
Nimiq RPC client library written in Go
License: Apache License 2.0
I was testing out this library in a production setting (upcoming Albatross visualizer) and I noticed the service was using 40 GB of memory an hour in :^)
Closing the http.Response.Body
s with defer fixed it.
Needs defer httpResp.Body.Close()
(with error handling) on line 120
Lines 116 to 120 in 5f3e3b4
Also, this check is wrong.
godoc:
// The http Client and Transport guarantee that Body is always
// non-nil, even on responses without a body or responses with
// a zero-length body. It is the caller's responsibility to
// close Body.
Lines 129 to 132 in 5f3e3b4
Have you looked at the library https://github.com/ybbus/jsonrpc yet?
It has a few nice features:
While the example has a lot of features, there is already a powerful RPC client at https://github.com/nimiq/core-js/blob/master/doc/json-rpc-client.md
I suggest we keep a minimal example in godoc
and remove example/
to keep the library more manageable.
Thanks a lot for creating a Go client for the Nimiq RPC interface. This will be helpful in the future!
I will be creating a few issues + PRs with suggestions with minor things I noticed.
Floating point numbers are prone to rounding errors (try python3 -c "print(0.1 + 0.2)"
in your terminal). We make an effort to store currency amounts as integers where possible.
The types at
Line 48 in 08b72c2
and
Line 51 in 08b72c2
should be changed to int64
s.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.