node

package
v0.0.0-...-7d10e31 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultSQLDBProvider

func DefaultSQLDBProvider(ctx *DBContext) (*dex.SQLDBBackend, error)

DefaultDBProvider returns a database using the DBBackend and DBDir specified in the ctx.Config.

func NewSQLDB

func NewSQLDB(ID string, dbdir string, contractAddr string) (*dex.SQLDBBackend, error)

Types

type DBContext

type DBContext struct {
	ID     string
	Config *cfg.Config
}

DBContext specifies config information for loading a new DB.

type Node

type Node struct {
	cmn.BaseService
	// contains filtered or unexported fields
}

func DefaultNewNode

func DefaultNewNode(config *cfg.Config, logger log.Logger) (*Node, error)

DefaultNewNode returns a blockchain node with default settings for the PrivValidator, and DBProvider. It implements NodeProvider.

func NewNode

func NewNode(config *cfg.Config, logger log.Logger, dbProvider SQLDBProvider) (*Node, error)

func (*Node) OnStart

func (n *Node) OnStart() error

OnStart starts the Node. It implements cmn.Service.

func (*Node) OnStop

func (n *Node) OnStop()

OnStop stops the Node. It implements cmn.Service.

func (*Node) RunForever

func (n *Node) RunForever()

RunForever waits for an interrupt signal and stops the node.

type NodeProvider

type NodeProvider func(*cfg.Config, log.Logger) (*Node, error)

NodeProvider takes a config and a logger and returns a ready to go Node.

type SQLDBProvider

type SQLDBProvider func(*DBContext) (*dex.SQLDBBackend, error)

DBProvider takes a DBContext and returns an instantiated DB.

Jump to

Keyboard shortcuts

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