2021-02-13 07:41:47 +00:00
|
|
|
syntax = "proto3";
|
|
|
|
|
2021-05-22 10:00:13 +00:00
|
|
|
import "google/protobuf/empty.proto";
|
2021-03-19 21:24:49 +00:00
|
|
|
import "types/types.proto";
|
2021-02-13 07:41:47 +00:00
|
|
|
|
|
|
|
package txpool;
|
|
|
|
|
2021-04-15 08:58:26 +00:00
|
|
|
option go_package = "./txpool;txpool";
|
|
|
|
|
2021-03-19 21:24:49 +00:00
|
|
|
message TxHashes { repeated types.H256 hashes = 1; }
|
2021-02-13 07:41:47 +00:00
|
|
|
|
2021-05-04 01:37:17 +00:00
|
|
|
message AddRequest { repeated bytes rlpTxs = 1; }
|
2021-02-13 07:41:47 +00:00
|
|
|
|
|
|
|
enum ImportResult {
|
2021-03-19 21:24:49 +00:00
|
|
|
SUCCESS = 0;
|
|
|
|
ALREADY_EXISTS = 1;
|
|
|
|
FEE_TOO_LOW = 2;
|
|
|
|
STALE = 3;
|
|
|
|
INVALID = 4;
|
2021-02-13 07:41:47 +00:00
|
|
|
INTERNAL_ERROR = 5;
|
|
|
|
}
|
|
|
|
|
2021-05-04 01:37:17 +00:00
|
|
|
message AddReply { repeated ImportResult imported = 1; repeated string errors = 2; }
|
2021-02-13 07:41:47 +00:00
|
|
|
|
2021-05-04 01:37:17 +00:00
|
|
|
message TransactionsRequest { repeated types.H256 hashes = 1; }
|
|
|
|
message TransactionsReply { repeated bytes rlpTxs = 1; }
|
|
|
|
|
|
|
|
message OnAddRequest {}
|
|
|
|
message OnAddReply {
|
|
|
|
repeated bytes rplTxs = 1;
|
|
|
|
}
|
2021-02-13 07:41:47 +00:00
|
|
|
|
|
|
|
service Txpool {
|
2021-05-22 10:00:13 +00:00
|
|
|
// Version returns the service version number
|
|
|
|
rpc Version(google.protobuf.Empty) returns (types.VersionReply);
|
2021-04-24 15:46:29 +00:00
|
|
|
// preserves incoming order, changes amount, unknown hashes will be omitted
|
2021-05-04 01:37:17 +00:00
|
|
|
rpc FindUnknown(TxHashes) returns (TxHashes);
|
|
|
|
// Expecting signed transactions. Preserves incoming order and amount
|
|
|
|
// Adding txs as local (use P2P to add remote txs)
|
|
|
|
rpc Add(AddRequest) returns (AddReply);
|
2021-04-24 15:46:29 +00:00
|
|
|
// preserves incoming order and amount, if some transaction doesn't exists in pool - returns nil in this slot
|
2021-05-04 01:37:17 +00:00
|
|
|
rpc Transactions(TransactionsRequest) returns (TransactionsReply);
|
|
|
|
// subscribe to new transactions add event
|
|
|
|
rpc OnAdd(OnAddRequest) returns (stream OnAddReply);
|
2021-02-13 07:41:47 +00:00
|
|
|
}
|