chatchain

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2022 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BalanceMonitorSubSize = 1024
	ConfigMonitorSubSize  = 16
	BlkStreamDelim        = '`'
	BlkSizePerRequest     = 100
	EthApiTryTimeInterval = time.Second * 15
)
View Source
const (
	DefaultDataBaseDir        = "chain_data"
	ChainDataStreamDelim byte = '@'

	ThNameConsensus     = "consensus of ninja chain"
	ThNameBalanceListen = "balance listener of ninja chain"
	ThNameConfigListen  = "config listener of ninja chain"
	ThNameAccountStore  = "storage of account manager"
	THNameBlockAdmin    = "block miner thread"
)

Variables

This section is empty.

Functions

func BalanceEthKey

func BalanceEthKey() *ecdsa.PrivateKey

func InitConfig

func InitConfig(c *Config, ethPk string)

Types

type Chain

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

func Inst

func Inst() *Chain

func (*Chain) CheckLocalBlocks

func (c *Chain) CheckLocalBlocks() error

func (*Chain) ProcChainDataRequestFromP2pNetwork

func (c *Chain) ProcChainDataRequestFromP2pNetwork(stream network.Stream)

func (*Chain) ProcMinedNewBlockByPrime

func (c *Chain) ProcMinedNewBlockByPrime(blk *pbs.BlockMined) error

func (*Chain) ShutDown

func (c *Chain) ShutDown()

func (*Chain) Start

func (c *Chain) Start(id string, findPeer func(pid string) (network.Stream, error)) error

type Config

type Config struct {
	DataBaseDir string `json:"chain.dir"`
	// contains filtered or unexported fields
}

func DefaultConfig

func DefaultConfig(isMain bool, base string) *Config

func (*Config) String

func (c *Config) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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