publisher

package
v0.4.0-alpha.4 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2023 License: Apache-2.0, BSD-2-Clause 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

View Source
var Event = events.NewEvent(func(handler interface{}, params ...interface{}) {
	callback := handler.(func(msgType string, parts []string))
	msgType := params[0].(string)
	parts := params[1].([]string)
	callback(msgType, parts)
})

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 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 Publisher added in v1.0.3

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

func NewPublisher

func NewPublisher(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