publisher

package
v0.5.0-alpha.8 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2023 License: Apache-2.0 Imports: 13 Imported by: 1

Documentation

Index

Constants

View Source
const (
	ISCEventKindNewBlock      = "new_block"
	ISCEventKindReceipt       = "receipt" // issuer will be the request sender
	ISCEventKindSmartContract = "contract"
)
View Source
const ISCEventIssuerVM = "vm"

Variables

This section is empty.

Functions

func PublishBlockEvents added in v1.0.3

func PublishBlockEvents(blockApplied *publisherBlockApplied, publish func(*ISCEvent), log *logger.Logger)

PublishBlockEvents extracts the events from a block, its returns a chan of ISCEvents so they can be filtered

Types

type Events added in v1.0.3

type Events struct {
	Published *event.Event[*PublishedEvent]
}

type ISCEvent added in v1.0.3

type ISCEvent struct {
	Kind      string
	Issuer    isc.AgentID // nil means issued by the VM
	RequestID isc.RequestID
	ChainID   isc.ChainID
	Content   string
}

func (*ISCEvent) String added in v1.0.3

func (e *ISCEvent) String() string

kind is not printed right now, because it is added when calling p.publish

type PublishedEvent

type PublishedEvent struct {
	MsgType string
	ChainID isc.ChainID
	Parts   []string
}

PublishedEvent contains the information about the published message.

type Publisher added in v1.0.3

type Publisher struct {
	Events *Events
	// contains filtered or unexported fields
}

func New added in v1.0.3

func New(log *logger.Logger) *Publisher

func (*Publisher) AccessNodesUpdated added in v1.0.3

func (p *Publisher) AccessNodesUpdated(chainID isc.ChainID, accessNodes []*cryptolib.PublicKey)

Implements the chain.ChainListener interface. NOTE: Do not block the caller!

func (*Publisher) BlockApplied added in v1.0.3

func (p *Publisher) BlockApplied(chainID isc.ChainID, block state.Block)

Implements the chain.ChainListener interface. NOTE: Do not block the caller!

func (*Publisher) Run added in v1.0.3

func (p *Publisher) Run(ctx context.Context)

This is called by the component to run this.

func (*Publisher) ServerNodesUpdated added in v1.0.3

func (p *Publisher) ServerNodesUpdated(chainID isc.ChainID, serverNodes []*cryptolib.PublicKey)

Implements the chain.ChainListener interface. NOTE: Do not block the caller!

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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