Documentation ¶
Index ¶
- Constants
- Variables
- func DefaultConfigFolder() string
- func GetBeaconDescription(value BeaconStatus) string
- func GetDkgStatusDescription(value DkgStatus) string
- func Proxy(s drand.PublicServer) client.Client
- func StatusResponseToString(status *drand.StatusResponse) string
- type BeaconProcess
- func (bp *BeaconProcess) BackupDatabase(ctx context.Context, req *drand.BackupDBRequest) (*drand.BackupDBResponse, error)
- func (bp *BeaconProcess) ChainInfo(ctx context.Context, _ *drand.ChainInfoRequest) (*drand.ChainInfoPacket, error)
- func (bp *BeaconProcess) GetIdentity(ctx context.Context, _ *drand.IdentityRequest) (*drand.IdentityResponse, error)
- func (bp *BeaconProcess) GroupFile(ctx context.Context, _ *drand.GroupRequest) (*drand.GroupPacket, error)
- func (bp *BeaconProcess) Home(ctx context.Context, _ *drand.HomeRequest) (*drand.HomeResponse, error)
- func (bp *BeaconProcess) ListBeaconIDs(ctx context.Context, _ *drand.ListBeaconIDsRequest) (*drand.ListBeaconIDsResponse, error)
- func (bp *BeaconProcess) ListSchemes(ctx context.Context, _ *drand.ListSchemesRequest) (*drand.ListSchemesResponse, error)
- func (bp *BeaconProcess) Load(ctx context.Context) error
- func (bp *BeaconProcess) PartialBeacon(ctx context.Context, in *drand.PartialBeaconPacket) (*drand.Empty, error)
- func (bp *BeaconProcess) PingPong(ctx context.Context, _ *drand.Ping) (*drand.Pong, error)
- func (bp *BeaconProcess) PublicKey(ctx context.Context, _ *drand.PublicKeyRequest) (*drand.PublicKeyResponse, error)
- func (bp *BeaconProcess) PublicRand(ctx context.Context, in *drand.PublicRandRequest) (*drand.PublicRandResponse, error)
- func (bp *BeaconProcess) PublicRandStream(req *drand.PublicRandRequest, stream drand.Public_PublicRandStreamServer) error
- func (bp *BeaconProcess) RemoteStatus(ctx context.Context, in *drand.RemoteStatusRequest) (*drand.RemoteStatusResponse, error)
- func (bp *BeaconProcess) StartBeacon(ctx context.Context, catchup bool) error
- func (bp *BeaconProcess) StartCheckChain(req *drand.StartSyncRequest, stream drand.Control_StartCheckChainServer) error
- func (bp *BeaconProcess) StartFollowChain(ctx context.Context, req *drand.StartSyncRequest, ...) error
- func (bp *BeaconProcess) StartListeningForDKGUpdates(ctx context.Context)
- func (bp *BeaconProcess) Status(ctx context.Context, in *drand.StatusRequest) (*drand.StatusResponse, error)
- func (bp *BeaconProcess) Stop(ctx context.Context)
- func (bp *BeaconProcess) StopBeacon(ctx context.Context)
- func (bp *BeaconProcess) SyncChain(req *drand.SyncRequest, stream drand.Protocol_SyncChainServer) error
- func (bp *BeaconProcess) WaitExit() chan bool
- type BeaconStatus
- type Client
- type Config
- func (d *Config) BoltOptions() *bolt.Options
- func (d *Config) ConfigFolder() string
- func (d *Config) ConfigFolderMB() string
- func (d *Config) ControlPort() string
- func (d *Config) DBFolder(beaconID string) string
- func (d *Config) Logger() log.Logger
- func (d *Config) PgDSN() string
- func (d *Config) PrivateListenAddress(defaultAddr string) string
- func (d *Config) PublicListenAddress(defaultAddr string) string
- func (d *Config) TracesEndpoint() string
- func (d *Config) TracesProbability() float64
- func (d *Config) Version() string
- type ConfigOption
- func WithBoltOptions(opts *bolt.Options) ConfigOption
- func WithCallOption(opts ...grpc.CallOption) ConfigOption
- func WithConfigFolder(folder string) ConfigOption
- func WithControlPort(port string) ConfigOption
- func WithDBStorageEngine(engine chain.StorageType) ConfigOption
- func WithDkgKickoffGracePeriod(t time.Duration) ConfigOption
- func WithDkgPhaseTimeout(t time.Duration) ConfigOption
- func WithDkgTimeout(t time.Duration) ConfigOption
- func WithMemDBSize(bufferSize int) ConfigOption
- func WithNamedLogger(name string) ConfigOption
- func WithPgDSN(dsn string) ConfigOption
- func WithPrivateListenAddress(addr string) ConfigOption
- func WithPublicListenAddress(addr string) ConfigOption
- func WithTracesEndpoint(tracesEndpoint string) ConfigOption
- func WithTracesProbability(tracesProbability float64) ConfigOption
- func WithVersion(version string) ConfigOption
- type DKGProcess
- type DkgStatus
- type DrandDaemon
- func (dd *DrandDaemon) AddBeaconHandler(ctx context.Context, beaconID string, bp *BeaconProcess)
- func (dd *DrandDaemon) BackupDatabase(ctx context.Context, in *drand.BackupDBRequest) (*drand.BackupDBResponse, error)
- func (dd *DrandDaemon) BroadcastDKG(ctx context.Context, packet *drand.DKGPacket) (*drand.EmptyDKGResponse, error)
- func (dd *DrandDaemon) ChainInfo(ctx context.Context, in *drand.ChainInfoRequest) (*drand.ChainInfoPacket, error)
- func (dd *DrandDaemon) Command(ctx context.Context, command *drand.DKGCommand) (*drand.EmptyDKGResponse, error)
- func (dd *DrandDaemon) DKGStatus(ctx context.Context, request *drand.DKGStatusRequest) (*drand.DKGStatusResponse, error)
- func (dd *DrandDaemon) GetIdentity(ctx context.Context, in *drand.IdentityRequest) (*drand.IdentityResponse, error)
- func (dd *DrandDaemon) GroupFile(ctx context.Context, in *drand.GroupRequest) (*drand.GroupPacket, error)
- func (dd *DrandDaemon) Home(c context.Context, _ *drand.HomeRequest) (*drand.HomeResponse, error)
- func (dd *DrandDaemon) InstantiateBeaconProcess(ctx context.Context, beaconID string, store key.Store) (*BeaconProcess, error)
- func (dd *DrandDaemon) KeypairFor(beaconID string) (*key.Pair, error)
- func (dd *DrandDaemon) ListBeaconIDs(ctx context.Context, _ *drand.ListBeaconIDsRequest) (*drand.ListBeaconIDsResponse, error)
- func (dd *DrandDaemon) ListSchemes(ctx context.Context, _ *drand.ListSchemesRequest) (*drand.ListSchemesResponse, error)
- func (dd *DrandDaemon) LoadBeacon(ctx context.Context, in *drand.LoadBeaconRequest) (*drand.LoadBeaconResponse, error)
- func (dd *DrandDaemon) LoadBeaconFromDisk(ctx context.Context, beaconID string) (*BeaconProcess, error)
- func (dd *DrandDaemon) LoadBeaconFromStore(ctx context.Context, beaconID string, store key.Store) (*BeaconProcess, error)
- func (dd *DrandDaemon) LoadBeaconsFromDisk(ctx context.Context, metricsFlag string, singleBeacon bool, ...) error
- func (dd *DrandDaemon) Metrics(ctx context.Context, _ *drand.MetricsRequest) (*drand.MetricsResponse, error)
- func (dd *DrandDaemon) NodeVersionStreamValidator(srv interface{}, ss grpc.ServerStream, _ *grpc.StreamServerInfo, ...) error
- func (dd *DrandDaemon) NodeVersionValidator(ctx context.Context, req interface{}, _ *grpc.UnaryServerInfo, ...) (response interface{}, err error)
- func (dd *DrandDaemon) Packet(ctx context.Context, packet *drand.GossipPacket) (*drand.EmptyDKGResponse, error)
- func (dd *DrandDaemon) PartialBeacon(ctx context.Context, in *drand.PartialBeaconPacket) (*drand.Empty, error)
- func (dd *DrandDaemon) PingPong(ctx context.Context, _ *drand.Ping) (*drand.Pong, error)
- func (dd *DrandDaemon) PublicKey(ctx context.Context, in *drand.PublicKeyRequest) (*drand.PublicKeyResponse, error)
- func (dd *DrandDaemon) PublicRand(ctx context.Context, in *drand.PublicRandRequest) (*drand.PublicRandResponse, error)
- func (dd *DrandDaemon) PublicRandStream(in *drand.PublicRandRequest, stream drand.Public_PublicRandStreamServer) error
- func (dd *DrandDaemon) RemoteStatus(ctx context.Context, request *drand.RemoteStatusRequest) (*drand.RemoteStatusResponse, error)
- func (dd *DrandDaemon) RemoveBeaconHandler(ctx context.Context, beaconID string, bp *BeaconProcess)
- func (dd *DrandDaemon) RemoveBeaconProcess(ctx context.Context, beaconID string, bp *BeaconProcess)
- func (dd *DrandDaemon) Shutdown(ctx context.Context, in *drand.ShutdownRequest) (*drand.ShutdownResponse, error)
- func (dd *DrandDaemon) StartCheckChain(in *drand.StartSyncRequest, stream drand.Control_StartCheckChainServer) error
- func (dd *DrandDaemon) StartFollowChain(in *drand.StartSyncRequest, stream drand.Control_StartFollowChainServer) error
- func (dd *DrandDaemon) Status(ctx context.Context, in *drand.StatusRequest) (*drand.StatusResponse, error)
- func (dd *DrandDaemon) Stop(ctx context.Context)
- func (dd *DrandDaemon) SyncChain(in *drand.SyncRequest, stream drand.Protocol_SyncChainServer) error
- func (dd *DrandDaemon) WaitExit() chan bool
- type MetadataGetter
- type MockNode
Constants ¶
const DefaultConfigFolderName = ".drand"
DefaultConfigFolderName is the name of the folder containing all key materials (and the beacons db file by default). It is relative to the user's home directory.
const DefaultControlPort = "8888"
DefaultControlPort is the default port the daemon and CLI use to communicate together.
const DefaultDBFolder = "db"
DefaultDBFolder is the name of the folder in which the db file is saved. It is relative to the DefaultConfigFolder path.
const DefaultDKGKickoffGracePeriod = 5 * time.Second
DefaultDKGKickoffGracePeriod is the amount of time that each node waits after receiving the execution notification from the leader.
const DefaultDKGPhaseTimeout = 10 * time.Second
DefaultDKGPhaseTimeout is the default time of each DKG period by default. Note that by default, DKG uses the "fast sync" mode that shorten the first phase and the second phase, "as fast as possible" when the protocol runs smoothly (there is no malicious party).
const DefaultDKGTimeout = 24 * time.Hour
DefaultDKGTimeout is the max amount of time from start of a DKG until it gets aborted automatically
const InProgressDesc = "In progress"
const NotStartedDesc = "Not started"
const UnknownDesc = "Unknown"
Variables ¶
var ErrDKGNotStarted = errors.New("DKG not started")
var ErrNoGroupSetup = errors.New("drand: no dkg group setup yet")
Functions ¶
func DefaultConfigFolder ¶
func DefaultConfigFolder() string
DefaultConfigFolder returns the default path of the configuration folder.
func GetBeaconDescription ¶
func GetBeaconDescription(value BeaconStatus) string
func GetDkgStatusDescription ¶
func Proxy ¶
func Proxy(s drand.PublicServer) client.Client
Proxy wraps a server interface into a client interface so it can be queried
func StatusResponseToString ¶
func StatusResponseToString(status *drand.StatusResponse) string
Types ¶
type BeaconProcess ¶
type BeaconProcess struct {
// contains filtered or unexported fields
}
BeaconProcess is the main logic of the program. It reads the keys / group file, it can start the DKG, read/write shares to files and can initiate/respond to tBLS signature requests.
func NewBeaconProcess ¶
func NewBeaconProcess(ctx context.Context, log dlog.Logger, store key.Store, completedDKGs *util.FanOutChan[dkg.SharingOutput], beaconID string, opts *Config, privGateway *net.PrivateGateway) (*BeaconProcess, error)
func (*BeaconProcess) BackupDatabase ¶
func (bp *BeaconProcess) BackupDatabase(ctx context.Context, req *drand.BackupDBRequest) (*drand.BackupDBResponse, error)
BackupDatabase triggers a backup of the primary database.
func (*BeaconProcess) ChainInfo ¶
func (bp *BeaconProcess) ChainInfo(ctx context.Context, _ *drand.ChainInfoRequest) (*drand.ChainInfoPacket, error)
ChainInfo replies with the chain information this node participates to
func (*BeaconProcess) GetIdentity ¶
func (bp *BeaconProcess) GetIdentity(ctx context.Context, _ *drand.IdentityRequest) (*drand.IdentityResponse, error)
GetIdentity returns the identity of this drand node
func (*BeaconProcess) GroupFile ¶
func (bp *BeaconProcess) GroupFile(ctx context.Context, _ *drand.GroupRequest) (*drand.GroupPacket, error)
GroupFile replies with the distributed key in the response
func (*BeaconProcess) Home ¶
func (bp *BeaconProcess) Home(ctx context.Context, _ *drand.HomeRequest) (*drand.HomeResponse, error)
Home provides the address the local node is listening
func (*BeaconProcess) ListBeaconIDs ¶
func (bp *BeaconProcess) ListBeaconIDs(ctx context.Context, _ *drand.ListBeaconIDsRequest) (*drand.ListBeaconIDsResponse, error)
func (*BeaconProcess) ListSchemes ¶
func (bp *BeaconProcess) ListSchemes(ctx context.Context, _ *drand.ListSchemesRequest) (*drand.ListSchemesResponse, error)
func (*BeaconProcess) Load ¶
func (bp *BeaconProcess) Load(ctx context.Context) error
Load restores a drand instance that is ready to serve randomness, with a pre-existing distributed share.
func (*BeaconProcess) PartialBeacon ¶
func (bp *BeaconProcess) PartialBeacon(ctx context.Context, in *drand.PartialBeaconPacket) (*drand.Empty, error)
PartialBeacon receives a beacon generation request and answers with the partial signature from this drand node.
func (*BeaconProcess) PingPong ¶
PingPong simply responds with an empty packet, proving that this drand node is up and alive.
func (*BeaconProcess) PublicKey ¶
func (bp *BeaconProcess) PublicKey(ctx context.Context, _ *drand.PublicKeyRequest) (*drand.PublicKeyResponse, error)
PublicKey is a functionality of Control Service defined in protobuf/control that requests the long term public key of the drand node running locally
func (*BeaconProcess) PublicRand ¶
func (bp *BeaconProcess) PublicRand(ctx context.Context, in *drand.PublicRandRequest) (*drand.PublicRandResponse, error)
PublicRand returns a public random beacon according to the request. If the Round field is 0, then it returns the last one generated.
func (*BeaconProcess) PublicRandStream ¶
func (bp *BeaconProcess) PublicRandStream(req *drand.PublicRandRequest, stream drand.Public_PublicRandStreamServer) error
PublicRandStream exports a stream of new beacons as they are generated over gRPC
func (*BeaconProcess) RemoteStatus ¶
func (bp *BeaconProcess) RemoteStatus(ctx context.Context, in *drand.RemoteStatusRequest) (*drand.RemoteStatusResponse, error)
func (*BeaconProcess) StartBeacon ¶
func (bp *BeaconProcess) StartBeacon(ctx context.Context, catchup bool) error
StartBeacon initializes the beacon if needed and launch a go routine that runs the generation loop.
func (*BeaconProcess) StartCheckChain ¶
func (bp *BeaconProcess) StartCheckChain(req *drand.StartSyncRequest, stream drand.Control_StartCheckChainServer) error
StartCheckChain checks a chain for validity and pulls invalid beacons from other nodes
func (*BeaconProcess) StartFollowChain ¶
func (bp *BeaconProcess) StartFollowChain(ctx context.Context, req *drand.StartSyncRequest, stream drand.Control_StartFollowChainServer) error
StartFollowChain syncs up with a chain from other nodes
func (*BeaconProcess) StartListeningForDKGUpdates ¶
func (bp *BeaconProcess) StartListeningForDKGUpdates(ctx context.Context)
func (*BeaconProcess) Status ¶
func (bp *BeaconProcess) Status(ctx context.Context, in *drand.StatusRequest) (*drand.StatusResponse, error)
Status responds with the actual status of drand process
func (*BeaconProcess) Stop ¶
func (bp *BeaconProcess) Stop(ctx context.Context)
Stop simply stops all drand operations.
func (*BeaconProcess) StopBeacon ¶
func (bp *BeaconProcess) StopBeacon(ctx context.Context)
StopBeacon stops the beacon generation process and resets it.
func (*BeaconProcess) SyncChain ¶
func (bp *BeaconProcess) SyncChain(req *drand.SyncRequest, stream drand.Protocol_SyncChainServer) error
SyncChain is an inter-node protocol that replies to a syncing request from a given round
func (*BeaconProcess) WaitExit ¶
func (bp *BeaconProcess) WaitExit() chan bool
WaitExit returns a channel that signals when drand stops its operations
type BeaconStatus ¶
type BeaconStatus uint32
const ( BeaconNotInited BeaconStatus = iota BeaconInited )
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is the endpoint logic, communicating with drand servers TODO: This API should go away. Do not extend any further.
func NewGrpcClient ¶
NewGrpcClient returns a Client able to talk to drand instances using gRPC communication method.
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
Config holds all relevant information for a drand node to run.
func NewConfig ¶
func NewConfig(l log.Logger, opts ...ConfigOption) *Config
NewConfig returns the config to pass to drand with the default options set and the updated values given by the options.
func (*Config) BoltOptions ¶
BoltOptions returns the options given to the bolt db
func (*Config) ConfigFolder ¶
ConfigFolder returns the folder under which drand stores all its configuration.
func (*Config) ConfigFolderMB ¶
ConfigFolderMB returns the folder under which multi-beacon drand stores all its configuration.
func (*Config) ControlPort ¶
ControlPort returns the port used for control port communications which can be the default one or the port setup thanks to WithControlPort
func (*Config) DBFolder ¶
DBFolder returns the folder under which drand stores db file specifically. If beacon id is empty, it will use the default value
func (*Config) PrivateListenAddress ¶
PrivateListenAddress returns the given default address or the listen address stored in the config thanks to WithPrivateListenAddress
func (*Config) PublicListenAddress ¶
PublicListenAddress returns the given default address or the listen address stored in the config thanks to WithPublicListenAddress
func (*Config) TracesEndpoint ¶
TracesEndpoint retrieves the configured tracing data endpoint
func (*Config) TracesProbability ¶
TracesProbability retrieves the probability of for traces to be collected and sent to the server
type ConfigOption ¶
type ConfigOption func(*Config)
ConfigOption is a function that applies a specific setting to a Config.
func WithBoltOptions ¶
func WithBoltOptions(opts *bolt.Options) ConfigOption
WithBoltOptions applies boltdb specific options when storing random beacons.
func WithCallOption ¶
func WithCallOption(opts ...grpc.CallOption) ConfigOption
WithCallOption applies grpc options when drand calls a gRPC method.
func WithConfigFolder ¶
func WithConfigFolder(folder string) ConfigOption
WithConfigFolder sets the base configuration folder to the given string.
func WithControlPort ¶
func WithControlPort(port string) ConfigOption
WithControlPort specifies which port on localhost the ListenerControl should bind to.
func WithDBStorageEngine ¶
func WithDBStorageEngine(engine chain.StorageType) ConfigOption
WithDBStorageEngine allows setting the specific storage type
func WithDkgKickoffGracePeriod ¶
func WithDkgKickoffGracePeriod(t time.Duration) ConfigOption
func WithDkgPhaseTimeout ¶
func WithDkgPhaseTimeout(t time.Duration) ConfigOption
func WithDkgTimeout ¶
func WithDkgTimeout(t time.Duration) ConfigOption
WithDkgTimeout sets the timeout under which the DKG must finish.
func WithMemDBSize ¶
func WithMemDBSize(bufferSize int) ConfigOption
func WithNamedLogger ¶
func WithNamedLogger(name string) ConfigOption
func WithPgDSN ¶
func WithPgDSN(dsn string) ConfigOption
WithPgDSN applies PosgresSQL specific options to the PG store. It will also create a new database connection.
func WithPrivateListenAddress ¶
func WithPrivateListenAddress(addr string) ConfigOption
WithPrivateListenAddress specifies the address the drand instance should bind to. It is useful if you want to advertise a public proxy address and the drand instance runs behind your network.
func WithPublicListenAddress ¶
func WithPublicListenAddress(addr string) ConfigOption
WithPublicListenAddress specifies the address the drand instance should bind to. It is useful if you want to advertise a public proxy address and the drand instance runs behind your network.
func WithTracesEndpoint ¶
func WithTracesEndpoint(tracesEndpoint string) ConfigOption
WithTracesEndpoint sets the receiver for the tracing data
func WithTracesProbability ¶
func WithTracesProbability(tracesProbability float64) ConfigOption
WithTracesProbability sets the probability of for traces to be collected and sent to the server
func WithVersion ¶
func WithVersion(version string) ConfigOption
WithVersion sets a version for drand, a visible string to other peers.
type DKGProcess ¶
type DKGProcess interface { DKGStatus(context context.Context, request *pdkg.DKGStatusRequest) (*pdkg.DKGStatusResponse, error) Command(context context.Context, command *pdkg.DKGCommand) (*pdkg.EmptyDKGResponse, error) Packet(context context.Context, packet *pdkg.GossipPacket) (*pdkg.EmptyDKGResponse, error) Migrate(beaconID string, group *key.Group, share *key.Share) error BroadcastDKG(context context.Context, packet *pdkg.DKGPacket) (*pdkg.EmptyDKGResponse, error) Close() }
type DrandDaemon ¶
type DrandDaemon struct {
// contains filtered or unexported fields
}
func NewDrandDaemon ¶
func NewDrandDaemon(ctx context.Context, c *Config) (*DrandDaemon, error)
NewDrandDaemon creates a new instance of DrandDaemon
func (*DrandDaemon) AddBeaconHandler ¶
func (dd *DrandDaemon) AddBeaconHandler(ctx context.Context, beaconID string, bp *BeaconProcess)
AddBeaconHandler adds a handler linked to beacon with chain hash from http server used to expose public services
func (*DrandDaemon) BackupDatabase ¶
func (dd *DrandDaemon) BackupDatabase(ctx context.Context, in *drand.BackupDBRequest) (*drand.BackupDBResponse, error)
BackupDatabase triggers a backup of the primary database.
func (*DrandDaemon) BroadcastDKG ¶
func (dd *DrandDaemon) BroadcastDKG(ctx context.Context, packet *drand.DKGPacket) (*drand.EmptyDKGResponse, error)
func (*DrandDaemon) ChainInfo ¶
func (dd *DrandDaemon) ChainInfo(ctx context.Context, in *drand.ChainInfoRequest) (*drand.ChainInfoPacket, error)
ChainInfo replies with the chain information this node participates to
func (*DrandDaemon) Command ¶
func (dd *DrandDaemon) Command(ctx context.Context, command *drand.DKGCommand) (*drand.EmptyDKGResponse, error)
func (*DrandDaemon) DKGStatus ¶
func (dd *DrandDaemon) DKGStatus(ctx context.Context, request *drand.DKGStatusRequest) (*drand.DKGStatusResponse, error)
func (*DrandDaemon) GetIdentity ¶
func (dd *DrandDaemon) GetIdentity(ctx context.Context, in *drand.IdentityRequest) (*drand.IdentityResponse, error)
GetIdentity returns the identity of this drand node
func (*DrandDaemon) GroupFile ¶
func (dd *DrandDaemon) GroupFile(ctx context.Context, in *drand.GroupRequest) (*drand.GroupPacket, error)
GroupFile replies with the distributed key in the response
func (*DrandDaemon) Home ¶
func (dd *DrandDaemon) Home(c context.Context, _ *drand.HomeRequest) (*drand.HomeResponse, error)
Home provides the address the local node is listening
func (*DrandDaemon) InstantiateBeaconProcess ¶
func (dd *DrandDaemon) InstantiateBeaconProcess(ctx context.Context, beaconID string, store key.Store) (*BeaconProcess, error)
InstantiateBeaconProcess creates a new BeaconProcess linked to beacon with id 'beaconID'
func (*DrandDaemon) KeypairFor ¶
func (dd *DrandDaemon) KeypairFor(beaconID string) (*key.Pair, error)
func (*DrandDaemon) ListBeaconIDs ¶
func (dd *DrandDaemon) ListBeaconIDs(ctx context.Context, _ *drand.ListBeaconIDsRequest) (*drand.ListBeaconIDsResponse, error)
func (*DrandDaemon) ListSchemes ¶
func (dd *DrandDaemon) ListSchemes(ctx context.Context, _ *drand.ListSchemesRequest) (*drand.ListSchemesResponse, error)
func (*DrandDaemon) LoadBeacon ¶
func (dd *DrandDaemon) LoadBeacon(ctx context.Context, in *drand.LoadBeaconRequest) (*drand.LoadBeaconResponse, error)
LoadBeacon tells the DrandDaemon to load a new beacon into the memory
func (*DrandDaemon) LoadBeaconFromDisk ¶
func (dd *DrandDaemon) LoadBeaconFromDisk(ctx context.Context, beaconID string) (*BeaconProcess, error)
func (*DrandDaemon) LoadBeaconFromStore ¶
func (dd *DrandDaemon) LoadBeaconFromStore(ctx context.Context, beaconID string, store key.Store) (*BeaconProcess, error)
func (*DrandDaemon) LoadBeaconsFromDisk ¶
func (dd *DrandDaemon) LoadBeaconsFromDisk(ctx context.Context, metricsFlag string, singleBeacon bool, singleBeaconName string) error
LoadBeaconsFromDisk checks for existing stores and creates the corresponding BeaconProcess accordingly to each stored BeaconID. When singleBeacon is set, and the singleBeaconName matches one of the stored beacons, then only that beacon will be loaded. If the singleBeaconName is an empty string, no beacon will be loaded.
func (*DrandDaemon) Metrics ¶
func (dd *DrandDaemon) Metrics(ctx context.Context, _ *drand.MetricsRequest) (*drand.MetricsResponse, error)
func (*DrandDaemon) NodeVersionStreamValidator ¶
func (dd *DrandDaemon) NodeVersionStreamValidator(srv interface{}, ss grpc.ServerStream, _ *grpc.StreamServerInfo, handler grpc.StreamHandler) error
func (*DrandDaemon) NodeVersionValidator ¶
func (dd *DrandDaemon) NodeVersionValidator(ctx context.Context, req interface{}, _ *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (response interface{}, err error)
func (*DrandDaemon) Packet ¶
func (dd *DrandDaemon) Packet(ctx context.Context, packet *drand.GossipPacket) (*drand.EmptyDKGResponse, error)
func (*DrandDaemon) PartialBeacon ¶
func (dd *DrandDaemon) PartialBeacon(ctx context.Context, in *drand.PartialBeaconPacket) (*drand.Empty, error)
PartialBeacon receives a beacon generation request and answers with the partial signature from this drand node.
func (*DrandDaemon) PingPong ¶
PingPong simply responds with an empty packet, proving that this drand node is up and alive.
func (*DrandDaemon) PublicKey ¶
func (dd *DrandDaemon) PublicKey(ctx context.Context, in *drand.PublicKeyRequest) (*drand.PublicKeyResponse, error)
PublicKey is a functionality of Control Service defined in protobuf/control that requests the long term public key of the drand node running locally
func (*DrandDaemon) PublicRand ¶
func (dd *DrandDaemon) PublicRand(ctx context.Context, in *drand.PublicRandRequest) (*drand.PublicRandResponse, error)
PublicRand returns a public random beacon according to the request. If the Round field is 0, then it returns the last one generated.
func (*DrandDaemon) PublicRandStream ¶
func (dd *DrandDaemon) PublicRandStream(in *drand.PublicRandRequest, stream drand.Public_PublicRandStreamServer) error
PublicRandStream exports a stream of new beacons as they are generated over gRPC
func (*DrandDaemon) RemoteStatus ¶
func (dd *DrandDaemon) RemoteStatus(ctx context.Context, request *drand.RemoteStatusRequest) (*drand.RemoteStatusResponse, error)
func (*DrandDaemon) RemoveBeaconHandler ¶
func (dd *DrandDaemon) RemoveBeaconHandler(ctx context.Context, beaconID string, bp *BeaconProcess)
RemoveBeaconHandler removes a handler linked to beacon with chain hash from http server used to expose public services
func (*DrandDaemon) RemoveBeaconProcess ¶
func (dd *DrandDaemon) RemoveBeaconProcess(ctx context.Context, beaconID string, bp *BeaconProcess)
RemoveBeaconProcess remove a BeaconProcess linked to beacon with id 'beaconID'
func (*DrandDaemon) Shutdown ¶
func (dd *DrandDaemon) Shutdown(ctx context.Context, in *drand.ShutdownRequest) (*drand.ShutdownResponse, error)
Shutdown stops the node
func (*DrandDaemon) StartCheckChain ¶
func (dd *DrandDaemon) StartCheckChain(in *drand.StartSyncRequest, stream drand.Control_StartCheckChainServer) error
func (*DrandDaemon) StartFollowChain ¶
func (dd *DrandDaemon) StartFollowChain(in *drand.StartSyncRequest, stream drand.Control_StartFollowChainServer) error
func (*DrandDaemon) Status ¶
func (dd *DrandDaemon) Status(ctx context.Context, in *drand.StatusRequest) (*drand.StatusResponse, error)
Status responds with the actual status of drand process
func (*DrandDaemon) Stop ¶
func (dd *DrandDaemon) Stop(ctx context.Context)
Stop simply stops all drand operations.
func (*DrandDaemon) SyncChain ¶
func (dd *DrandDaemon) SyncChain(in *drand.SyncRequest, stream drand.Protocol_SyncChainServer) error
SyncChain is an inter-node protocol that replies to a syncing request from a given round
func (*DrandDaemon) WaitExit ¶
func (dd *DrandDaemon) WaitExit() chan bool
WaitExit returns a channel that signals when drand stops its operations
type MetadataGetter ¶
Source Files ¶
- client_public.go
- config.go
- constants.go
- convert.go
- drand_beacon.go
- drand_beacon_control.go
- drand_beacon_public.go
- drand_daemon.go
- drand_daemon_control.go
- drand_daemon_dkg_proxy.go
- drand_daemon_helper.go
- drand_daemon_interceptors.go
- drand_daemon_metrics.go
- drand_daemon_public.go
- drand_proxy.go
- drand_status.go
- mock_node.go