rpcpb

package
v0.0.0-...-9098a98 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 7, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package rpcpb is a generated protocol buffer package.

It is generated from these files:

service.proto

It has these top-level messages:

TxStatus
HelloRequest
HelloResponse
SubmitTxRequest
SubmitTxResponse
QueryTxRequest
QueryTxResponse
CreateTestAccountRequest
CreateTestAccountResponse
GetAccountRequest
GetAccountResponse
NotifyRequest
NotifyResponse
QueryRequest
QueryResponse

Index

Constants

This section is empty.

Variables

View Source
var NotifyMsgType_name = map[int32]string{
	0: "TX",
	1: "STATEMENT",
}
View Source
var NotifyMsgType_value = map[string]int32{
	"TX":        0,
	"STATEMENT": 1,
}
View Source
var QueryMsgType_name = map[int32]string{
	0: "QUORUM",
	1: "TXSET",
	2: "LEDGER",
}
View Source
var QueryMsgType_value = map[string]int32{
	"QUORUM": 0,
	"TXSET":  1,
	"LEDGER": 2,
}
View Source
var TxStatusCode_name = map[int32]string{
	0: "NOTEXIST",
	1: "REJECTED",
	2: "ACCEPTED",
	3: "CONFIRMED",
	4: "FAILED",
}
View Source
var TxStatusCode_value = map[string]int32{
	"NOTEXIST":  0,
	"REJECTED":  1,
	"ACCEPTED":  2,
	"CONFIRMED": 3,
	"FAILED":    4,
}

Functions

func RegisterNodeServer

func RegisterNodeServer(s *grpc.Server, srv NodeServer)

Types

type CreateTestAccountRequest

type CreateTestAccountRequest struct {
	NetworkID string `protobuf:"bytes,1,opt,name=NetworkID" json:"NetworkID,omitempty"`
	AccountID string `protobuf:"bytes,2,opt,name=AccountID" json:"AccountID,omitempty"`
}

func (*CreateTestAccountRequest) Descriptor

func (*CreateTestAccountRequest) Descriptor() ([]byte, []int)

func (*CreateTestAccountRequest) GetAccountID

func (m *CreateTestAccountRequest) GetAccountID() string

func (*CreateTestAccountRequest) GetNetworkID

func (m *CreateTestAccountRequest) GetNetworkID() string

func (*CreateTestAccountRequest) ProtoMessage

func (*CreateTestAccountRequest) ProtoMessage()

func (*CreateTestAccountRequest) Reset

func (m *CreateTestAccountRequest) Reset()

func (*CreateTestAccountRequest) String

func (m *CreateTestAccountRequest) String() string

type CreateTestAccountResponse

type CreateTestAccountResponse struct {
	TxKey string `protobuf:"bytes,1,opt,name=TxKey" json:"TxKey,omitempty"`
}

func (*CreateTestAccountResponse) Descriptor

func (*CreateTestAccountResponse) Descriptor() ([]byte, []int)

func (*CreateTestAccountResponse) GetTxKey

func (m *CreateTestAccountResponse) GetTxKey() string

func (*CreateTestAccountResponse) ProtoMessage

func (*CreateTestAccountResponse) ProtoMessage()

func (*CreateTestAccountResponse) Reset

func (m *CreateTestAccountResponse) Reset()

func (*CreateTestAccountResponse) String

func (m *CreateTestAccountResponse) String() string

type GetAccountRequest

type GetAccountRequest struct {
	NetworkID string `protobuf:"bytes,1,opt,name=NetworkID" json:"NetworkID,omitempty"`
	AccountID string `protobuf:"bytes,2,opt,name=AccountID" json:"AccountID,omitempty"`
}

func (*GetAccountRequest) Descriptor

func (*GetAccountRequest) Descriptor() ([]byte, []int)

func (*GetAccountRequest) GetAccountID

func (m *GetAccountRequest) GetAccountID() string

func (*GetAccountRequest) GetNetworkID

func (m *GetAccountRequest) GetNetworkID() string

func (*GetAccountRequest) ProtoMessage

func (*GetAccountRequest) ProtoMessage()

func (*GetAccountRequest) Reset

func (m *GetAccountRequest) Reset()

func (*GetAccountRequest) String

func (m *GetAccountRequest) String() string

type GetAccountResponse

type GetAccountResponse struct {
	Data []byte `protobuf:"bytes,1,opt,name=Data,proto3" json:"Data,omitempty"`
}

func (*GetAccountResponse) Descriptor

func (*GetAccountResponse) Descriptor() ([]byte, []int)

func (*GetAccountResponse) GetData

func (m *GetAccountResponse) GetData() []byte

func (*GetAccountResponse) ProtoMessage

func (*GetAccountResponse) ProtoMessage()

func (*GetAccountResponse) Reset

func (m *GetAccountResponse) Reset()

func (*GetAccountResponse) String

func (m *GetAccountResponse) String() string

type HelloRequest

type HelloRequest struct {
	NetworkID string `protobuf:"bytes,1,opt,name=NetworkID" json:"NetworkID,omitempty"`
}

func (*HelloRequest) Descriptor

func (*HelloRequest) Descriptor() ([]byte, []int)

func (*HelloRequest) GetNetworkID

func (m *HelloRequest) GetNetworkID() string

func (*HelloRequest) ProtoMessage

func (*HelloRequest) ProtoMessage()

func (*HelloRequest) Reset

func (m *HelloRequest) Reset()

func (*HelloRequest) String

func (m *HelloRequest) String() string

type HelloResponse

type HelloResponse struct {
}

func (*HelloResponse) Descriptor

func (*HelloResponse) Descriptor() ([]byte, []int)

func (*HelloResponse) ProtoMessage

func (*HelloResponse) ProtoMessage()

func (*HelloResponse) Reset

func (m *HelloResponse) Reset()

func (*HelloResponse) String

func (m *HelloResponse) String() string

type NodeClient

type NodeClient interface {
	// CreateTestAccount allows the client to create a test account for testing.
	CreateTestAccount(ctx context.Context, in *CreateTestAccountRequest, opts ...grpc.CallOption) (*CreateTestAccountResponse, error)
	// GetAccount allows the client to get the account information of an account.
	GetAccount(ctx context.Context, in *GetAccountRequest, opts ...grpc.CallOption) (*GetAccountResponse, error)
	// SubmitTx is the main way for the client to submit a transaction.
	SubmitTx(ctx context.Context, in *SubmitTxRequest, opts ...grpc.CallOption) (*SubmitTxResponse, error)
	// QueryTx is used for querying the status of previous submitted transactions.
	QueryTx(ctx context.Context, in *QueryTxRequest, opts ...grpc.CallOption) (*QueryTxResponse, error)
	// Hello is used for initial connection between new peers.
	Hello(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (*HelloResponse, error)
	// Notify is used for the node to notify transactions and consensus messages to other peers.
	Notify(ctx context.Context, in *NotifyRequest, opts ...grpc.CallOption) (*NotifyResponse, error)
	// Query is used for the node to ask for missing information about transactions.
	Query(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error)
}

func NewNodeClient

func NewNodeClient(cc *grpc.ClientConn) NodeClient

type NodeServer

type NodeServer interface {
	// CreateTestAccount allows the client to create a test account for testing.
	CreateTestAccount(context.Context, *CreateTestAccountRequest) (*CreateTestAccountResponse, error)
	// GetAccount allows the client to get the account information of an account.
	GetAccount(context.Context, *GetAccountRequest) (*GetAccountResponse, error)
	// SubmitTx is the main way for the client to submit a transaction.
	SubmitTx(context.Context, *SubmitTxRequest) (*SubmitTxResponse, error)
	// QueryTx is used for querying the status of previous submitted transactions.
	QueryTx(context.Context, *QueryTxRequest) (*QueryTxResponse, error)
	// Hello is used for initial connection between new peers.
	Hello(context.Context, *HelloRequest) (*HelloResponse, error)
	// Notify is used for the node to notify transactions and consensus messages to other peers.
	Notify(context.Context, *NotifyRequest) (*NotifyResponse, error)
	// Query is used for the node to ask for missing information about transactions.
	Query(context.Context, *QueryRequest) (*QueryResponse, error)
}

type NotifyMsgType

type NotifyMsgType int32
const (
	NotifyMsgType_TX        NotifyMsgType = 0
	NotifyMsgType_STATEMENT NotifyMsgType = 1
)

func (NotifyMsgType) EnumDescriptor

func (NotifyMsgType) EnumDescriptor() ([]byte, []int)

func (NotifyMsgType) String

func (x NotifyMsgType) String() string

type NotifyRequest

type NotifyRequest struct {
	NetworkID string `protobuf:"bytes,1,opt,name=NetworkID" json:"NetworkID,omitempty"`
	// Type of the message.
	MsgType NotifyMsgType `protobuf:"varint,2,opt,name=MsgType,enum=rpcpb.NotifyMsgType" json:"MsgType,omitempty"`
	// Message payload in pb format.
	Data []byte `protobuf:"bytes,3,opt,name=Data,proto3" json:"Data,omitempty"`
	// Digital signature of the data signed by the private key of peer node.
	Signature string `protobuf:"bytes,4,opt,name=Signature" json:"Signature,omitempty"`
}

func (*NotifyRequest) Descriptor

func (*NotifyRequest) Descriptor() ([]byte, []int)

func (*NotifyRequest) GetData

func (m *NotifyRequest) GetData() []byte

func (*NotifyRequest) GetMsgType

func (m *NotifyRequest) GetMsgType() NotifyMsgType

func (*NotifyRequest) GetNetworkID

func (m *NotifyRequest) GetNetworkID() string

func (*NotifyRequest) GetSignature

func (m *NotifyRequest) GetSignature() string

func (*NotifyRequest) ProtoMessage

func (*NotifyRequest) ProtoMessage()

func (*NotifyRequest) Reset

func (m *NotifyRequest) Reset()

func (*NotifyRequest) String

func (m *NotifyRequest) String() string

type NotifyResponse

type NotifyResponse struct {
}

func (*NotifyResponse) Descriptor

func (*NotifyResponse) Descriptor() ([]byte, []int)

func (*NotifyResponse) ProtoMessage

func (*NotifyResponse) ProtoMessage()

func (*NotifyResponse) Reset

func (m *NotifyResponse) Reset()

func (*NotifyResponse) String

func (m *NotifyResponse) String() string

type QueryMsgType

type QueryMsgType int32

QueryMsgType enumerates the type of query issued by the node.

const (
	// Query Quorum information.
	QueryMsgType_QUORUM QueryMsgType = 0
	// Query TxSet information.
	QueryMsgType_TXSET QueryMsgType = 1
	// Query Ledger information.
	QueryMsgType_LEDGER QueryMsgType = 2
)

func (QueryMsgType) EnumDescriptor

func (QueryMsgType) EnumDescriptor() ([]byte, []int)

func (QueryMsgType) String

func (x QueryMsgType) String() string

type QueryRequest

type QueryRequest struct {
	NetworkID string `protobuf:"bytes,1,opt,name=NetworkID" json:"NetworkID,omitempty"`
	// Type of message.
	MsgType QueryMsgType `protobuf:"varint,2,opt,name=MsgType,enum=rpcpb.QueryMsgType" json:"MsgType,omitempty"`
	// Message payload in pb format.
	Data []byte `protobuf:"bytes,3,opt,name=Data,proto3" json:"Data,omitempty"`
	// Digital signature of the data signed by the private key of peer node.
	Signature string `protobuf:"bytes,4,opt,name=Signature" json:"Signature,omitempty"`
}

func (*QueryRequest) Descriptor

func (*QueryRequest) Descriptor() ([]byte, []int)

func (*QueryRequest) GetData

func (m *QueryRequest) GetData() []byte

func (*QueryRequest) GetMsgType

func (m *QueryRequest) GetMsgType() QueryMsgType

func (*QueryRequest) GetNetworkID

func (m *QueryRequest) GetNetworkID() string

func (*QueryRequest) GetSignature

func (m *QueryRequest) GetSignature() string

func (*QueryRequest) ProtoMessage

func (*QueryRequest) ProtoMessage()

func (*QueryRequest) Reset

func (m *QueryRequest) Reset()

func (*QueryRequest) String

func (m *QueryRequest) String() string

type QueryResponse

type QueryResponse struct {
	// requested data encoded in pb format
	Data []byte `protobuf:"bytes,1,opt,name=Data,proto3" json:"Data,omitempty"`
}

func (*QueryResponse) Descriptor

func (*QueryResponse) Descriptor() ([]byte, []int)

func (*QueryResponse) GetData

func (m *QueryResponse) GetData() []byte

func (*QueryResponse) ProtoMessage

func (*QueryResponse) ProtoMessage()

func (*QueryResponse) Reset

func (m *QueryResponse) Reset()

func (*QueryResponse) String

func (m *QueryResponse) String() string

type QueryTxRequest

type QueryTxRequest struct {
	NetworkID string `protobuf:"bytes,1,opt,name=NetworkID" json:"NetworkID,omitempty"`
	TxKey     string `protobuf:"bytes,2,opt,name=TxKey" json:"TxKey,omitempty"`
}

func (*QueryTxRequest) Descriptor

func (*QueryTxRequest) Descriptor() ([]byte, []int)

func (*QueryTxRequest) GetNetworkID

func (m *QueryTxRequest) GetNetworkID() string

func (*QueryTxRequest) GetTxKey

func (m *QueryTxRequest) GetTxKey() string

func (*QueryTxRequest) ProtoMessage

func (*QueryTxRequest) ProtoMessage()

func (*QueryTxRequest) Reset

func (m *QueryTxRequest) Reset()

func (*QueryTxRequest) String

func (m *QueryTxRequest) String() string

type QueryTxResponse

type QueryTxResponse struct {
	TxStatus *TxStatus `protobuf:"bytes,1,opt,name=TxStatus" json:"TxStatus,omitempty"`
}

func (*QueryTxResponse) Descriptor

func (*QueryTxResponse) Descriptor() ([]byte, []int)

func (*QueryTxResponse) GetTxStatus

func (m *QueryTxResponse) GetTxStatus() *TxStatus

func (*QueryTxResponse) ProtoMessage

func (*QueryTxResponse) ProtoMessage()

func (*QueryTxResponse) Reset

func (m *QueryTxResponse) Reset()

func (*QueryTxResponse) String

func (m *QueryTxResponse) String() string

type SubmitTxRequest

type SubmitTxRequest struct {
	// Network id of the network.
	NetworkID string `protobuf:"bytes,1,opt,name=NetworkID" json:"NetworkID,omitempty"`
	// Transaction data in pb format.
	Data []byte `protobuf:"bytes,2,opt,name=Data,proto3" json:"Data,omitempty"`
	// Transaction ULTKey.
	TxKey string `protobuf:"bytes,3,opt,name=TxKey" json:"TxKey,omitempty"`
	// Digital signature of the data signed by the source account private key.
	Signature string `protobuf:"bytes,4,opt,name=Signature" json:"Signature,omitempty"`
}

func (*SubmitTxRequest) Descriptor

func (*SubmitTxRequest) Descriptor() ([]byte, []int)

func (*SubmitTxRequest) GetData

func (m *SubmitTxRequest) GetData() []byte

func (*SubmitTxRequest) GetNetworkID

func (m *SubmitTxRequest) GetNetworkID() string

func (*SubmitTxRequest) GetSignature

func (m *SubmitTxRequest) GetSignature() string

func (*SubmitTxRequest) GetTxKey

func (m *SubmitTxRequest) GetTxKey() string

func (*SubmitTxRequest) ProtoMessage

func (*SubmitTxRequest) ProtoMessage()

func (*SubmitTxRequest) Reset

func (m *SubmitTxRequest) Reset()

func (*SubmitTxRequest) String

func (m *SubmitTxRequest) String() string

type SubmitTxResponse

type SubmitTxResponse struct {
}

func (*SubmitTxResponse) Descriptor

func (*SubmitTxResponse) Descriptor() ([]byte, []int)

func (*SubmitTxResponse) ProtoMessage

func (*SubmitTxResponse) ProtoMessage()

func (*SubmitTxResponse) Reset

func (m *SubmitTxResponse) Reset()

func (*SubmitTxResponse) String

func (m *SubmitTxResponse) String() string

type TxStatus

type TxStatus struct {
	StatusCode   TxStatusCode `protobuf:"varint,1,opt,name=StatusCode,enum=rpcpb.TxStatusCode" json:"StatusCode,omitempty"`
	ErrorMessage string       `protobuf:"bytes,2,opt,name=ErrorMessage" json:"ErrorMessage,omitempty"`
	// The full information of the tx in pb format.
	Data []byte `protobuf:"bytes,3,opt,name=Data,proto3" json:"Data,omitempty"`
}

TxStatus contains the status code of a queried transaction and the error message associated with a failed transaction.

func (*TxStatus) Descriptor

func (*TxStatus) Descriptor() ([]byte, []int)

func (*TxStatus) GetData

func (m *TxStatus) GetData() []byte

func (*TxStatus) GetErrorMessage

func (m *TxStatus) GetErrorMessage() string

func (*TxStatus) GetStatusCode

func (m *TxStatus) GetStatusCode() TxStatusCode

func (*TxStatus) ProtoMessage

func (*TxStatus) ProtoMessage()

func (*TxStatus) Reset

func (m *TxStatus) Reset()

func (*TxStatus) String

func (m *TxStatus) String() string

type TxStatusCode

type TxStatusCode int32

TxStatusCode enumerates the status of a transaction in the node.

const (
	TxStatusCode_NOTEXIST  TxStatusCode = 0
	TxStatusCode_REJECTED  TxStatusCode = 1
	TxStatusCode_ACCEPTED  TxStatusCode = 2
	TxStatusCode_CONFIRMED TxStatusCode = 3
	TxStatusCode_FAILED    TxStatusCode = 4
)

func (TxStatusCode) EnumDescriptor

func (TxStatusCode) EnumDescriptor() ([]byte, []int)

func (TxStatusCode) String

func (x TxStatusCode) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL