Commit 0e1b3898 authored by Ubuntu's avatar Ubuntu

update proto

parent 6322ca8e
...@@ -7,4 +7,4 @@ directories: ...@@ -7,4 +7,4 @@ directories:
- p2papi - p2papi
- ringapi - ringapi
- sentryapi - sentryapi
- txcheckerapi #- txcheckerapi
\ No newline at end of file \ No newline at end of file
节点用到的主要是 recover from , 验签失败,from返回的空地址 00000000
\ No newline at end of file
syntax = "proto3";
package ethrpc.v1;
import "google/protobuf/field_mask.proto";
import "google/protobuf/timestamp.proto";
import "ethrpc/v1/resource.proto";
message NodeVersionRequest { }
message NodeVersionResponse {
bytes version = 1;
}
message Sha3Request {
// data need to caculate sha3.
bytes data = 1;
}
message Sha3Response {
//
bytes hash = 1;
}
message NetVersionRequest { }
message NetVersionResponse {
bytes version = 1;
}
message NetPeerCountRequest { }
message NetPeerCountResponse {
uint32 peer_count = 1;
}
message ProtocolVersionRequest { }
message ProtocolVersionResponse {
bytes version = 1;
}
message SyncingRequest { }
message SyncingResponse {
bytes start = 1;
bytes end = 2;
bytes current = 3;
}
message CoinbaseRequest { }
message CoinbaseResponse {
bytes address = 1;
}
message MiningRequest { }
message MiningResponse {
string status = 1;
}
message HashRateRequest { }
message HashRateResponse {
string result = 1;
}
message GasPriceRequest { }
message GasPriceResponse {
// gas price in wei.
bytes gas_price = 1;
}
message AccountsRequest { }
message AccountsResponse {
repeated bytes address = 1;
}
message HeightRequest { }
message HeightResponse {
bytes height = 1;
}
message BalanceRequest {
// request address
bytes address = 1;
// request block number
bytes block_id = 2;
}
message BalanceResponse {
// the address
bytes address = 1;
// block height
bytes block_id = 2;
// balance
bytes balance = 3;
}
message StorageRequest {
bytes address = 1;
bytes block_id = 2;
bytes position = 3;
}
message StorageResponse {
bytes address = 1;
bytes block_id = 2;
bytes position = 3;
bytes data = 4;
}
message NonceRequest {
// request address
bytes address = 1;
// request block number
bytes block_id = 2;
}
message NonceResponse {
// the address
bytes address = 1;
// block height
bytes block_id = 2;
// nonce
bytes nonce = 3;
}
message RepeatedNonceRequest {
// request address
repeated bytes address = 1;
// request block number
repeated bytes block_id = 2;
}
message RepeatedNonceResponse {
// the address
repeated bytes address = 1;
// block height
repeated bytes block_id = 2;
// nonce
repeated bytes nonce = 3;
}
message TransactionCountRequest {
// request address
bytes address = 1;
// request block number
bytes block_id = 2;
}
message TransactionCountResponse {
// the address
bytes address = 1;
// block height
bytes block_id = 2;
// count
bytes count = 3;
}
message BlockTransactionCountByHashRequest {
bytes block_hash = 1;
}
message BlockTransactionCountByHashResponse {
bytes block_hash = 1;
uint32 count = 2;
}
message BlockTransactionCountByNumberRequest {
bytes block_id = 1;
}
message BlockTransactionCountByNumberResponse {
bytes block_id = 1;
uint32 count = 2;
}
message UncleCountByHashRequest {
bytes block_hash = 1;
}
message UncleCountByHashResponse {
bytes block_hash = 1;
uint32 count = 2;
}
message UncleCountByNumberRequest {
bytes block_id = 1;
}
message UncleCountByNumberResponse {
bytes block_id = 1;
uint32 count = 2;
}
message GetCodeRequest {
bytes address = 1;
bytes block_id = 2;
}
message GetCodeResponse {
bytes address = 1;
bytes block_id = 2;
bytes code = 3;
}
message SignRequest {
bytes address = 1;
bytes data = 2;
}
message SignResponse {
bytes signature = 1;
}
message SignTransactionRequest {
bytes address = 1;
bytes tx_data = 2;
bytes method = 3;
}
message SignTransactionResponse {
bytes signed_tx = 1;
}
message SendTransactionRequest {
bytes address = 1;
bytes tx_data = 2;
}
message SendTransactionResponse {
bytes tx_hash = 1;
}
message SendRawTransactionRequest {
bytes signed_tx = 1;
}
message SendRawTransactionResponse {
bytes tx_hash = 1;
}
message CallRequest {
bytes signed_tx = 1;
}
message CallResponse {
bytes result = 1;
}
message EstimateGasRequest {
bytes signed_tx = 1;
}
message EstimateGasResponse {
bytes result = 1;
uint32 gas = 2;
}
message BlockByHashRequest {
bytes block_hash = 1;
}
message BlockByHashResponse {
bytes block = 1;
}
message BlockByNumberRequest {
bytes block_id = 1;
}
message BlockByNumberResponse {
bytes block = 1;
}
message TransactionByHashRequest {
bytes tx_hash = 1;
}
message TransactionByHashResponse {
bytes tx_data = 1;
}
message TransactionByBlockHashAndIndexRequest {
bytes block_hash = 1;
uint32 index = 2;
}
message TransactionByBlockHashAndIndexResponse {
bytes tx_data = 1;
}
message TransactionByBlockNumberAndIndexRequest {
bytes block_id = 1;
uint32 index = 2;
}
message TransactionByBlockNumberAndIndexResponse {
bytes tx_data = 1;
}
message TransactionReceiptRequest {
bytes tx_hash = 1;
}
message TransactionReceiptResponse {
bytes tx_receipt = 1;
}
message UncleByBlockHashAndIndexRequest {
bytes block_hash = 1;
uint32 index = 2;
}
message UncleByBlockHashAndIndexResponse {
bytes uncle_block = 1;
}
message UncleByBlockNumberAndIndexRequest {
bytes block_id = 1;
uint32 index = 2;
}
message UncleByBlockNumberAndIndexResponse {
bytes uncle_block = 1;
}
message CompilersRequest {
}
message CompilersResponse {
bytes compilers = 1;
}
message CompileSolidityRequest {
bytes source = 1;
}
message CompileSolidityResponse {
bytes code = 1;
}
message CompileLLLRequest {
bytes source = 1;
}
message CompileLLLResponse {
bytes code = 1;
}
message CompileSerpentRequest {
bytes source = 1;
}
message CompileSerpentResponse {
bytes code = 1;
}
message NewFilterRequest {
bytes param = 1;
}
message NewFilterResponse {
bytes filter_id = 1;
}
message NewBlockFilterRequest { }
message NewBlockFilterResponse {
bytes filter_id = 1;
}
message PendingTransactionFilterRequest { }
message PendingTransactionFilterResponse {
bytes filter_id = 1;
}
message UninstallFilterRequest {
bytes filter_id = 1;
}
message UninstallFilterResponse {
bool result = 1;
}
message FilterChangesRequest {
bytes filter_id = 1;
}
message FilterChangesResponse {
bytes info = 1;
}
message FilterLogsRequest {
bytes filter_id = 1;
}
message FilterLogsResponse {
bytes logs = 1;
}
message LogsRequest {
bytes param = 1;
}
message LogsResponse {
bytes logs = 1;
}
\ No newline at end of file
syntax = "proto3";
package ethrpc.v1;
//option go_package = "protoeth";
import "google/protobuf/empty.proto";
// GetAccounts only for ganache
message GetAccountsReq {}
message TestnetReq {
uint32 id = 1;
}
message HashStringOrNumber {
string reqString = 1;
uint64 reqNum = 2;
}
message InfoWithIndex {
HashStringOrNumber req = 1;
uint64 index = 2;
}
message CountResp {
uint64 count = 1;
}
message ObjResp {
string respObj = 1;
}
message GetAccountsResp {
repeated string accounts = 1;
}
// GetBalance -> eth.getBalance -> eth_getBalance
message GetBalanceReq {
repeated string address = 1;
}
message GetBalanceResp {
repeated string balance = 1;
}
// GetNonce -> eth.GetNonce -> GetNonce
message GetNonceReq {
repeated string address = 1;
}
message GetNonceResp {
repeated string balance = 1;
}
message CreateRawTransactionReq {
string to = 1;
string data = 2;
uint32 gas = 3;
uint32 value = 4;
}
message CreateRawTransactionResp {
string rawTX = 1;
}
message DeploySignedTransactionReq{
string signedTX = 1;
}
message DeploySignedTransactionResp {
string txReciept = 1;
}
// GetTransaction -> Eth.getTransaction -> eth_getTransactionByHAsh
message TxHash {
string txhash = 1;
}
message TransactionInfo {
string transaction = 1;
}
message TxReceipt {
string txReceipt = 1;
}
message RawTxRequest {
uint32 networkid = 1;
string tx = 2;
}
message BlockNumber {
uint64 blocknum = 1;
}
message TxResponse {
string txData = 1;
}
message NumResult {
uint64 resultNum = 1;
}
message GetTxReq {
uint32 networkid = 1;
string txhash = 2;
}
message CallRequest {
uint32 networkid = 1;
string fn = 2;
string params = 3;
string abi = 4;
string address = 5;
string fromAddress = 6; // python will not allow .from so it has to be fromAddress
uint64 value = 7;
uint64 gasSupply = 8;
}
message CallResponse {
string result = 1;
}
service ProtoEthService {
rpc GetBalance(GetBalanceReq) returns (GetBalanceResp) {};
rpc GetNonce(GetNonceReq) returns (GetNonceResp) {};
rpc GetTransaction(GetTxReq) returns (TransactionInfo) {};
rpc GetTransactionReceipt(TxHash) returns (TxReceipt) {};
rpc ContractCall(CallRequest) returns (CallResponse) {};
rpc GetHashrate(google.protobuf.Empty) returns (NumResult) {};
rpc GetGasPrice(google.protobuf.Empty) returns (NumResult) {};
rpc GetBlockNumber(google.protobuf.Empty) returns (BlockNumber) {};
rpc GetBlockTransactionCount(HashStringOrNumber) returns (CountResp) {};
rpc GetBlock(HashStringOrNumber) returns (ObjResp) {};
rpc GetTransactionFromBlock(InfoWithIndex) returns (ObjResp) {};
// eth_sendRawTransaction should have simple requests but stream of responses
rpc SendRawTransactions(RawTxRequest) returns (TxResponse) {};
}
// ##############################
// ## 1. create protocol buffer for sendTransaction
// ## this protobuf should return a stream. Once the transaction is successful, stream will return confirmations
// ## 2. split functions in multiple subs exmp - eth, personal, debug
// ##############################
syntax = "proto3";
package ethrpc.v1;
import "google/protobuf/field_mask.proto";
import "google/protobuf/timestamp.proto";
import "ethrpc/v1/resource.proto";
syntax = "proto3";
package ethrpc.v1;
import "base/v1/resource.proto";
message Tx {
base.v1.Address address = 1;
base.v1.Hash hash = 2;
}
\ No newline at end of file
syntax = "proto3";
package ethrpc.v1;
import "google/protobuf/empty.proto";
import "ethrpc/v1/request_response.proto";
import "ethrpc/v1/account_req_res.proto";
service NebulaService {
// web3
rpc Sha3(Sha3Request) returns (Sha3Response) {};
rpc NodeVersion(google.protobuf.Empty) returns (NodeVersionResponse) {};
// network info service
rpc NetVersion(google.protobuf.Empty) returns (NetVersionResponse) {};
rpc NetPeerCount(google.protobuf.Empty) returns (NetPeerCountResponse) {};
// node status
rpc ProtocolVersion(google.protobuf.Empty) returns (ProtocolVersionResponse) {};
rpc Syncing(google.protobuf.Empty) returns (SyncingResponse) {};
rpc Coinbase(google.protobuf.Empty) returns (CoinbaseResponse) {};
rpc Mining(google.protobuf.Empty) returns (MiningResponse) {};
rpc HashRate(google.protobuf.Empty) returns (HashRateResponse) {};
rpc Accounts(google.protobuf.Empty) returns (AccountsResponse) {};
// tx operatoration
rpc GasPrice(google.protobuf.Empty) returns (GasPriceResponse) {};
// block info service
rpc BlockNumber(google.protobuf.Empty) returns (HeightResponse) {};
rpc BlockByHash(BlockByHashRequest) returns (BlockByHashResponse) {};
rpc BlockByNumber(BlockByNumberRequest) returns (BlockByNumberResponse) {};
rpc BlockTransactionCountByHash(BlockTransactionCountByHashRequest) returns (BlockTransactionCountByHashResponse) {};
rpc BlockTransactionCountByNumber(BlockTransactionCountByNumberRequest) returns (BlockTransactionCountByNumberResponse) {};
rpc UncleCountByHash(UncleCountByHashRequest) returns (UncleCountByHashResponse) {};
rpc UncleCountByNumber(UncleCountByNumberRequest) returns (UncleCountByNumberResponse) {};
rpc UncleByBlockHashAndIndex(UncleByBlockHashAndIndexRequest) returns (UncleByBlockHashAndIndexResponse) {};
rpc UncleByBlockNumberAndIndex(UncleByBlockNumberAndIndexRequest) returns (UncleByBlockNumberAndIndexResponse) {};
// compiler
rpc Compilers(CompilersRequest) returns (CompilersResponse) {};
rpc CompileSolidity(CompileSolidityRequest) returns (CompileSolidityResponse) {};
rpc CompileLLL(CompileLLLRequest) returns (CompileLLLResponse) {};
rpc CompileSerpent(CompileSerpentRequest) returns (CompileSerpentResponse) {};
// transaction info service
rpc EstimateGas(EstimateGasRequest) returns (EstimateGasResponse) {};
rpc TransactionByHash(TransactionByHashRequest) returns (TransactionByHashResponse) {};
rpc TransactionByBlockHashAndIndex(TransactionByBlockHashAndIndexRequest) returns (TransactionByBlockHashAndIndexResponse) {};
rpc TransactionByBlockNumberAndIndex(TransactionByBlockNumberAndIndexRequest) returns (TransactionByBlockNumberAndIndexResponse) {};
rpc TransactionReceipt(TransactionReceiptRequest) returns (TransactionReceiptResponse) {};
// account info service
rpc Balance(BalanceRequest) returns (BalanceResponse) {};
rpc Storage(StorageRequest) returns (StorageResponse) {};
rpc Nonce(NonceRequest) returns (NonceResponse) {};
rpc RepeatedNonce(RepeatedNonceRequest) returns (RepeatedNonceResponse) {};
rpc TransactionCount(TransactionCountRequest) returns (TransactionCountResponse) {};
rpc GetCode(GetCodeRequest) returns (GetCodeResponse) {};
rpc Sign(SignRequest) returns (SignResponse) {};
rpc SignTransaction(SignTransactionRequest) returns (SignTransactionResponse) {};
rpc SendTransaction(SendTransactionRequest) returns (SendTransactionResponse) {};
rpc SendRawTransaction(SendRawTransactionRequest) returns (SendRawTransactionResponse) {};
rpc Call(CallRequest) returns (CallResponse) {};
// filter
rpc NewFilter(NewFilterRequest) returns (NewFilterResponse) {};
rpc NewBlockFilter(google.protobuf.Empty) returns (NewBlockFilterResponse) {};
rpc PendingTransactionFilter(google.protobuf.Empty) returns (PendingTransactionFilterResponse) {};
rpc UninstallFilter(UninstallFilterRequest) returns (UninstallFilterResponse) {};
rpc FilterChanges(FilterChangesRequest) returns (FilterChangesResponse) {};
rpc FilterLogs(FilterLogsRequest) returns (FilterLogsResponse) {};
rpc Logs(LogsRequest) returns (LogsResponse) {};
// consensus info service
}
\ No newline at end of file
### 对外的接口
1. 对外封装 grpc接口;
2. 转json rpc 到对应的各个模块的 grpc接口(引用对应模块的grpc)。
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.28.1
// protoc (unknown)
// source: ethrpc/v1/request_response.proto
package ethrpcv1
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
_ "google.golang.org/protobuf/types/known/fieldmaskpb"
_ "google.golang.org/protobuf/types/known/timestamppb"
reflect "reflect"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
var File_ethrpc_v1_request_response_proto protoreflect.FileDescriptor
var file_ethrpc_v1_request_response_proto_rawDesc = []byte{
0x0a, 0x20, 0x65, 0x74, 0x68, 0x72, 0x70, 0x63, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x12, 0x09, 0x65, 0x74, 0x68, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x1a, 0x20, 0x67,
0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x66,
0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a,
0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,
0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x1a, 0x18, 0x65, 0x74, 0x68, 0x72, 0x70, 0x63, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x65, 0x73, 0x6f,
0x75, 0x72, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x42, 0xbd, 0x01, 0x0a, 0x0d, 0x63,
0x6f, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x42, 0x14, 0x52, 0x65,
0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x50, 0x72, 0x6f,
0x74, 0x6f, 0x50, 0x01, 0x5a, 0x51, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d,
0x2f, 0x43, 0x61, 0x64, 0x75, 0x63, 0x65, 0x75, 0x73, 0x4d, 0x65, 0x74, 0x61, 0x76, 0x65, 0x72,
0x73, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x6d, 0x65, 0x74, 0x61, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x2f, 0x67, 0x6f, 0x2f, 0x65, 0x74, 0x68, 0x72, 0x70, 0x63, 0x2f, 0x76, 0x31, 0x3b, 0x65,
0x74, 0x68, 0x72, 0x70, 0x63, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x45, 0x58, 0x58, 0xaa, 0x02, 0x09,
0x45, 0x74, 0x68, 0x72, 0x70, 0x63, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x09, 0x45, 0x74, 0x68, 0x72,
0x70, 0x63, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x15, 0x45, 0x74, 0x68, 0x72, 0x70, 0x63, 0x5c, 0x56,
0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0a,
0x45, 0x74, 0x68, 0x72, 0x70, 0x63, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x33,
}
var file_ethrpc_v1_request_response_proto_goTypes = []interface{}{}
var file_ethrpc_v1_request_response_proto_depIdxs = []int32{
0, // [0:0] is the sub-list for method output_type
0, // [0:0] is the sub-list for method input_type
0, // [0:0] is the sub-list for extension type_name
0, // [0:0] is the sub-list for extension extendee
0, // [0:0] is the sub-list for field type_name
}
func init() { file_ethrpc_v1_request_response_proto_init() }
func file_ethrpc_v1_request_response_proto_init() {
if File_ethrpc_v1_request_response_proto != nil {
return
}
file_ethrpc_v1_resource_proto_init()
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_ethrpc_v1_request_response_proto_rawDesc,
NumEnums: 0,
NumMessages: 0,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_ethrpc_v1_request_response_proto_goTypes,
DependencyIndexes: file_ethrpc_v1_request_response_proto_depIdxs,
}.Build()
File_ethrpc_v1_request_response_proto = out.File
file_ethrpc_v1_request_response_proto_rawDesc = nil
file_ethrpc_v1_request_response_proto_goTypes = nil
file_ethrpc_v1_request_response_proto_depIdxs = nil
}
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.28.1
// protoc (unknown)
// source: ethrpc/v1/resource.proto
package ethrpcv1
import (
v1 "github.com/CaduceusMetaverseProtocol/metaprotocol/gen/proto/go/base/v1"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type Tx struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Address *v1.Address `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
Hash *v1.Hash `protobuf:"bytes,2,opt,name=hash,proto3" json:"hash,omitempty"`
}
func (x *Tx) Reset() {
*x = Tx{}
if protoimpl.UnsafeEnabled {
mi := &file_ethrpc_v1_resource_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Tx) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Tx) ProtoMessage() {}
func (x *Tx) ProtoReflect() protoreflect.Message {
mi := &file_ethrpc_v1_resource_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Tx.ProtoReflect.Descriptor instead.
func (*Tx) Descriptor() ([]byte, []int) {
return file_ethrpc_v1_resource_proto_rawDescGZIP(), []int{0}
}
func (x *Tx) GetAddress() *v1.Address {
if x != nil {
return x.Address
}
return nil
}
func (x *Tx) GetHash() *v1.Hash {
if x != nil {
return x.Hash
}
return nil
}
var File_ethrpc_v1_resource_proto protoreflect.FileDescriptor
var file_ethrpc_v1_resource_proto_rawDesc = []byte{
0x0a, 0x18, 0x65, 0x74, 0x68, 0x72, 0x70, 0x63, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x65, 0x73, 0x6f,
0x75, 0x72, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x09, 0x65, 0x74, 0x68, 0x72,
0x70, 0x63, 0x2e, 0x76, 0x31, 0x1a, 0x16, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x72,
0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x53, 0x0a,
0x02, 0x54, 0x78, 0x12, 0x2a, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01,
0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x41,
0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12,
0x21, 0x0a, 0x04, 0x68, 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e,
0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x48, 0x61, 0x73, 0x68, 0x52, 0x04, 0x68, 0x61,
0x73, 0x68, 0x42, 0xb6, 0x01, 0x0a, 0x0d, 0x63, 0x6f, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x72, 0x70,
0x63, 0x2e, 0x76, 0x31, 0x42, 0x0d, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x50, 0x72,
0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x51, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f,
0x6d, 0x2f, 0x43, 0x61, 0x64, 0x75, 0x63, 0x65, 0x75, 0x73, 0x4d, 0x65, 0x74, 0x61, 0x76, 0x65,
0x72, 0x73, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x6d, 0x65, 0x74, 0x61,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x2f, 0x65, 0x74, 0x68, 0x72, 0x70, 0x63, 0x2f, 0x76, 0x31, 0x3b,
0x65, 0x74, 0x68, 0x72, 0x70, 0x63, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x45, 0x58, 0x58, 0xaa, 0x02,
0x09, 0x45, 0x74, 0x68, 0x72, 0x70, 0x63, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x09, 0x45, 0x74, 0x68,
0x72, 0x70, 0x63, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x15, 0x45, 0x74, 0x68, 0x72, 0x70, 0x63, 0x5c,
0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02,
0x0a, 0x45, 0x74, 0x68, 0x72, 0x70, 0x63, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x33,
}
var (
file_ethrpc_v1_resource_proto_rawDescOnce sync.Once
file_ethrpc_v1_resource_proto_rawDescData = file_ethrpc_v1_resource_proto_rawDesc
)
func file_ethrpc_v1_resource_proto_rawDescGZIP() []byte {
file_ethrpc_v1_resource_proto_rawDescOnce.Do(func() {
file_ethrpc_v1_resource_proto_rawDescData = protoimpl.X.CompressGZIP(file_ethrpc_v1_resource_proto_rawDescData)
})
return file_ethrpc_v1_resource_proto_rawDescData
}
var file_ethrpc_v1_resource_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_ethrpc_v1_resource_proto_goTypes = []interface{}{
(*Tx)(nil), // 0: ethrpc.v1.Tx
(*v1.Address)(nil), // 1: base.v1.Address
(*v1.Hash)(nil), // 2: base.v1.Hash
}
var file_ethrpc_v1_resource_proto_depIdxs = []int32{
1, // 0: ethrpc.v1.Tx.address:type_name -> base.v1.Address
2, // 1: ethrpc.v1.Tx.hash:type_name -> base.v1.Hash
2, // [2:2] is the sub-list for method output_type
2, // [2:2] is the sub-list for method input_type
2, // [2:2] is the sub-list for extension type_name
2, // [2:2] is the sub-list for extension extendee
0, // [0:2] is the sub-list for field type_name
}
func init() { file_ethrpc_v1_resource_proto_init() }
func file_ethrpc_v1_resource_proto_init() {
if File_ethrpc_v1_resource_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_ethrpc_v1_resource_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Tx); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_ethrpc_v1_resource_proto_rawDesc,
NumEnums: 0,
NumMessages: 1,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_ethrpc_v1_resource_proto_goTypes,
DependencyIndexes: file_ethrpc_v1_resource_proto_depIdxs,
MessageInfos: file_ethrpc_v1_resource_proto_msgTypes,
}.Build()
File_ethrpc_v1_resource_proto = out.File
file_ethrpc_v1_resource_proto_rawDesc = nil
file_ethrpc_v1_resource_proto_goTypes = nil
file_ethrpc_v1_resource_proto_depIdxs = nil
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -9,6 +9,7 @@ package p2pv1 ...@@ -9,6 +9,7 @@ package p2pv1
import ( import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl" protoimpl "google.golang.org/protobuf/runtime/protoimpl"
emptypb "google.golang.org/protobuf/types/known/emptypb"
reflect "reflect" reflect "reflect"
) )
...@@ -25,51 +26,69 @@ var file_p2p_v1_service_proto_rawDesc = []byte{ ...@@ -25,51 +26,69 @@ var file_p2p_v1_service_proto_rawDesc = []byte{
0x0a, 0x14, 0x70, 0x32, 0x70, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x0a, 0x14, 0x70, 0x32, 0x70, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x70, 0x32, 0x70, 0x2e, 0x76, 0x31, 0x1a, 0x1d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x70, 0x32, 0x70, 0x2e, 0x76, 0x31, 0x1a, 0x1d,
0x70, 0x32, 0x70, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x72, 0x70, 0x32, 0x70, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x72,
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0xe0, 0x01, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67,
0x0a, 0x0a, 0x50, 0x32, 0x50, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x45, 0x0a, 0x0c, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65,
0x42, 0x72, 0x6f, 0x61, 0x64, 0x63, 0x61, 0x73, 0x74, 0x4d, 0x73, 0x67, 0x12, 0x18, 0x2e, 0x70, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0xec, 0x02, 0x0a, 0x0a, 0x50,
0x32, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x72, 0x6f, 0x61, 0x64, 0x43, 0x61, 0x73, 0x74, 0x52, 0x32, 0x50, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x45, 0x0a, 0x0c, 0x42, 0x72, 0x6f,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x70, 0x32, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x61, 0x64, 0x63, 0x61, 0x73, 0x74, 0x4d, 0x73, 0x67, 0x12, 0x18, 0x2e, 0x70, 0x32, 0x70, 0x2e,
0x42, 0x72, 0x6f, 0x61, 0x64, 0x43, 0x61, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x76, 0x31, 0x2e, 0x42, 0x72, 0x6f, 0x61, 0x64, 0x43, 0x61, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75,
0x65, 0x22, 0x00, 0x12, 0x3e, 0x0a, 0x07, 0x53, 0x65, 0x6e, 0x64, 0x4d, 0x73, 0x67, 0x12, 0x17, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x70, 0x32, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x72, 0x6f,
0x2e, 0x70, 0x32, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x44, 0x61, 0x74, 0x61, 0x61, 0x64, 0x43, 0x61, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x32, 0x70, 0x2e, 0x76, 0x31, 0x12, 0x3e, 0x0a, 0x07, 0x53, 0x65, 0x6e, 0x64, 0x4d, 0x73, 0x67, 0x12, 0x17, 0x2e, 0x70, 0x32,
0x2e, 0x53, 0x65, 0x6e, 0x64, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71,
0x65, 0x22, 0x00, 0x12, 0x4b, 0x0a, 0x0c, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x32, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65,
0x4d, 0x73, 0x67, 0x12, 0x1b, 0x2e, 0x70, 0x32, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x75, 0x62, 0x6e, 0x64, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00,
0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x4b, 0x0a, 0x0c, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x4d, 0x73, 0x67,
0x1a, 0x1c, 0x2e, 0x70, 0x32, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x12, 0x1b, 0x2e, 0x70, 0x32, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72,
0x69, 0x62, 0x65, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x69, 0x62, 0x65, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e,
0x42, 0xa0, 0x01, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x32, 0x70, 0x2e, 0x76, 0x31, 0x42, 0x70, 0x32, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65,
0x0c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x46, 0x0a,
0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x43, 0x61, 0x64, 0x75, 0x0c, 0x4e, 0x65, 0x74, 0x50, 0x65, 0x65, 0x72, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x16, 0x2e,
0x63, 0x65, 0x75, 0x73, 0x4d, 0x65, 0x74, 0x61, 0x76, 0x65, 0x72, 0x73, 0x65, 0x50, 0x72, 0x6f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e,
0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x6d, 0x65, 0x74, 0x61, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x1c, 0x2e, 0x70, 0x32, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x4e,
0x6f, 0x6c, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x2f, 0x65, 0x74, 0x50, 0x65, 0x65, 0x72, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f,
0x70, 0x32, 0x70, 0x2f, 0x76, 0x31, 0x3b, 0x70, 0x32, 0x70, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x50, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x42, 0x0a, 0x0a, 0x4e, 0x65, 0x74, 0x56, 0x65, 0x72, 0x73,
0x58, 0x58, 0xaa, 0x02, 0x06, 0x50, 0x32, 0x70, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x06, 0x50, 0x32, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f,
0x70, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x12, 0x50, 0x32, 0x70, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x1a, 0x2e, 0x70, 0x32,
0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x07, 0x50, 0x32, 0x70, 0x3a, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x4e, 0x65, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52,
0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0xa0, 0x01, 0x0a, 0x0a, 0x63, 0x6f,
0x6d, 0x2e, 0x70, 0x32, 0x70, 0x2e, 0x76, 0x31, 0x42, 0x0c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63,
0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62,
0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x43, 0x61, 0x64, 0x75, 0x63, 0x65, 0x75, 0x73, 0x4d, 0x65, 0x74,
0x61, 0x76, 0x65, 0x72, 0x73, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x6d,
0x65, 0x74, 0x61, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x67, 0x65, 0x6e, 0x2f,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x2f, 0x70, 0x32, 0x70, 0x2f, 0x76, 0x31, 0x3b,
0x70, 0x32, 0x70, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x50, 0x58, 0x58, 0xaa, 0x02, 0x06, 0x50, 0x32,
0x70, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x06, 0x50, 0x32, 0x70, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x12,
0x50, 0x32, 0x70, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61,
0x74, 0x61, 0xea, 0x02, 0x07, 0x50, 0x32, 0x70, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x33,
} }
var file_p2p_v1_service_proto_goTypes = []interface{}{ var file_p2p_v1_service_proto_goTypes = []interface{}{
(*BroadCastRequest)(nil), // 0: p2p.v1.BroadCastRequest (*BroadCastRequest)(nil), // 0: p2p.v1.BroadCastRequest
(*SendDataRequest)(nil), // 1: p2p.v1.SendDataRequest (*SendDataRequest)(nil), // 1: p2p.v1.SendDataRequest
(*SubscribeMsgRequest)(nil), // 2: p2p.v1.SubscribeMsgRequest (*SubscribeMsgRequest)(nil), // 2: p2p.v1.SubscribeMsgRequest
(*BroadCastResponse)(nil), // 3: p2p.v1.BroadCastResponse (*emptypb.Empty)(nil), // 3: google.protobuf.Empty
(*SendDataResponse)(nil), // 4: p2p.v1.SendDataResponse (*BroadCastResponse)(nil), // 4: p2p.v1.BroadCastResponse
(*SubscribeMsgResponse)(nil), // 5: p2p.v1.SubscribeMsgResponse (*SendDataResponse)(nil), // 5: p2p.v1.SendDataResponse
(*SubscribeMsgResponse)(nil), // 6: p2p.v1.SubscribeMsgResponse
(*NetPeerCountResponse)(nil), // 7: p2p.v1.NetPeerCountResponse
(*NetVersionResponse)(nil), // 8: p2p.v1.NetVersionResponse
} }
var file_p2p_v1_service_proto_depIdxs = []int32{ var file_p2p_v1_service_proto_depIdxs = []int32{
0, // 0: p2p.v1.P2PService.BroadcastMsg:input_type -> p2p.v1.BroadCastRequest 0, // 0: p2p.v1.P2PService.BroadcastMsg:input_type -> p2p.v1.BroadCastRequest
1, // 1: p2p.v1.P2PService.SendMsg:input_type -> p2p.v1.SendDataRequest 1, // 1: p2p.v1.P2PService.SendMsg:input_type -> p2p.v1.SendDataRequest
2, // 2: p2p.v1.P2PService.SubscribeMsg:input_type -> p2p.v1.SubscribeMsgRequest 2, // 2: p2p.v1.P2PService.SubscribeMsg:input_type -> p2p.v1.SubscribeMsgRequest
3, // 3: p2p.v1.P2PService.BroadcastMsg:output_type -> p2p.v1.BroadCastResponse 3, // 3: p2p.v1.P2PService.NetPeerCount:input_type -> google.protobuf.Empty
4, // 4: p2p.v1.P2PService.SendMsg:output_type -> p2p.v1.SendDataResponse 3, // 4: p2p.v1.P2PService.NetVersion:input_type -> google.protobuf.Empty
5, // 5: p2p.v1.P2PService.SubscribeMsg:output_type -> p2p.v1.SubscribeMsgResponse 4, // 5: p2p.v1.P2PService.BroadcastMsg:output_type -> p2p.v1.BroadCastResponse
3, // [3:6] is the sub-list for method output_type 5, // 6: p2p.v1.P2PService.SendMsg:output_type -> p2p.v1.SendDataResponse
0, // [0:3] is the sub-list for method input_type 6, // 7: p2p.v1.P2PService.SubscribeMsg:output_type -> p2p.v1.SubscribeMsgResponse
7, // 8: p2p.v1.P2PService.NetPeerCount:output_type -> p2p.v1.NetPeerCountResponse
8, // 9: p2p.v1.P2PService.NetVersion:output_type -> p2p.v1.NetVersionResponse
5, // [5:10] is the sub-list for method output_type
0, // [0:5] is the sub-list for method input_type
0, // [0:0] is the sub-list for extension type_name 0, // [0:0] is the sub-list for extension type_name
0, // [0:0] is the sub-list for extension extendee 0, // [0:0] is the sub-list for extension extendee
0, // [0:0] is the sub-list for field type_name 0, // [0:0] is the sub-list for field type_name
......
...@@ -11,6 +11,7 @@ import ( ...@@ -11,6 +11,7 @@ import (
grpc "google.golang.org/grpc" grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes" codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status" status "google.golang.org/grpc/status"
emptypb "google.golang.org/protobuf/types/known/emptypb"
) )
// This is a compile-time assertion to ensure that this generated file // This is a compile-time assertion to ensure that this generated file
...@@ -25,6 +26,9 @@ type P2PServiceClient interface { ...@@ -25,6 +26,9 @@ type P2PServiceClient interface {
BroadcastMsg(ctx context.Context, in *BroadCastRequest, opts ...grpc.CallOption) (*BroadCastResponse, error) BroadcastMsg(ctx context.Context, in *BroadCastRequest, opts ...grpc.CallOption) (*BroadCastResponse, error)
SendMsg(ctx context.Context, in *SendDataRequest, opts ...grpc.CallOption) (*SendDataResponse, error) SendMsg(ctx context.Context, in *SendDataRequest, opts ...grpc.CallOption) (*SendDataResponse, error)
SubscribeMsg(ctx context.Context, in *SubscribeMsgRequest, opts ...grpc.CallOption) (*SubscribeMsgResponse, error) SubscribeMsg(ctx context.Context, in *SubscribeMsgRequest, opts ...grpc.CallOption) (*SubscribeMsgResponse, error)
// network info service
NetPeerCount(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*NetPeerCountResponse, error)
NetVersion(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*NetVersionResponse, error)
} }
type p2PServiceClient struct { type p2PServiceClient struct {
...@@ -62,6 +66,24 @@ func (c *p2PServiceClient) SubscribeMsg(ctx context.Context, in *SubscribeMsgReq ...@@ -62,6 +66,24 @@ func (c *p2PServiceClient) SubscribeMsg(ctx context.Context, in *SubscribeMsgReq
return out, nil return out, nil
} }
func (c *p2PServiceClient) NetPeerCount(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*NetPeerCountResponse, error) {
out := new(NetPeerCountResponse)
err := c.cc.Invoke(ctx, "/p2p.v1.P2PService/NetPeerCount", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *p2PServiceClient) NetVersion(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*NetVersionResponse, error) {
out := new(NetVersionResponse)
err := c.cc.Invoke(ctx, "/p2p.v1.P2PService/NetVersion", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// P2PServiceServer is the server API for P2PService service. // P2PServiceServer is the server API for P2PService service.
// All implementations must embed UnimplementedP2PServiceServer // All implementations must embed UnimplementedP2PServiceServer
// for forward compatibility // for forward compatibility
...@@ -69,6 +91,9 @@ type P2PServiceServer interface { ...@@ -69,6 +91,9 @@ type P2PServiceServer interface {
BroadcastMsg(context.Context, *BroadCastRequest) (*BroadCastResponse, error) BroadcastMsg(context.Context, *BroadCastRequest) (*BroadCastResponse, error)
SendMsg(context.Context, *SendDataRequest) (*SendDataResponse, error) SendMsg(context.Context, *SendDataRequest) (*SendDataResponse, error)
SubscribeMsg(context.Context, *SubscribeMsgRequest) (*SubscribeMsgResponse, error) SubscribeMsg(context.Context, *SubscribeMsgRequest) (*SubscribeMsgResponse, error)
// network info service
NetPeerCount(context.Context, *emptypb.Empty) (*NetPeerCountResponse, error)
NetVersion(context.Context, *emptypb.Empty) (*NetVersionResponse, error)
mustEmbedUnimplementedP2PServiceServer() mustEmbedUnimplementedP2PServiceServer()
} }
...@@ -85,6 +110,12 @@ func (UnimplementedP2PServiceServer) SendMsg(context.Context, *SendDataRequest) ...@@ -85,6 +110,12 @@ func (UnimplementedP2PServiceServer) SendMsg(context.Context, *SendDataRequest)
func (UnimplementedP2PServiceServer) SubscribeMsg(context.Context, *SubscribeMsgRequest) (*SubscribeMsgResponse, error) { func (UnimplementedP2PServiceServer) SubscribeMsg(context.Context, *SubscribeMsgRequest) (*SubscribeMsgResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method SubscribeMsg not implemented") return nil, status.Errorf(codes.Unimplemented, "method SubscribeMsg not implemented")
} }
func (UnimplementedP2PServiceServer) NetPeerCount(context.Context, *emptypb.Empty) (*NetPeerCountResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method NetPeerCount not implemented")
}
func (UnimplementedP2PServiceServer) NetVersion(context.Context, *emptypb.Empty) (*NetVersionResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method NetVersion not implemented")
}
func (UnimplementedP2PServiceServer) mustEmbedUnimplementedP2PServiceServer() {} func (UnimplementedP2PServiceServer) mustEmbedUnimplementedP2PServiceServer() {}
// UnsafeP2PServiceServer may be embedded to opt out of forward compatibility for this service. // UnsafeP2PServiceServer may be embedded to opt out of forward compatibility for this service.
...@@ -152,6 +183,42 @@ func _P2PService_SubscribeMsg_Handler(srv interface{}, ctx context.Context, dec ...@@ -152,6 +183,42 @@ func _P2PService_SubscribeMsg_Handler(srv interface{}, ctx context.Context, dec
return interceptor(ctx, in, info, handler) return interceptor(ctx, in, info, handler)
} }
func _P2PService_NetPeerCount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(emptypb.Empty)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(P2PServiceServer).NetPeerCount(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/p2p.v1.P2PService/NetPeerCount",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(P2PServiceServer).NetPeerCount(ctx, req.(*emptypb.Empty))
}
return interceptor(ctx, in, info, handler)
}
func _P2PService_NetVersion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(emptypb.Empty)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(P2PServiceServer).NetVersion(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/p2p.v1.P2PService/NetVersion",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(P2PServiceServer).NetVersion(ctx, req.(*emptypb.Empty))
}
return interceptor(ctx, in, info, handler)
}
// P2PService_ServiceDesc is the grpc.ServiceDesc for P2PService service. // P2PService_ServiceDesc is the grpc.ServiceDesc for P2PService service.
// It's only intended for direct use with grpc.RegisterService, // It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy) // and not to be introspected or modified (even as a copy)
...@@ -171,6 +238,14 @@ var P2PService_ServiceDesc = grpc.ServiceDesc{ ...@@ -171,6 +238,14 @@ var P2PService_ServiceDesc = grpc.ServiceDesc{
MethodName: "SubscribeMsg", MethodName: "SubscribeMsg",
Handler: _P2PService_SubscribeMsg_Handler, Handler: _P2PService_SubscribeMsg_Handler,
}, },
{
MethodName: "NetPeerCount",
Handler: _P2PService_NetPeerCount_Handler,
},
{
MethodName: "NetVersion",
Handler: _P2PService_NetVersion_Handler,
},
}, },
Streams: []grpc.StreamDesc{}, Streams: []grpc.StreamDesc{},
Metadata: "p2p/v1/service.proto", Metadata: "p2p/v1/service.proto",
......
This diff is collapsed.
This diff is collapsed.
...@@ -31,3 +31,17 @@ message SubscribeMsgRequest { ...@@ -31,3 +31,17 @@ message SubscribeMsgRequest {
message SubscribeMsgResponse { message SubscribeMsgResponse {
bool success = 1; bool success = 1;
} }
message NetVersionRequest { }
message NetVersionResponse {
bytes version = 1;
}
message NetPeerCountRequest { }
message NetPeerCountResponse {
uint32 peer_count = 1;
}
...@@ -2,6 +2,7 @@ syntax = "proto3"; ...@@ -2,6 +2,7 @@ syntax = "proto3";
package p2p.v1; package p2p.v1;
import "p2p/v1/request_response.proto"; import "p2p/v1/request_response.proto";
import "google/protobuf/empty.proto";
service P2PService { service P2PService {
...@@ -9,4 +10,10 @@ service P2PService { ...@@ -9,4 +10,10 @@ service P2PService {
rpc SendMsg(SendDataRequest) returns (SendDataResponse) {} rpc SendMsg(SendDataRequest) returns (SendDataResponse) {}
rpc SubscribeMsg(SubscribeMsgRequest) returns (SubscribeMsgResponse) {} rpc SubscribeMsg(SubscribeMsgRequest) returns (SubscribeMsgResponse) {}
// network info service
rpc NetPeerCount(google.protobuf.Empty) returns (NetPeerCountResponse) {};
rpc NetVersion(google.protobuf.Empty) returns (NetVersionResponse) {};
} }
主要是收交易;
...@@ -8,73 +8,8 @@ import "ring/v1/account_req_res.proto"; ...@@ -8,73 +8,8 @@ import "ring/v1/account_req_res.proto";
import "base/v1/resource.proto"; import "base/v1/resource.proto";
service RingService{ service RingService{
// web3
rpc Sha3(Sha3Request) returns (Sha3Response) {};
rpc NodeVersion(google.protobuf.Empty) returns (NodeVersionResponse) {};
// network info service
rpc NetVersion(google.protobuf.Empty) returns (NetVersionResponse) {};
rpc NetPeerCount(google.protobuf.Empty) returns (NetPeerCountResponse) {};
// node status
rpc ProtocolVersion(google.protobuf.Empty) returns (ProtocolVersionResponse) {};
rpc Syncing(google.protobuf.Empty) returns (SyncingResponse) {};
rpc Coinbase(google.protobuf.Empty) returns (CoinbaseResponse) {};
rpc Mining(google.protobuf.Empty) returns (MiningResponse) {};
rpc HashRate(google.protobuf.Empty) returns (HashRateResponse) {};
rpc Accounts(google.protobuf.Empty) returns (AccountsResponse) {};
// tx operatoration
rpc GasPrice(google.protobuf.Empty) returns (GasPriceResponse) {};
// block info service
rpc BlockNumber(google.protobuf.Empty) returns (HeightResponse) {};
rpc BlockByHash(BlockByHashRequest) returns (BlockByHashResponse) {};
rpc BlockByNumber(BlockByNumberRequest) returns (BlockByNumberResponse) {};
rpc BlockTransactionCountByHash(BlockTransactionCountByHashRequest) returns (BlockTransactionCountByHashResponse) {};
rpc BlockTransactionCountByNumber(BlockTransactionCountByNumberRequest) returns (BlockTransactionCountByNumberResponse) {};
rpc UncleCountByHash(UncleCountByHashRequest) returns (UncleCountByHashResponse) {};
rpc UncleCountByNumber(UncleCountByNumberRequest) returns (UncleCountByNumberResponse) {};
rpc UncleByBlockHashAndIndex(UncleByBlockHashAndIndexRequest) returns (UncleByBlockHashAndIndexResponse) {};
rpc UncleByBlockNumberAndIndex(UncleByBlockNumberAndIndexRequest) returns (UncleByBlockNumberAndIndexResponse) {};
// compiler
rpc Compilers(CompilersRequest) returns (CompilersResponse) {};
rpc CompileSolidity(CompileSolidityRequest) returns (CompileSolidityResponse) {};
rpc CompileLLL(CompileLLLRequest) returns (CompileLLLResponse) {};
rpc CompileSerpent(CompileSerpentRequest) returns (CompileSerpentResponse) {};
// transaction info service
rpc EstimateGas(EstimateGasRequest) returns (EstimateGasResponse) {};
rpc TransactionByHash(TransactionByHashRequest) returns (TransactionByHashResponse) {};
rpc TransactionByBlockHashAndIndex(TransactionByBlockHashAndIndexRequest) returns (TransactionByBlockHashAndIndexResponse) {};
rpc TransactionByBlockNumberAndIndex(TransactionByBlockNumberAndIndexRequest) returns (TransactionByBlockNumberAndIndexResponse) {};
rpc TransactionReceipt(TransactionReceiptRequest) returns (TransactionReceiptResponse) {};
// account info service // account info service
rpc Balance(BalanceRequest) returns (BalanceResponse) {};
rpc Storage(StorageRequest) returns (StorageResponse) {};
rpc Nonce(NonceRequest) returns (NonceResponse) {};
rpc RepeatedNonce(RepeatedNonceRequest) returns (RepeatedNonceResponse) {};
rpc TransactionCount(TransactionCountRequest) returns (TransactionCountResponse) {};
rpc GetCode(GetCodeRequest) returns (GetCodeResponse) {};
rpc Sign(SignRequest) returns (SignResponse) {};
rpc SignTransaction(SignTransactionRequest) returns (SignTransactionResponse) {};
rpc SendTransaction(base.v1.EthTransaction) returns (SendTransactionResponse) {};
rpc SendRawTransaction(SendRawTransactionRequest) returns (SendRawTransactionResponse) {}; rpc SendRawTransaction(SendRawTransactionRequest) returns (SendRawTransactionResponse) {};
rpc Call(CallRequest) returns (CallResponse) {};
// filter
rpc NewFilter(NewFilterRequest) returns (NewFilterResponse) {};
rpc NewBlockFilter(google.protobuf.Empty) returns (NewBlockFilterResponse) {};
rpc PendingTransactionFilter(google.protobuf.Empty) returns (PendingTransactionFilterResponse) {};
rpc UninstallFilter(UninstallFilterRequest) returns (UninstallFilterResponse) {};
rpc FilterChanges(FilterChangesRequest) returns (FilterChangesResponse) {};
rpc FilterLogs(FilterLogsRequest) returns (FilterLogsResponse) {};
rpc Logs(LogsRequest) returns (LogsResponse) {};
// consensus info service
} }
\ No newline at end of file
## 主要是提交 批次hash;并携带查询到的 block; block更新后,再提交下一个批次;
version: v1
breaking:
use:
- FILE
lint:
use:
- DEFAULT
syntax = "proto3";
package state.v1;
\ No newline at end of file
syntax = "proto3";
package state.v1;
\ No newline at end of file
syntax = "proto3";
package state.v1;
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment