consensus

package
v0.0.0-...-2aff137 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2019 License: LGPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CONSENSUS_DBFT = "dbft"
	CONSENSUS_SOLO = "solo"
	CONSENSUS_VBFT = "vbft"
	CONSENSUS_POC  = "poc"
)
View Source
const (
	B  = 1
	KB = 1024 * B
	MB = 1024 * KB
	GB = 1024 * MB
)

Variables

This section is empty.

Functions

func GetAllFileSize

func GetAllFileSize(pathname string) uint64

func InitPolicy

func InitPolicy()

func LoadConfigFromProperties

func LoadConfigFromProperties(c *configViper, account *account.Account) error

func WatchConfig

func WatchConfig(c *configViper, account *account.Account) error

监听配置文件的修改和变动

Types

type ConsensusService

type ConsensusService interface {
	Start() error
	Halt() error
	GetPID() *actor.PID
}

func NewConsensusService

func NewConsensusService(consensusType string, account *account.Account, txpool *actor.PID, ledger *actor.PID, p2p *actor.PID) (ConsensusService, error)

type DiskStatus

type DiskStatus struct {
	All  uint64
	Used uint64
	Free uint64
}

func DiskUsage

func DiskUsage(path string) (disk DiskStatus)

type Policy

type Policy struct {
	PolicyLevel PolicyLevel
	List        []common.Address
}
var DefaultPolicy *Policy

func NewPolicy

func NewPolicy() *Policy

func (*Policy) Refresh

func (p *Policy) Refresh()

type PolicyLevel

type PolicyLevel byte
const (
	AllowAll  PolicyLevel = 0x00
	DenyAll   PolicyLevel = 0x01
	AllowList PolicyLevel = 0x02
	DenyList  PolicyLevel = 0x03
)

Directories

Path Synopsis
poc

Jump to

Keyboard shortcuts

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