core

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2017 License: Apache-2.0 Imports: 18 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(SubscribeResult, "event"),
	"unsubscribe": rpc.NewWSRPCFunc(UnsubscribeResult, "event"),

	"status":               rpc.NewRPCFunc(StatusResult, ""),
	"net_info":             rpc.NewRPCFunc(NetInfoResult, ""),
	"blockchain":           rpc.NewRPCFunc(BlockchainInfoResult, "minHeight,maxHeight"),
	"genesis":              rpc.NewRPCFunc(GenesisResult, ""),
	"block":                rpc.NewRPCFunc(BlockResult, "height"),
	"commit":               rpc.NewRPCFunc(CommitResult, "height"),
	"validators":           rpc.NewRPCFunc(ValidatorsResult, ""),
	"dump_consensus_state": rpc.NewRPCFunc(DumpConsensusStateResult, ""),
	"unconfirmed_txs":      rpc.NewRPCFunc(UnconfirmedTxsResult, ""),
	"num_unconfirmed_txs":  rpc.NewRPCFunc(NumUnconfirmedTxsResult, ""),

	"broadcast_tx_commit": rpc.NewRPCFunc(BroadcastTxCommitResult, "tx"),
	"broadcast_tx_sync":   rpc.NewRPCFunc(BroadcastTxSyncResult, "tx"),
	"broadcast_tx_async":  rpc.NewRPCFunc(BroadcastTxAsyncResult, "tx"),

	"abci_query": rpc.NewRPCFunc(ABCIQueryResult, "path,data,prove"),
	"abci_info":  rpc.NewRPCFunc(ABCIInfoResult, ""),

	"dial_seeds":           rpc.NewRPCFunc(UnsafeDialSeedsResult, "seeds"),
	"unsafe_flush_mempool": rpc.NewRPCFunc(UnsafeFlushMempool, ""),
	"unsafe_set_config":    rpc.NewRPCFunc(UnsafeSetConfigResult, "type,key,value"),

	"unsafe_start_cpu_profiler": rpc.NewRPCFunc(UnsafeStartCPUProfilerResult, "filename"),
	"unsafe_stop_cpu_profiler":  rpc.NewRPCFunc(UnsafeStopCPUProfilerResult, ""),
	"unsafe_write_heap_profile": rpc.NewRPCFunc(UnsafeWriteHeapProfileResult, "filename"),
}

TODO: better system than "unsafe" prefix

Functions

func ABCIInfo

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

func ABCIInfoResult added in v0.8.0

func ABCIInfoResult() (ctypes.TMResult, error)

func ABCIQuery

func ABCIQuery(path string, data []byte, prove bool) (*ctypes.ResultABCIQuery, error)

func ABCIQueryResult added in v0.8.0

func ABCIQueryResult(path string, data []byte, prove bool) (ctypes.TMResult, error)

func Block

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

func BlockResult added in v0.7.0

func BlockResult(height int) (ctypes.TMResult, error)

func BlockchainInfo

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

TODO: limit/permission on (max - min)

func BlockchainInfoResult added in v0.7.0

func BlockchainInfoResult(min, max int) (ctypes.TMResult, error)

func BroadcastTxAsync

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

Returns right away, with no response

func BroadcastTxAsyncResult added in v0.7.0

func BroadcastTxAsyncResult(tx []byte) (ctypes.TMResult, error)

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 BroadcastTxCommitResult added in v0.7.0

func BroadcastTxCommitResult(tx []byte) (ctypes.TMResult, error)

func BroadcastTxSync

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

Returns with the response from CheckTx

func BroadcastTxSyncResult added in v0.7.0

func BroadcastTxSyncResult(tx []byte) (ctypes.TMResult, error)

func Commit

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

func CommitResult added in v0.9.0

func CommitResult(height int) (ctypes.TMResult, error)

func DumpConsensusState

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

func DumpConsensusStateResult added in v0.7.0

func DumpConsensusStateResult() (ctypes.TMResult, error)

func Genesis

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

func GenesisResult added in v0.7.0

func GenesisResult() (ctypes.TMResult, error)

func NetInfo

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

func NetInfoResult added in v0.7.0

func NetInfoResult() (ctypes.TMResult, error)

func NumUnconfirmedTxs

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

func NumUnconfirmedTxsResult added in v0.7.0

func NumUnconfirmedTxsResult() (ctypes.TMResult, error)

func SetAddrBook

func SetAddrBook(book *p2p.AddrBook)

func SetBlockStore

func SetBlockStore(bs types.BlockStore)

func SetConfig

func SetConfig(c cfg.Config)

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 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 Status

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

func StatusResult added in v0.7.0

func StatusResult() (ctypes.TMResult, error)

func Subscribe

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

func SubscribeResult added in v0.7.0

func SubscribeResult(wsCtx rpctypes.WSRPCContext, event string) (ctypes.TMResult, error)

func UnconfirmedTxs

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

func UnconfirmedTxsResult added in v0.7.0

func UnconfirmedTxsResult() (ctypes.TMResult, error)

func UnsafeDialSeeds

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

Dial given list of seeds

func UnsafeDialSeedsResult added in v0.7.4

func UnsafeDialSeedsResult(seeds []string) (ctypes.TMResult, error)

func UnsafeFlushMempool

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

func UnsafeFlushMempoolResult added in v0.7.0

func UnsafeFlushMempoolResult() (ctypes.TMResult, error)

func UnsafeSetConfig added in v0.7.0

func UnsafeSetConfig(typ, key, value string) (*ctypes.ResultUnsafeSetConfig, error)

func UnsafeSetConfigResult added in v0.7.0

func UnsafeSetConfigResult(typ, key, value string) (ctypes.TMResult, error)

func UnsafeStartCPUProfiler

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

func UnsafeStartCPUProfilerResult added in v0.7.0

func UnsafeStartCPUProfilerResult(filename string) (ctypes.TMResult, error)

func UnsafeStopCPUProfiler

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

func UnsafeStopCPUProfilerResult added in v0.7.0

func UnsafeStopCPUProfilerResult() (ctypes.TMResult, error)

func UnsafeWriteHeapProfile

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

func UnsafeWriteHeapProfileResult added in v0.7.0

func UnsafeWriteHeapProfileResult(filename string) (ctypes.TMResult, error)

func Unsubscribe

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

func UnsubscribeResult added in v0.7.0

func UnsubscribeResult(wsCtx rpctypes.WSRPCContext, event string) (ctypes.TMResult, error)

func Validators

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

func ValidatorsResult added in v0.7.0

func ValidatorsResult() (ctypes.TMResult, 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