2021-02-13 07:41:47 +00:00
|
|
|
syntax = "proto3";
|
|
|
|
|
|
|
|
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_control;
|
|
|
|
|
2021-04-15 08:58:26 +00:00
|
|
|
option go_package = "./txpool;txpool";
|
|
|
|
|
2021-02-13 07:41:47 +00:00
|
|
|
message AccountInfoRequest {
|
2021-03-19 21:24:49 +00:00
|
|
|
types.H256 block_hash = 1;
|
|
|
|
types.H160 account = 2;
|
2021-02-13 07:41:47 +00:00
|
|
|
}
|
2021-03-19 21:24:49 +00:00
|
|
|
|
2021-02-13 07:41:47 +00:00
|
|
|
message AccountInfoReply {
|
2021-03-19 21:24:49 +00:00
|
|
|
types.H256 balance = 1;
|
|
|
|
uint64 nonce = 2;
|
2021-02-13 07:41:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message BlockStreamRequest {
|
|
|
|
oneof start_with {
|
|
|
|
google.protobuf.Empty latest = 1;
|
2021-03-19 21:24:49 +00:00
|
|
|
types.H256 block_hash = 2;
|
2021-02-13 07:41:47 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
message AccountInfo {
|
2021-03-19 21:24:49 +00:00
|
|
|
types.H160 address = 1;
|
|
|
|
types.H256 balance = 2;
|
|
|
|
uint64 nonce = 3;
|
2021-02-13 07:41:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message AppliedBlock {
|
2021-03-19 21:24:49 +00:00
|
|
|
types.H256 hash = 1;
|
|
|
|
types.H256 parent_hash = 2;
|
|
|
|
repeated AccountInfo changed_accounts = 3;
|
2021-02-13 07:41:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message RevertedBlock {
|
2021-03-19 21:24:49 +00:00
|
|
|
types.H256 reverted_hash = 1;
|
2021-02-13 07:41:47 +00:00
|
|
|
repeated bytes reverted_transactions = 2;
|
2021-03-19 21:24:49 +00:00
|
|
|
types.H256 new_hash = 3;
|
|
|
|
types.H256 new_parent = 4;
|
|
|
|
repeated AccountInfo reverted_accounts = 5;
|
2021-02-13 07:41:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message BlockDiff {
|
|
|
|
oneof diff {
|
|
|
|
AppliedBlock applied = 1;
|
|
|
|
RevertedBlock reverted = 2;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
service TxpoolControl {
|
2021-03-19 21:24:49 +00:00
|
|
|
rpc AccountInfo(AccountInfoRequest) returns (AccountInfoReply);
|
|
|
|
rpc BlockStream(BlockStreamRequest) returns (stream BlockDiff);
|
2021-02-13 07:41:47 +00:00
|
|
|
}
|