Add some blockchain RPC handlers and DB fetching routines #55
No reviewers
Labels
No labels
consider soon
documentation
good first issue
hacktoberfest
help wanted
priority: blocker
priority: high
priority: low
priority: medium
type: bug
type: discussion
type: improvement
type: new feature
type: refactor
type: task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: LBRYCommunity/herald.go#55
Loading…
Reference in a new issue
No description provided.
Delete branch "blockchain_rpc1"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Mempool transactions fetching is not implemented yet.
Fixes #52
Now integrated with basic gorilla/rpc support.
Tests are currently based on a snapshot of mainnet at height 599529. I just picked out a couple of addresses I saw in the block explorer. Still looking for a better way to get test data. The regression tests in lbry-sdk cleanup after every test if I am not mistaken, so it's not so easy to get a sizable test data set.
More or less ready for review. Need to see whether the gorilla/rpc integration works (does the right method get called, etc).
Here are some manual tests showing the RPC handlers are registered & called:
It's on the way to being compatible with (python) herald, but I have seen some squirrelly behavior with how errors are emitted, and how params are handled:
It's supposed to be possible to specify params as an object/dict in jsonrpc v2. But the only thing I can get to work is:
[<json_val>]
or
[{"field1": <json_val>, "field2": <json_val>, ...}]
Also, extra params are ignored:
see comments
Are these tests not running in the ci? This isn't going to work when run in the ci.
So I checked out your branch and ran the tests, it all passes, but it skips these tests because the DB isn't there.
let's get figure out a way to get some test data in there, or at least download it or something so we can run those tests, and then this looks good.
I have a technique to get test data from lbry-sdk test "test_variety_of_transactions_and_longish_history".
I'm waiting for the EffectiveAmount & RepostedCount to be stabilized. Then I will regenerate from that version of scribe.
Added sample data from lbry-sdk integration test. Reworked tests to match.
spv17 is down (for upgrade?), so I added a Skip if the ping fails: