rpc

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2018 License: LGPL-3.0 Imports: 30 Imported by: 2

Documentation

Overview

Package rpc is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthApis = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowApis   = fmt.Errorf("proto: integer overflow")
)

Functions

func RegisterApisHandler

func RegisterApisHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterApisHandler registers the http handlers for service Apis to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterApisHandlerClient

func RegisterApisHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ApisClient) error

RegisterApisHandlerClient registers the http handlers for service Apis to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ApisClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ApisClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "ApisClient" to call the correct interceptors.

func RegisterApisHandlerFromEndpoint

func RegisterApisHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterApisHandlerFromEndpoint is same as RegisterApisHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterApisServer

func RegisterApisServer(s *grpc.Server, srv ApisServer)

Types

type ApisClient

type ApisClient interface {
	// get the current height of the blockchain
	GetHeight(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*HeightRes, error)
	// get the tx by hash
	GetTxByHash(ctx context.Context, in *HashReq, opts ...grpc.CallOption) (*TxRes, error)
	// get receipt by hash
	GetTxReceiptByHash(ctx context.Context, in *HashReq, opts ...grpc.CallOption) (*TxReceiptRes, error)
	// get receipt by txhash
	GetTxReceiptByTxHash(ctx context.Context, in *HashReq, opts ...grpc.CallOption) (*TxReceiptRes, error)
	// get the block by hash
	GetBlockByHash(ctx context.Context, in *BlockByHashReq, opts ...grpc.CallOption) (*BlockInfo, error)
	// get the block by number
	GetBlockByNum(ctx context.Context, in *BlockByNumReq, opts ...grpc.CallOption) (*BlockInfo, error)
	// get the balance of some account by account ID
	GetBalance(ctx context.Context, in *GetBalanceReq, opts ...grpc.CallOption) (*GetBalanceRes, error)
	// get the Net ID
	GetNetID(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*GetNetIDRes, error)
	// get the value of the corresponding key in stateDB
	GetState(ctx context.Context, in *GetStateReq, opts ...grpc.CallOption) (*GetStateRes, error)
	// receive encoded tx
	SendRawTx(ctx context.Context, in *RawTxReq, opts ...grpc.CallOption) (*SendRawTxRes, error)
	// not supported yet
	EstimateGas(ctx context.Context, in *RawTxReq, opts ...grpc.CallOption) (*GasRes, error)
	// subscribe an event
	Subscribe(ctx context.Context, in *SubscribeReq, opts ...grpc.CallOption) (Apis_SubscribeClient, error)
}

ApisClient is the client API for Apis service.

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

func NewApisClient

func NewApisClient(cc *grpc.ClientConn) ApisClient

type ApisServer

type ApisServer interface {
	// get the current height of the blockchain
	GetHeight(context.Context, *empty.Empty) (*HeightRes, error)
	// get the tx by hash
	GetTxByHash(context.Context, *HashReq) (*TxRes, error)
	// get receipt by hash
	GetTxReceiptByHash(context.Context, *HashReq) (*TxReceiptRes, error)
	// get receipt by txhash
	GetTxReceiptByTxHash(context.Context, *HashReq) (*TxReceiptRes, error)
	// get the block by hash
	GetBlockByHash(context.Context, *BlockByHashReq) (*BlockInfo, error)
	// get the block by number
	GetBlockByNum(context.Context, *BlockByNumReq) (*BlockInfo, error)
	// get the balance of some account by account ID
	GetBalance(context.Context, *GetBalanceReq) (*GetBalanceRes, error)
	// get the Net ID
	GetNetID(context.Context, *empty.Empty) (*GetNetIDRes, error)
	// get the value of the corresponding key in stateDB
	GetState(context.Context, *GetStateReq) (*GetStateRes, error)
	// receive encoded tx
	SendRawTx(context.Context, *RawTxReq) (*SendRawTxRes, error)
	// not supported yet
	EstimateGas(context.Context, *RawTxReq) (*GasRes, error)
	// subscribe an event
	Subscribe(*SubscribeReq, Apis_SubscribeServer) error
}

ApisServer is the server API for Apis service.

type Apis_SubscribeClient

type Apis_SubscribeClient interface {
	Recv() (*SubscribeRes, error)
	grpc.ClientStream
}

type Apis_SubscribeServer

type Apis_SubscribeServer interface {
	Send(*SubscribeRes) error
	grpc.ServerStream
}

type BlockByHashReq

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

complete means return the whole block or just blockhead+txhash_list

func (*BlockByHashReq) Descriptor

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

func (*BlockByHashReq) GetComplete

func (m *BlockByHashReq) GetComplete() bool

func (*BlockByHashReq) GetHash

func (m *BlockByHashReq) GetHash() string

func (*BlockByHashReq) Marshal

func (m *BlockByHashReq) Marshal() (dAtA []byte, err error)

func (*BlockByHashReq) MarshalTo

func (m *BlockByHashReq) MarshalTo(dAtA []byte) (int, error)

func (*BlockByHashReq) ProtoMessage

func (*BlockByHashReq) ProtoMessage()

func (*BlockByHashReq) Reset

func (m *BlockByHashReq) Reset()

func (*BlockByHashReq) Size

func (m *BlockByHashReq) Size() (n int)

func (*BlockByHashReq) String

func (m *BlockByHashReq) String() string

func (*BlockByHashReq) Unmarshal

func (m *BlockByHashReq) Unmarshal(dAtA []byte) error

func (*BlockByHashReq) XXX_DiscardUnknown

func (m *BlockByHashReq) XXX_DiscardUnknown()

func (*BlockByHashReq) XXX_Marshal

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

func (*BlockByHashReq) XXX_Merge

func (dst *BlockByHashReq) XXX_Merge(src proto.Message)

func (*BlockByHashReq) XXX_Size

func (m *BlockByHashReq) XXX_Size() int

func (*BlockByHashReq) XXX_Unmarshal

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

type BlockByNumReq

type BlockByNumReq struct {
	Num                  int64    `protobuf:"varint,1,opt,name=num,proto3" json:"num,omitempty"`
	Complete             bool     `protobuf:"varint,2,opt,name=complete,proto3" json:"complete,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*BlockByNumReq) Descriptor

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

func (*BlockByNumReq) GetComplete

func (m *BlockByNumReq) GetComplete() bool

func (*BlockByNumReq) GetNum

func (m *BlockByNumReq) GetNum() int64

func (*BlockByNumReq) Marshal

func (m *BlockByNumReq) Marshal() (dAtA []byte, err error)

func (*BlockByNumReq) MarshalTo

func (m *BlockByNumReq) MarshalTo(dAtA []byte) (int, error)

func (*BlockByNumReq) ProtoMessage

func (*BlockByNumReq) ProtoMessage()

func (*BlockByNumReq) Reset

func (m *BlockByNumReq) Reset()

func (*BlockByNumReq) Size

func (m *BlockByNumReq) Size() (n int)

func (*BlockByNumReq) String

func (m *BlockByNumReq) String() string

func (*BlockByNumReq) Unmarshal

func (m *BlockByNumReq) Unmarshal(dAtA []byte) error

func (*BlockByNumReq) XXX_DiscardUnknown

func (m *BlockByNumReq) XXX_DiscardUnknown()

func (*BlockByNumReq) XXX_Marshal

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

func (*BlockByNumReq) XXX_Merge

func (dst *BlockByNumReq) XXX_Merge(src proto.Message)

func (*BlockByNumReq) XXX_Size

func (m *BlockByNumReq) XXX_Size() int

func (*BlockByNumReq) XXX_Unmarshal

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

type BlockInfo

type BlockInfo struct {
	Head                 *block.BlockHead   `protobuf:"bytes,1,opt,name=head" json:"head,omitempty"`
	Hash                 []byte             `protobuf:"bytes,2,opt,name=hash,proto3" json:"hash,omitempty"`
	Txs                  []*tx.TxRaw        `protobuf:"bytes,3,rep,name=txs" json:"txs,omitempty"`
	Txhash               [][]byte           `protobuf:"bytes,4,rep,name=txhash" json:"txhash,omitempty"`
	Receipts             []*tx.TxReceiptRaw `protobuf:"bytes,5,rep,name=receipts" json:"receipts,omitempty"`
	ReceiptHash          [][]byte           `protobuf:"bytes,6,rep,name=receiptHash" json:"receiptHash,omitempty"`
	XXX_NoUnkeyedLiteral struct{}           `json:"-"`
	XXX_unrecognized     []byte             `json:"-"`
	XXX_sizecache        int32              `json:"-"`
}

func (*BlockInfo) Descriptor

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

func (*BlockInfo) GetHash

func (m *BlockInfo) GetHash() []byte

func (*BlockInfo) GetHead

func (m *BlockInfo) GetHead() *block.BlockHead

func (*BlockInfo) GetReceiptHash

func (m *BlockInfo) GetReceiptHash() [][]byte

func (*BlockInfo) GetReceipts

func (m *BlockInfo) GetReceipts() []*tx.TxReceiptRaw

func (*BlockInfo) GetTxhash

func (m *BlockInfo) GetTxhash() [][]byte

func (*BlockInfo) GetTxs

func (m *BlockInfo) GetTxs() []*tx.TxRaw

func (*BlockInfo) Marshal

func (m *BlockInfo) Marshal() (dAtA []byte, err error)

func (*BlockInfo) MarshalTo

func (m *BlockInfo) MarshalTo(dAtA []byte) (int, error)

func (*BlockInfo) ProtoMessage

func (*BlockInfo) ProtoMessage()

func (*BlockInfo) Reset

func (m *BlockInfo) Reset()

func (*BlockInfo) Size

func (m *BlockInfo) Size() (n int)

func (*BlockInfo) String

func (m *BlockInfo) String() string

func (*BlockInfo) Unmarshal

func (m *BlockInfo) Unmarshal(dAtA []byte) error

func (*BlockInfo) XXX_DiscardUnknown

func (m *BlockInfo) XXX_DiscardUnknown()

func (*BlockInfo) XXX_Marshal

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

func (*BlockInfo) XXX_Merge

func (dst *BlockInfo) XXX_Merge(src proto.Message)

func (*BlockInfo) XXX_Size

func (m *BlockInfo) XXX_Size() int

func (*BlockInfo) XXX_Unmarshal

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

type GRPCServer

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

GRPCServer GRPC rpc server

func NewRPCServer

func NewRPCServer(tp txpool.TxPool, bcache blockcache.BlockCache, _global global.BaseVariable, p2pService p2p.Service) *GRPCServer

NewRPCServer create GRPC rpc server

func (*GRPCServer) EstimateGas

func (s *GRPCServer) EstimateGas(ctx context.Context, rawTx *RawTxReq) (*GasRes, error)

EstimateGas estimate gas used by transaction

func (*GRPCServer) GetBalance

func (s *GRPCServer) GetBalance(ctx context.Context, key *GetBalanceReq) (*GetBalanceRes, error)

GetBalance get account balance

func (*GRPCServer) GetBlockByHash

func (s *GRPCServer) GetBlockByHash(ctx context.Context, blkHashReq *BlockByHashReq) (*BlockInfo, error)

GetBlockByHash get block by block head hash

func (*GRPCServer) GetBlockByNum

func (s *GRPCServer) GetBlockByNum(ctx context.Context, blkNumReq *BlockByNumReq) (*BlockInfo, error)

GetBlockByNum get block by block number

func (*GRPCServer) GetHeight

func (s *GRPCServer) GetHeight(ctx context.Context, empty *empty.Empty) (*HeightRes, error)

GetHeight get current block height

func (*GRPCServer) GetNetID

func (s *GRPCServer) GetNetID(ctx context.Context, empty *empty.Empty) (*GetNetIDRes, error)

GetNetID get net id

func (*GRPCServer) GetState

func (s *GRPCServer) GetState(ctx context.Context, key *GetStateReq) (*GetStateRes, error)

GetState get value from state db

func (*GRPCServer) GetTxByHash

func (s *GRPCServer) GetTxByHash(ctx context.Context, hash *HashReq) (*TxRes, error)

GetTxByHash get tx by transaction hash

func (*GRPCServer) GetTxReceiptByHash

func (s *GRPCServer) GetTxReceiptByHash(ctx context.Context, hash *HashReq) (*TxReceiptRes, error)

GetTxReceiptByHash get receipt by receipt hash

func (*GRPCServer) GetTxReceiptByTxHash

func (s *GRPCServer) GetTxReceiptByTxHash(ctx context.Context, hash *HashReq) (*TxReceiptRes, error)

GetTxReceiptByTxHash get receipt by transaction hash

func (*GRPCServer) SendRawTx

func (s *GRPCServer) SendRawTx(ctx context.Context, rawTx *RawTxReq) (*SendRawTxRes, error)

SendRawTx send transaction to blockchain

func (*GRPCServer) Start

func (s *GRPCServer) Start() error

Start start GRPC server

func (*GRPCServer) Stop

func (s *GRPCServer) Stop()

Stop stop GRPC server

func (*GRPCServer) Subscribe

func (s *GRPCServer) Subscribe(req *SubscribeReq, res Apis_SubscribeServer) error

Subscribe used for event

type GasRes

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

func (*GasRes) Descriptor

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

func (*GasRes) GetGas

func (m *GasRes) GetGas() uint64

func (*GasRes) Marshal

func (m *GasRes) Marshal() (dAtA []byte, err error)

func (*GasRes) MarshalTo

func (m *GasRes) MarshalTo(dAtA []byte) (int, error)

func (*GasRes) ProtoMessage

func (*GasRes) ProtoMessage()

func (*GasRes) Reset

func (m *GasRes) Reset()

func (*GasRes) Size

func (m *GasRes) Size() (n int)

func (*GasRes) String

func (m *GasRes) String() string

func (*GasRes) Unmarshal

func (m *GasRes) Unmarshal(dAtA []byte) error

func (*GasRes) XXX_DiscardUnknown

func (m *GasRes) XXX_DiscardUnknown()

func (*GasRes) XXX_Marshal

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

func (*GasRes) XXX_Merge

func (dst *GasRes) XXX_Merge(src proto.Message)

func (*GasRes) XXX_Size

func (m *GasRes) XXX_Size() int

func (*GasRes) XXX_Unmarshal

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

type GetBalanceReq

type GetBalanceReq struct {
	ID                   string   `protobuf:"bytes,1,opt,name=ID,proto3" json:"ID,omitempty"`
	UseLongestChain      bool     `protobuf:"varint,2,opt,name=useLongestChain,proto3" json:"useLongestChain,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*GetBalanceReq) Descriptor

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

func (*GetBalanceReq) GetID

func (m *GetBalanceReq) GetID() string

func (*GetBalanceReq) GetUseLongestChain

func (m *GetBalanceReq) GetUseLongestChain() bool

func (*GetBalanceReq) Marshal

func (m *GetBalanceReq) Marshal() (dAtA []byte, err error)

func (*GetBalanceReq) MarshalTo

func (m *GetBalanceReq) MarshalTo(dAtA []byte) (int, error)

func (*GetBalanceReq) ProtoMessage

func (*GetBalanceReq) ProtoMessage()

func (*GetBalanceReq) Reset

func (m *GetBalanceReq) Reset()

func (*GetBalanceReq) Size

func (m *GetBalanceReq) Size() (n int)

func (*GetBalanceReq) String

func (m *GetBalanceReq) String() string

func (*GetBalanceReq) Unmarshal

func (m *GetBalanceReq) Unmarshal(dAtA []byte) error

func (*GetBalanceReq) XXX_DiscardUnknown

func (m *GetBalanceReq) XXX_DiscardUnknown()

func (*GetBalanceReq) XXX_Marshal

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

func (*GetBalanceReq) XXX_Merge

func (dst *GetBalanceReq) XXX_Merge(src proto.Message)

func (*GetBalanceReq) XXX_Size

func (m *GetBalanceReq) XXX_Size() int

func (*GetBalanceReq) XXX_Unmarshal

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

type GetBalanceRes

type GetBalanceRes struct {
	Balance              int64    `protobuf:"varint,1,opt,name=balance,proto3" json:"balance,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*GetBalanceRes) Descriptor

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

func (*GetBalanceRes) GetBalance

func (m *GetBalanceRes) GetBalance() int64

func (*GetBalanceRes) Marshal

func (m *GetBalanceRes) Marshal() (dAtA []byte, err error)

func (*GetBalanceRes) MarshalTo

func (m *GetBalanceRes) MarshalTo(dAtA []byte) (int, error)

func (*GetBalanceRes) ProtoMessage

func (*GetBalanceRes) ProtoMessage()

func (*GetBalanceRes) Reset

func (m *GetBalanceRes) Reset()

func (*GetBalanceRes) Size

func (m *GetBalanceRes) Size() (n int)

func (*GetBalanceRes) String

func (m *GetBalanceRes) String() string

func (*GetBalanceRes) Unmarshal

func (m *GetBalanceRes) Unmarshal(dAtA []byte) error

func (*GetBalanceRes) XXX_DiscardUnknown

func (m *GetBalanceRes) XXX_DiscardUnknown()

func (*GetBalanceRes) XXX_Marshal

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

func (*GetBalanceRes) XXX_Merge

func (dst *GetBalanceRes) XXX_Merge(src proto.Message)

func (*GetBalanceRes) XXX_Size

func (m *GetBalanceRes) XXX_Size() int

func (*GetBalanceRes) XXX_Unmarshal

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

type GetNetIDRes

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

func (*GetNetIDRes) Descriptor

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

func (*GetNetIDRes) GetID

func (m *GetNetIDRes) GetID() string

func (*GetNetIDRes) Marshal

func (m *GetNetIDRes) Marshal() (dAtA []byte, err error)

func (*GetNetIDRes) MarshalTo

func (m *GetNetIDRes) MarshalTo(dAtA []byte) (int, error)

func (*GetNetIDRes) ProtoMessage

func (*GetNetIDRes) ProtoMessage()

func (*GetNetIDRes) Reset

func (m *GetNetIDRes) Reset()

func (*GetNetIDRes) Size

func (m *GetNetIDRes) Size() (n int)

func (*GetNetIDRes) String

func (m *GetNetIDRes) String() string

func (*GetNetIDRes) Unmarshal

func (m *GetNetIDRes) Unmarshal(dAtA []byte) error

func (*GetNetIDRes) XXX_DiscardUnknown

func (m *GetNetIDRes) XXX_DiscardUnknown()

func (*GetNetIDRes) XXX_Marshal

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

func (*GetNetIDRes) XXX_Merge

func (dst *GetNetIDRes) XXX_Merge(src proto.Message)

func (*GetNetIDRes) XXX_Size

func (m *GetNetIDRes) XXX_Size() int

func (*GetNetIDRes) XXX_Unmarshal

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

type GetStateReq

type GetStateReq struct {
	Key                  string   `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	Field                string   `protobuf:"bytes,2,opt,name=field,proto3" json:"field,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*GetStateReq) Descriptor

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

func (*GetStateReq) GetField

func (m *GetStateReq) GetField() string

func (*GetStateReq) GetKey

func (m *GetStateReq) GetKey() string

func (*GetStateReq) Marshal

func (m *GetStateReq) Marshal() (dAtA []byte, err error)

func (*GetStateReq) MarshalTo

func (m *GetStateReq) MarshalTo(dAtA []byte) (int, error)

func (*GetStateReq) ProtoMessage

func (*GetStateReq) ProtoMessage()

func (*GetStateReq) Reset

func (m *GetStateReq) Reset()

func (*GetStateReq) Size

func (m *GetStateReq) Size() (n int)

func (*GetStateReq) String

func (m *GetStateReq) String() string

func (*GetStateReq) Unmarshal

func (m *GetStateReq) Unmarshal(dAtA []byte) error

func (*GetStateReq) XXX_DiscardUnknown

func (m *GetStateReq) XXX_DiscardUnknown()

func (*GetStateReq) XXX_Marshal

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

func (*GetStateReq) XXX_Merge

func (dst *GetStateReq) XXX_Merge(src proto.Message)

func (*GetStateReq) XXX_Size

func (m *GetStateReq) XXX_Size() int

func (*GetStateReq) XXX_Unmarshal

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

type GetStateRes

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

func (*GetStateRes) Descriptor

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

func (*GetStateRes) GetValue

func (m *GetStateRes) GetValue() string

func (*GetStateRes) Marshal

func (m *GetStateRes) Marshal() (dAtA []byte, err error)

func (*GetStateRes) MarshalTo

func (m *GetStateRes) MarshalTo(dAtA []byte) (int, error)

func (*GetStateRes) ProtoMessage

func (*GetStateRes) ProtoMessage()

func (*GetStateRes) Reset

func (m *GetStateRes) Reset()

func (*GetStateRes) Size

func (m *GetStateRes) Size() (n int)

func (*GetStateRes) String

func (m *GetStateRes) String() string

func (*GetStateRes) Unmarshal

func (m *GetStateRes) Unmarshal(dAtA []byte) error

func (*GetStateRes) XXX_DiscardUnknown

func (m *GetStateRes) XXX_DiscardUnknown()

func (*GetStateRes) XXX_Marshal

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

func (*GetStateRes) XXX_Merge

func (dst *GetStateRes) XXX_Merge(src proto.Message)

func (*GetStateRes) XXX_Size

func (m *GetStateRes) XXX_Size() int

func (*GetStateRes) XXX_Unmarshal

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

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) Marshal

func (m *HashReq) Marshal() (dAtA []byte, err error)

func (*HashReq) MarshalTo

func (m *HashReq) MarshalTo(dAtA []byte) (int, error)

func (*HashReq) ProtoMessage

func (*HashReq) ProtoMessage()

func (*HashReq) Reset

func (m *HashReq) Reset()

func (*HashReq) Size

func (m *HashReq) Size() (n int)

func (*HashReq) String

func (m *HashReq) String() string

func (*HashReq) Unmarshal

func (m *HashReq) Unmarshal(dAtA []byte) error

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 (dst *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 HeightRes

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

func (*HeightRes) Descriptor

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

func (*HeightRes) GetHeight

func (m *HeightRes) GetHeight() int64

func (*HeightRes) Marshal

func (m *HeightRes) Marshal() (dAtA []byte, err error)

func (*HeightRes) MarshalTo

func (m *HeightRes) MarshalTo(dAtA []byte) (int, error)

func (*HeightRes) ProtoMessage

func (*HeightRes) ProtoMessage()

func (*HeightRes) Reset

func (m *HeightRes) Reset()

func (*HeightRes) Size

func (m *HeightRes) Size() (n int)

func (*HeightRes) String

func (m *HeightRes) String() string

func (*HeightRes) Unmarshal

func (m *HeightRes) Unmarshal(dAtA []byte) error

func (*HeightRes) XXX_DiscardUnknown

func (m *HeightRes) XXX_DiscardUnknown()

func (*HeightRes) XXX_Marshal

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

func (*HeightRes) XXX_Merge

func (dst *HeightRes) XXX_Merge(src proto.Message)

func (*HeightRes) XXX_Size

func (m *HeightRes) XXX_Size() int

func (*HeightRes) XXX_Unmarshal

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

type JSONServer

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

JSONServer json rpc server

func NewJSONServer

func NewJSONServer(_global global.BaseVariable) *JSONServer

NewJSONServer create json rpc server

func (*JSONServer) Start

func (j *JSONServer) Start() error

Start start json rpc server

func (*JSONServer) Stop

func (j *JSONServer) Stop()

Stop stop json rpc server

type RawTxReq

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

the rawdata of a tx

func (*RawTxReq) Descriptor

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

func (*RawTxReq) GetData

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

func (*RawTxReq) Marshal

func (m *RawTxReq) Marshal() (dAtA []byte, err error)

func (*RawTxReq) MarshalTo

func (m *RawTxReq) MarshalTo(dAtA []byte) (int, error)

func (*RawTxReq) ProtoMessage

func (*RawTxReq) ProtoMessage()

func (*RawTxReq) Reset

func (m *RawTxReq) Reset()

func (*RawTxReq) Size

func (m *RawTxReq) Size() (n int)

func (*RawTxReq) String

func (m *RawTxReq) String() string

func (*RawTxReq) Unmarshal

func (m *RawTxReq) Unmarshal(dAtA []byte) error

func (*RawTxReq) XXX_DiscardUnknown

func (m *RawTxReq) XXX_DiscardUnknown()

func (*RawTxReq) XXX_Marshal

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

func (*RawTxReq) XXX_Merge

func (dst *RawTxReq) XXX_Merge(src proto.Message)

func (*RawTxReq) XXX_Size

func (m *RawTxReq) XXX_Size() int

func (*RawTxReq) XXX_Unmarshal

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

type SendRawTxRes

type SendRawTxRes 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 (*SendRawTxRes) Descriptor

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

func (*SendRawTxRes) GetHash

func (m *SendRawTxRes) GetHash() string

func (*SendRawTxRes) Marshal

func (m *SendRawTxRes) Marshal() (dAtA []byte, err error)

func (*SendRawTxRes) MarshalTo

func (m *SendRawTxRes) MarshalTo(dAtA []byte) (int, error)

func (*SendRawTxRes) ProtoMessage

func (*SendRawTxRes) ProtoMessage()

func (*SendRawTxRes) Reset

func (m *SendRawTxRes) Reset()

func (*SendRawTxRes) Size

func (m *SendRawTxRes) Size() (n int)

func (*SendRawTxRes) String

func (m *SendRawTxRes) String() string

func (*SendRawTxRes) Unmarshal

func (m *SendRawTxRes) Unmarshal(dAtA []byte) error

func (*SendRawTxRes) XXX_DiscardUnknown

func (m *SendRawTxRes) XXX_DiscardUnknown()

func (*SendRawTxRes) XXX_Marshal

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

func (*SendRawTxRes) XXX_Merge

func (dst *SendRawTxRes) XXX_Merge(src proto.Message)

func (*SendRawTxRes) XXX_Size

func (m *SendRawTxRes) XXX_Size() int

func (*SendRawTxRes) XXX_Unmarshal

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

type SubscribeReq

type SubscribeReq struct {
	Topics               []event.Event_Topic `protobuf:"varint,1,rep,packed,name=topics,enum=event.Event_Topic" json:"topics,omitempty"`
	XXX_NoUnkeyedLiteral struct{}            `json:"-"`
	XXX_unrecognized     []byte              `json:"-"`
	XXX_sizecache        int32               `json:"-"`
}

func (*SubscribeReq) Descriptor

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

func (*SubscribeReq) GetTopics

func (m *SubscribeReq) GetTopics() []event.Event_Topic

func (*SubscribeReq) Marshal

func (m *SubscribeReq) Marshal() (dAtA []byte, err error)

func (*SubscribeReq) MarshalTo

func (m *SubscribeReq) MarshalTo(dAtA []byte) (int, error)

func (*SubscribeReq) ProtoMessage

func (*SubscribeReq) ProtoMessage()

func (*SubscribeReq) Reset

func (m *SubscribeReq) Reset()

func (*SubscribeReq) Size

func (m *SubscribeReq) Size() (n int)

func (*SubscribeReq) String

func (m *SubscribeReq) String() string

func (*SubscribeReq) Unmarshal

func (m *SubscribeReq) Unmarshal(dAtA []byte) error

func (*SubscribeReq) XXX_DiscardUnknown

func (m *SubscribeReq) XXX_DiscardUnknown()

func (*SubscribeReq) XXX_Marshal

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

func (*SubscribeReq) XXX_Merge

func (dst *SubscribeReq) XXX_Merge(src proto.Message)

func (*SubscribeReq) XXX_Size

func (m *SubscribeReq) XXX_Size() int

func (*SubscribeReq) XXX_Unmarshal

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

type SubscribeRes

type SubscribeRes struct {
	Ev                   *event.Event `protobuf:"bytes,1,opt,name=ev" json:"ev,omitempty"`
	XXX_NoUnkeyedLiteral struct{}     `json:"-"`
	XXX_unrecognized     []byte       `json:"-"`
	XXX_sizecache        int32        `json:"-"`
}

func (*SubscribeRes) Descriptor

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

func (*SubscribeRes) GetEv

func (m *SubscribeRes) GetEv() *event.Event

func (*SubscribeRes) Marshal

func (m *SubscribeRes) Marshal() (dAtA []byte, err error)

func (*SubscribeRes) MarshalTo

func (m *SubscribeRes) MarshalTo(dAtA []byte) (int, error)

func (*SubscribeRes) ProtoMessage

func (*SubscribeRes) ProtoMessage()

func (*SubscribeRes) Reset

func (m *SubscribeRes) Reset()

func (*SubscribeRes) Size

func (m *SubscribeRes) Size() (n int)

func (*SubscribeRes) String

func (m *SubscribeRes) String() string

func (*SubscribeRes) Unmarshal

func (m *SubscribeRes) Unmarshal(dAtA []byte) error

func (*SubscribeRes) XXX_DiscardUnknown

func (m *SubscribeRes) XXX_DiscardUnknown()

func (*SubscribeRes) XXX_Marshal

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

func (*SubscribeRes) XXX_Merge

func (dst *SubscribeRes) XXX_Merge(src proto.Message)

func (*SubscribeRes) XXX_Size

func (m *SubscribeRes) XXX_Size() int

func (*SubscribeRes) XXX_Unmarshal

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

type TxReceiptRes

type TxReceiptRes struct {
	TxReceiptRaw         *tx.TxReceiptRaw `protobuf:"bytes,1,opt,name=txReceiptRaw" json:"txReceiptRaw,omitempty"`
	Hash                 []byte           `protobuf:"bytes,2,opt,name=hash,proto3" json:"hash,omitempty"`
	XXX_NoUnkeyedLiteral struct{}         `json:"-"`
	XXX_unrecognized     []byte           `json:"-"`
	XXX_sizecache        int32            `json:"-"`
}

func (*TxReceiptRes) Descriptor

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

func (*TxReceiptRes) GetHash

func (m *TxReceiptRes) GetHash() []byte

func (*TxReceiptRes) GetTxReceiptRaw

func (m *TxReceiptRes) GetTxReceiptRaw() *tx.TxReceiptRaw

func (*TxReceiptRes) Marshal

func (m *TxReceiptRes) Marshal() (dAtA []byte, err error)

func (*TxReceiptRes) MarshalTo

func (m *TxReceiptRes) MarshalTo(dAtA []byte) (int, error)

func (*TxReceiptRes) ProtoMessage

func (*TxReceiptRes) ProtoMessage()

func (*TxReceiptRes) Reset

func (m *TxReceiptRes) Reset()

func (*TxReceiptRes) Size

func (m *TxReceiptRes) Size() (n int)

func (*TxReceiptRes) String

func (m *TxReceiptRes) String() string

func (*TxReceiptRes) Unmarshal

func (m *TxReceiptRes) Unmarshal(dAtA []byte) error

func (*TxReceiptRes) XXX_DiscardUnknown

func (m *TxReceiptRes) XXX_DiscardUnknown()

func (*TxReceiptRes) XXX_Marshal

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

func (*TxReceiptRes) XXX_Merge

func (dst *TxReceiptRes) XXX_Merge(src proto.Message)

func (*TxReceiptRes) XXX_Size

func (m *TxReceiptRes) XXX_Size() int

func (*TxReceiptRes) XXX_Unmarshal

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

type TxRes

type TxRes struct {
	TxRaw                *tx.TxRaw `protobuf:"bytes,1,opt,name=txRaw" json:"txRaw,omitempty"`
	Hash                 []byte    `protobuf:"bytes,2,opt,name=hash,proto3" json:"hash,omitempty"`
	XXX_NoUnkeyedLiteral struct{}  `json:"-"`
	XXX_unrecognized     []byte    `json:"-"`
	XXX_sizecache        int32     `json:"-"`
}

func (*TxRes) Descriptor

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

func (*TxRes) GetHash

func (m *TxRes) GetHash() []byte

func (*TxRes) GetTxRaw

func (m *TxRes) GetTxRaw() *tx.TxRaw

func (*TxRes) Marshal

func (m *TxRes) Marshal() (dAtA []byte, err error)

func (*TxRes) MarshalTo

func (m *TxRes) MarshalTo(dAtA []byte) (int, error)

func (*TxRes) ProtoMessage

func (*TxRes) ProtoMessage()

func (*TxRes) Reset

func (m *TxRes) Reset()

func (*TxRes) Size

func (m *TxRes) Size() (n int)

func (*TxRes) String

func (m *TxRes) String() string

func (*TxRes) Unmarshal

func (m *TxRes) Unmarshal(dAtA []byte) error

func (*TxRes) XXX_DiscardUnknown

func (m *TxRes) XXX_DiscardUnknown()

func (*TxRes) XXX_Marshal

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

func (*TxRes) XXX_Merge

func (dst *TxRes) XXX_Merge(src proto.Message)

func (*TxRes) XXX_Size

func (m *TxRes) XXX_Size() int

func (*TxRes) XXX_Unmarshal

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

Jump to

Keyboard shortcuts

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