client

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: 6 Imported by: 0

Documentation

Overview

Package client 系统接口客户端: 封装 Queue Event

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type QueueProtocol

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

QueueProtocol 消息通道协议实现

func (*QueueProtocol) Close

func (q *QueueProtocol) Close()

Close close client

func (*QueueProtocol) CloseQueue

func (q *QueueProtocol) CloseQueue() (*types.Reply, error)

CloseQueue close client queue

func (*QueueProtocol) DumpPrivkey

func (q *QueueProtocol) DumpPrivkey(param *types.ReqString) (*types.ReplyString, error)

DumpPrivkey dump privkey by wallet

func (*QueueProtocol) ExecWallet

func (q *QueueProtocol) ExecWallet(param *types.ChainExecutor) (types.Message, error)

ExecWallet exec wallet function

func (*QueueProtocol) ExecWalletFunc

func (q *QueueProtocol) ExecWalletFunc(driver string, funcname string, param types.Message) (types.Message, error)

ExecWalletFunc exec wallet function interface

func (*QueueProtocol) GenSeed

func (q *QueueProtocol) GenSeed(param *types.GenSeedLang) (*types.ReplySeed, error)

GenSeed generate seed return the seed

func (*QueueProtocol) GetAddrOverview

func (q *QueueProtocol) GetAddrOverview(param *types.ReqAddr) (*types.AddrOverview, error)

GetAddrOverview get block head detil by address

func (*QueueProtocol) GetBlockByHashes

func (q *QueueProtocol) GetBlockByHashes(param *types.ReqHashes) (*types.BlockDetails, error)

GetBlockByHashes get block detail list by hash list

func (*QueueProtocol) GetBlockHash

func (q *QueueProtocol) GetBlockHash(param *types.ReqInt) (*types.ReplyHash, error)

GetBlockHash get blockHash by height

func (*QueueProtocol) GetBlockOverview

func (q *QueueProtocol) GetBlockOverview(param *types.ReqHash) (*types.BlockOverview, error)

GetBlockOverview get block head detil by hash

func (*QueueProtocol) GetBlockSequences

func (q *QueueProtocol) GetBlockSequences(param *types.ReqBlocks) (*types.BlockSequences, error)

GetBlockSequences block执行序列号

func (*QueueProtocol) GetBlocks

func (q *QueueProtocol) GetBlocks(param *types.ReqBlocks) (*types.BlockDetails, error)

GetBlocks get block detail from blockchain

func (*QueueProtocol) GetFatalFailure

func (q *QueueProtocol) GetFatalFailure() (*types.Int32, error)

GetFatalFailure get fatal failure from wallet

func (*QueueProtocol) GetHeaders

func (q *QueueProtocol) GetHeaders(param *types.ReqBlocks) (*types.Headers, error)

GetHeaders get block headers by height

func (*QueueProtocol) GetLastBlockSequence

func (q *QueueProtocol) GetLastBlockSequence() (*types.Int64, error)

GetLastBlockSequence 获取最新的block执行序列号

func (*QueueProtocol) GetLastHeader

func (q *QueueProtocol) GetLastHeader() (*types.Header, error)

GetLastHeader get the current head detail

func (*QueueProtocol) GetLastMempool

func (q *QueueProtocol) GetLastMempool() (*types.ReplyTxList, error)

GetLastMempool get transactions from last mempool

func (*QueueProtocol) GetMempool

func (q *QueueProtocol) GetMempool() (*types.ReplyTxList, error)

GetMempool get transactions from mempool

func (*QueueProtocol) GetNetInfo

func (q *QueueProtocol) GetNetInfo() (*types.NodeNetInfo, error)

GetNetInfo get the net information

func (*QueueProtocol) GetSeed

func (q *QueueProtocol) GetSeed(param *types.GetSeedByPw) (*types.ReplySeed, error)

GetSeed get seed from wallet

func (*QueueProtocol) GetTicketCount

func (q *QueueProtocol) GetTicketCount() (*types.Int64, error)

GetTicketCount get ticket count from consensus

func (*QueueProtocol) GetTransactionByAddr

func (q *QueueProtocol) GetTransactionByAddr(param *types.ReqAddr) (*types.ReplyTxInfos, error)

GetTransactionByAddr get transaction by address

func (*QueueProtocol) GetTransactionByHash

func (q *QueueProtocol) GetTransactionByHash(param *types.ReqHashes) (*types.TransactionDetails, error)

GetTransactionByHash get transactions by hash from blockchain

func (*QueueProtocol) GetTxList

func (q *QueueProtocol) GetTxList(param *types.TxHashList) (*types.ReplyTxList, error)

GetTxList get transactions from mempool

func (*QueueProtocol) GetWalletStatus

func (q *QueueProtocol) GetWalletStatus() (*types.WalletStatus, error)

GetWalletStatus get wallet current status

func (*QueueProtocol) IsNtpClockSync

func (q *QueueProtocol) IsNtpClockSync() (*types.Reply, error)

IsNtpClockSync query the ntp clock sync state

func (*QueueProtocol) IsSync

func (q *QueueProtocol) IsSync() (*types.Reply, error)

IsSync query the blockchain sync state

func (*QueueProtocol) LocalGet

func (q *QueueProtocol) LocalGet(param *types.LocalDBGet) (*types.LocalReplyValue, error)

LocalGet get value from local db by key

func (*QueueProtocol) LocalList

func (q *QueueProtocol) LocalList(param *types.LocalDBList) (*types.LocalReplyValue, error)

LocalList get value list from local db by key list

func (*QueueProtocol) NewAccount

func (q *QueueProtocol) NewAccount(param *types.ReqNewAccount) (*types.WalletAccount, error)

NewAccount new account in wallet

func (*QueueProtocol) NewMessage

func (q *QueueProtocol) NewMessage(topic string, msgid int64, data interface{}) queue.Message

NewMessage new message

func (*QueueProtocol) Notify

func (q *QueueProtocol) Notify(topic string, ty int64, data interface{}) (queue.Message, error)

Notify new and send client message

func (*QueueProtocol) PeerInfo

func (q *QueueProtocol) PeerInfo() (*types.PeerList, error)

PeerInfo query peer list

func (*QueueProtocol) Query

func (q *QueueProtocol) Query(driver, funcname string, param types.Message) (types.Message, error)

Query the query interface

func (*QueueProtocol) QueryChain

func (q *QueueProtocol) QueryChain(param *types.ChainExecutor) (types.Message, error)

QueryChain query chain

func (*QueueProtocol) QueryConsensus

func (q *QueueProtocol) QueryConsensus(param *types.ChainExecutor) (types.Message, error)

QueryConsensus query consensus data

func (*QueueProtocol) QueryConsensusFunc

func (q *QueueProtocol) QueryConsensusFunc(driver string, funcname string, param types.Message) (types.Message, error)

QueryConsensusFunc query consensus function

func (*QueueProtocol) QueryTx

func (q *QueueProtocol) QueryTx(param *types.ReqHash) (*types.TransactionDetail, error)

QueryTx query transaction detail by transaction hash from blockchain

func (*QueueProtocol) SaveSeed

func (q *QueueProtocol) SaveSeed(param *types.SaveSeedByPw) (*types.Reply, error)

SaveSeed save the wallet seed

func (*QueueProtocol) SendTx

func (q *QueueProtocol) SendTx(param *types.Transaction) (*types.Reply, error)

SendTx send transaction to mempool

func (*QueueProtocol) SignRawTx

func (q *QueueProtocol) SignRawTx(param *types.ReqSignRawTx) (*types.ReplySignRawTx, error)

SignRawTx sign transaction return the sign tx data

func (*QueueProtocol) StoreGet

func (q *QueueProtocol) StoreGet(param *types.StoreGet) (*types.StoreReplyValue, error)

StoreGet get value by statehash and key from statedb

func (*QueueProtocol) StoreGetTotalCoins

func (q *QueueProtocol) StoreGetTotalCoins(param *types.IterateRangeByStateHash) (*types.ReplyGetTotalCoins, error)

StoreGetTotalCoins get total coins from statedb

func (*QueueProtocol) StoreList

func (q *QueueProtocol) StoreList(param *types.StoreList) (*types.StoreListReply, error)

StoreList query list from statedb

func (*QueueProtocol) Version

func (q *QueueProtocol) Version() (*types.Reply, error)

Version get the software version

func (*QueueProtocol) WalletCreateTx

func (q *QueueProtocol) WalletCreateTx(param *types.ReqCreateTransaction) (*types.Transaction, error)

WalletCreateTx create transaction

func (*QueueProtocol) WalletGetAccountList

func (q *QueueProtocol) WalletGetAccountList(req *types.ReqAccountList) (*types.WalletAccounts, error)

WalletGetAccountList get account list from wallet

func (*QueueProtocol) WalletImportprivkey

func (q *QueueProtocol) WalletImportprivkey(param *types.ReqWalletImportPrivkey) (*types.WalletAccount, error)

WalletImportprivkey import privkey in wallet

func (*QueueProtocol) WalletLock

func (q *QueueProtocol) WalletLock() (*types.Reply, error)

WalletLock lock wallet

func (*QueueProtocol) WalletMergeBalance

func (q *QueueProtocol) WalletMergeBalance(param *types.ReqWalletMergeBalance) (*types.ReplyHashes, error)

WalletMergeBalance merge balance to one address

func (*QueueProtocol) WalletSendToAddress

func (q *QueueProtocol) WalletSendToAddress(param *types.ReqWalletSendToAddress) (*types.ReplyHash, error)

WalletSendToAddress req send to address

func (*QueueProtocol) WalletSetFee

func (q *QueueProtocol) WalletSetFee(param *types.ReqWalletSetFee) (*types.Reply, error)

WalletSetFee set wallet transaction fee

func (*QueueProtocol) WalletSetLabel

func (q *QueueProtocol) WalletSetLabel(param *types.ReqWalletSetLabel) (*types.WalletAccount, error)

WalletSetLabel set wallet address and label

func (*QueueProtocol) WalletSetPasswd

func (q *QueueProtocol) WalletSetPasswd(param *types.ReqWalletSetPasswd) (*types.Reply, error)

WalletSetPasswd set wallet passwd

func (*QueueProtocol) WalletTransactionList

func (q *QueueProtocol) WalletTransactionList(param *types.ReqWalletTransactionList) (*types.WalletTxDetails, error)

WalletTransactionList get transactions from wallet

func (*QueueProtocol) WalletUnLock

func (q *QueueProtocol) WalletUnLock(param *types.WalletUnLock) (*types.Reply, error)

WalletUnLock unlock wallet

type QueueProtocolAPI

type QueueProtocolAPI interface {
	Version() (*types.Reply, error)
	Close()
	NewMessage(topic string, msgid int64, data interface{}) queue.Message
	Notify(topic string, ty int64, data interface{}) (queue.Message, error)
	// +++++++++++++++ mempool interfaces begin
	// 同步发送交易信息到指定模块,获取应答消息 types.EventTx
	SendTx(param *types.Transaction) (*types.Reply, error)
	// types.EventTxList
	GetTxList(param *types.TxHashList) (*types.ReplyTxList, error)
	// types.EventGetMempool
	GetMempool() (*types.ReplyTxList, error)
	// types.EventGetLastMempool
	GetLastMempool() (*types.ReplyTxList, error)
	// +++++++++++++++ execs interfaces begin
	// types.EventBlockChainQuery
	Query(driver, funcname string, param types.Message) (types.Message, error)
	QueryConsensus(param *types.ChainExecutor) (types.Message, error)
	QueryConsensusFunc(driver string, funcname string, param types.Message) (types.Message, error)
	QueryChain(param *types.ChainExecutor) (types.Message, error)
	ExecWalletFunc(driver string, funcname string, param types.Message) (types.Message, error)
	ExecWallet(param *types.ChainExecutor) (types.Message, error)

	// +++++++++++++++ p2p interfaces begin
	// types.EventPeerInfo
	PeerInfo() (*types.PeerList, error)
	// types.EventGetNetInfo
	GetNetInfo() (*types.NodeNetInfo, error)
	// --------------- p2p interfaces end
	// +++++++++++++++ wallet interfaces begin
	// types.EventLocalGet
	LocalGet(param *types.LocalDBGet) (*types.LocalReplyValue, error)
	// types.EventLocalList
	LocalList(param *types.LocalDBList) (*types.LocalReplyValue, error)
	// types.EventWalletGetAccountList
	WalletGetAccountList(req *types.ReqAccountList) (*types.WalletAccounts, error)
	// types.EventNewAccount
	NewAccount(param *types.ReqNewAccount) (*types.WalletAccount, error)
	// types.EventWalletTransactionList
	WalletTransactionList(param *types.ReqWalletTransactionList) (*types.WalletTxDetails, error)
	// types.EventWalletImportprivkey
	WalletImportprivkey(param *types.ReqWalletImportPrivkey) (*types.WalletAccount, error)
	// types.EventWalletSendToAddress
	WalletSendToAddress(param *types.ReqWalletSendToAddress) (*types.ReplyHash, error)
	// types.EventWalletSetFee
	WalletSetFee(param *types.ReqWalletSetFee) (*types.Reply, error)
	// types.EventWalletSetLabel
	WalletSetLabel(param *types.ReqWalletSetLabel) (*types.WalletAccount, error)
	// types.EventWalletMergeBalance
	WalletMergeBalance(param *types.ReqWalletMergeBalance) (*types.ReplyHashes, error)
	// types.EventWalletSetPasswd
	WalletSetPasswd(param *types.ReqWalletSetPasswd) (*types.Reply, error)
	// types.EventWalletLock
	WalletLock() (*types.Reply, error)
	// types.EventWalletUnLock
	WalletUnLock(param *types.WalletUnLock) (*types.Reply, error)
	// types.EventGenSeed
	GenSeed(param *types.GenSeedLang) (*types.ReplySeed, error)
	// types.EventSaveSeed
	SaveSeed(param *types.SaveSeedByPw) (*types.Reply, error)
	// types.EventGetSeed
	GetSeed(param *types.GetSeedByPw) (*types.ReplySeed, error)
	// types.EventGetWalletStatus
	GetWalletStatus() (*types.WalletStatus, error)
	// types.EventDumpPrivkey
	DumpPrivkey(param *types.ReqString) (*types.ReplyString, error)
	// types.EventSignRawTx
	SignRawTx(param *types.ReqSignRawTx) (*types.ReplySignRawTx, error)
	GetFatalFailure() (*types.Int32, error)
	// types.EventCreateTransaction 由服务器协助创建一个交易
	WalletCreateTx(param *types.ReqCreateTransaction) (*types.Transaction, error)
	// types.EventGetBlocks
	GetBlocks(param *types.ReqBlocks) (*types.BlockDetails, error)
	// types.EventQueryTx
	QueryTx(param *types.ReqHash) (*types.TransactionDetail, error)
	// types.EventGetTransactionByAddr
	GetTransactionByAddr(param *types.ReqAddr) (*types.ReplyTxInfos, error)
	// types.EventGetTransactionByHash
	GetTransactionByHash(param *types.ReqHashes) (*types.TransactionDetails, error)
	// types.EventGetHeaders
	GetHeaders(param *types.ReqBlocks) (*types.Headers, error)
	// types.EventGetBlockOverview
	GetBlockOverview(param *types.ReqHash) (*types.BlockOverview, error)
	// types.EventGetAddrOverview
	GetAddrOverview(param *types.ReqAddr) (*types.AddrOverview, error)
	// types.EventGetBlockHash
	GetBlockHash(param *types.ReqInt) (*types.ReplyHash, error)
	// types.EventIsSync
	IsSync() (*types.Reply, error)
	// types.EventIsNtpClockSync
	IsNtpClockSync() (*types.Reply, error)
	// types.EventGetLastHeader
	GetLastHeader() (*types.Header, error)

	//types.EventGetLastBlockSequence:
	GetLastBlockSequence() (*types.Int64, error)
	//types.EventGetBlockSequences:
	GetBlockSequences(param *types.ReqBlocks) (*types.BlockSequences, error)
	//types.EventGetBlockByHashes:
	GetBlockByHashes(param *types.ReqHashes) (*types.BlockDetails, error)

	// +++++++++++++++ store interfaces begin
	StoreGet(*types.StoreGet) (*types.StoreReplyValue, error)
	StoreGetTotalCoins(*types.IterateRangeByStateHash) (*types.ReplyGetTotalCoins, error)
	StoreList(param *types.StoreList) (*types.StoreListReply, error)

	// +++++++++++++++ other interfaces begin
	// close chain33
	CloseQueue() (*types.Reply, error)
}

QueueProtocolAPI 消息通道交互API接口定义

func New

func New(client queue.Client, option *QueueProtocolOption) (QueueProtocolAPI, error)

New New QueueProtocolAPI interface

type QueueProtocolOption

type QueueProtocolOption struct {
	// 发送请求超时时间
	SendTimeout time.Duration
	// 接收应答超时时间
	WaitTimeout time.Duration
}

QueueProtocolOption queue protocol option

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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