Documentation
¶
Index ¶
- Constants
- Variables
- type Config
- func (m *Config) CloneMessageVT() protobuf_go_lite.CloneMessage
- func (m *Config) CloneVT() *Config
- func (this *Config) EqualMessageVT(thatMsg any) bool
- func (this *Config) EqualVT(that *Config) bool
- func (c *Config) EqualsConfig(other config.Config) bool
- func (x *Config) GetBucketId() string
- func (x *Config) GetChunkSize() uint32
- func (c *Config) GetChunkSizeOrDefault() uint32
- func (c *Config) GetConfigID() string
- func (x *Config) GetMaxBlockSize() uint64
- func (c *Config) GetMaxBlockSizeOrDefault() uint64
- func (x *Config) GetMaxConcurrentStreams() uint32
- func (c *Config) GetMaxConcurrentStreamsOrDefault() uint32
- func (x *Config) GetPeerId() string
- func (x *Config) GetPublishDebounceMs() uint32
- func (c *Config) GetPublishDebounceMsOrDefault() uint32
- func (x *Config) GetPubsubChannelId() string
- func (x *Config) GetSyncBackoff() *backoff.Backoff
- func (x *Config) GetTransportId() uint64
- func (x *Config) MarshalJSON() ([]byte, error)
- func (x *Config) MarshalProtoJSON(s *json.MarshalState)
- func (x *Config) MarshalProtoText() string
- func (m *Config) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *Config) MarshalToVT(dAtA []byte) (int, error)
- func (m *Config) MarshalVT() (dAtA []byte, err error)
- func (c *Config) ParsePeerID() (peer.ID, error)
- func (*Config) ProtoMessage()
- func (x *Config) Reset()
- func (m *Config) SizeVT() (n int)
- func (x *Config) String() string
- func (x *Config) UnmarshalJSON(b []byte) error
- func (x *Config) UnmarshalProtoJSON(s *json.UnmarshalState)
- func (m *Config) UnmarshalVT(dAtA []byte) error
- func (c *Config) Validate() error
- type Controller
- func (c *Controller) Close() error
- func (c *Controller) Execute(ctx context.Context) error
- func (c *Controller) GetControllerInfo() *controller.Info
- func (c *Controller) HandleDirective(ctx context.Context, di directive.Instance) ([]directive.Resolver, error)
- func (c *Controller) HandleMountedStream(ctx context.Context, ms link.MountedStream) error
- type Factory
- func (t *Factory) Construct(ctx context.Context, conf config.Config, opts controller.ConstructOpts) (controller.Controller, error)
- func (t *Factory) ConstructConfig() config.Config
- func (t *Factory) GetConfigID() string
- func (t *Factory) GetControllerID() string
- func (t *Factory) GetVersion() controller.Version
- type PubSubMessage
- func (m *PubSubMessage) CloneMessageVT() protobuf_go_lite.CloneMessage
- func (m *PubSubMessage) CloneVT() *PubSubMessage
- func (this *PubSubMessage) EqualMessageVT(thatMsg any) bool
- func (this *PubSubMessage) EqualVT(that *PubSubMessage) bool
- func (x *PubSubMessage) GetClearRefs() []*block.BlockRef
- func (x *PubSubMessage) GetTimestampUnixNano() int64
- func (x *PubSubMessage) GetWantEmpty() bool
- func (x *PubSubMessage) GetWantRefs() []*block.BlockRef
- func (x *PubSubMessage) MarshalJSON() ([]byte, error)
- func (x *PubSubMessage) MarshalProtoJSON(s *json.MarshalState)
- func (x *PubSubMessage) MarshalProtoText() string
- func (m *PubSubMessage) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *PubSubMessage) MarshalToVT(dAtA []byte) (int, error)
- func (m *PubSubMessage) MarshalVT() (dAtA []byte, err error)
- func (*PubSubMessage) ProtoMessage()
- func (x *PubSubMessage) Reset()
- func (m *PubSubMessage) SizeVT() (n int)
- func (x *PubSubMessage) String() string
- func (x *PubSubMessage) UnmarshalJSON(b []byte) error
- func (x *PubSubMessage) UnmarshalProtoJSON(s *json.UnmarshalState)
- func (m *PubSubMessage) UnmarshalVT(dAtA []byte) error
- type SyncMessage
- func (m *SyncMessage) CloneMessageVT() protobuf_go_lite.CloneMessage
- func (m *SyncMessage) CloneVT() *SyncMessage
- func (this *SyncMessage) EqualMessageVT(thatMsg any) bool
- func (this *SyncMessage) EqualVT(that *SyncMessage) bool
- func (x *SyncMessage) GetTransfer() *session.BlockTransfer
- func (x *SyncMessage) MarshalJSON() ([]byte, error)
- func (x *SyncMessage) MarshalProtoJSON(s *json.MarshalState)
- func (x *SyncMessage) MarshalProtoText() string
- func (m *SyncMessage) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *SyncMessage) MarshalToVT(dAtA []byte) (int, error)
- func (m *SyncMessage) MarshalVT() (dAtA []byte, err error)
- func (*SyncMessage) ProtoMessage()
- func (x *SyncMessage) Reset()
- func (m *SyncMessage) SizeVT() (n int)
- func (x *SyncMessage) String() string
- func (x *SyncMessage) UnmarshalJSON(b []byte) error
- func (x *SyncMessage) UnmarshalProtoJSON(s *json.UnmarshalState)
- func (m *SyncMessage) UnmarshalVT(dAtA []byte) error
Constants ¶
const ConfigID = ControllerID
ConfigID is the identifier for the config type.
const ControllerID = "hydra/dex/psecho"
ControllerID is the ID of the controller.
Variables ¶
var Version = controller.MustParseVersion("0.0.1")
Version is the version of the controller implementation.
var WithLocalOnly = bucket_lookup.WithLocalOnly
WithLocalOnly is a shorthand for bucket_lookup.WithLocalOnly.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// BucketId is the bucket to exchange blocks for.
BucketId string `protobuf:"bytes,1,opt,name=bucket_id,json=bucketId,proto3" json:"bucketId,omitempty"`
// PubsubChannelId is the pub-sub channel for want-list gossip.
PubsubChannelId string `protobuf:"bytes,2,opt,name=pubsub_channel_id,json=pubsubChannelId,proto3" json:"pubsubChannelId,omitempty"`
// PeerId is the local peer ID for pub-sub subscription.
PeerId string `protobuf:"bytes,3,opt,name=peer_id,json=peerId,proto3" json:"peerId,omitempty"`
// TransportId constrains which transport to use.
TransportId uint64 `protobuf:"varint,4,opt,name=transport_id,json=transportId,proto3" json:"transportId,omitempty"`
// MaxConcurrentStreams is the max outgoing streams per peer.
// Default: 4.
MaxConcurrentStreams uint32 `protobuf:"varint,5,opt,name=max_concurrent_streams,json=maxConcurrentStreams,proto3" json:"maxConcurrentStreams,omitempty"`
// PublishDebounceMs is the debounce window for want-list
// publishing in milliseconds. Default: 100.
PublishDebounceMs uint32 `protobuf:"varint,6,opt,name=publish_debounce_ms,json=publishDebounceMs,proto3" json:"publishDebounceMs,omitempty"`
// MaxBlockSize is the maximum accepted block size in bytes.
// Default: 10485760 (10MB).
MaxBlockSize uint64 `protobuf:"varint,7,opt,name=max_block_size,json=maxBlockSize,proto3" json:"maxBlockSize,omitempty"`
// ChunkSize is the chunk size in bytes for block transfer.
// Default: 1024 (1KB).
ChunkSize uint32 `protobuf:"varint,8,opt,name=chunk_size,json=chunkSize,proto3" json:"chunkSize,omitempty"`
// SyncBackoff configures retry backoff for failed peer streams.
SyncBackoff *backoff.Backoff `protobuf:"bytes,9,opt,name=sync_backoff,json=syncBackoff,proto3" json:"syncBackoff,omitempty"`
// contains filtered or unexported fields
}
Config configures the pub-sub DEX controller.
func (*Config) CloneMessageVT ¶
func (m *Config) CloneMessageVT() protobuf_go_lite.CloneMessage
func (*Config) EqualMessageVT ¶
func (*Config) EqualsConfig ¶
EqualsConfig checks if the config is equal to another.
func (*Config) GetBucketId ¶
func (*Config) GetChunkSize ¶
func (*Config) GetChunkSizeOrDefault ¶
GetChunkSizeOrDefault returns the chunk size or default.
func (*Config) GetConfigID ¶
GetConfigID returns the unique string for this configuration type.
func (*Config) GetMaxBlockSize ¶
func (*Config) GetMaxBlockSizeOrDefault ¶
GetMaxBlockSizeOrDefault returns the max block size or default.
func (*Config) GetMaxConcurrentStreams ¶
func (*Config) GetMaxConcurrentStreamsOrDefault ¶
GetMaxConcurrentStreamsOrDefault returns the max concurrent streams or default.
func (*Config) GetPublishDebounceMs ¶
func (*Config) GetPublishDebounceMsOrDefault ¶
GetPublishDebounceMsOrDefault returns the publish debounce ms or default.
func (*Config) GetPubsubChannelId ¶
func (*Config) GetSyncBackoff ¶
func (*Config) GetTransportId ¶
func (*Config) MarshalJSON ¶
MarshalJSON marshals the Config to JSON.
func (*Config) MarshalProtoJSON ¶
func (x *Config) MarshalProtoJSON(s *json.MarshalState)
MarshalProtoJSON marshals the Config message to JSON.
func (*Config) MarshalProtoText ¶
func (*Config) MarshalToSizedBufferVT ¶
func (*Config) ParsePeerID ¶
ParsePeerID parses the peer ID from config.
func (*Config) ProtoMessage ¶
func (*Config) ProtoMessage()
func (*Config) UnmarshalJSON ¶
UnmarshalJSON unmarshals the Config from JSON.
func (*Config) UnmarshalProtoJSON ¶
func (x *Config) UnmarshalProtoJSON(s *json.UnmarshalState)
UnmarshalProtoJSON unmarshals the Config message from JSON.
func (*Config) UnmarshalVT ¶
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
Controller is the pub-sub DEX controller.
func NewController ¶
NewController constructs a new pub-sub DEX controller.
func (*Controller) Close ¶
func (c *Controller) Close() error
Close releases any resources used by the controller.
func (*Controller) Execute ¶
func (c *Controller) Execute(ctx context.Context) error
Execute executes the controller goroutine.
func (*Controller) GetControllerInfo ¶
func (c *Controller) GetControllerInfo() *controller.Info
GetControllerInfo returns information about the controller.
func (*Controller) HandleDirective ¶
func (c *Controller) HandleDirective( ctx context.Context, di directive.Instance, ) ([]directive.Resolver, error)
HandleDirective asks if the handler can resolve the directive.
func (*Controller) HandleMountedStream ¶
func (c *Controller) HandleMountedStream( ctx context.Context, ms link.MountedStream, ) error
HandleMountedStream handles an incoming mounted stream.
type Factory ¶
type Factory struct {
// contains filtered or unexported fields
}
Factory constructs a pub-sub DEX controller.
func NewFactory ¶
NewFactory builds a pub-sub DEX controller factory.
func (*Factory) Construct ¶
func (t *Factory) Construct( ctx context.Context, conf config.Config, opts controller.ConstructOpts, ) (controller.Controller, error)
Construct constructs the associated controller given configuration.
func (*Factory) ConstructConfig ¶
ConstructConfig constructs an instance of the controller configuration.
func (*Factory) GetConfigID ¶
GetConfigID returns the unique ID for the config.
func (*Factory) GetControllerID ¶
GetControllerID returns the unique ID for the controller.
func (*Factory) GetVersion ¶
func (t *Factory) GetVersion() controller.Version
GetVersion returns the version of this controller.
type PubSubMessage ¶
type PubSubMessage struct {
// WantRefs is a full snapshot of blocks we currently want.
WantRefs []*block.BlockRef `protobuf:"bytes,1,rep,name=want_refs,json=wantRefs,proto3" json:"wantRefs,omitempty"`
// ClearRefs signals we no longer want these blocks.
ClearRefs []*block.BlockRef `protobuf:"bytes,2,rep,name=clear_refs,json=clearRefs,proto3" json:"clearRefs,omitempty"`
// WantEmpty indicates the wantlist is empty.
WantEmpty bool `protobuf:"varint,3,opt,name=want_empty,json=wantEmpty,proto3" json:"wantEmpty,omitempty"`
// TimestampUnixNano is the message timestamp (for ordering).
TimestampUnixNano int64 `protobuf:"varint,4,opt,name=timestamp_unix_nano,json=timestampUnixNano,proto3" json:"timestampUnixNano,omitempty"`
// contains filtered or unexported fields
}
PubSubMessage is gossipped on the pub-sub channel.
func (*PubSubMessage) CloneMessageVT ¶
func (m *PubSubMessage) CloneMessageVT() protobuf_go_lite.CloneMessage
func (*PubSubMessage) CloneVT ¶
func (m *PubSubMessage) CloneVT() *PubSubMessage
func (*PubSubMessage) EqualMessageVT ¶
func (this *PubSubMessage) EqualMessageVT(thatMsg any) bool
func (*PubSubMessage) EqualVT ¶
func (this *PubSubMessage) EqualVT(that *PubSubMessage) bool
func (*PubSubMessage) GetClearRefs ¶
func (x *PubSubMessage) GetClearRefs() []*block.BlockRef
func (*PubSubMessage) GetTimestampUnixNano ¶
func (x *PubSubMessage) GetTimestampUnixNano() int64
func (*PubSubMessage) GetWantEmpty ¶
func (x *PubSubMessage) GetWantEmpty() bool
func (*PubSubMessage) GetWantRefs ¶
func (x *PubSubMessage) GetWantRefs() []*block.BlockRef
func (*PubSubMessage) MarshalJSON ¶
func (x *PubSubMessage) MarshalJSON() ([]byte, error)
MarshalJSON marshals the PubSubMessage to JSON.
func (*PubSubMessage) MarshalProtoJSON ¶
func (x *PubSubMessage) MarshalProtoJSON(s *json.MarshalState)
MarshalProtoJSON marshals the PubSubMessage message to JSON.
func (*PubSubMessage) MarshalProtoText ¶
func (x *PubSubMessage) MarshalProtoText() string
func (*PubSubMessage) MarshalToSizedBufferVT ¶
func (m *PubSubMessage) MarshalToSizedBufferVT(dAtA []byte) (int, error)
func (*PubSubMessage) MarshalToVT ¶
func (m *PubSubMessage) MarshalToVT(dAtA []byte) (int, error)
func (*PubSubMessage) MarshalVT ¶
func (m *PubSubMessage) MarshalVT() (dAtA []byte, err error)
func (*PubSubMessage) ProtoMessage ¶
func (*PubSubMessage) ProtoMessage()
func (*PubSubMessage) Reset ¶
func (x *PubSubMessage) Reset()
func (*PubSubMessage) SizeVT ¶
func (m *PubSubMessage) SizeVT() (n int)
func (*PubSubMessage) String ¶
func (x *PubSubMessage) String() string
func (*PubSubMessage) UnmarshalJSON ¶
func (x *PubSubMessage) UnmarshalJSON(b []byte) error
UnmarshalJSON unmarshals the PubSubMessage from JSON.
func (*PubSubMessage) UnmarshalProtoJSON ¶
func (x *PubSubMessage) UnmarshalProtoJSON(s *json.UnmarshalState)
UnmarshalProtoJSON unmarshals the PubSubMessage message from JSON.
func (*PubSubMessage) UnmarshalVT ¶
func (m *PubSubMessage) UnmarshalVT(dAtA []byte) error
type SyncMessage ¶
type SyncMessage struct {
// Transfer is the block transfer payload.
Transfer *session.BlockTransfer `protobuf:"bytes,1,opt,name=transfer,proto3" json:"transfer,omitempty"`
// contains filtered or unexported fields
}
SyncMessage wraps a BlockTransfer for psecho sync streams.
func (*SyncMessage) CloneMessageVT ¶
func (m *SyncMessage) CloneMessageVT() protobuf_go_lite.CloneMessage
func (*SyncMessage) CloneVT ¶
func (m *SyncMessage) CloneVT() *SyncMessage
func (*SyncMessage) EqualMessageVT ¶
func (this *SyncMessage) EqualMessageVT(thatMsg any) bool
func (*SyncMessage) EqualVT ¶
func (this *SyncMessage) EqualVT(that *SyncMessage) bool
func (*SyncMessage) GetTransfer ¶
func (x *SyncMessage) GetTransfer() *session.BlockTransfer
func (*SyncMessage) MarshalJSON ¶
func (x *SyncMessage) MarshalJSON() ([]byte, error)
MarshalJSON marshals the SyncMessage to JSON.
func (*SyncMessage) MarshalProtoJSON ¶
func (x *SyncMessage) MarshalProtoJSON(s *json.MarshalState)
MarshalProtoJSON marshals the SyncMessage message to JSON.
func (*SyncMessage) MarshalProtoText ¶
func (x *SyncMessage) MarshalProtoText() string
func (*SyncMessage) MarshalToSizedBufferVT ¶
func (m *SyncMessage) MarshalToSizedBufferVT(dAtA []byte) (int, error)
func (*SyncMessage) MarshalToVT ¶
func (m *SyncMessage) MarshalToVT(dAtA []byte) (int, error)
func (*SyncMessage) MarshalVT ¶
func (m *SyncMessage) MarshalVT() (dAtA []byte, err error)
func (*SyncMessage) ProtoMessage ¶
func (*SyncMessage) ProtoMessage()
func (*SyncMessage) Reset ¶
func (x *SyncMessage) Reset()
func (*SyncMessage) SizeVT ¶
func (m *SyncMessage) SizeVT() (n int)
func (*SyncMessage) String ¶
func (x *SyncMessage) String() string
func (*SyncMessage) UnmarshalJSON ¶
func (x *SyncMessage) UnmarshalJSON(b []byte) error
UnmarshalJSON unmarshals the SyncMessage from JSON.
func (*SyncMessage) UnmarshalProtoJSON ¶
func (x *SyncMessage) UnmarshalProtoJSON(s *json.UnmarshalState)
UnmarshalProtoJSON unmarshals the SyncMessage message from JSON.
func (*SyncMessage) UnmarshalVT ¶
func (m *SyncMessage) UnmarshalVT(dAtA []byte) error