app

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: May 31, 2019 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BeaconApp

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

BeaconApp contains all the high level states and workflow for P2P module

func NewBeaconApp

func NewBeaconApp(config Config) *BeaconApp

NewBeaconApp creates a new instance of BeaconApp

func (BeaconApp) Exit

func (app BeaconApp) Exit()

Exit sends a request to exit the application.

func (*BeaconApp) GetHostNode

func (app *BeaconApp) GetHostNode() *p2p.HostNode

GetHostNode gets the host node

func (*BeaconApp) Run

func (app *BeaconApp) Run() error

Run runs the main loop of BeaconApp

func (*BeaconApp) WaitForConnections

func (app *BeaconApp) WaitForConnections(numConnections int)

WaitForConnections waits until beacon app is connected

type ChainConfig added in v0.2.4

type ChainConfig struct {
	GenesisTime       uint64
	BootstrapPeers    []string
	NetworkID         string
	InitialValidators InitialValidatorList
}

ChainConfig is the JSON encoded information about the network.

type Config

type Config struct {
	RPCProto               string
	RPCAddress             string
	DataDirectory          string
	NetworkConfig          *config.Config
	Resync                 bool
	IsIntegrationTest      bool
	InitialSyncConnections int
	ListeningAddress       string
	MinPeerCountToWait     int
	HeartBeatInterval      time.Duration
	TimeOutInterval        time.Duration
	MaxPeers               int

	// These options are filled in through the chain file.
	GenesisTime          uint64
	InitialValidatorList []beacon.InitialValidatorEntry
	DiscoveryOptions     p2p.DiscoveryOptions
}

Config is the config of an BeaconApp

func GenerateConfigFromChainConfig added in v0.2.4

func GenerateConfigFromChainConfig(chainConfig ChainConfig) (*Config, error)

GenerateConfigFromChainConfig generates a new config from the passed in network config which should be loaded from a JSON file.

func NewConfig

func NewConfig() Config

NewConfig creates a default Config

func ReadChainFileToConfig added in v0.2.4

func ReadChainFileToConfig(r io.Reader) (*Config, error)

ReadChainFileToConfig reads a network config from the reader.

type InitialValidatorInformation added in v0.2.4

type InitialValidatorInformation struct {
	PubKey                string
	ProofOfPossession     string
	WithdrawalShard       uint32
	WithdrawalCredentials string
	DepositSize           uint64
	ID                    uint32
}

InitialValidatorInformation is the encoded information from the JSON file of an initial validator.

type InitialValidatorList added in v0.2.4

type InitialValidatorList struct {
	NumValidators int
	Validators    []InitialValidatorInformation
}

InitialValidatorList is a list of initial validators and the number of validators

Jump to

Keyboard shortcuts

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