rpc

package
v0.0.0-...-9259d71 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2018 License: BSD-2-Clause Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitCfg

func InitCfg(cfg *types.Rpc)

func InitGrpcFuncBlacklist

func InitGrpcFuncBlacklist(cfg *types.Rpc)

func InitGrpcFuncWhitelist

func InitGrpcFuncWhitelist(cfg *types.Rpc)

func InitIpWhitelist

func InitIpWhitelist(cfg *types.Rpc)

func InitJrpcFuncBlacklist

func InitJrpcFuncBlacklist(cfg *types.Rpc)

func InitJrpcFuncWhitelist

func InitJrpcFuncWhitelist(cfg *types.Rpc)

Types

type Chain33

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

func (*Chain33) CloseQueue

func (c *Chain33) CloseQueue(in *types.ReqNil, result *interface{}) error

func (*Chain33) ConvertExectoAddr

func (c *Chain33) ConvertExectoAddr(in rpctypes.ExecNameParm, result *string) error

func (*Chain33) CreateNoBalanceTransaction

func (c *Chain33) CreateNoBalanceTransaction(in *types.NoBalanceTx, result *string) error

func (*Chain33) CreateRawTransaction

func (c *Chain33) CreateRawTransaction(in *types.CreateTx, result *interface{}) error

func (*Chain33) CreateRawTxGroup

func (c *Chain33) CreateRawTxGroup(in *types.CreateTransactionGroup, result *interface{}) error

func (*Chain33) CreateTransaction

func (c *Chain33) CreateTransaction(in *rpctypes.CreateTxIn, result *interface{}) error

func (*Chain33) DecodeRawTransaction

func (c *Chain33) DecodeRawTransaction(in *types.ReqDecodeRawTransaction, result *interface{}) error

func (*Chain33) DumpPrivkey

func (c *Chain33) DumpPrivkey(in types.ReqString, result *interface{}) error

func (*Chain33) ExecWallet

func (c *Chain33) ExecWallet(in *rpctypes.ChainExecutor, result *interface{}) error

func (*Chain33) GenSeed

func (c *Chain33) GenSeed(in types.GenSeedLang, result *interface{}) error

seed

func (*Chain33) GetAccounts

func (c *Chain33) GetAccounts(in *types.ReqAccountList, result *interface{}) error

func (*Chain33) GetAccountsV2

func (c *Chain33) GetAccountsV2(in *types.ReqNil, result *interface{}) error

func (*Chain33) GetAddrOverview

func (c *Chain33) GetAddrOverview(in types.ReqAddr, result *interface{}) error

func (*Chain33) GetAllExecBalance

func (c *Chain33) GetAllExecBalance(in types.ReqAddr, result *interface{}) error

func (*Chain33) GetBalance

func (c *Chain33) GetBalance(in types.ReqBalance, result *interface{}) error

func (*Chain33) GetBlockByHashes

func (c *Chain33) GetBlockByHashes(in rpctypes.ReqHashes, result *interface{}) error

通过block hash 获取对应的block信息

func (*Chain33) GetBlockHash

func (c *Chain33) GetBlockHash(in types.ReqInt, result *interface{}) error

func (*Chain33) GetBlockOverview

func (c *Chain33) GetBlockOverview(in rpctypes.QueryParm, result *interface{}) error

GetBlockOverview(parm *types.ReqHash) (*types.BlockOverview, error)

func (*Chain33) GetBlockSequences

func (c *Chain33) GetBlockSequences(in rpctypes.BlockParam, result *interface{}) error

获取指定区间的block加载序列号信息。输入信息只使用:start,end

func (*Chain33) GetBlocks

func (c *Chain33) GetBlocks(in rpctypes.BlockParam, result *interface{}) error

func (*Chain33) GetExecBalance

func (c *Chain33) GetExecBalance(in *types.ReqGetExecBalance, result *interface{}) error

func (*Chain33) GetFatalFailure

func (c *Chain33) GetFatalFailure(in *types.ReqNil, result *interface{}) error

func (*Chain33) GetHeaders

func (c *Chain33) GetHeaders(in types.ReqBlocks, result *interface{}) error

func (*Chain33) GetHexTxByHash

func (c *Chain33) GetHexTxByHash(in rpctypes.QueryParm, result *interface{}) error

func (*Chain33) GetLastBlockSequence

func (c *Chain33) GetLastBlockSequence(in *types.ReqNil, result *interface{}) error

func (*Chain33) GetLastHeader

func (c *Chain33) GetLastHeader(in *types.ReqNil, result *interface{}) error

func (*Chain33) GetLastMemPool

func (c *Chain33) GetLastMemPool(in types.ReqNil, result *interface{}) error

func (*Chain33) GetMempool

func (c *Chain33) GetMempool(in *types.ReqNil, result *interface{}) error

func (*Chain33) GetNetInfo

func (c *Chain33) GetNetInfo(in *types.ReqNil, result *interface{}) error

func (*Chain33) GetPeerInfo

func (c *Chain33) GetPeerInfo(in types.ReqNil, result *interface{}) error

func (*Chain33) GetSeed

func (c *Chain33) GetSeed(in types.GetSeedByPw, result *interface{}) error

func (*Chain33) GetTimeStatus

func (c *Chain33) GetTimeStatus(in *types.ReqNil, result *interface{}) error

func (*Chain33) GetTotalCoins

func (c *Chain33) GetTotalCoins(in *types.ReqGetTotalCoins, result *interface{}) error

func (*Chain33) GetTxByAddr

func (c *Chain33) GetTxByAddr(in types.ReqAddr, result *interface{}) error

GetTxByAddr(parm *types.ReqAddr) (*types.ReplyTxInfo, error)

func (*Chain33) GetTxByHashes

func (c *Chain33) GetTxByHashes(in rpctypes.ReqHashes, result *interface{}) error

func (*Chain33) GetWalletStatus

func (c *Chain33) GetWalletStatus(in types.ReqNil, result *interface{}) error

func (*Chain33) ImportPrivkey

func (c *Chain33) ImportPrivkey(in types.ReqWalletImportPrivkey, result *interface{}) error

func (*Chain33) IsNtpClockSync

func (c *Chain33) IsNtpClockSync(in *types.ReqNil, result *interface{}) error

func (*Chain33) IsSync

func (c *Chain33) IsSync(in *types.ReqNil, result *interface{}) error

func (*Chain33) Lock

func (c *Chain33) Lock(in types.ReqNil, result *interface{}) error

func (*Chain33) MergeBalance

func (c *Chain33) MergeBalance(in types.ReqWalletMergeBalance, result *interface{}) error

func (*Chain33) NewAccount

func (c *Chain33) NewAccount(in types.ReqNewAccount, result *interface{}) error

func (*Chain33) Query

func (c *Chain33) Query(in rpctypes.Query4Jrpc, result *interface{}) error

func (*Chain33) QueryTicketInfo

func (c *Chain33) QueryTicketInfo(in *types.LocalDBGet, result *interface{}) error

func (*Chain33) QueryTicketInfoList

func (c *Chain33) QueryTicketInfoList(in *types.LocalDBList, result *interface{}) error

func (*Chain33) QueryTicketStat

func (c *Chain33) QueryTicketStat(in *types.LocalDBGet, result *interface{}) error

func (*Chain33) QueryTotalFee

func (c *Chain33) QueryTotalFee(in *types.LocalDBGet, result *interface{}) error

func (*Chain33) QueryTransaction

func (c *Chain33) QueryTransaction(in rpctypes.QueryParm, result *interface{}) error

func (*Chain33) SaveSeed

func (c *Chain33) SaveSeed(in types.SaveSeedByPw, result *interface{}) error

func (*Chain33) SendRawTransaction

func (c *Chain33) SendRawTransaction(in rpctypes.SignedTx, result *interface{}) error

func (*Chain33) SendToAddress

func (c *Chain33) SendToAddress(in types.ReqWalletSendToAddress, result *interface{}) error

func (*Chain33) SendTransaction

func (c *Chain33) SendTransaction(in rpctypes.RawParm, result *interface{}) error

func (*Chain33) SetLabl

func (c *Chain33) SetLabl(in types.ReqWalletSetLabel, result *interface{}) error

func (*Chain33) SetPasswd

func (c *Chain33) SetPasswd(in types.ReqWalletSetPasswd, result *interface{}) error

func (*Chain33) SetTxFee

func (c *Chain33) SetTxFee(in types.ReqWalletSetFee, result *interface{}) error

func (*Chain33) SignRawTx

func (c *Chain33) SignRawTx(in *types.ReqSignRawTx, result *interface{}) error

func (*Chain33) UnLock

func (c *Chain33) UnLock(in types.WalletUnLock, result *interface{}) error

func (*Chain33) Version

func (c *Chain33) Version(in *types.ReqNil, result *interface{}) error

func (*Chain33) WalletCreateTx

func (c *Chain33) WalletCreateTx(in types.ReqCreateTransaction, result *interface{}) error

func (*Chain33) WalletTxList

func (c *Chain33) WalletTxList(in rpctypes.ReqWalletTransactionList, result *interface{}) error

type Grpc

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

func (*Grpc) CloseQueue

func (g *Grpc) CloseQueue(ctx context.Context, in *pb.ReqNil) (*pb.Reply, error)

func (*Grpc) CreateNoBalanceTransaction

func (g *Grpc) CreateNoBalanceTransaction(ctx context.Context, in *pb.NoBalanceTx) (*pb.ReplySignRawTx, error)

func (*Grpc) CreateRawTransaction

func (g *Grpc) CreateRawTransaction(ctx context.Context, in *pb.CreateTx) (*pb.UnsignTx, error)

func (*Grpc) CreateRawTxGroup

func (g *Grpc) CreateRawTxGroup(ctx context.Context, in *pb.CreateTransactionGroup) (*pb.UnsignTx, error)

func (*Grpc) CreateTransaction

func (g *Grpc) CreateTransaction(ctx context.Context, in *pb.CreateTxIn) (*pb.UnsignTx, error)

func (*Grpc) DumpPrivkey

func (g *Grpc) DumpPrivkey(ctx context.Context, in *pb.ReqString) (*pb.ReplyString, error)

func (*Grpc) ExecWallet

func (g *Grpc) ExecWallet(ctx context.Context, in *pb.ChainExecutor) (*pb.Reply, error)

func (*Grpc) GenSeed

func (g *Grpc) GenSeed(ctx context.Context, in *pb.GenSeedLang) (*pb.ReplySeed, error)

seed

func (*Grpc) GetAccounts

func (g *Grpc) GetAccounts(ctx context.Context, in *pb.ReqNil) (*pb.WalletAccounts, error)

func (*Grpc) GetAddrOverview

func (g *Grpc) GetAddrOverview(ctx context.Context, in *pb.ReqAddr) (*pb.AddrOverview, error)

func (*Grpc) GetAllExecBalance

func (g *Grpc) GetAllExecBalance(ctx context.Context, in *pb.ReqAddr) (*pb.AllExecBalance, error)

func (*Grpc) GetBalance

func (g *Grpc) GetBalance(ctx context.Context, in *pb.ReqBalance) (*pb.Accounts, error)

func (*Grpc) GetBlockByHashes

func (g *Grpc) GetBlockByHashes(ctx context.Context, in *pb.ReqHashes) (*pb.BlockDetails, error)

func (*Grpc) GetBlockHash

func (g *Grpc) GetBlockHash(ctx context.Context, in *pb.ReqInt) (*pb.ReplyHash, error)

func (*Grpc) GetBlockOverview

func (g *Grpc) GetBlockOverview(ctx context.Context, in *pb.ReqHash) (*pb.BlockOverview, error)

add by hyb GetBlockOverview(parm *types.ReqHash) (*types.BlockOverview, error)

func (*Grpc) GetBlockSequences

func (g *Grpc) GetBlockSequences(ctx context.Context, in *pb.ReqBlocks) (*pb.BlockSequences, error)

func (*Grpc) GetBlocks

func (g *Grpc) GetBlocks(ctx context.Context, in *pb.ReqBlocks) (*pb.Reply, error)

func (*Grpc) GetFatalFailure

func (g *Grpc) GetFatalFailure(ctx context.Context, in *pb.ReqNil) (*pb.Int32, error)

func (*Grpc) GetHeaders

func (g *Grpc) GetHeaders(ctx context.Context, in *pb.ReqBlocks) (*pb.Headers, error)

func (*Grpc) GetHexTxByHash

func (g *Grpc) GetHexTxByHash(ctx context.Context, in *pb.ReqHash) (*pb.HexTx, error)

func (*Grpc) GetLastBlockSequence

func (g *Grpc) GetLastBlockSequence(ctx context.Context, in *pb.ReqNil) (*pb.Int64, error)

func (*Grpc) GetLastHeader

func (g *Grpc) GetLastHeader(ctx context.Context, in *pb.ReqNil) (*pb.Header, error)

func (*Grpc) GetLastMemPool

func (g *Grpc) GetLastMemPool(ctx context.Context, in *pb.ReqNil) (*pb.ReplyTxList, error)

func (*Grpc) GetMemPool

func (g *Grpc) GetMemPool(ctx context.Context, in *pb.ReqNil) (*pb.ReplyTxList, error)

func (*Grpc) GetPeerInfo

func (g *Grpc) GetPeerInfo(ctx context.Context, in *pb.ReqNil) (*pb.PeerList, error)

func (*Grpc) GetSeed

func (g *Grpc) GetSeed(ctx context.Context, in *pb.GetSeedByPw) (*pb.ReplySeed, error)

func (*Grpc) GetTransactionByAddr

func (g *Grpc) GetTransactionByAddr(ctx context.Context, in *pb.ReqAddr) (*pb.ReplyTxInfos, error)

func (*Grpc) GetTransactionByHashes

func (g *Grpc) GetTransactionByHashes(ctx context.Context, in *pb.ReqHashes) (*pb.TransactionDetails, error)

func (*Grpc) GetWalletStatus

func (g *Grpc) GetWalletStatus(ctx context.Context, in *pb.ReqNil) (*pb.WalletStatus, error)

func (*Grpc) ImportPrivkey

func (g *Grpc) ImportPrivkey(ctx context.Context, in *pb.ReqWalletImportPrivkey) (*pb.WalletAccount, error)

func (*Grpc) IsNtpClockSync

func (g *Grpc) IsNtpClockSync(ctx context.Context, in *pb.ReqNil) (*pb.Reply, error)

func (*Grpc) IsSync

func (g *Grpc) IsSync(ctx context.Context, in *pb.ReqNil) (*pb.Reply, error)

func (*Grpc) Lock

func (g *Grpc) Lock(ctx context.Context, in *pb.ReqNil) (*pb.Reply, error)

func (*Grpc) MergeBalance

func (g *Grpc) MergeBalance(ctx context.Context, in *pb.ReqWalletMergeBalance) (*pb.ReplyHashes, error)

func (*Grpc) NetInfo

func (g *Grpc) NetInfo(ctx context.Context, in *pb.ReqNil) (*pb.NodeNetInfo, error)

func (*Grpc) NewAccount

func (g *Grpc) NewAccount(ctx context.Context, in *pb.ReqNewAccount) (*pb.WalletAccount, error)

func (*Grpc) QueryChain

func (g *Grpc) QueryChain(ctx context.Context, in *pb.ChainExecutor) (*pb.Reply, error)

func (*Grpc) QueryConsensus

func (g *Grpc) QueryConsensus(ctx context.Context, in *pb.ChainExecutor) (*pb.Reply, error)

func (*Grpc) QueryTransaction

func (g *Grpc) QueryTransaction(ctx context.Context, in *pb.ReqHash) (*pb.TransactionDetail, error)

func (*Grpc) SaveSeed

func (g *Grpc) SaveSeed(ctx context.Context, in *pb.SaveSeedByPw) (*pb.Reply, error)

func (*Grpc) SendRawTransaction

func (g *Grpc) SendRawTransaction(ctx context.Context, in *pb.SignedTx) (*pb.Reply, error)

func (*Grpc) SendToAddress

func (g *Grpc) SendToAddress(ctx context.Context, in *pb.ReqWalletSendToAddress) (*pb.ReplyHash, error)

func (*Grpc) SendTransaction

func (g *Grpc) SendTransaction(ctx context.Context, in *pb.Transaction) (*pb.Reply, error)

func (*Grpc) SetLabl

func (g *Grpc) SetLabl(ctx context.Context, in *pb.ReqWalletSetLabel) (*pb.WalletAccount, error)

func (*Grpc) SetPasswd

func (g *Grpc) SetPasswd(ctx context.Context, in *pb.ReqWalletSetPasswd) (*pb.Reply, error)

func (*Grpc) SetTxFee

func (g *Grpc) SetTxFee(ctx context.Context, in *pb.ReqWalletSetFee) (*pb.Reply, error)

func (*Grpc) SignRawTx

func (g *Grpc) SignRawTx(ctx context.Context, in *pb.ReqSignRawTx) (*pb.ReplySignRawTx, error)

func (*Grpc) UnLock

func (g *Grpc) UnLock(ctx context.Context, in *pb.WalletUnLock) (*pb.Reply, error)

func (*Grpc) Version

func (g *Grpc) Version(ctx context.Context, in *pb.ReqNil) (*pb.Reply, error)

func (*Grpc) WalletTransactionList

func (g *Grpc) WalletTransactionList(ctx context.Context, in *pb.ReqWalletTransactionList) (*pb.WalletTxDetails, error)

type Grpcserver

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

func NewGRpcServer

func NewGRpcServer(c queue.Client, api client.QueueProtocolAPI) *Grpcserver

func NewGrpcServer

func NewGrpcServer() *Grpcserver

NewGrpcServer 创建 GrpcServer 对象

func (*Grpcserver) Close

func (j *Grpcserver) Close()

func (*Grpcserver) Listen

func (g *Grpcserver) Listen() (int, error)

type HTTPConn

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

adapt HTTP connection to ReadWriteCloser

func (*HTTPConn) Close

func (c *HTTPConn) Close() error

func (*HTTPConn) Read

func (c *HTTPConn) Read(p []byte) (n int, err error)

func (*HTTPConn) Write

func (c *HTTPConn) Write(d []byte) (n int, err error)

type JSONRPCServer

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

func NewJSONRPCServer

func NewJSONRPCServer(c queue.Client, api client.QueueProtocolAPI) *JSONRPCServer

func (*JSONRPCServer) Close

func (s *JSONRPCServer) Close()

func (*JSONRPCServer) Listen

func (j *JSONRPCServer) Listen() (int, error)

type RPC

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

func New

func New(cfg *types.Rpc) *RPC

func (*RPC) Close

func (rpc *RPC) Close()

func (*RPC) GRPC

func (rpc *RPC) GRPC() *grpc.Server

func (*RPC) GetQueueClient

func (rpc *RPC) GetQueueClient() queue.Client

func (*RPC) JRPC

func (rpc *RPC) JRPC() *rpc.Server

func (*RPC) Listen

func (rpc *RPC) Listen() (port1 int, port2 int)

func (*RPC) SetAPI

func (r *RPC) SetAPI(api client.QueueProtocolAPI)

func (*RPC) SetQueueClient

func (r *RPC) SetQueueClient(c queue.Client)

func (*RPC) SetQueueClientNoListen

func (r *RPC) SetQueueClientNoListen(c queue.Client)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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