rpc

package
v0.0.0-...-b124b1e Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2022 License: Apache-2.0 Imports: 38 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EndorserModuleDefault = "default"
	EndorserModuleProxy   = "proxy"
)
View Source
const (
	// DefaultKeyPath is the default key path
	DefaultKeyPath = "./data/endorser/keys/"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultXEndorser

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

func NewDefaultXEndorser

func NewDefaultXEndorser(svr XEndorserServer, engine engineBase.Engine) *DefaultXEndorser

func (*DefaultXEndorser) EndorserCall

func (dxe *DefaultXEndorser) EndorserCall(ctx context.Context, req *pb.EndorserRequest) (*pb.EndorserResponse, error)

EndorserCall process endorser call

type ProxyXEndorser

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

func (*ProxyXEndorser) EndorserCall

func (pxe *ProxyXEndorser) EndorserCall(gctx context.Context, req *pb.EndorserRequest) (*pb.EndorserResponse, error)

type RpcManager

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

rpc server启停控制管理

func NewRpcServMG

func NewRpcServMG(scfg *sconf.ServConf, en engineBase.BasicEngine) (*RpcManager, error)

func (*RpcManager) Exit

func (t *RpcManager) Exit()

退出rpc服务,释放相关资源,需要幂等

func (*RpcManager) Run

func (t *RpcManager) Run() error

启动rpc服务,阻塞运行

type RpcServer

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

func NewRpcServ

func NewRpcServ(engine base.Engine, log logger.Logger) *RpcServer

func (*RpcServer) ConfirmBlockChainStatus

func (t *RpcServer) ConfirmBlockChainStatus(gctx context.Context, req *pb.BCStatus) (*pb.BCTipStatus, error)

ConfirmBlockChainStatus confirm is_trunk

func (*RpcServer) DposCandidates

func (t *RpcServer) DposCandidates(gctx context.Context, req *pb.DposCandidatesRequest) (*pb.DposCandidatesResponse, error)

DposCandidates get all candidates of the xpos consensus

func (*RpcServer) DposCheckResults

DposCheckResults get check results of a specific term

func (*RpcServer) DposNominateRecords

DposNominateRecords get all records nominated by an user

func (*RpcServer) DposNomineeRecords

DposNomineeRecords get nominated record of a candidate

func (*RpcServer) DposStatus

func (t *RpcServer) DposStatus(gctx context.Context, req *pb.DposStatusRequest) (*pb.DposStatusResponse, error)

DposStatus get dpos status

func (*RpcServer) DposVoteRecords

DposVoteRecords get all vote records voted by an user

func (*RpcServer) DposVotedRecords

DposVotedRecords get all vote records of a candidate

func (*RpcServer) GetAccountByAK

func (t *RpcServer) GetAccountByAK(gctx context.Context, req *pb.AK2AccountRequest) (*pb.AK2AccountResponse, error)

GetAccountByAK get account list with contain ak

func (*RpcServer) GetAccountContracts

GetAccountContracts get account request

func (*RpcServer) GetAddressContracts

func (t *RpcServer) GetAddressContracts(gctx context.Context, req *pb.AddressContractsRequest) (*pb.AddressContractsResponse, error)

GetAddressContracts get contracts of accounts contain a specific address

func (*RpcServer) GetBalance

func (t *RpcServer) GetBalance(gctx context.Context, req *pb.AddressStatus) (*pb.AddressStatus, error)

GetBalance get balance for account or addr

func (*RpcServer) GetBalanceDetail

func (t *RpcServer) GetBalanceDetail(gctx context.Context, req *pb.AddressBalanceStatus) (*pb.AddressBalanceStatus, error)

GetBalanceDetail get balance frozened for account or addr

func (*RpcServer) GetBlock

func (t *RpcServer) GetBlock(gctx context.Context, req *pb.BlockID) (*pb.Block, error)

GetBlock get block info according to blockID

func (*RpcServer) GetBlockByHeight

func (t *RpcServer) GetBlockByHeight(gctx context.Context, req *pb.BlockHeight) (*pb.Block, error)

GetBlockByHeight get trunk block by height

func (*RpcServer) GetBlockChainStatus

func (t *RpcServer) GetBlockChainStatus(gctx context.Context, req *pb.BCStatus) (*pb.BCStatus, error)

GetBlockChainStatus get systemstatus

func (*RpcServer) GetBlockChains

func (t *RpcServer) GetBlockChains(gctx context.Context, req *pb.CommonIn) (*pb.BlockChains, error)

GetBlockChains get BlockChains

func (*RpcServer) GetConsensusStatus

func (t *RpcServer) GetConsensusStatus(gctx context.Context, req *pb.ConsensusStatRequest) (*pb.ConsensusStatus, error)

func (*RpcServer) GetFrozenBalance

func (t *RpcServer) GetFrozenBalance(gctx context.Context, req *pb.AddressStatus) (*pb.AddressStatus, error)

GetFrozenBalance get balance frozened for account or addr

func (*RpcServer) GetNetURL

func (t *RpcServer) GetNetURL(gctx context.Context, req *pb.CommonIn) (*pb.RawUrl, error)

GetNetURL get net url in p2p_base

func (*RpcServer) GetSystemStatus

func (t *RpcServer) GetSystemStatus(gctx context.Context, req *pb.CommonIn) (*pb.SystemsStatusReply, error)

GetSystemStatus get systemstatus

func (*RpcServer) PostTx

func (t *RpcServer) PostTx(gctx context.Context, req *pb.TxStatus) (*pb.CommonReply, error)

PostTx post transaction to blockchain network

func (*RpcServer) PreExec

PreExec smart contract preExec process

func (*RpcServer) PreExecWithSelectUTXO

PreExecWithSelectUTXO preExec + selectUtxo

func (*RpcServer) QueryACL

func (t *RpcServer) QueryACL(gctx context.Context, req *pb.AclStatus) (*pb.AclStatus, error)

QueryACL query some account info

func (*RpcServer) QueryContractStatData

func (t *RpcServer) QueryContractStatData(gctx context.Context,
	req *pb.ContractStatDataRequest) (*pb.ContractStatDataResponse, error)

QueryContractStatData query statistic info about contract

func (*RpcServer) QueryTx

func (t *RpcServer) QueryTx(gctx context.Context, req *pb.TxStatus) (*pb.TxStatus, error)

QueryTx Get transaction details

func (*RpcServer) QueryUtxoRecord

func (t *RpcServer) QueryUtxoRecord(gctx context.Context,
	req *pb.UtxoRecordDetail) (*pb.UtxoRecordDetail, error)

QueryUtxoRecord query utxo records

func (*RpcServer) SelectUTXO

func (t *RpcServer) SelectUTXO(gctx context.Context, req *pb.UtxoInput) (*pb.UtxoOutput, error)

SelectUTXO select utxo inputs depending on amount

func (*RpcServer) SelectUTXOBySize

func (t *RpcServer) SelectUTXOBySize(gctx context.Context, req *pb.UtxoInput) (*pb.UtxoOutput, error)

SelectUTXOBySize select utxo inputs depending on size

func (*RpcServer) UnaryInterceptor

func (t *RpcServer) UnaryInterceptor() grpc.UnaryServerInterceptor

UnaryInterceptor provides a hook to intercept the execution of a unary RPC on the server.

type XEndorser

type XEndorser interface {
	EndorserCall(gctx context.Context, req *pb.EndorserRequest) (*pb.EndorserResponse, error)
}

type XEndorserServer

type XEndorserServer interface {
	// PostTx post Transaction to a node
	PostTx(context.Context, *pb.TxStatus) (*pb.CommonReply, error)
	// QueryTx query Transaction by TxStatus,
	// Bcname and Txid are required for this
	QueryTx(context.Context, *pb.TxStatus) (*pb.TxStatus, error)
	// PreExecWithSelectUTXO preExec & selectUtxo
	PreExecWithSelectUTXO(context.Context, *pb.PreExecWithSelectUTXORequest) (*pb.PreExecWithSelectUTXOResponse, error)
	// 预执行合约
	PreExec(context.Context, *pb.InvokeRPCRequest) (*pb.InvokeRPCResponse, error)
}

Jump to

Keyboard shortcuts

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