node

package
v0.4.9 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2022 License: ISC Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Controller

func Controller(logger zerolog.Logger) *chainController

nolint: golint, revive

Types

type BeaconCtl

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

func NewBeaconCtl

func NewBeaconCtl(ctx context.Context, logger zerolog.Logger, cfg *Config) BeaconCtl

func (*BeaconCtl) ChainCtx

func (beaconCtl *BeaconCtl) ChainCtx() chainctx.IChainCtx

func (*BeaconCtl) ChainProvider

func (beaconCtl *BeaconCtl) ChainProvider() *cprovider.ChainProvider

func (*BeaconCtl) Init

func (beaconCtl *BeaconCtl) Init(ctx context.Context) (bool, error)

nolint: contextcheck

func (*BeaconCtl) Run

func (beaconCtl *BeaconCtl) Run(ctx context.Context)

nolint: gomnd

func (*BeaconCtl) Stats

func (beaconCtl *BeaconCtl) Stats() map[string]float64

type Config

type Config struct {
	ConfigFile  string `toml:"-" yaml:"-" short:"C" long:"configfile" description:"Path to configuration file"`
	ShowVersion bool   `toml:"-" yaml:"-" short:"V" long:"version" description:"Display version information and exit"`
	TestNet     bool   `toml:"-" yaml:"-" long:"testnet" description:"Start node with default testnet settings"`
	MainNet     bool   `toml:"-" yaml:"-" long:"mainnet" description:"Start node with default mainnet settings"`

	DropAddrIndex bool `` /* 142-byte string literal not displayed */
	DropCfIndex   bool `` /* 156-byte string literal not displayed */
	DropTxIndex   bool `` /* 137-byte string literal not displayed */
	RefillTxIndex bool `toml:"-" yaml:"-" long:"refilltxindex"`
	VerifyState   bool `` /* 138-byte string literal not displayed */

	DataDir      string   `toml:"data_dir" yaml:"data_dir" short:"b" long:"datadir" description:"Directory to store data"`
	LogDir       string   `toml:"log_dir" yaml:"log_dir" long:"logdir" description:"Directory to log output."`
	CPUProfile   string   `toml:"cpu_profile" yaml:"cpu_profile" long:"cpuprofile" description:"Write CPU profile to the specified file"`
	DebugLevel   string   `` /* 313-byte string literal not displayed */
	Profile      string   `` /* 138-byte string literal not displayed */
	TorIsolation bool     `` /* 156-byte string literal not displayed */
	Whitelists   []string `` /* 143-byte string literal not displayed */

	LogConfig corelog.Config     `toml:"log_config" yaml:"log_config" `
	Node      InstanceConfig     `toml:"node" yaml:"node"`
	BTCD      btcd.Configuration `toml:"btcd" yaml:"btcd"`
}

type DBCtl

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

type Index

type Index struct {
	LastShardID      uint32
	LastBeaconHeight int32
	Shards           map[uint32]ShardInfo
}

func (*Index) AddShard

func (index *Index) AddShard(block *jaxutil.Block, opts p2p.ListenOpts) uint32

func (*Index) SetShardGenesis added in v0.4.3

func (index *Index) SetShardGenesis(shardID uint32, genesisHash *chainhash.Hash)

type InstanceConfig added in v0.3.13

type InstanceConfig struct {
	BeaconChain         cprovider.ChainRuntimeConfig `yaml:"beacon_chain" toml:"beacon_chain"`
	RPC                 rpc.Config                   `yaml:"rpc" toml:"rpc"`
	P2P                 p2p.Config                   `yaml:"p2p" toml:"p2p"`
	Shards              ShardConfig                  `yaml:"shards" toml:"shards"`
	DBType              string                       `yaml:"db_type" toml:"db_type" description:"Database backend to use for the Block Chain"`
	Net                 string                       `yaml:"net" toml:"net"`
	EnableCPUMiner      bool                         `yaml:"enable_cpu_miner" toml:"enable_cpu_miner"`
	DumpMMR             bool                         `yaml:"dump_mmr" toml:"dump_mmr"`
	AutominingEnabled   bool                         `yaml:"automining_enabled" toml:"automining_enabled"`
	AutominingThreshold int32                        `yaml:"automining_threshold" toml:"automining_threshold"`
}

func (*InstanceConfig) ChainParams added in v0.3.13

func (cfg *InstanceConfig) ChainParams() *chaincfg.Params

type ShardConfig

type ShardConfig struct {
	Enable        bool     `yaml:"enable" toml:"enable"`
	Autorun       bool     `yaml:"autorun" toml:"autorun"`
	EnabledShards []uint32 `yaml:"enabled_shards" toml:"enabled_shards"`
}

type ShardCtl

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

func NewShardCtl

func NewShardCtl(ctx context.Context, log zerolog.Logger, cfg *Config,
	chain chainctx.IChainCtx, listenCfg p2p.ListenOpts) *ShardCtl

func (*ShardCtl) ChainCtx

func (shardCtl *ShardCtl) ChainCtx() chainctx.IChainCtx

func (*ShardCtl) ChainProvider

func (shardCtl *ShardCtl) ChainProvider() *cprovider.ChainProvider

func (*ShardCtl) Init

func (shardCtl *ShardCtl) Init(ctx context.Context, beaconBlockGen chaindata.BeaconBlockProvider) (bool, error)

nolint: contextcheck

func (*ShardCtl) Run

func (shardCtl *ShardCtl) Run(ctx context.Context)

nolint: gomnd

func (*ShardCtl) Stats

func (shardCtl *ShardCtl) Stats() map[string]float64

type ShardInfo

type ShardInfo struct {
	chaindata.ShardInfo
	ShardGenesisHash chainhash.Hash
	Enabled          bool
	P2PInfo          p2p.ListenOpts
}

Directories

Path Synopsis
Package blockchain implements bitcoin block handling and chain selection rules.
Package blockchain implements bitcoin block handling and chain selection rules.
fullblocktests
Package fullblocktests provides a set of block consensus validation tests.
Package fullblocktests provides a set of block consensus validation tests.
indexers
Package indexers implements optional block chain indexes.
Package indexers implements optional block chain indexes.
Package chaindata: Functions related to Block Serial ID feature.
Package chaindata: Functions related to Block Serial ID feature.
Package mempool provides a policy-enforced pool of unmined bitcoin transactions.
Package mempool provides a policy-enforced pool of unmined bitcoin transactions.
mmr
Package mmr provides implementation of the Merkle Mountain Range.
Package mmr provides implementation of the Merkle Mountain Range.

Jump to

Keyboard shortcuts

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