Help us shape the future of Go! Take the 2026 Go Developer Survey

psecho

package
v0.57.21 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2026 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const ConfigID = ControllerID

ConfigID is the identifier for the config type.

View Source
const ControllerID = "hydra/dex/psecho"

ControllerID is the ID of the controller.

Variables

View Source
var Version = controller.MustParseVersion("0.0.1")

Version is the version of the controller implementation.

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) CloneVT

func (m *Config) CloneVT() *Config

func (*Config) EqualMessageVT

func (this *Config) EqualMessageVT(thatMsg any) bool

func (*Config) EqualVT

func (this *Config) EqualVT(that *Config) bool

func (*Config) EqualsConfig

func (c *Config) EqualsConfig(other config.Config) bool

EqualsConfig checks if the config is equal to another.

func (*Config) GetBucketId

func (x *Config) GetBucketId() string

func (*Config) GetChunkSize

func (x *Config) GetChunkSize() uint32

func (*Config) GetChunkSizeOrDefault

func (c *Config) GetChunkSizeOrDefault() uint32

GetChunkSizeOrDefault returns the chunk size or default.

func (*Config) GetConfigID

func (c *Config) GetConfigID() string

GetConfigID returns the unique string for this configuration type.

func (*Config) GetMaxBlockSize

func (x *Config) GetMaxBlockSize() uint64

func (*Config) GetMaxBlockSizeOrDefault

func (c *Config) GetMaxBlockSizeOrDefault() uint64

GetMaxBlockSizeOrDefault returns the max block size or default.

func (*Config) GetMaxConcurrentStreams

func (x *Config) GetMaxConcurrentStreams() uint32

func (*Config) GetMaxConcurrentStreamsOrDefault

func (c *Config) GetMaxConcurrentStreamsOrDefault() uint32

GetMaxConcurrentStreamsOrDefault returns the max concurrent streams or default.

func (*Config) GetPeerId

func (x *Config) GetPeerId() string

func (*Config) GetPublishDebounceMs

func (x *Config) GetPublishDebounceMs() uint32

func (*Config) GetPublishDebounceMsOrDefault

func (c *Config) GetPublishDebounceMsOrDefault() uint32

GetPublishDebounceMsOrDefault returns the publish debounce ms or default.

func (*Config) GetPubsubChannelId

func (x *Config) GetPubsubChannelId() string

func (*Config) GetSyncBackoff

func (x *Config) GetSyncBackoff() *backoff.Backoff

func (*Config) GetTransportId

func (x *Config) GetTransportId() uint64

func (*Config) MarshalJSON

func (x *Config) MarshalJSON() ([]byte, error)

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 (x *Config) MarshalProtoText() string

func (*Config) MarshalToSizedBufferVT

func (m *Config) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*Config) MarshalToVT

func (m *Config) MarshalToVT(dAtA []byte) (int, error)

func (*Config) MarshalVT

func (m *Config) MarshalVT() (dAtA []byte, err error)

func (*Config) ParsePeerID

func (c *Config) ParsePeerID() (peer.ID, error)

ParsePeerID parses the peer ID from config.

func (*Config) ProtoMessage

func (*Config) ProtoMessage()

func (*Config) Reset

func (x *Config) Reset()

func (*Config) SizeVT

func (m *Config) SizeVT() (n int)

func (*Config) String

func (x *Config) String() string

func (*Config) UnmarshalJSON

func (x *Config) UnmarshalJSON(b []byte) error

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

func (m *Config) UnmarshalVT(dAtA []byte) error

func (*Config) Validate

func (c *Config) Validate() error

Validate validates the configuration.

type Controller

type Controller struct {
	// contains filtered or unexported fields
}

Controller is the pub-sub DEX controller.

func NewController

func NewController(le *logrus.Entry, b bus.Bus, cc *Config) (*Controller, error)

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

func NewFactory(bus bus.Bus) *Factory

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

func (t *Factory) ConstructConfig() config.Config

ConstructConfig constructs an instance of the controller configuration.

func (*Factory) GetConfigID

func (t *Factory) GetConfigID() string

GetConfigID returns the unique ID for the config.

func (*Factory) GetControllerID

func (t *Factory) GetControllerID() string

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

Jump to

Keyboard shortcuts

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