Add subscribe/unsubscribe RPCs. Add session, sessionManager, and serve JSON RPC (without HTTP). #66
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#66
Loading…
Reference in a new issue
No description provided.
Delete branch "blockchain_rpc2"
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?
Fixes #63
I've added a new argument
--json-rpc-http-port
which will get you the original gorilla/rpc server started on the specified port. Gorilla/rpc serves JSONRPC in the body of HTTP POST. The pure JSON server (TCP without HTTP) listens on port 50001 by default.I've been manually testing with netcat (nc) like this:
This is one of the biggest obstacles to limiting the number of go-routines. I have to call
ServeCodec()
in a new go-routine in order to allow more than one session at a time, and I don't know how to control/track this routine.This looks like an infinite for that only triggers if JSONRPCPort != 0, and then breaks unconditionally? Wouldn't an if statement do the same and be less awkward?
Same thing here, is this for needed?
I found that
break
only works insidefor
. That's the reason. I wanted to bail out of the block of code setting up the pure JSON server if anything failed so that it would continue on and set up the alternate HTTP-based server.Testing showed a problem with how I compute hashX values for addresses. Either the DB produced by python scribe does not contain anything for HashXStatus, or I'm not computing hashX key the exact same way as python.
Otherwise ready for review.
Got it!
1eb645a0b9
The HashXStatus, HashXMempoolStatus tables are not populated unless scribe
--index_address_statuses
option was used.@ -269,0 +283,4 @@
Prefix: []byte{prefixes.HashXStatus},
HashX: hashX,
}
rawKey := key.PackKey()
@jackrobison Can you confirm that the lookup should go to HashXMempoolStatus first, return if found, then go to HashXStatus?
Interesting way to keep this running forever, I think it spawns a new goroutine every time, it might be better to just use this in an intfinite loop with a sleep, and maybe parametarize the polling time?
@ -269,0 +283,4 @@
Prefix: []byte{prefixes.HashXStatus},
HashX: hashX,
}
rawKey := key.PackKey()
Resolved at meeting.
Using Ticker object now. The Ticker.Reset() method can be used in unit tests to adjust frequency up/down.