core

package
v0.10.3 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2017 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const Version = "3" // rpc routes for profiling, setting config

Variables

View Source
var Routes = map[string]*rpc.RPCFunc{

	"subscribe":   rpc.NewWSRPCFunc(Subscribe, "event"),
	"unsubscribe": rpc.NewWSRPCFunc(Unsubscribe, "event"),

	"status":               rpc.NewRPCFunc(Status, ""),
	"net_info":             rpc.NewRPCFunc(NetInfo, ""),
	"blockchain":           rpc.NewRPCFunc(BlockchainInfo, "minHeight,maxHeight"),
	"genesis":              rpc.NewRPCFunc(Genesis, ""),
	"block":                rpc.NewRPCFunc(Block, "height"),
	"commit":               rpc.NewRPCFunc(Commit, "height"),
	"tx":                   rpc.NewRPCFunc(Tx, "hash,prove"),
	"validators":           rpc.NewRPCFunc(Validators, ""),
	"dump_consensus_state": rpc.NewRPCFunc(DumpConsensusState, ""),
	"unconfirmed_txs":      rpc.NewRPCFunc(UnconfirmedTxs, ""),
	"num_unconfirmed_txs":  rpc.NewRPCFunc(NumUnconfirmedTxs, ""),

	"broadcast_tx_commit": rpc.NewRPCFunc(BroadcastTxCommit, "tx"),
	"broadcast_tx_sync":   rpc.NewRPCFunc(BroadcastTxSync, "tx"),
	"broadcast_tx_async":  rpc.NewRPCFunc(BroadcastTxAsync, "tx"),

	"abci_query": rpc.NewRPCFunc(ABCIQuery, "path,data,prove"),
	"abci_info":  rpc.NewRPCFunc(ABCIInfo, ""),
}

TODO: better system than "unsafe" prefix

Functions

func ABCIInfo

func ABCIInfo() (*ctypes.ResultABCIInfo, error)

func ABCIQuery

func ABCIQuery(path string, data data.Bytes, prove bool) (*ctypes.ResultABCIQuery, error)

func AddUnsafeRoutes

func AddUnsafeRoutes()

func Block

func Block(height int) (*ctypes.ResultBlock, error)

func BlockchainInfo

func BlockchainInfo(minHeight, maxHeight int) (*ctypes.ResultBlockchainInfo, error)

Returns at most 20 blocks

func BroadcastTxAsync

func BroadcastTxAsync(tx types.Tx) (*ctypes.ResultBroadcastTx, error)

Returns right away, with no response

func BroadcastTxCommit

func BroadcastTxCommit(tx types.Tx) (*ctypes.ResultBroadcastTxCommit, error)

CONTRACT: only returns error if mempool.BroadcastTx errs (ie. problem with the app) or if we timeout waiting for tx to commit. If CheckTx or DeliverTx fail, no error will be returned, but the returned result will contain a non-OK ABCI code.

func BroadcastTxSync

func BroadcastTxSync(tx types.Tx) (*ctypes.ResultBroadcastTx, error)

Returns with the response from CheckTx

func Commit

func Commit(height int) (*ctypes.ResultCommit, error)

func DumpConsensusState

func DumpConsensusState() (*ctypes.ResultDumpConsensusState, error)

func Genesis

func Genesis() (*ctypes.ResultGenesis, error)

func NetInfo

func NetInfo() (*ctypes.ResultNetInfo, error)

func NumUnconfirmedTxs

func NumUnconfirmedTxs() (*ctypes.ResultUnconfirmedTxs, error)

func SetAddrBook

func SetAddrBook(book *p2p.AddrBook)

func SetBlockStore

func SetBlockStore(bs types.BlockStore)

func SetConsensusReactor

func SetConsensusReactor(conR *consensus.ConsensusReactor)

func SetConsensusState

func SetConsensusState(cs Consensus)

func SetEventSwitch added in v0.7.0

func SetEventSwitch(evsw types.EventSwitch)

func SetGenesisDoc

func SetGenesisDoc(doc *types.GenesisDoc)

func SetLogger

func SetLogger(l log.Logger)

func SetMempool

func SetMempool(mem types.Mempool)

func SetProxyAppQuery

func SetProxyAppQuery(appConn proxy.AppConnQuery)

func SetPubKey

func SetPubKey(pk crypto.PubKey)

func SetSwitch added in v0.7.0

func SetSwitch(sw P2P)

func SetTxIndexer

func SetTxIndexer(indexer txindex.TxIndexer)

func Status

func Status() (*ctypes.ResultStatus, error)

func Subscribe

func Subscribe(wsCtx rpctypes.WSRPCContext, event string) (*ctypes.ResultSubscribe, error)

func Tx

func Tx(hash []byte, prove bool) (*ctypes.ResultTx, error)

Tx allow user to query the transaction results. `nil` could mean the transaction is in the mempool, invalidated, or was not send in the first place.

func UnconfirmedTxs

func UnconfirmedTxs() (*ctypes.ResultUnconfirmedTxs, error)

func UnsafeDialSeeds

func UnsafeDialSeeds(seeds []string) (*ctypes.ResultDialSeeds, error)

Dial given list of seeds

func UnsafeFlushMempool

func UnsafeFlushMempool() (*ctypes.ResultUnsafeFlushMempool, error)

func UnsafeStartCPUProfiler

func UnsafeStartCPUProfiler(filename string) (*ctypes.ResultUnsafeProfile, error)

func UnsafeStopCPUProfiler

func UnsafeStopCPUProfiler() (*ctypes.ResultUnsafeProfile, error)

func UnsafeWriteHeapProfile

func UnsafeWriteHeapProfile(filename string) (*ctypes.ResultUnsafeProfile, error)

func Unsubscribe

func Unsubscribe(wsCtx rpctypes.WSRPCContext, event string) (*ctypes.ResultUnsubscribe, error)

func Validators

func Validators() (*ctypes.ResultValidators, error)

Types

type Consensus

type Consensus interface {
	GetValidators() (int, []*types.Validator)
	GetRoundState() *consensus.RoundState
}

type P2P added in v0.7.3

type P2P interface {
	Listeners() []p2p.Listener
	Peers() p2p.IPeerSet
	NumPeers() (outbound, inbound, dialig int)
	NodeInfo() *p2p.NodeInfo
	IsListening() bool
	DialSeeds(*p2p.AddrBook, []string) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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