Documentation
¶
Overview ¶
Package app provides the top app-level abstraction and entrypoint for a charon DVC instance. The sub-packages also provide app-level functionality.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Manifest ¶ added in v0.2.0
type Manifest struct {
// DVs is the set of distributed validators managed by the cluster.
// Each DV is defined by its threshold signature scheme.
DVs []tbls.TSS
// Peers is set of charon nodes in the cluster.
Peers []p2p.Peer
}
Manifest defines a charon cluster. The same manifest is loaded by all charon nodes in the cluster. TODO(corver): Add authentication signatures for each peer per DV.
func NewClusterForT ¶ added in v0.2.0
func NewClusterForT(t *testing.T, dv, k, n, seed int) (Manifest, []*ecdsa.PrivateKey, [][]*bls_sig.SecretKeyShare)
NewClusterForT returns a new cluster manifest with dv number of distributed validators, k threshold and n peers. It also returns the peer p2p keys and BLS secret shares. If the seed is zero a random cluster on available loopback ports is generated, else a deterministic cluster is generated. Note this is not defined in testutil since it is tightly coupled with the app package.
func (Manifest) MarshalJSON ¶ added in v0.2.0
func (Manifest) PeerIDs ¶ added in v0.2.0
PeerIDs is a convenience function that returns the peer IDs.
func (Manifest) PublicKeys ¶ added in v0.2.0
PublicKeys is a convenience function that returns the DV root public keys.
func (*Manifest) UnmarshalJSON ¶ added in v0.2.0
type NodeIdx ¶ added in v0.2.0
type NodeIdx struct {
// PeerIdx is the index of a peer in the peer list (it 0-indexed).
PeerIdx int
ShareIdx int
}
NodeIdx represents the index of a node/peer/share in the cluster as defined in the manifest.
type TestConfig ¶
type TestConfig struct {
// Manifest provides the manifest explicitly, skips loading ManifestFile from disk.
Manifest *Manifest
// P2PKey provides the p2p privkey explicitly, skips loading from keystore on disk.
P2PKey *ecdsa.PrivateKey
// DisablePing disables the ping service.
DisablePing bool
// PingCallback is called when a ping was completed to a peer.
PingCallback func(peer.ID)
// ParSigExFunc provides an in-memory partial signature exchange.
ParSigExFunc func() core.ParSigEx
// LcastTransportFunc provides an in-memory leader cast transport.
LcastTransportFunc func() leadercast.Transport
// SimnetKeys provides private key shares for the simnet validatormock signer.
SimnetKeys []*bls_sig.SecretKey
// SimnetBMockOpts defines additional simnet beacon mock options.
SimnetBMockOpts []beaconmock.Option
// BroadcastCallback is called when a duty is completed and sent to the broadcast component.
BroadcastCallback func(context.Context, core.Duty, core.PubKey, core.AggSignedData) error
}
TestConfig defines additional test-only config.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package errors provides errors with structured fields and stack traces.
|
Package errors provides errors with structured fields and stack traces. |
|
Package lifecycle provides a life cycle manager abstracting the starting and stopping of processes by registered start or stop hooks.
|
Package lifecycle provides a life cycle manager abstracting the starting and stopping of processes by registered start or stop hooks. |
|
Package log provides global logging functions to be used throughout the charon app.
|
Package log provides global logging functions to be used throughout the charon app. |
|
Package tracer provides a global OpenTelemetry tracer.
|
Package tracer provides a global OpenTelemetry tracer. |
|
Package z provides an API for structured logging fields by wrapping zap.Field.
|
Package z provides an API for structured logging fields by wrapping zap.Field. |