jetcoordinator

package
v0.8.7 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package jetcoordinator is responsible for all jet manipulations.

Package responsible for jet drops, split/merge jets, choose of validators.

Index

Constants

View Source
const (
	VirtualValidatorCount  = 3
	MaterialValidatorCount = 3

	VirtualExecutorCount  = 1
	MaterialExecutorCount = 1
)

Hardcoded roles count for validation and execution

Variables

This section is empty.

Functions

This section is empty.

Types

type JetCoordinator

type JetCoordinator struct {
	NodeNet                    core.NodeNetwork                `inject:""`
	PlatformCryptographyScheme core.PlatformCryptographyScheme `inject:""`
	PulseStorage               core.PulseStorage               `inject:""`
	JetStorage                 storage.JetStorage              `inject:""`
	PulseTracker               storage.PulseTracker            `inject:""`
	Nodes                      nodes.Accessor                  `inject:""`
	// contains filtered or unexported fields
}

JetCoordinator is responsible for all jet interactions

func NewJetCoordinator added in v0.0.5

func NewJetCoordinator(lightChainLimit int) *JetCoordinator

NewJetCoordinator creates new coordinator instance.

func (*JetCoordinator) Heavy added in v0.7.5

func (jc *JetCoordinator) Heavy(ctx context.Context, pulse core.PulseNumber) (*core.RecordRef, error)

Heavy returns *core.RecorRef to a heavy of specific pulse

func (*JetCoordinator) IsAuthorized added in v0.2.0

func (jc *JetCoordinator) IsAuthorized(
	ctx context.Context,
	role core.DynamicRole,
	obj core.RecordID,
	pulse core.PulseNumber,
	node core.RecordRef,
) (bool, error)

IsAuthorized checks for role on concrete pulse for the address.

func (*JetCoordinator) IsBeyondLimit added in v0.8.0

func (jc *JetCoordinator) IsBeyondLimit(ctx context.Context, currentPN, targetPN core.PulseNumber) (bool, error)

IsBeyondLimit calculates if target pulse is behind clean-up limit or if currentPN|targetPN didn't found in in-memory pulse-storage.

func (*JetCoordinator) LightExecutorForJet added in v0.7.5

func (jc *JetCoordinator) LightExecutorForJet(
	ctx context.Context, jetID core.RecordID, pulse core.PulseNumber,
) (*core.RecordRef, error)

LightExecutorForJet returns list of LEs for a provided pulse and jetID

func (*JetCoordinator) LightExecutorForObject added in v0.7.5

func (jc *JetCoordinator) LightExecutorForObject(
	ctx context.Context, objID core.RecordID, pulse core.PulseNumber,
) (*core.RecordRef, error)

LightExecutorForObject returns list of LEs for a provided pulse and objID

func (*JetCoordinator) LightValidatorsForJet added in v0.7.5

func (jc *JetCoordinator) LightValidatorsForJet(
	ctx context.Context, jetID core.RecordID, pulse core.PulseNumber,
) ([]core.RecordRef, error)

LightValidatorsForJet returns list of LVs for a provided pulse and jetID

func (*JetCoordinator) LightValidatorsForObject added in v0.7.5

func (jc *JetCoordinator) LightValidatorsForObject(
	ctx context.Context, objID core.RecordID, pulse core.PulseNumber,
) ([]core.RecordRef, error)

LightValidatorsForObject returns list of LVs for a provided pulse and objID

func (*JetCoordinator) Me added in v0.7.5

func (jc *JetCoordinator) Me() core.RecordRef

Me returns current node.

func (*JetCoordinator) NodeForJet added in v0.8.0

func (jc *JetCoordinator) NodeForJet(ctx context.Context, jetID core.RecordID, rootPN, targetPN core.PulseNumber) (*core.RecordRef, error)

NodeForJet calculates a node (LME or heavy) for a specific jet for a specific pulseNumber

func (*JetCoordinator) NodeForObject added in v0.8.0

func (jc *JetCoordinator) NodeForObject(ctx context.Context, objectID core.RecordID, rootPN, targetPN core.PulseNumber) (*core.RecordRef, error)

NodeForObject calculates a node (LME or heavy) for a specific jet for a specific pulseNumber

func (*JetCoordinator) QueryRole added in v0.2.0

func (jc *JetCoordinator) QueryRole(
	ctx context.Context,
	role core.DynamicRole,
	objID core.RecordID,
	pulse core.PulseNumber,
) ([]core.RecordRef, error)

QueryRole returns node refs responsible for role bound operations for given object and pulse.

func (*JetCoordinator) VirtualExecutorForObject added in v0.7.5

func (jc *JetCoordinator) VirtualExecutorForObject(
	ctx context.Context, objID core.RecordID, pulse core.PulseNumber,
) (*core.RecordRef, error)

VirtualExecutorForObject returns list of VEs for a provided pulse and objID

func (*JetCoordinator) VirtualValidatorsForObject added in v0.7.5

func (jc *JetCoordinator) VirtualValidatorsForObject(
	ctx context.Context, objID core.RecordID, pulse core.PulseNumber,
) ([]core.RecordRef, error)

VirtualValidatorsForObject returns list of VVs for a provided pulse and objID

Jump to

Keyboard shortcuts

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