plasma

package
v0.0.0-...-77960fc Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2018 License: GPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfig = Config{
	SyncMode:      downloader.FastSync,
	NetworkId:     1,
	LightPeers:    100,
	DatabaseCache: 768,
	TrieCache:     256,
	TrieTimeout:   60 * time.Minute,

	TxPool:       core.DefaultTxPoolConfig,
	DataDir:      "",
	ChainUrl:     "",
	CxAddr:       "",
	KeystorePath: "",
}

DefaultConfig contains default settings for use on the Ethereum main net.

Functions

func CreateDB

func CreateDB(config *Config, name string) (store.Database, error)

CreateDB creates the chain database.

Types

type Config

type Config struct {

	// Protocol options
	NetworkId uint64 // Network ID to use for selecting peers to connect to
	SyncMode  downloader.SyncMode
	NoPruning bool

	// Light client options
	LightServ  int `toml:",omitempty"` // Maximum percentage of time allowed for serving LES requests
	LightPeers int `toml:",omitempty"` // Maximum number of LES client peers

	// Database options
	SkipBcVersionCheck bool `toml:"-"`
	DatabaseHandles    int  `toml:"-"`
	DatabaseCache      int
	TrieCache          int
	TrieTimeout        time.Duration

	// Mining-related options
	Operbase  common.Address `toml:",omitempty"`
	ExtraData []byte         `toml:",omitempty"`

	// Transaction pool options
	TxPool core.TxPoolConfig

	// Enables tracking of SHA3 preimages in the VM
	EnablePreimageRecording bool

	// Miscellaneous options
	DocRoot string `toml:"-"`
	// DataDir is the file system folder the node should use for any data storage
	// requirements. The configured data directory will not be directly shared with
	// registered services, instead those can use utility methods to create/access
	// databases or flat files. This enables ephemeral nodes which can fully reside
	// in memory.
	DataDir string

	ChainUrl     string
	CxAddr       string
	CxAbi        string
	OperPwd      string
	KeystorePath string
	IsOperator   bool
}

type LesServer

type LesServer interface {
	Start(srvr *p2p.Server)
	Stop()
	Protocols() []p2p.Protocol
}

type Plasma

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

Plasma implements the Ethereum full node service.

func New

func New(config *Config) (*Plasma, error)

New creates a new Plasma object (including the initialisation of the common Plasma object)

func (*Plasma) AddLesServer

func (s *Plasma) AddLesServer(ls LesServer)

func (*Plasma) BlockChain

func (s *Plasma) BlockChain() *core.BlockChain

func (*Plasma) ChainDb

func (s *Plasma) ChainDb() store.Database

func (*Plasma) Config

func (s *Plasma) Config() *Config

func (*Plasma) Engine

func (s *Plasma) Engine() consensus.Engine

func (*Plasma) EventMux

func (s *Plasma) EventMux() *event.TypeMux

func (*Plasma) IsListening

func (s *Plasma) IsListening() bool

func (*Plasma) NetVersion

func (s *Plasma) NetVersion() uint64

func (s *Plasma) EthVersion() int { return int(s.protocolManager.SubProtocols[0].Version) }

func (*Plasma) Operbase

func (s *Plasma) Operbase() common.Address

func (*Plasma) ProcessRemoteTxs

func (s *Plasma) ProcessRemoteTxs(txs types.Transactions)

func (*Plasma) Protocols

func (s *Plasma) Protocols() []p2p.Protocol

Protocols implements node.Service, returning all the currently configured network protocols to start.

func (*Plasma) RootChain

func (s *Plasma) RootChain() *core.RootChain

func (*Plasma) Start

func (s *Plasma) Start(srvr *p2p.Server) error

Start implements node.Service, starting all internal goroutines needed by the Plasma protocol implementation.

func (*Plasma) StartMining

func (s *Plasma) StartMining(local bool) error

func (*Plasma) Stop

func (s *Plasma) Stop() error

Stop implements node.Service, terminating all internal goroutines used by the Plasma protocol.

func (*Plasma) SubscribeNewBlockCh

func (s *Plasma) SubscribeNewBlockCh(ch chan *types.Block)

func (*Plasma) SubscribeNewTxsCh

func (s *Plasma) SubscribeNewTxsCh(ch chan types.Transactions)

func (*Plasma) TxPool

func (s *Plasma) TxPool() *core.TxPool

func (*Plasma) WriteBlock

func (s *Plasma) WriteBlock(block *types.Block) error

type Worker

type Worker interface {
	Start()
	ProcessRemoteTxs(txs types.Transactions)
	ProcessRemoteBlock(block *types.Block)
	// SubscribeNewTxsCh(ch chan types.Transactions)
	SubscribeNewBlockCh(ch chan *types.Block)
	WriteBlock(block *types.Block) error
}

Jump to

Keyboard shortcuts

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