accumulated

package
v1.0.0-rc3.2 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2022 License: MIT Imports: 53 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildGenesisDocs added in v1.0.0

func BuildGenesisDocs(network *NetworkInit, globals *core.GlobalValues, time time.Time, logger log.Logger, factomAddresses func() (io.Reader, error), snapshots []func() (ioutil2.SectionReader, error)) (map[string]*tmtypes.GenesisDoc, error)

func BuildNodesConfig added in v1.0.0

func BuildNodesConfig(network *NetworkInit, mkcfg MakeConfigFunc) [][][2]*config.Config

func ConfigureNodePorts added in v1.0.0

func ConfigureNodePorts(node *NodeInit, cfg *config.Config, offset config.PortOffset)

func LoadOrGenerateTmPrivKey added in v1.0.0

func LoadOrGenerateTmPrivKey(privFileName string) (ed25519.PrivKey, error)

func WriteNodeFiles added in v1.0.0

func WriteNodeFiles(cfg *config.Config, privValKey, nodeKey []byte, genDoc *tmtypes.GenesisDoc) (err error)

Types

type AddressType added in v1.0.0

type AddressType int
const (
	ListenAddress AddressType = iota
	AdvertizeAddress
	PeerAddress
)

type BvnInit added in v1.0.0

type BvnInit struct {
	Id    string      `json:"id,omitempty" form:"id" query:"id" validate:"required"`
	Nodes []*NodeInit `json:"nodes,omitempty" form:"nodes" query:"nodes" validate:"required"`
}

func (*BvnInit) MarshalJSON added in v1.0.0

func (v *BvnInit) MarshalJSON() ([]byte, error)

func (*BvnInit) Peers added in v1.0.0

func (b *BvnInit) Peers(node *NodeInit, offset ...config.PortOffset) []string

func (*BvnInit) UnmarshalJSON added in v1.0.0

func (v *BvnInit) UnmarshalJSON(data []byte) error

type Daemon

type Daemon struct {
	Config *config.Config
	Logger tmlog.Logger

	// knobs for tests
	// IsTest   bool
	UseMemDB bool
	// contains filtered or unexported fields
}

func Load

func Load(dir string, newWriter func(*config.Config) (io.Writer, error)) (*Daemon, error)

func (*Daemon) ConnectDirectly added in v0.5.1

func (d *Daemon) ConnectDirectly(e *Daemon) error

func (*Daemon) DB_TESTONLY

func (d *Daemon) DB_TESTONLY() *database.Database

func (*Daemon) Done added in v1.0.0

func (d *Daemon) Done() <-chan struct{}

func (*Daemon) Jrpc_TESTONLY

func (d *Daemon) Jrpc_TESTONLY() *api.JrpcMethods

func (*Daemon) Key

func (d *Daemon) Key() crypto.PrivKey

func (*Daemon) LoadSnapshot added in v1.0.0

func (d *Daemon) LoadSnapshot(file ioutil2.SectionReader) error

func (*Daemon) LocalClient added in v1.0.0

func (d *Daemon) LocalClient() (connections.ABCIClient, error)

func (*Daemon) Node_TESTONLY

func (d *Daemon) Node_TESTONLY() *node.Node

func (*Daemon) Start

func (d *Daemon) Start() (err error)

func (*Daemon) Stop

func (d *Daemon) Stop() error

type DevnetOptions added in v1.0.0

type DevnetOptions struct {
	BvnCount       int
	ValidatorCount int
	FollowerCount  int
	BasePort       int
	GenerateKeys   func() (privVal, node []byte)
	HostName       func(bvnNum, nodeNum int) (host, listen string)
}

type MakeConfigFunc added in v1.0.0

type MakeConfigFunc func(networkName string, net config.NetworkType, node config.NodeType, netId string) *config.Config

type NetworkInit added in v1.0.0

type NetworkInit struct {
	Id   string     `json:"id,omitempty" form:"id" query:"id" validate:"required"`
	Bvns []*BvnInit `json:"bvns,omitempty" form:"bvns" query:"bvns" validate:"required"`
}

func NewDevnet added in v1.0.0

func NewDevnet(opts DevnetOptions) *NetworkInit

func (*NetworkInit) MarshalJSON added in v1.0.0

func (v *NetworkInit) MarshalJSON() ([]byte, error)

func (*NetworkInit) Peers added in v1.0.0

func (n *NetworkInit) Peers(node *NodeInit, offset ...config.PortOffset) []string

func (*NetworkInit) UnmarshalJSON added in v1.0.0

func (v *NetworkInit) UnmarshalJSON(data []byte) error

type NodeInit added in v1.0.0

type NodeInit struct {
	DnnType          config.NodeType `json:"dnnType,omitempty" form:"dnnType" query:"dnnType" validate:"required"`
	BvnnType         config.NodeType `json:"bvnnType,omitempty" form:"bvnnType" query:"bvnnType" validate:"required"`
	BasePort         uint64          `json:"basePort,omitempty" form:"basePort" query:"basePort" validate:"required"`
	AdvertizeAddress string          `json:"advertizeAddress,omitempty" form:"advertizeAddress" query:"advertizeAddress" validate:"required"`
	ListenAddress    string          `json:"listenAddress,omitempty" form:"listenAddress" query:"listenAddress" validate:"required"`
	PeerAddress      string          `json:"peerAddress,omitempty" form:"peerAddress" query:"peerAddress" validate:"required"`
	PrivValKey       []byte          `json:"privValKey,omitempty" form:"privValKey" query:"privValKey" validate:"required"`
	NodeKey          []byte          `json:"nodeKey,omitempty" form:"nodeKey" query:"nodeKey" validate:"required"`
}

func (*NodeInit) Address added in v1.0.0

func (n *NodeInit) Address(typ AddressType, scheme string, offset ...config.PortOffset) string

func (*NodeInit) MarshalJSON added in v1.0.0

func (v *NodeInit) MarshalJSON() ([]byte, error)

func (*NodeInit) Port added in v1.0.0

func (n *NodeInit) Port(offset ...config.PortOffset) int

func (*NodeInit) UnmarshalJSON added in v1.0.0

func (v *NodeInit) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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