dex_solicit

package
v0.55.0 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 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/solicit"

ControllerID is the ID of the controller.

View Source
const DexProtocolID = protocol.ID("hydra/dex")

DexProtocolID is the protocol ID used for solicitation.

Variables

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

Version is the version of the controller implementation.

Functions

This section is empty.

Types

type Config

type Config struct {

	// BucketId is the bucket ID to use to serve and store blocks.
	BucketId string `protobuf:"bytes,1,opt,name=bucket_id,json=bucketId,proto3" json:"bucketId,omitempty"`
	// PeerId is the peer ID to use for DEX.
	// If empty, attaches to any available peer.
	PeerId string `protobuf:"bytes,2,opt,name=peer_id,json=peerId,proto3" json:"peerId,omitempty"`
	// TransportId sets a transport ID constraint.
	// Can be empty.
	TransportId uint64 `protobuf:"varint,3,opt,name=transport_id,json=transportId,proto3" json:"transportId,omitempty"`
	// MaxForwardHops is the maximum number of times a request can be
	// forwarded between peers. Zero disables forwarding (default).
	MaxForwardHops uint32 `protobuf:"varint,4,opt,name=max_forward_hops,json=maxForwardHops,proto3" json:"maxForwardHops,omitempty"`
	// contains filtered or unexported fields
}

Config configures the solicitation-based 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) GetConfigID

func (c *Config) GetConfigID() string

GetConfigID returns the unique string for this configuration type.

func (*Config) GetMaxForwardHops

func (x *Config) GetMaxForwardHops() uint32

func (*Config) GetPeerId

func (x *Config) GetPeerId() string

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 solicitation-based DEX controller.

func NewController

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

NewController constructs a new solicitation-based 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.

type DexMessage

type DexMessage struct {

	// RequestId is a unique ID for this request/response pair.
	// The requester picks a unique ID. The responder echoes it back.
	RequestId uint32 `protobuf:"varint,1,opt,name=request_id,json=requestId,proto3" json:"requestId,omitempty"`
	// IsResponse indicates this is a response to a prior request.
	IsResponse bool `protobuf:"varint,2,opt,name=is_response,json=isResponse,proto3" json:"isResponse,omitempty"`
	// Ref is the block reference to look up (request only).
	Ref *block.BlockRef `protobuf:"bytes,3,opt,name=ref,proto3" json:"ref,omitempty"`
	// Found indicates whether the block was found (response only).
	Found bool `protobuf:"varint,4,opt,name=found,proto3" json:"found,omitempty"`
	// Data is the block data (response only).
	Data []byte `protobuf:"bytes,5,opt,name=data,proto3" json:"data,omitempty"`
	// Error is an error message (response only).
	Error string `protobuf:"bytes,6,opt,name=error,proto3" json:"error,omitempty"`
	// RemainingHops limits forwarding to prevent loops.
	// When a node does not have the block locally and remaining_hops > 0,
	// it forwards the request to other connected peers with remaining_hops - 1.
	// Zero means no forwarding allowed (local lookup only).
	RemainingHops uint32 `protobuf:"varint,7,opt,name=remaining_hops,json=remainingHops,proto3" json:"remainingHops,omitempty"`
	// contains filtered or unexported fields
}

DexMessage is a message sent over a DEX stream. Each message is either a request or a response, distinguished by the request_id field. A request has a non-empty ref and a zero-value response. A response has a non-zero request_id and the response fields set.

func (*DexMessage) CloneMessageVT

func (m *DexMessage) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*DexMessage) CloneVT

func (m *DexMessage) CloneVT() *DexMessage

func (*DexMessage) EqualMessageVT

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

func (*DexMessage) EqualVT

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

func (*DexMessage) GetData

func (x *DexMessage) GetData() []byte

func (*DexMessage) GetError

func (x *DexMessage) GetError() string

func (*DexMessage) GetFound

func (x *DexMessage) GetFound() bool

func (*DexMessage) GetIsResponse

func (x *DexMessage) GetIsResponse() bool

func (*DexMessage) GetRef

func (x *DexMessage) GetRef() *block.BlockRef

func (*DexMessage) GetRemainingHops

func (x *DexMessage) GetRemainingHops() uint32

func (*DexMessage) GetRequestId

func (x *DexMessage) GetRequestId() uint32

func (*DexMessage) MarshalJSON

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

MarshalJSON marshals the DexMessage to JSON.

func (*DexMessage) MarshalProtoJSON

func (x *DexMessage) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the DexMessage message to JSON.

func (*DexMessage) MarshalProtoText

func (x *DexMessage) MarshalProtoText() string

func (*DexMessage) MarshalToSizedBufferVT

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

func (*DexMessage) MarshalToVT

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

func (*DexMessage) MarshalVT

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

func (*DexMessage) ProtoMessage

func (*DexMessage) ProtoMessage()

func (*DexMessage) Reset

func (x *DexMessage) Reset()

func (*DexMessage) SizeVT

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

func (*DexMessage) String

func (x *DexMessage) String() string

func (*DexMessage) UnmarshalJSON

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

UnmarshalJSON unmarshals the DexMessage from JSON.

func (*DexMessage) UnmarshalProtoJSON

func (x *DexMessage) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the DexMessage message from JSON.

func (*DexMessage) UnmarshalVT

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

type Factory

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

Factory constructs a solicitation-based DEX controller.

func NewFactory

func NewFactory(bus bus.Bus) *Factory

NewFactory builds a solicitation-based 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.

Jump to

Keyboard shortcuts

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