dngine

package
v0.0.0-...-cd93eb8 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2017 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Overview

Copyright 2017 Delos Development Foundation and contributors. Licensed under the Apache License, Version 2.0. See the COPYING file at the root of this distribution or at http://www.apache.org/licenses/LICENSE-2.0

Copyright 2017 Delos Development Foundation and contributors. Licensed under the Apache License, Version 2.0. See the COPYING file at the root of this distribution or at http://www.apache.org/licenses/LICENSE-2.0

Copyright 2017 Delos Development Foundation and contributors. Licensed under the Apache License, Version 2.0. See the COPYING file at the root of this distribution or at http://www.apache.org/licenses/LICENSE-2.0

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckSpecialOPVoteSig

func CheckSpecialOPVoteSig(cmd *types.SpecialOPCmd, pk crypto.PubKey, sigData []byte) error

func Initialize

func Initialize(tune *DngineTunes)

func InitializeLog

func InitializeLog(env, logpath string) *zap.Logger

func ProtocolAndAddress

func ProtocolAndAddress(listenAddr string) (string, string)

Defaults to tcp

Types

type Dngine

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

Dngine is a high level abstraction of all the state, consensus, mempool blah blah...

func NewDngine

func NewDngine(tune *DngineTunes) *Dngine

NewDngine makes and returns a new dngine, which can be used directly after being imported

func (*Dngine) BroadcastTx

func (e *Dngine) BroadcastTx(tx []byte) error

func (*Dngine) BroadcastTxCommit

func (e *Dngine) BroadcastTxCommit(tx []byte) error

func (*Dngine) CheckSpecialOp

func (e *Dngine) CheckSpecialOp(cmd *types.SpecialOPCmd) ([]byte, error)

func (*Dngine) CollectSpecialVotes

func (e *Dngine) CollectSpecialVotes(cmd *types.SpecialOPCmd, tx []byte) error

CollectSpecialVotes returns nil means the vote passed

func (*Dngine) ConnectApp

func (e *Dngine) ConnectApp(app types.Application)

func (*Dngine) DialSeeds

func (e *Dngine) DialSeeds(seeds []string)

func (*Dngine) FlushMempool

func (e *Dngine) FlushMempool()

func (*Dngine) Genesis

func (e *Dngine) Genesis() *types.GenesisDoc

func (*Dngine) GetBlacklist

func (e *Dngine) GetBlacklist() []string

func (*Dngine) GetBlock

func (e *Dngine) GetBlock(height int) (*types.Block, *types.BlockMeta)

func (*Dngine) GetConsensusStateInfo

func (e *Dngine) GetConsensusStateInfo() (string, []string)

func (*Dngine) GetNodeInfo

func (e *Dngine) GetNodeInfo() *p2p.NodeInfo

func (*Dngine) GetNumPeers

func (e *Dngine) GetNumPeers() int

func (*Dngine) GetNumUnconfirmedTxs

func (e *Dngine) GetNumUnconfirmedTxs() int

func (*Dngine) GetP2PNetInfo

func (e *Dngine) GetP2PNetInfo() (bool, []string, []*types.Peer)

func (*Dngine) GetUnconfirmedTxs

func (e *Dngine) GetUnconfirmedTxs() []types.Tx

func (*Dngine) GetValidators

func (e *Dngine) GetValidators() (int, []*types.Validator)

func (*Dngine) Height

func (e *Dngine) Height() int

func (*Dngine) IsNodeValidator

func (e *Dngine) IsNodeValidator(pub crypto.PubKey) bool

func (*Dngine) P2PHost

func (e *Dngine) P2PHost() string

func (*Dngine) P2PPort

func (e *Dngine) P2PPort() uint16

func (*Dngine) PrivValidator

func (e *Dngine) PrivValidator() *types.PrivValidator

func (*Dngine) ProcessSpecialOP

func (e *Dngine) ProcessSpecialOP(tx []byte) error

func (*Dngine) RecoverFromCrash

func (e *Dngine) RecoverFromCrash(appHash []byte, appBlockHeight int) error

Recover world status Replay all blocks after blockHeight and ensure the result matches the current state.

func (*Dngine) RegisterNodeInfo

func (e *Dngine) RegisterNodeInfo(ni *p2p.NodeInfo)

func (*Dngine) SetSpecialVoteRPC

func (e *Dngine) SetSpecialVoteRPC(f func([]byte, *types.Validator) ([]byte, error))

func (*Dngine) Start

func (e *Dngine) Start() error

func (*Dngine) Stop

func (e *Dngine) Stop() bool

Stop just wrap around swtich.Stop, which will stop reactors, listeners,etc

type DngineTunes

type DngineTunes struct {
	Runtime string
	Conf    *cfg.MapConfig
}

type ITxCheck

type ITxCheck interface {
	CheckTx(types.Tx) (bool, error)
}

type MempoolFilter

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

func NewMempoolFilter

func NewMempoolFilter(f func([]byte) (bool, error)) MempoolFilter

func (MempoolFilter) CheckTx

func (m MempoolFilter) CheckTx(tx types.Tx) (bool, error)

type MockMempool

type MockMempool struct {
}

Updates to the mempool need to be synchronized with committing a block so apps can reset their transient state on Commit

func (MockMempool) Lock

func (m MockMempool) Lock()

func (MockMempool) Unlock

func (m MockMempool) Unlock()

func (MockMempool) Update

func (m MockMempool) Update(height int64, txs []types.Tx)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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