Documentation
¶
Overview ¶
Package anytx is the reference module: tm_anytx admits every output of every object, and ls_anytx answers by outpoint from the engine's storage.
It is the Go twin of the TypeScript host's default manager and the parity oracle's read side. It is deliberately trivial: the only reason two hosts fed the same objects may answer differently is then the thing under test, never an admission rule. It is not a template for a real overlay.
It manages every carried topic by default (the TypeScript host's default posture). module.Mount refuses two modules on one topic, so a host that mounts an application module beside it names anytx's own topics with OVERLAY_ANYTX_TOPICS.
Index ¶
- Constants
- func New(h module.Host) (module.Module, error)
- type Lookup
- func (*Lookup) GetDocumentation() string
- func (*Lookup) GetMetaData() *overlay.MetaData
- func (l *Lookup) Lookup(ctx context.Context, q *lookup.LookupQuestion) (*lookup.LookupAnswer, error)
- func (*Lookup) OutputAdmittedByTopic(context.Context, *engine.OutputAdmittedByTopic) error
- func (*Lookup) OutputBlockHeightUpdated(context.Context, *chainhash.Hash, uint32, uint64) error
- func (*Lookup) OutputEvicted(context.Context, *transaction.Outpoint) error
- func (*Lookup) OutputNoLongerRetainedInHistory(context.Context, *transaction.Outpoint, string) error
- func (*Lookup) OutputSpent(context.Context, *engine.OutputSpent) error
- type Manager
- func (m Manager) GetDocumentation() string
- func (m Manager) GetMetaData() *overlay.MetaData
- func (m Manager) IdentifyAdmissibleOutputs(_ context.Context, beef *transaction.Beef, txid *chainhash.Hash, _ []uint32) (overlay.AdmittanceInstructions, error)
- func (Manager) IdentifyNeededInputs(context.Context, *transaction.Beef, *chainhash.Hash) ([]*transaction.Outpoint, error)
Constants ¶
const LookupName = "ls_anytx"
LookupName is the lookup service this module mounts.
const MaxAll = 1000
MaxAll caps a `{all:true}` answer, as the engine's own lookup cap does on the TypeScript host.
const Name = "anytx"
Name is the module name in OVERLAY_MODULES.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Lookup ¶
Lookup answers from the engine's storage at question time. It keeps no index, so there is nothing to rebuild on start and no second copy of the set for two hosts to disagree about.
func (*Lookup) GetDocumentation ¶
GetDocumentation implements engine.LookupService.
func (*Lookup) GetMetaData ¶
GetMetaData implements engine.LookupService.
func (*Lookup) Lookup ¶
func (l *Lookup) Lookup(ctx context.Context, q *lookup.LookupQuestion) (*lookup.LookupAnswer, error)
Lookup implements engine.LookupService.
{"outpoint": "<txid>.<index>"} that outpoint, while unspent on a carried topic
{"all": true, "limit": n} unspent outpoints on carried topics, sorted, at most n (<= 1000)
func (*Lookup) OutputAdmittedByTopic ¶
OutputAdmittedByTopic implements engine.LookupService; nothing is indexed.
func (*Lookup) OutputBlockHeightUpdated ¶
OutputBlockHeightUpdated implements engine.LookupService.
func (*Lookup) OutputEvicted ¶
OutputEvicted implements engine.LookupService.
func (*Lookup) OutputNoLongerRetainedInHistory ¶
func (*Lookup) OutputNoLongerRetainedInHistory(context.Context, *transaction.Outpoint, string) error
OutputNoLongerRetainedInHistory implements engine.LookupService.
func (*Lookup) OutputSpent ¶
OutputSpent implements engine.LookupService.
type Manager ¶
type Manager struct{ Topic string }
Manager admits every output of the submitted transaction.
func (Manager) GetDocumentation ¶
GetDocumentation implements engine.TopicManager.
func (Manager) GetMetaData ¶
GetMetaData implements engine.TopicManager.
func (Manager) IdentifyAdmissibleOutputs ¶
func (m Manager) IdentifyAdmissibleOutputs(_ context.Context, beef *transaction.Beef, txid *chainhash.Hash, _ []uint32) (overlay.AdmittanceInstructions, error)
IdentifyAdmissibleOutputs implements engine.TopicManager. A transaction it cannot find is an empty admission, never an error: the object came from an open plane, and whatever it is, it is the sender's problem.
func (Manager) IdentifyNeededInputs ¶
func (Manager) IdentifyNeededInputs(context.Context, *transaction.Beef, *chainhash.Hash) ([]*transaction.Outpoint, error)
IdentifyNeededInputs implements engine.TopicManager: admission depends on no previous output.