core

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2017 License: AGPL-3.0 Imports: 8 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{

	"net_info":       rpc.NewRPCFunc(NetInfo, ""),
	"getwork":        rpc.NewRPCFunc(GetWork, ""),
	"submitwork":     rpc.NewRPCFunc(SubmitWork, "height"),
	"getBlockHeight": rpc.NewRPCFunc(BlockHeight, ""),
}

TODO: better system than "unsafe" prefix

Functions

func AddUnsafeRoutes

func AddUnsafeRoutes()

func BlockHeight

func BlockHeight() (*ctypes.ResultBlockchainInfo, error)

func GetWork

func GetWork() (*ctypes.ResultBlockHeaderInfo, error)

func NetInfo

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

func SetAddrBook

func SetAddrBook(book *p2p.AddrBook)

func SetBlockStore

func SetBlockStore(bs *txdb.Store)

func SetEventSwitch

func SetEventSwitch(evsw types.EventSwitch)

func SetLogger

func SetLogger(l log.Logger)

func SetSwitch

func SetSwitch(sw P2P)

func SubmitWork

func SubmitWork(height uint64) (bool, error)

func UnsafeDialSeeds

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

Dial given list of seeds

Types

type P2P

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