-
Notifications
You must be signed in to change notification settings - Fork 60
single-connection GetSubscription flow #951
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
Merged
Merged
Changes from 8 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
3ffd3b5
add single-connection GetSubscription flow and UpdateSubscriptionScri…
bitcoin-coder-bob f5d0807
lint fix
bitcoin-coder-bob fb8b4e7
add single-connection subscription support to indexer gRPC client and…
bitcoin-coder-bob f725895
proto comment for scripts field
bitcoin-coder-bob c415a5f
fix subscription HTTP binding, permissions, error handling, client cl…
bitcoin-coder-bob ceaecd7
remove script len check
bitcoin-coder-bob 937f4a9
remove script validation, test against it
bitcoin-coder-bob c548079
make modify subscription scripts atomic by validating all inputs befo…
bitcoin-coder-bob 5d28cb7
Merge branch 'master' into bob/stream-single-connection
bitcoin-coder-bob d2c6527
Merge remote-tracking branch 'origin/master' into bob/stream-single-c…
bitcoin-coder-bob b2d81b7
Removed scripts cache per commented request
bitcoin-coder-bob 6232c5b
Merge remote-tracking branch 'origin/master' into bob/stream-single-c…
bitcoin-coder-bob b9d7896
Merge master into bob/stream-single-connection
bitcoin-coder-bob 7e30bba
merge master into bob/stream-single-connection
bitcoin-coder-bob 8376755
Merge master into bob/stream-single-connection
bitcoin-coder-bob d8d6250
Merge master into bob/stream-single-connection
bitcoin-coder-bob 442e92a
generalize UpdateSubscription RPC with pluggable filters
bitcoin-coder-bob c39614d
revert pkg/client-lib changes; moved to bob/client-lib-stream-changes
bitcoin-coder-bob 23e30c4
use SubscriptionFilter for initial GetSubscription input
bitcoin-coder-bob 36b9509
Update rest paths
altafan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -127,6 +127,25 @@ service IndexerService { | |||||
| disable_chunked_transfer: true | ||||||
| disable_websockets: true | ||||||
| } | ||||||
| additional_bindings: [ | ||||||
| { | ||||||
| get: "/v1/indexer/script/subscription" | ||||||
| stream: { | ||||||
| disable_chunked_transfer: true | ||||||
| disable_websockets: true | ||||||
| } | ||||||
| } | ||||||
| ] | ||||||
| }; | ||||||
| }; | ||||||
|
|
||||||
| // UpdateSubscriptionScripts allows to modify the scripts of an existing subscription | ||||||
| // created via GetSubscription. | ||||||
| rpc UpdateSubscriptionScripts(UpdateSubscriptionScriptsRequest) | ||||||
| returns (UpdateSubscriptionScriptsResponse) { | ||||||
| option (meshapi.gateway.http) = { | ||||||
| post: "/v1/indexer/script/updateScripts" | ||||||
| body: "*" | ||||||
| }; | ||||||
| }; | ||||||
| } | ||||||
|
|
@@ -354,16 +373,48 @@ message UnsubscribeForScriptsResponse {} | |||||
|
|
||||||
|
|
||||||
| message GetSubscriptionRequest { | ||||||
| // If empty, server creates a new subscription automatically. | ||||||
| string subscription_id = 1; | ||||||
| // Optional: scripts to subscribe to on stream creation. | ||||||
| // Only used when subscription_id is empty; ignored otherwise. | ||||||
| repeated string scripts = 2; | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done in 23e30c4 |
||||||
| } | ||||||
|
|
||||||
| message GetSubscriptionResponse { | ||||||
| oneof data { | ||||||
| IndexerHeartbeat heartbeat = 1; | ||||||
| IndexerSubscriptionEvent event = 2; | ||||||
| SubscriptionStartedEvent subscription_started = 3; | ||||||
| } | ||||||
| } | ||||||
|
|
||||||
| message SubscriptionStartedEvent { | ||||||
| string subscription_id = 1; | ||||||
| } | ||||||
|
|
||||||
| message ModifyScripts { | ||||||
| repeated string add_scripts = 1; | ||||||
| repeated string remove_scripts = 2; | ||||||
| } | ||||||
|
|
||||||
| message OverwriteScripts { | ||||||
| repeated string scripts = 1; | ||||||
| } | ||||||
|
|
||||||
| message UpdateSubscriptionScriptsRequest { | ||||||
| string subscription_id = 1; | ||||||
| oneof scripts_change { | ||||||
| ModifyScripts modify = 2; | ||||||
| OverwriteScripts overwrite = 3; | ||||||
| } | ||||||
| } | ||||||
|
|
||||||
| message UpdateSubscriptionScriptsResponse { | ||||||
| repeated string scripts_added = 1; | ||||||
| repeated string scripts_removed = 2; | ||||||
| repeated string all_scripts = 3; | ||||||
| } | ||||||
|
|
||||||
| message IndexerTxData { | ||||||
| string txid = 1; | ||||||
| string tx = 2; | ||||||
|
|
||||||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.