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

Add tx broadcast gRPC endpoint #7852

Merged
merged 40 commits into from
Dec 2, 2020
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
4d22fdf
WIP tx/broadcast grpc endpoint
aleem1314 Nov 9, 2020
6674921
fix lint
aleem1314 Nov 9, 2020
6134a9b
fix proto lint
aleem1314 Nov 9, 2020
0f09eb9
Merge branch 'master' of https://github.com/cosmos/cosmos-sdk into 73…
aleem1314 Nov 9, 2020
437b1bf
Merge branch 'master' of https://github.com/cosmos/cosmos-sdk into 73…
aleem1314 Nov 11, 2020
4871d32
Update service.proto
aleem1314 Nov 12, 2020
ccf6f0c
Merge branch 'master' of https://github.com/cosmos/cosmos-sdk into 73…
aleem1314 Nov 12, 2020
d65d3ee
Merge branch 'master' of https://github.com/cosmos/cosmos-sdk into 73…
aleem1314 Nov 12, 2020
abc49b8
resolve conflicts
aleem1314 Nov 12, 2020
05f6282
update service.proto
aleem1314 Nov 16, 2020
a0e5111
Update service.proto
aleem1314 Nov 16, 2020
dc8e1f3
Merge branch 'master' of https://github.com/cosmos/cosmos-sdk into 73…
aleem1314 Nov 16, 2020
c1d323e
review changes
aleem1314 Nov 18, 2020
1401b00
Merge branch 'master' of https://github.com/cosmos/cosmos-sdk into 73…
aleem1314 Nov 18, 2020
3ed9110
proto lint
aleem1314 Nov 18, 2020
75d7f8b
Merge branch 'master' into 7355-grpc-broadcast
aleem1314 Nov 23, 2020
c7031a6
Merge branch 'master' into 7355-grpc-broadcast
aleem1314 Nov 27, 2020
24030a4
Merge branch 'master' of ssh://github.com/cosmos/cosmos-sdk into 7355…
amaury1093 Nov 27, 2020
846946f
Merge branch 'master' of ssh://github.com/cosmos/cosmos-sdk into 7355…
amaury1093 Nov 30, 2020
52a9860
Switch to txraw
amaury1093 Nov 30, 2020
152022e
Add check breaking at the end
amaury1093 Nov 30, 2020
6e2c50d
Fix broadcast
amaury1093 Nov 30, 2020
c70daf7
Merge branch 'master' of ssh://github.com/cosmos/cosmos-sdk into 7355…
amaury1093 Nov 30, 2020
d2ec8f9
Send Msg on SetupSuite
amaury1093 Nov 30, 2020
4b323c4
Remove proto-check-breaking
amaury1093 Nov 30, 2020
48b8e4c
1 validator in test
amaury1093 Nov 30, 2020
41039b0
Add grpc server tests for broadcast
amaury1093 Nov 30, 2020
ce8f657
Fix grpc server tests
amaury1093 Nov 30, 2020
04cdc23
Merge branch 'master' into 7355-grpc-broadcast
amaury1093 Nov 30, 2020
4fb6f7f
Add some changes
amaury1093 Dec 1, 2020
d5152d8
Merge branch 'master' of ssh://github.com/cosmos/cosmos-sdk into 7355…
amaury1093 Dec 1, 2020
e2c75f1
Add ress comments
amaury1093 Dec 1, 2020
aade13d
Add table tests for tx service
amaury1093 Dec 1, 2020
00683e5
Add test for mode
amaury1093 Dec 1, 2020
b37c04c
Add simulate tests
amaury1093 Dec 1, 2020
8803107
Add build flag back
amaury1093 Dec 1, 2020
57cc0e8
Revert custom stringer for enum
amaury1093 Dec 2, 2020
3113060
Remove stray logs
amaury1093 Dec 2, 2020
64d4719
Merge branch 'master' into 7355-grpc-broadcast
alexanderbez Dec 2, 2020
7c3ad41
Use /txs/{hash}
amaury1093 Dec 2, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 50 additions & 13 deletions proto/cosmos/tx/v1beta1/service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,29 @@ package cosmos.tx.v1beta1;
import "google/api/annotations.proto";
import "cosmos/base/abci/v1beta1/abci.proto";
import "cosmos/tx/v1beta1/tx.proto";
import "gogoproto/gogo.proto";
import "cosmos/base/query/v1beta1/pagination.proto";

option go_package = "github.com/cosmos/cosmos-sdk/types/tx";

// Service defines a gRPC service for interacting with transactions.
service Service {
// Simulate simulates executing a transaction for estimating gas usage.
rpc Simulate(SimulateRequest) returns (SimulateResponse) {
option (google.api.http).post = "/cosmos/tx/v1beta1/simulate";
}
// GetTx fetches a tx by hash.
rpc GetTx(GetTxRequest) returns (GetTxResponse) {
option (google.api.http).get = "/cosmos/tx/v1beta1/tx/{hash}";
}

// GetTxsEvent fetches txs by event.
rpc GetTxsEvent(GetTxsEventRequest) returns (GetTxsEventResponse) {
option (google.api.http).get = "/cosmos/tx/v1beta1/txs";
}
// Simulate simulates executing a transaction for estimating gas usage.
rpc Simulate(SimulateRequest) returns (SimulateResponse) {
option (google.api.http).post = "/cosmos/tx/v1beta1/simulate";
}
// GetTx fetches a tx by hash.
rpc GetTx(GetTxRequest) returns (GetTxResponse) {
option (google.api.http).get = "/cosmos/tx/v1beta1/tx/{hash}";
}
// BroadcastTx broadcast transaction.
rpc BroadcastTx(BroadcastTxRequest) returns (BroadcastTxResponse) {
option (google.api.http).post = "/cosmos/tx/v1beta1/txs";
}
// GetTxsEvent fetches txs by event.
rpc GetTxsEvent(GetTxsEventRequest) returns (GetTxsEventResponse) {
option (google.api.http).get = "/cosmos/tx/v1beta1/txs";
}
}

// GetTxsEventRequest is the request type for the Service.TxsByEvents
Expand All @@ -45,6 +49,39 @@ message GetTxsEventResponse {
cosmos.base.query.v1beta1.PageResponse pagination = 3;
}

// BroadcastTxRequest is the request type for the Service.BroadcastTxRequest
// RPC method.
message BroadcastTxRequest {
// tx is the list of queried transactions.
bytes tx = 1;
aleem1314 marked this conversation as resolved.
Show resolved Hide resolved
BroadcastMode mode = 2;
}

// BroadcastMode specifies the broadcast mode for the TxService.Broadcast RPC method.
enum BroadcastMode {
// zero-value for mode ordering
BROADCAST_MODE_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "none"];
// BROADCAST_MODE_BLOCK defines a tx broadcasting mode where the client waits for
// the tx to be committed in a block.
BROADCAST_MODE_BLOCK = 1 [(gogoproto.enumvalue_customname) = "block"];
// BROADCAST_MODE_SYNC defines a tx broadcasting mode where the client waits for
// a CheckTx execution response only.
BROADCAST_MODE_SYNC = 2 [(gogoproto.enumvalue_customname) = "sync"];
// BROADCAST_MODE_ASYNC defines a tx broadcasting mode where the client returns
// immediately.
BROADCAST_MODE_ASYNC = 3 [(gogoproto.enumvalue_customname) = "async"];
}

// BroadcastTxResponse is the response type for the
// Service.BroadcastTx method.
message BroadcastTxResponse {
// tx is the queried transaction.
cosmos.tx.v1beta1.Tx tx = 1;
// tx_response is the queried TxResponses.
cosmos.base.abci.v1beta1.TxResponse tx_response = 2;
}


// SimulateRequest is the request type for the Service.Simulate
// RPC method.
message SimulateRequest {
Expand Down
Loading