policy

package
v0.0.21 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

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

Service fetches signing policies from the blockchain and distributes them via action queues.

func NewService

func NewService(aq *queue.ActionQueues, responses *result.ResultStorage, addresses config.Addresses, chainID uint64, nodeState nodePolicyState, m *metrics.Metrics) *Service

NewService creates a new policy Service with the given action queues, result storage, contract addresses, chain ID, a view of the node's applied policy state, and metrics. m may be nil or disabled.

func (*Service) Initialize

func (s *Service) Initialize(ctx context.Context, db *gorm.DB, offset int, teeInitialInfo *types.TeeInfoResponse) error

Initialize prepares the service for operation by loading the active signing policy from the database. On a fresh start it submits an INITIALIZE_POLICY action; on restart it loads existing policies from the node.

func (*Service) Run

func (s *Service) Run(ctx context.Context, db *gorm.DB, policyFetchInterval time.Duration) (<-chan cpolicy.SigningPolicy, error)

Run starts the signing policy update loop and returns a channel that emits new signing policies.

Jump to

Keyboard shortcuts

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