rpc

package
v0.2.9 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2020 License: ISC Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Success     = 0
	Err_Params  = 1
	Err_MsgPool = 2
	Err_Chain   = 3
	Err_DPos    = 4
	Err_Token   = 5
	Err_Local   = 6
	Err_Unknown = 7
)

Variables

This section is empty.

Functions

func RegisterGreeterServer

func RegisterGreeterServer(s *grpc.Server, srv GreeterServer)

Types

type AddressReq

type AddressReq struct {
	Address              string   `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*AddressReq) Descriptor

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

func (*AddressReq) GetAddress

func (m *AddressReq) GetAddress() string

func (*AddressReq) ProtoMessage

func (*AddressReq) ProtoMessage()

func (*AddressReq) Reset

func (m *AddressReq) Reset()

func (*AddressReq) String

func (m *AddressReq) String() string

func (*AddressReq) XXX_DiscardUnknown

func (m *AddressReq) XXX_DiscardUnknown()

func (*AddressReq) XXX_Marshal

func (m *AddressReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*AddressReq) XXX_Merge

func (m *AddressReq) XXX_Merge(src proto.Message)

func (*AddressReq) XXX_Size

func (m *AddressReq) XXX_Size() int

func (*AddressReq) XXX_Unmarshal

func (m *AddressReq) XXX_Unmarshal(b []byte) error

type CancelReq

type CancelReq struct {
	From                 string   `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty"`
	Fees                 uint64   `protobuf:"varint,2,opt,name=fees,proto3" json:"fees,omitempty"`
	Timestamp            uint64   `protobuf:"varint,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	Nonce                uint64   `protobuf:"varint,4,opt,name=nonce,proto3" json:"nonce,omitempty"`
	Signature            string   `protobuf:"bytes,5,opt,name=signature,proto3" json:"signature,omitempty"`
	Publickey            string   `protobuf:"bytes,6,opt,name=publickey,proto3" json:"publickey,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*CancelReq) Descriptor

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

func (*CancelReq) GetFees

func (m *CancelReq) GetFees() uint64

func (*CancelReq) GetFrom

func (m *CancelReq) GetFrom() string

func (*CancelReq) GetNonce

func (m *CancelReq) GetNonce() uint64

func (*CancelReq) GetPublickey

func (m *CancelReq) GetPublickey() string

func (*CancelReq) GetSignature

func (m *CancelReq) GetSignature() string

func (*CancelReq) GetTimestamp

func (m *CancelReq) GetTimestamp() uint64

func (*CancelReq) ProtoMessage

func (*CancelReq) ProtoMessage()

func (*CancelReq) Reset

func (m *CancelReq) Reset()

func (*CancelReq) String

func (m *CancelReq) String() string

func (*CancelReq) XXX_DiscardUnknown

func (m *CancelReq) XXX_DiscardUnknown()

func (*CancelReq) XXX_Marshal

func (m *CancelReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*CancelReq) XXX_Merge

func (m *CancelReq) XXX_Merge(src proto.Message)

func (*CancelReq) XXX_Size

func (m *CancelReq) XXX_Size() int

func (*CancelReq) XXX_Unmarshal

func (m *CancelReq) XXX_Unmarshal(b []byte) error

type CandidateReq

type CandidateReq struct {
	From                 string   `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty"`
	P2Pid                string   `protobuf:"bytes,2,opt,name=p2pid,proto3" json:"p2pid,omitempty"`
	Fees                 uint64   `protobuf:"varint,3,opt,name=fees,proto3" json:"fees,omitempty"`
	Timestamp            uint64   `protobuf:"varint,4,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	Nonce                uint64   `protobuf:"varint,5,opt,name=nonce,proto3" json:"nonce,omitempty"`
	Signature            string   `protobuf:"bytes,6,opt,name=signature,proto3" json:"signature,omitempty"`
	Publickey            string   `protobuf:"bytes,7,opt,name=publickey,proto3" json:"publickey,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*CandidateReq) Descriptor

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

func (*CandidateReq) GetFees

func (m *CandidateReq) GetFees() uint64

func (*CandidateReq) GetFrom

func (m *CandidateReq) GetFrom() string

func (*CandidateReq) GetNonce

func (m *CandidateReq) GetNonce() uint64

func (*CandidateReq) GetP2Pid

func (m *CandidateReq) GetP2Pid() string

func (*CandidateReq) GetPublickey

func (m *CandidateReq) GetPublickey() string

func (*CandidateReq) GetSignature

func (m *CandidateReq) GetSignature() string

func (*CandidateReq) GetTimestamp

func (m *CandidateReq) GetTimestamp() uint64

func (*CandidateReq) ProtoMessage

func (*CandidateReq) ProtoMessage()

func (*CandidateReq) Reset

func (m *CandidateReq) Reset()

func (*CandidateReq) String

func (m *CandidateReq) String() string

func (*CandidateReq) XXX_DiscardUnknown

func (m *CandidateReq) XXX_DiscardUnknown()

func (*CandidateReq) XXX_Marshal

func (m *CandidateReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*CandidateReq) XXX_Merge

func (m *CandidateReq) XXX_Merge(src proto.Message)

func (*CandidateReq) XXX_Size

func (m *CandidateReq) XXX_Size() int

func (*CandidateReq) XXX_Unmarshal

func (m *CandidateReq) XXX_Unmarshal(b []byte) error

type Client

type Client struct {
	Gc GreeterClient
	// contains filtered or unexported fields
}

func NewClient

func NewClient(cfg *config.RpcConfig) *Client

func (*Client) Close

func (c *Client) Close()

func (*Client) Connect

func (c *Client) Connect() error

type CycleReq

type CycleReq struct {
	Cycle                uint64   `protobuf:"varint,1,opt,name=cycle,proto3" json:"cycle,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*CycleReq) Descriptor

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

func (*CycleReq) GetCycle

func (m *CycleReq) GetCycle() uint64

func (*CycleReq) ProtoMessage

func (*CycleReq) ProtoMessage()

func (*CycleReq) Reset

func (m *CycleReq) Reset()

func (*CycleReq) String

func (m *CycleReq) String() string

func (*CycleReq) XXX_DiscardUnknown

func (m *CycleReq) XXX_DiscardUnknown()

func (*CycleReq) XXX_Marshal

func (m *CycleReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*CycleReq) XXX_Merge

func (m *CycleReq) XXX_Merge(src proto.Message)

func (*CycleReq) XXX_Size

func (m *CycleReq) XXX_Size() int

func (*CycleReq) XXX_Unmarshal

func (m *CycleReq) XXX_Unmarshal(b []byte) error

type GenerateReq

type GenerateReq struct {
	Network              string   `protobuf:"bytes,1,opt,name=network,proto3" json:"network,omitempty"`
	Publickey            string   `protobuf:"bytes,2,opt,name=publickey,proto3" json:"publickey,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*GenerateReq) Descriptor

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

func (*GenerateReq) GetNetwork

func (m *GenerateReq) GetNetwork() string

func (*GenerateReq) GetPublickey

func (m *GenerateReq) GetPublickey() string

func (*GenerateReq) ProtoMessage

func (*GenerateReq) ProtoMessage()

func (*GenerateReq) Reset

func (m *GenerateReq) Reset()

func (*GenerateReq) String

func (m *GenerateReq) String() string

func (*GenerateReq) XXX_DiscardUnknown

func (m *GenerateReq) XXX_DiscardUnknown()

func (*GenerateReq) XXX_Marshal

func (m *GenerateReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GenerateReq) XXX_Merge

func (m *GenerateReq) XXX_Merge(src proto.Message)

func (*GenerateReq) XXX_Size

func (m *GenerateReq) XXX_Size() int

func (*GenerateReq) XXX_Unmarshal

func (m *GenerateReq) XXX_Unmarshal(b []byte) error

type GenerateTokenReq

type GenerateTokenReq struct {
	Network              string   `protobuf:"bytes,1,opt,name=network,proto3" json:"network,omitempty"`
	Address              string   `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"`
	Abbr                 string   `protobuf:"bytes,3,opt,name=abbr,proto3" json:"abbr,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*GenerateTokenReq) Descriptor

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

func (*GenerateTokenReq) GetAbbr

func (m *GenerateTokenReq) GetAbbr() string

func (*GenerateTokenReq) GetAddress

func (m *GenerateTokenReq) GetAddress() string

func (*GenerateTokenReq) GetNetwork

func (m *GenerateTokenReq) GetNetwork() string

func (*GenerateTokenReq) ProtoMessage

func (*GenerateTokenReq) ProtoMessage()

func (*GenerateTokenReq) Reset

func (m *GenerateTokenReq) Reset()

func (*GenerateTokenReq) String

func (m *GenerateTokenReq) String() string

func (*GenerateTokenReq) XXX_DiscardUnknown

func (m *GenerateTokenReq) XXX_DiscardUnknown()

func (*GenerateTokenReq) XXX_Marshal

func (m *GenerateTokenReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GenerateTokenReq) XXX_Merge

func (m *GenerateTokenReq) XXX_Merge(src proto.Message)

func (*GenerateTokenReq) XXX_Size

func (m *GenerateTokenReq) XXX_Size() int

func (*GenerateTokenReq) XXX_Unmarshal

func (m *GenerateTokenReq) XXX_Unmarshal(b []byte) error

type GreeterClient

type GreeterClient interface {
	// Sends a greeting
	GetAccount(ctx context.Context, in *AddressReq, opts ...grpc.CallOption) (*Response, error)
	SendMessageRaw(ctx context.Context, in *SendMessageCodeReq, opts ...grpc.CallOption) (*Response, error)
	GetMessage(ctx context.Context, in *HashReq, opts ...grpc.CallOption) (*Response, error)
	GetBlockHash(ctx context.Context, in *HashReq, opts ...grpc.CallOption) (*Response, error)
	GetBlockHeight(ctx context.Context, in *HeightReq, opts ...grpc.CallOption) (*Response, error)
	LastHeight(ctx context.Context, in *NullReq, opts ...grpc.CallOption) (*Response, error)
	Confirmed(ctx context.Context, in *NullReq, opts ...grpc.CallOption) (*Response, error)
	GetMsgPool(ctx context.Context, in *NullReq, opts ...grpc.CallOption) (*Response, error)
	Candidates(ctx context.Context, in *NullReq, opts ...grpc.CallOption) (*Response, error)
	GetCycleSupers(ctx context.Context, in *CycleReq, opts ...grpc.CallOption) (*Response, error)
	Token(ctx context.Context, in *TokenAddressReq, opts ...grpc.CallOption) (*Response, error)
	PeersInfo(ctx context.Context, in *NullReq, opts ...grpc.CallOption) (*Response, error)
	LocalInfo(ctx context.Context, in *NullReq, opts ...grpc.CallOption) (*Response, error)
	GenerateAddress(ctx context.Context, in *GenerateReq, opts ...grpc.CallOption) (*Response, error)
	GenerateTokenAddress(ctx context.Context, in *GenerateTokenReq, opts ...grpc.CallOption) (*Response, error)
	CreateTransaction(ctx context.Context, in *TransactionReq, opts ...grpc.CallOption) (*Response, error)
	CreateToken(ctx context.Context, in *TokenReq, opts ...grpc.CallOption) (*Response, error)
	CreateCandidate(ctx context.Context, in *CandidateReq, opts ...grpc.CallOption) (*Response, error)
	CreateCancel(ctx context.Context, in *CancelReq, opts ...grpc.CallOption) (*Response, error)
	CreateVote(ctx context.Context, in *VoteReq, opts ...grpc.CallOption) (*Response, error)
	SendTransaction(ctx context.Context, in *TransactionReq, opts ...grpc.CallOption) (*Response, error)
	SendToken(ctx context.Context, in *TokenReq, opts ...grpc.CallOption) (*Response, error)
	SendCandidate(ctx context.Context, in *CandidateReq, opts ...grpc.CallOption) (*Response, error)
	SendCancel(ctx context.Context, in *CancelReq, opts ...grpc.CallOption) (*Response, error)
	SendVote(ctx context.Context, in *VoteReq, opts ...grpc.CallOption) (*Response, error)
}

GreeterClient is the client API for Greeter service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewGreeterClient

func NewGreeterClient(cc *grpc.ClientConn) GreeterClient

type GreeterServer

type GreeterServer interface {
	// Sends a greeting
	GetAccount(context.Context, *AddressReq) (*Response, error)
	SendMessageRaw(context.Context, *SendMessageCodeReq) (*Response, error)
	GetMessage(context.Context, *HashReq) (*Response, error)
	GetBlockHash(context.Context, *HashReq) (*Response, error)
	GetBlockHeight(context.Context, *HeightReq) (*Response, error)
	LastHeight(context.Context, *NullReq) (*Response, error)
	Confirmed(context.Context, *NullReq) (*Response, error)
	GetMsgPool(context.Context, *NullReq) (*Response, error)
	Candidates(context.Context, *NullReq) (*Response, error)
	GetCycleSupers(context.Context, *CycleReq) (*Response, error)
	Token(context.Context, *TokenAddressReq) (*Response, error)
	PeersInfo(context.Context, *NullReq) (*Response, error)
	LocalInfo(context.Context, *NullReq) (*Response, error)
	GenerateAddress(context.Context, *GenerateReq) (*Response, error)
	GenerateTokenAddress(context.Context, *GenerateTokenReq) (*Response, error)
	CreateTransaction(context.Context, *TransactionReq) (*Response, error)
	CreateToken(context.Context, *TokenReq) (*Response, error)
	CreateCandidate(context.Context, *CandidateReq) (*Response, error)
	CreateCancel(context.Context, *CancelReq) (*Response, error)
	CreateVote(context.Context, *VoteReq) (*Response, error)
	SendTransaction(context.Context, *TransactionReq) (*Response, error)
	SendToken(context.Context, *TokenReq) (*Response, error)
	SendCandidate(context.Context, *CandidateReq) (*Response, error)
	SendCancel(context.Context, *CancelReq) (*Response, error)
	SendVote(context.Context, *VoteReq) (*Response, error)
}

GreeterServer is the server API for Greeter service.

type HashReq

type HashReq struct {
	Hash                 string   `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*HashReq) Descriptor

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

func (*HashReq) GetHash

func (m *HashReq) GetHash() string

func (*HashReq) ProtoMessage

func (*HashReq) ProtoMessage()

func (*HashReq) Reset

func (m *HashReq) Reset()

func (*HashReq) String

func (m *HashReq) String() string

func (*HashReq) XXX_DiscardUnknown

func (m *HashReq) XXX_DiscardUnknown()

func (*HashReq) XXX_Marshal

func (m *HashReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*HashReq) XXX_Merge

func (m *HashReq) XXX_Merge(src proto.Message)

func (*HashReq) XXX_Size

func (m *HashReq) XXX_Size() int

func (*HashReq) XXX_Unmarshal

func (m *HashReq) XXX_Unmarshal(b []byte) error

type HeightReq

type HeightReq struct {
	Height               uint64   `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*HeightReq) Descriptor

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

func (*HeightReq) GetHeight

func (m *HeightReq) GetHeight() uint64

func (*HeightReq) ProtoMessage

func (*HeightReq) ProtoMessage()

func (*HeightReq) Reset

func (m *HeightReq) Reset()

func (*HeightReq) String

func (m *HeightReq) String() string

func (*HeightReq) XXX_DiscardUnknown

func (m *HeightReq) XXX_DiscardUnknown()

func (*HeightReq) XXX_Marshal

func (m *HeightReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*HeightReq) XXX_Merge

func (m *HeightReq) XXX_Merge(src proto.Message)

func (*HeightReq) XXX_Size

func (m *HeightReq) XXX_Size() int

func (*HeightReq) XXX_Unmarshal

func (m *HeightReq) XXX_Unmarshal(b []byte) error

type NullReq

type NullReq struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*NullReq) Descriptor

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

func (*NullReq) ProtoMessage

func (*NullReq) ProtoMessage()

func (*NullReq) Reset

func (m *NullReq) Reset()

func (*NullReq) String

func (m *NullReq) String() string

func (*NullReq) XXX_DiscardUnknown

func (m *NullReq) XXX_DiscardUnknown()

func (*NullReq) XXX_Marshal

func (m *NullReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*NullReq) XXX_Merge

func (m *NullReq) XXX_Merge(src proto.Message)

func (*NullReq) XXX_Size

func (m *NullReq) XXX_Size() int

func (*NullReq) XXX_Unmarshal

func (m *NullReq) XXX_Unmarshal(b []byte) error

type Response

type Response struct {
	Code                 int32    `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"`
	Result               []byte   `protobuf:"bytes,2,opt,name=result,proto3" json:"result,omitempty"`
	Err                  string   `protobuf:"bytes,3,opt,name=err,proto3" json:"err,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

The response message containing the greetings

func NewResponse

func NewResponse(code int32, result []byte, err string) *Response

func (*Response) Descriptor

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

func (*Response) GetCode

func (m *Response) GetCode() int32

func (*Response) GetErr

func (m *Response) GetErr() string

func (*Response) GetResult

func (m *Response) GetResult() []byte

func (*Response) ProtoMessage

func (*Response) ProtoMessage()

func (*Response) Reset

func (m *Response) Reset()

func (*Response) String

func (m *Response) String() string

func (*Response) XXX_DiscardUnknown

func (m *Response) XXX_DiscardUnknown()

func (*Response) XXX_Marshal

func (m *Response) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Response) XXX_Merge

func (m *Response) XXX_Merge(src proto.Message)

func (*Response) XXX_Size

func (m *Response) XXX_Size() int

func (*Response) XXX_Unmarshal

func (m *Response) XXX_Unmarshal(b []byte) error

type Rpc

type Rpc struct {
	// contains filtered or unexported fields
}

func NewRpc

func NewRpc(status status.IStatus, msgPool *pool.Pool, chain blockchain.IChain, peers *peers.Peers) *Rpc

func (*Rpc) Candidates

func (r *Rpc) Candidates(context.Context, *NullReq) (*Response, error)

func (*Rpc) Confirmed

func (r *Rpc) Confirmed(context.Context, *NullReq) (*Response, error)

func (*Rpc) CreateCancel

func (r *Rpc) CreateCancel(ctx context.Context, req *CancelReq) (*Response, error)

func (*Rpc) CreateCandidate

func (r *Rpc) CreateCandidate(ctx context.Context, req *CandidateReq) (*Response, error)

func (*Rpc) CreateToken

func (r *Rpc) CreateToken(ctx context.Context, req *TokenReq) (*Response, error)

func (*Rpc) CreateTransaction

func (r *Rpc) CreateTransaction(ctx context.Context, req *TransactionReq) (*Response, error)

func (*Rpc) CreateVote

func (r *Rpc) CreateVote(ctx context.Context, req *VoteReq) (*Response, error)

func (*Rpc) GenerateAddress

func (r *Rpc) GenerateAddress(ctx context.Context, req *GenerateReq) (*Response, error)

func (*Rpc) GenerateTokenAddress

func (r *Rpc) GenerateTokenAddress(ctx context.Context, req *GenerateTokenReq) (*Response, error)

func (*Rpc) GetAccount

func (r *Rpc) GetAccount(_ context.Context, address *AddressReq) (*Response, error)

func (*Rpc) GetBlockHash

func (r *Rpc) GetBlockHash(ctx context.Context, hash *HashReq) (*Response, error)

func (*Rpc) GetBlockHeight

func (r *Rpc) GetBlockHeight(ctx context.Context, height *HeightReq) (*Response, error)

func (*Rpc) GetCycleSupers

func (r *Rpc) GetCycleSupers(ctx context.Context, cycle *CycleReq) (*Response, error)

func (*Rpc) GetMessage

func (r *Rpc) GetMessage(ctx context.Context, hash *HashReq) (*Response, error)

func (*Rpc) GetMsgPool

func (r *Rpc) GetMsgPool(context.Context, *NullReq) (*Response, error)

func (*Rpc) Info

func (r *Rpc) Info() map[string]interface{}

func (*Rpc) LastHeight

func (r *Rpc) LastHeight(context.Context, *NullReq) (*Response, error)

func (*Rpc) LocalInfo

func (r *Rpc) LocalInfo(context.Context, *NullReq) (*Response, error)

func (*Rpc) Name

func (r *Rpc) Name() string

func (*Rpc) NewGRpcServer

func (r *Rpc) NewGRpcServer() (*grpc.Server, error)

func (*Rpc) PeersInfo

func (r *Rpc) PeersInfo(context.Context, *NullReq) (*Response, error)

func (*Rpc) RegisterLocalInfo

func (r *Rpc) RegisterLocalInfo(f func() *types.Local)

func (*Rpc) SendCancel

func (r *Rpc) SendCancel(ctx context.Context, req *CancelReq) (*Response, error)

func (*Rpc) SendCandidate

func (r *Rpc) SendCandidate(ctx context.Context, req *CandidateReq) (*Response, error)

func (*Rpc) SendMessageRaw

func (r *Rpc) SendMessageRaw(ctx context.Context, code *SendMessageCodeReq) (*Response, error)

func (*Rpc) SendToken

func (r *Rpc) SendToken(ctx context.Context, req *TokenReq) (*Response, error)

func (*Rpc) SendTransaction

func (r *Rpc) SendTransaction(ctx context.Context, req *TransactionReq) (*Response, error)

func (*Rpc) SendVote

func (r *Rpc) SendVote(ctx context.Context, req *VoteReq) (*Response, error)

func (*Rpc) Start

func (r *Rpc) Start() error

func (*Rpc) Stop

func (r *Rpc) Stop() error

func (*Rpc) Token

func (r *Rpc) Token(ctx context.Context, token *TokenAddressReq) (*Response, error)

type SendMessageCodeReq

type SendMessageCodeReq struct {
	Code                 []byte   `protobuf:"bytes,1,opt,name=code,proto3" json:"code,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*SendMessageCodeReq) Descriptor

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

func (*SendMessageCodeReq) GetCode

func (m *SendMessageCodeReq) GetCode() []byte

func (*SendMessageCodeReq) ProtoMessage

func (*SendMessageCodeReq) ProtoMessage()

func (*SendMessageCodeReq) Reset

func (m *SendMessageCodeReq) Reset()

func (*SendMessageCodeReq) String

func (m *SendMessageCodeReq) String() string

func (*SendMessageCodeReq) XXX_DiscardUnknown

func (m *SendMessageCodeReq) XXX_DiscardUnknown()

func (*SendMessageCodeReq) XXX_Marshal

func (m *SendMessageCodeReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*SendMessageCodeReq) XXX_Merge

func (m *SendMessageCodeReq) XXX_Merge(src proto.Message)

func (*SendMessageCodeReq) XXX_Size

func (m *SendMessageCodeReq) XXX_Size() int

func (*SendMessageCodeReq) XXX_Unmarshal

func (m *SendMessageCodeReq) XXX_Unmarshal(b []byte) error

type TokenAddressReq

type TokenAddressReq struct {
	Token                string   `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*TokenAddressReq) Descriptor

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

func (*TokenAddressReq) GetToken

func (m *TokenAddressReq) GetToken() string

func (*TokenAddressReq) ProtoMessage

func (*TokenAddressReq) ProtoMessage()

func (*TokenAddressReq) Reset

func (m *TokenAddressReq) Reset()

func (*TokenAddressReq) String

func (m *TokenAddressReq) String() string

func (*TokenAddressReq) XXX_DiscardUnknown

func (m *TokenAddressReq) XXX_DiscardUnknown()

func (*TokenAddressReq) XXX_Marshal

func (m *TokenAddressReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TokenAddressReq) XXX_Merge

func (m *TokenAddressReq) XXX_Merge(src proto.Message)

func (*TokenAddressReq) XXX_Size

func (m *TokenAddressReq) XXX_Size() int

func (*TokenAddressReq) XXX_Unmarshal

func (m *TokenAddressReq) XXX_Unmarshal(b []byte) error

type TokenReq

type TokenReq struct {
	From                 string   `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty"`
	Receiver             string   `protobuf:"bytes,2,opt,name=receiver,proto3" json:"receiver,omitempty"`
	Token                string   `protobuf:"bytes,4,opt,name=token,proto3" json:"token,omitempty"`
	Name                 string   `protobuf:"bytes,5,opt,name=name,proto3" json:"name,omitempty"`
	Abbr                 string   `protobuf:"bytes,6,opt,name=abbr,proto3" json:"abbr,omitempty"`
	Increase             bool     `protobuf:"varint,7,opt,name=increase,proto3" json:"increase,omitempty"`
	Amount               uint64   `protobuf:"varint,8,opt,name=amount,proto3" json:"amount,omitempty"`
	Fees                 uint64   `protobuf:"varint,9,opt,name=fees,proto3" json:"fees,omitempty"`
	Timestamp            uint64   `protobuf:"varint,10,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	Nonce                uint64   `protobuf:"varint,11,opt,name=nonce,proto3" json:"nonce,omitempty"`
	Signature            string   `protobuf:"bytes,12,opt,name=signature,proto3" json:"signature,omitempty"`
	Publickey            string   `protobuf:"bytes,13,opt,name=publickey,proto3" json:"publickey,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*TokenReq) Descriptor

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

func (*TokenReq) GetAbbr

func (m *TokenReq) GetAbbr() string

func (*TokenReq) GetAmount

func (m *TokenReq) GetAmount() uint64

func (*TokenReq) GetFees

func (m *TokenReq) GetFees() uint64

func (*TokenReq) GetFrom

func (m *TokenReq) GetFrom() string

func (*TokenReq) GetIncrease

func (m *TokenReq) GetIncrease() bool

func (*TokenReq) GetName

func (m *TokenReq) GetName() string

func (*TokenReq) GetNonce

func (m *TokenReq) GetNonce() uint64

func (*TokenReq) GetPublickey

func (m *TokenReq) GetPublickey() string

func (*TokenReq) GetReceiver

func (m *TokenReq) GetReceiver() string

func (*TokenReq) GetSignature

func (m *TokenReq) GetSignature() string

func (*TokenReq) GetTimestamp

func (m *TokenReq) GetTimestamp() uint64

func (*TokenReq) GetToken

func (m *TokenReq) GetToken() string

func (*TokenReq) ProtoMessage

func (*TokenReq) ProtoMessage()

func (*TokenReq) Reset

func (m *TokenReq) Reset()

func (*TokenReq) String

func (m *TokenReq) String() string

func (*TokenReq) XXX_DiscardUnknown

func (m *TokenReq) XXX_DiscardUnknown()

func (*TokenReq) XXX_Marshal

func (m *TokenReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TokenReq) XXX_Merge

func (m *TokenReq) XXX_Merge(src proto.Message)

func (*TokenReq) XXX_Size

func (m *TokenReq) XXX_Size() int

func (*TokenReq) XXX_Unmarshal

func (m *TokenReq) XXX_Unmarshal(b []byte) error

type TransactionReq

type TransactionReq struct {
	From                 string   `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty"`
	To                   string   `protobuf:"bytes,2,opt,name=to,proto3" json:"to,omitempty"`
	Token                string   `protobuf:"bytes,3,opt,name=token,proto3" json:"token,omitempty"`
	Note                 string   `protobuf:"bytes,4,opt,name=note,proto3" json:"note,omitempty"`
	Amount               uint64   `protobuf:"varint,5,opt,name=amount,proto3" json:"amount,omitempty"`
	Fees                 uint64   `protobuf:"varint,6,opt,name=fees,proto3" json:"fees,omitempty"`
	Timestamp            uint64   `protobuf:"varint,7,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	Nonce                uint64   `protobuf:"varint,8,opt,name=nonce,proto3" json:"nonce,omitempty"`
	Signature            string   `protobuf:"bytes,9,opt,name=signature,proto3" json:"signature,omitempty"`
	Publickey            string   `protobuf:"bytes,10,opt,name=publickey,proto3" json:"publickey,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*TransactionReq) Descriptor

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

func (*TransactionReq) GetAmount

func (m *TransactionReq) GetAmount() uint64

func (*TransactionReq) GetFees

func (m *TransactionReq) GetFees() uint64

func (*TransactionReq) GetFrom

func (m *TransactionReq) GetFrom() string

func (*TransactionReq) GetNonce

func (m *TransactionReq) GetNonce() uint64

func (*TransactionReq) GetNote

func (m *TransactionReq) GetNote() string

func (*TransactionReq) GetPublickey

func (m *TransactionReq) GetPublickey() string

func (*TransactionReq) GetSignature

func (m *TransactionReq) GetSignature() string

func (*TransactionReq) GetTimestamp

func (m *TransactionReq) GetTimestamp() uint64

func (*TransactionReq) GetTo

func (m *TransactionReq) GetTo() string

func (*TransactionReq) GetToken

func (m *TransactionReq) GetToken() string

func (*TransactionReq) ProtoMessage

func (*TransactionReq) ProtoMessage()

func (*TransactionReq) Reset

func (m *TransactionReq) Reset()

func (*TransactionReq) String

func (m *TransactionReq) String() string

func (*TransactionReq) XXX_DiscardUnknown

func (m *TransactionReq) XXX_DiscardUnknown()

func (*TransactionReq) XXX_Marshal

func (m *TransactionReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TransactionReq) XXX_Merge

func (m *TransactionReq) XXX_Merge(src proto.Message)

func (*TransactionReq) XXX_Size

func (m *TransactionReq) XXX_Size() int

func (*TransactionReq) XXX_Unmarshal

func (m *TransactionReq) XXX_Unmarshal(b []byte) error

type UnimplementedGreeterServer

type UnimplementedGreeterServer struct {
}

UnimplementedGreeterServer can be embedded to have forward compatible implementations.

func (*UnimplementedGreeterServer) Candidates

func (*UnimplementedGreeterServer) Candidates(ctx context.Context, req *NullReq) (*Response, error)

func (*UnimplementedGreeterServer) Confirmed

func (*UnimplementedGreeterServer) Confirmed(ctx context.Context, req *NullReq) (*Response, error)

func (*UnimplementedGreeterServer) CreateCancel

func (*UnimplementedGreeterServer) CreateCancel(ctx context.Context, req *CancelReq) (*Response, error)

func (*UnimplementedGreeterServer) CreateCandidate

func (*UnimplementedGreeterServer) CreateCandidate(ctx context.Context, req *CandidateReq) (*Response, error)

func (*UnimplementedGreeterServer) CreateToken

func (*UnimplementedGreeterServer) CreateToken(ctx context.Context, req *TokenReq) (*Response, error)

func (*UnimplementedGreeterServer) CreateTransaction

func (*UnimplementedGreeterServer) CreateTransaction(ctx context.Context, req *TransactionReq) (*Response, error)

func (*UnimplementedGreeterServer) CreateVote

func (*UnimplementedGreeterServer) CreateVote(ctx context.Context, req *VoteReq) (*Response, error)

func (*UnimplementedGreeterServer) GenerateAddress

func (*UnimplementedGreeterServer) GenerateAddress(ctx context.Context, req *GenerateReq) (*Response, error)

func (*UnimplementedGreeterServer) GenerateTokenAddress

func (*UnimplementedGreeterServer) GenerateTokenAddress(ctx context.Context, req *GenerateTokenReq) (*Response, error)

func (*UnimplementedGreeterServer) GetAccount

func (*UnimplementedGreeterServer) GetBlockHash

func (*UnimplementedGreeterServer) GetBlockHash(ctx context.Context, req *HashReq) (*Response, error)

func (*UnimplementedGreeterServer) GetBlockHeight

func (*UnimplementedGreeterServer) GetBlockHeight(ctx context.Context, req *HeightReq) (*Response, error)

func (*UnimplementedGreeterServer) GetCycleSupers

func (*UnimplementedGreeterServer) GetCycleSupers(ctx context.Context, req *CycleReq) (*Response, error)

func (*UnimplementedGreeterServer) GetMessage

func (*UnimplementedGreeterServer) GetMessage(ctx context.Context, req *HashReq) (*Response, error)

func (*UnimplementedGreeterServer) GetMsgPool

func (*UnimplementedGreeterServer) GetMsgPool(ctx context.Context, req *NullReq) (*Response, error)

func (*UnimplementedGreeterServer) LastHeight

func (*UnimplementedGreeterServer) LastHeight(ctx context.Context, req *NullReq) (*Response, error)

func (*UnimplementedGreeterServer) LocalInfo

func (*UnimplementedGreeterServer) LocalInfo(ctx context.Context, req *NullReq) (*Response, error)

func (*UnimplementedGreeterServer) PeersInfo

func (*UnimplementedGreeterServer) PeersInfo(ctx context.Context, req *NullReq) (*Response, error)

func (*UnimplementedGreeterServer) SendCancel

func (*UnimplementedGreeterServer) SendCandidate

func (*UnimplementedGreeterServer) SendCandidate(ctx context.Context, req *CandidateReq) (*Response, error)

func (*UnimplementedGreeterServer) SendMessageRaw

func (*UnimplementedGreeterServer) SendToken

func (*UnimplementedGreeterServer) SendTransaction

func (*UnimplementedGreeterServer) SendTransaction(ctx context.Context, req *TransactionReq) (*Response, error)

func (*UnimplementedGreeterServer) SendVote

func (*UnimplementedGreeterServer) Token

type VoteReq

type VoteReq struct {
	From                 string   `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty"`
	To                   string   `protobuf:"bytes,2,opt,name=to,proto3" json:"to,omitempty"`
	Fees                 uint64   `protobuf:"varint,3,opt,name=fees,proto3" json:"fees,omitempty"`
	Timestamp            uint64   `protobuf:"varint,4,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	Nonce                uint64   `protobuf:"varint,5,opt,name=nonce,proto3" json:"nonce,omitempty"`
	Signature            string   `protobuf:"bytes,6,opt,name=signature,proto3" json:"signature,omitempty"`
	Publickey            string   `protobuf:"bytes,7,opt,name=publickey,proto3" json:"publickey,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*VoteReq) Descriptor

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

func (*VoteReq) GetFees

func (m *VoteReq) GetFees() uint64

func (*VoteReq) GetFrom

func (m *VoteReq) GetFrom() string

func (*VoteReq) GetNonce

func (m *VoteReq) GetNonce() uint64

func (*VoteReq) GetPublickey

func (m *VoteReq) GetPublickey() string

func (*VoteReq) GetSignature

func (m *VoteReq) GetSignature() string

func (*VoteReq) GetTimestamp

func (m *VoteReq) GetTimestamp() uint64

func (*VoteReq) GetTo

func (m *VoteReq) GetTo() string

func (*VoteReq) ProtoMessage

func (*VoteReq) ProtoMessage()

func (*VoteReq) Reset

func (m *VoteReq) Reset()

func (*VoteReq) String

func (m *VoteReq) String() string

func (*VoteReq) XXX_DiscardUnknown

func (m *VoteReq) XXX_DiscardUnknown()

func (*VoteReq) XXX_Marshal

func (m *VoteReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*VoteReq) XXX_Merge

func (m *VoteReq) XXX_Merge(src proto.Message)

func (*VoteReq) XXX_Size

func (m *VoteReq) XXX_Size() int

func (*VoteReq) XXX_Unmarshal

func (m *VoteReq) XXX_Unmarshal(b []byte) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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