Documentation ¶
Index ¶
- func BuildGenesisDocs(network *NetworkInit, globals *core.GlobalValues, time time.Time, ...) (map[string]*tmtypes.GenesisDoc, error)
- func BuildNodesConfig(network *NetworkInit, mkcfg MakeConfigFunc) [][][2]*config.Config
- func ConfigureNodePorts(node *NodeInit, cfg *config.Config, part protocol.PartitionType)
- func LoadOrGenerateTmPrivKey(privFileName string) (tmed25519.PrivKey, error)
- func WriteNodeFiles(cfg *config.Config, privValKey, nodeKey []byte, genDoc *tmtypes.GenesisDoc) (err error)
- type AddressBuilder
- func (b AddressBuilder) AccumulateAPI() AddressBuilder
- func (b AddressBuilder) AccumulateP2P() AddressBuilder
- func (b AddressBuilder) BlockValidator() AddressBuilder
- func (b AddressBuilder) Directory() AddressBuilder
- func (b AddressBuilder) Multiaddr() multiaddr.Multiaddr
- func (b AddressBuilder) PartitionType(typ protocol.PartitionType) AddressBuilder
- func (b AddressBuilder) Prometheus() AddressBuilder
- func (b AddressBuilder) Scheme(scheme string) AddressBuilder
- func (b AddressBuilder) String() string
- func (b AddressBuilder) TendermintP2P() AddressBuilder
- func (b AddressBuilder) TendermintRPC() AddressBuilder
- func (b AddressBuilder) WithKey() AddressBuilder
- type AddressSliceBuilder
- func (b AddressSliceBuilder) AccumulateAPI() AddressSliceBuilder
- func (b AddressSliceBuilder) AccumulateP2P() AddressSliceBuilder
- func (b AddressSliceBuilder) BlockValidator() AddressSliceBuilder
- func (b AddressSliceBuilder) Directory() AddressSliceBuilder
- func (b AddressSliceBuilder) Do(fn ...func(AddressBuilder) AddressBuilder) AddressSliceBuilder
- func (b AddressSliceBuilder) Multiaddr() []multiaddr.Multiaddr
- func (b AddressSliceBuilder) PartitionType(typ protocol.PartitionType) AddressSliceBuilder
- func (b AddressSliceBuilder) Prometheus() AddressSliceBuilder
- func (b AddressSliceBuilder) Scheme(scheme string) AddressSliceBuilder
- func (b AddressSliceBuilder) String() []string
- func (b AddressSliceBuilder) TendermintP2P() AddressSliceBuilder
- func (b AddressSliceBuilder) TendermintRPC() AddressSliceBuilder
- func (b AddressSliceBuilder) WithKey() AddressSliceBuilder
- type BvnInit
- type Daemon
- func (d *Daemon) API() *nodeapi.Handler
- func (d *Daemon) ConnectDirectly(e *Daemon) error
- func (d *Daemon) DB_TESTONLY() *database.Database
- func (d *Daemon) Done() <-chan struct{}
- func (d *Daemon) Key() crypto.PrivKey
- func (d *Daemon) LoadSnapshot(file ioutil2.SectionReader) error
- func (d *Daemon) LocalClient() (connections.ABCIClient, error)
- func (d *Daemon) Node_TESTONLY() *node.Node
- func (d *Daemon) P2P_TESTONLY() *p2p.Node
- func (d *Daemon) Start() (err error)
- func (d *Daemon) StartSecondary(e *Daemon) error
- func (d *Daemon) Stop() error
- type DevnetOptions
- type MakeConfigFunc
- type NetworkInit
- type NodeInit
- type RateLimitedListener
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildGenesisDocs ¶
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 ¶
func BuildNodesConfig(network *NetworkInit, mkcfg MakeConfigFunc) [][][2]*config.Config
func ConfigureNodePorts ¶
func ConfigureNodePorts(node *NodeInit, cfg *config.Config, part protocol.PartitionType)
func LoadOrGenerateTmPrivKey ¶
func WriteNodeFiles ¶
Types ¶
type AddressBuilder ¶
type AddressBuilder struct {
// contains filtered or unexported fields
}
AddressBuilder builds an address.
func (AddressBuilder) AccumulateAPI ¶
func (b AddressBuilder) AccumulateAPI() AddressBuilder
AccumulateAPI sets the service to config.PortOffsetAccumulateApi.
func (AddressBuilder) AccumulateP2P ¶
func (b AddressBuilder) AccumulateP2P() AddressBuilder
AccumulateP2P sets the service to config.PortOffsetAccumulateP2P.
func (AddressBuilder) BlockValidator ¶
func (b AddressBuilder) BlockValidator() AddressBuilder
BlockValidator sets the partition type to protocol.PartitionTypeBlockValidator.
func (AddressBuilder) Directory ¶
func (b AddressBuilder) Directory() AddressBuilder
Directory sets the partition type to protocol.PartitionTypeDirectory.
func (AddressBuilder) Multiaddr ¶
func (b AddressBuilder) Multiaddr() multiaddr.Multiaddr
Multiaddr builds the address as a multiaddr.
func (AddressBuilder) PartitionType ¶
func (b AddressBuilder) PartitionType(typ protocol.PartitionType) AddressBuilder
PartitionType sets the partition type.
func (AddressBuilder) Prometheus ¶
func (b AddressBuilder) Prometheus() AddressBuilder
Prometheus sets the service to config.PortOffsetPrometheus.
func (AddressBuilder) Scheme ¶
func (b AddressBuilder) Scheme(scheme string) AddressBuilder
Scheme sets the address scheme.
func (AddressBuilder) String ¶
func (b AddressBuilder) String() string
String builds the address as a traditional URL address string.
func (AddressBuilder) TendermintP2P ¶
func (b AddressBuilder) TendermintP2P() AddressBuilder
TendermintP2P sets the service to config.PortOffsetTendermintP2P.
func (AddressBuilder) TendermintRPC ¶
func (b AddressBuilder) TendermintRPC() AddressBuilder
TendermintRPC sets the service to config.PortOffsetTendermintRpc.
func (AddressBuilder) WithKey ¶
func (b AddressBuilder) WithKey() AddressBuilder
WithKey includes the node key in the address.
type AddressSliceBuilder ¶
type AddressSliceBuilder []AddressBuilder
AddressSliceBuilder builds a slice of addresses.
func (AddressSliceBuilder) AccumulateAPI ¶
func (b AddressSliceBuilder) AccumulateAPI() AddressSliceBuilder
AccumulateAPI sets the service to config.PortOffsetAccumulateApi.
func (AddressSliceBuilder) AccumulateP2P ¶
func (b AddressSliceBuilder) AccumulateP2P() AddressSliceBuilder
AccumulateP2P sets the service to config.PortOffsetAccumulateP2P.
func (AddressSliceBuilder) BlockValidator ¶
func (b AddressSliceBuilder) BlockValidator() AddressSliceBuilder
func (AddressSliceBuilder) Directory ¶
func (b AddressSliceBuilder) Directory() AddressSliceBuilder
Directory sets the partition type to protocol.PartitionTypeDirectory.
func (AddressSliceBuilder) Do ¶
func (b AddressSliceBuilder) Do(fn ...func(AddressBuilder) AddressBuilder) AddressSliceBuilder
Do returns the Cartesian product of the address list and the given operations. Given N addresses and M operations, Do returns N⨯M addresses.
func (AddressSliceBuilder) Multiaddr ¶
func (b AddressSliceBuilder) Multiaddr() []multiaddr.Multiaddr
Multiaddr builds the address as a multiaddr.
func (AddressSliceBuilder) PartitionType ¶
func (b AddressSliceBuilder) PartitionType(typ protocol.PartitionType) AddressSliceBuilder
PartitionType sets the partition type.
func (AddressSliceBuilder) Prometheus ¶
func (b AddressSliceBuilder) Prometheus() AddressSliceBuilder
Prometheus sets the service to config.PortOffsetPrometheus.
func (AddressSliceBuilder) Scheme ¶
func (b AddressSliceBuilder) Scheme(scheme string) AddressSliceBuilder
Scheme sets the address scheme.
func (AddressSliceBuilder) String ¶
func (b AddressSliceBuilder) String() []string
String builds the address as a traditional URL address string.
func (AddressSliceBuilder) TendermintP2P ¶
func (b AddressSliceBuilder) TendermintP2P() AddressSliceBuilder
TendermintP2P sets the service to config.PortOffsetTendermintP2P.
func (AddressSliceBuilder) TendermintRPC ¶
func (b AddressSliceBuilder) TendermintRPC() AddressSliceBuilder
TendermintRPC sets the service to config.PortOffsetTendermintRpc.
func (AddressSliceBuilder) WithKey ¶
func (b AddressSliceBuilder) WithKey() AddressSliceBuilder
WithKey includes the node key in the address.
type BvnInit ¶
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 ¶
func (*BvnInit) Peers ¶
func (b *BvnInit) Peers(node *NodeInit) AddressSliceBuilder
Peers returns an address slice builder for every node in the BVN other than the given one.
func (*BvnInit) UnmarshalJSON ¶
type Daemon ¶
type Daemon struct { Config *config.Config Logger tmlog.Logger // knobs for tests // IsTest bool UseMemDB bool // contains filtered or unexported fields }
func (*Daemon) ConnectDirectly ¶
func (*Daemon) DB_TESTONLY ¶
func (*Daemon) LoadSnapshot ¶
func (d *Daemon) LoadSnapshot(file ioutil2.SectionReader) error
func (*Daemon) LocalClient ¶
func (d *Daemon) LocalClient() (connections.ABCIClient, error)
func (*Daemon) Node_TESTONLY ¶
func (*Daemon) P2P_TESTONLY ¶
func (*Daemon) StartSecondary ¶
StartSecondary starts this daemon as a secondary process of the given daemon (which must already be running).
type DevnetOptions ¶
type MakeConfigFunc ¶
type NetworkInit ¶
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 ¶
func NewDevnet(opts DevnetOptions) *NetworkInit
func (*NetworkInit) MarshalJSON ¶
func (v *NetworkInit) MarshalJSON() ([]byte, error)
func (*NetworkInit) Peers ¶
func (n *NetworkInit) Peers(node *NodeInit) AddressSliceBuilder
Peers returns an address slice builder for every node in the network other than the given one.
func (*NetworkInit) UnmarshalJSON ¶
func (v *NetworkInit) UnmarshalJSON(data []byte) error
type NodeInit ¶
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"` DnNodeKey []byte `json:"dnNodeKey,omitempty" form:"dnNodeKey" query:"dnNodeKey" validate:"required"` BvnNodeKey []byte `json:"bvnNodeKey,omitempty" form:"bvnNodeKey" query:"bvnNodeKey" validate:"required"` }
func (*NodeInit) Advertize ¶
func (n *NodeInit) Advertize() AddressBuilder
Advertize returns an address builder for the node's advertized address.
func (*NodeInit) Listen ¶
func (n *NodeInit) Listen() AddressBuilder
Listen returns an address builder for the node's listen address.
func (*NodeInit) MarshalJSON ¶
func (*NodeInit) Peer ¶
func (n *NodeInit) Peer() AddressBuilder
Peer returns an address builder for the node's peer address.