Documentation ¶
Overview ¶
Package jetcoordinator is responsible for all jet manipulations.
Package responsible for jet drops, split/merge jets, choose of validators.
Index ¶
- Constants
- type Coordinator
- func (jc *Coordinator) Heavy(ctx context.Context) (*insolar.Reference, error)
- func (jc *Coordinator) IsAuthorized(ctx context.Context, role insolar.DynamicRole, obj insolar.ID, ...) (bool, error)
- func (jc *Coordinator) IsBeyondLimit(ctx context.Context, targetPN insolar.PulseNumber) (bool, error)
- func (jc *Coordinator) IsMeAuthorizedNow(ctx context.Context, role insolar.DynamicRole, obj insolar.ID) (bool, error)
- func (jc *Coordinator) LightExecutorForJet(ctx context.Context, jetID insolar.ID, pulse insolar.PulseNumber) (*insolar.Reference, error)
- func (jc *Coordinator) LightExecutorForObject(ctx context.Context, objID insolar.ID, pulse insolar.PulseNumber) (*insolar.Reference, error)
- func (jc *Coordinator) LightValidatorsForJet(ctx context.Context, jetID insolar.ID, pulse insolar.PulseNumber) ([]insolar.Reference, error)
- func (jc *Coordinator) LightValidatorsForObject(ctx context.Context, objID insolar.ID, pulse insolar.PulseNumber) ([]insolar.Reference, error)
- func (jc *Coordinator) Me() insolar.Reference
- func (jc *Coordinator) NodeForJet(ctx context.Context, jetID insolar.ID, targetPN insolar.PulseNumber) (*insolar.Reference, error)
- func (jc *Coordinator) NodeForObject(ctx context.Context, objectID insolar.ID, targetPN insolar.PulseNumber) (*insolar.Reference, error)
- func (jc *Coordinator) QueryRole(ctx context.Context, role insolar.DynamicRole, objID insolar.ID, ...) ([]insolar.Reference, error)
- func (jc *Coordinator) VirtualExecutorForObject(ctx context.Context, objID insolar.ID, pulse insolar.PulseNumber) (*insolar.Reference, error)
- func (jc *Coordinator) VirtualValidatorsForObject(ctx context.Context, objID insolar.ID, pulse insolar.PulseNumber) ([]insolar.Reference, error)
Constants ¶
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 Coordinator ¶
type Coordinator struct { OriginProvider network.OriginProvider `inject:""` PlatformCryptographyScheme insolar.PlatformCryptographyScheme `inject:""` PulseAccessor pulse.Accessor `inject:""` PulseCalculator pulse.Calculator `inject:""` JetAccessor jet.Accessor `inject:""` Nodes node.Accessor `inject:""` // contains filtered or unexported fields }
Coordinator is responsible for all jet interactions
func NewJetCoordinator ¶
func NewJetCoordinator(lightChainLimit int) *Coordinator
NewJetCoordinator creates new coordinator instance.
func (*Coordinator) IsAuthorized ¶
func (jc *Coordinator) IsAuthorized( ctx context.Context, role insolar.DynamicRole, obj insolar.ID, pulse insolar.PulseNumber, node insolar.Reference, ) (bool, error)
IsAuthorized checks for role on concrete pulse for the address.
func (*Coordinator) IsBeyondLimit ¶
func (jc *Coordinator) IsBeyondLimit(ctx context.Context, targetPN insolar.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 (*Coordinator) IsMeAuthorizedNow ¶
func (jc *Coordinator) IsMeAuthorizedNow( ctx context.Context, role insolar.DynamicRole, obj insolar.ID, ) (bool, error)
IsMeAuthorizedNow checks role of the current node in the current pulse for the address. Wrapper around IsAuthorized.
func (*Coordinator) LightExecutorForJet ¶
func (jc *Coordinator) LightExecutorForJet( ctx context.Context, jetID insolar.ID, pulse insolar.PulseNumber, ) (*insolar.Reference, error)
LightExecutorForJet returns list of LEs for a provided pulse and jetID
func (*Coordinator) LightExecutorForObject ¶
func (jc *Coordinator) LightExecutorForObject( ctx context.Context, objID insolar.ID, pulse insolar.PulseNumber, ) (*insolar.Reference, error)
LightExecutorForObject returns list of LEs for a provided pulse and objID
func (*Coordinator) LightValidatorsForJet ¶
func (jc *Coordinator) LightValidatorsForJet( ctx context.Context, jetID insolar.ID, pulse insolar.PulseNumber, ) ([]insolar.Reference, error)
LightValidatorsForJet returns list of LVs for a provided pulse and jetID
func (*Coordinator) LightValidatorsForObject ¶
func (jc *Coordinator) LightValidatorsForObject( ctx context.Context, objID insolar.ID, pulse insolar.PulseNumber, ) ([]insolar.Reference, error)
LightValidatorsForObject returns list of LVs for a provided pulse and objID
func (*Coordinator) NodeForJet ¶
func (jc *Coordinator) NodeForJet(ctx context.Context, jetID insolar.ID, targetPN insolar.PulseNumber) (*insolar.Reference, error)
NodeForJet calculates a node (LME or heavy) for a specific jet for a specific pulseNumber
func (*Coordinator) NodeForObject ¶
func (jc *Coordinator) NodeForObject(ctx context.Context, objectID insolar.ID, targetPN insolar.PulseNumber) (*insolar.Reference, error)
NodeForObject calculates a node (LME or heavy) for a specific jet for a specific pulseNumber
func (*Coordinator) QueryRole ¶
func (jc *Coordinator) QueryRole( ctx context.Context, role insolar.DynamicRole, objID insolar.ID, pulse insolar.PulseNumber, ) ([]insolar.Reference, error)
QueryRole returns node refs responsible for role bound operations for given object and pulse.
func (*Coordinator) VirtualExecutorForObject ¶
func (jc *Coordinator) VirtualExecutorForObject( ctx context.Context, objID insolar.ID, pulse insolar.PulseNumber, ) (*insolar.Reference, error)
VirtualExecutorForObject returns list of VEs for a provided pulse and objID
func (*Coordinator) VirtualValidatorsForObject ¶
func (jc *Coordinator) VirtualValidatorsForObject( ctx context.Context, objID insolar.ID, pulse insolar.PulseNumber, ) ([]insolar.Reference, error)
VirtualValidatorsForObject returns list of VVs for a provided pulse and objID