services

package
v0.6.1-alpha.9 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2023 License: Apache-2.0 Imports: 47 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewChainService

func NewChainService(logger *logger.Logger, chainsProvider chains.Provider, chainMetricsProvider *metrics.ChainMetricsProvider, chainRecordRegistryProvider registry.ChainRecordRegistryProvider, vmService interfaces.VMService) interfaces.ChainService

func NewCommitteeService

func NewCommitteeService(chainsProvider chains.Provider, networkProvider peering.NetworkProvider, dkShareRegistryProvider registry.DKShareRegistryProvider) interfaces.CommitteeService

func NewEVMService

func NewEVMService(
	chainService interfaces.ChainService,
	networkProvider peering.NetworkProvider,
	pub *publisher.Publisher,
	log *logger.Logger,
) interfaces.EVMService

func NewMetricsService

func NewMetricsService(chainProvider chains.Provider, chainMetricsProvider *metrics.ChainMetricsProvider) interfaces.MetricsService

func NewNodeService

func NewNodeService(chainRecordRegistryProvider registry.ChainRecordRegistryProvider, nodeOwnerAddresses []string, nodeIdentityProvider registry.NodeIdentityProvider, shutdownHandler *shutdown.ShutdownHandler, trustedNetworkManager peering.TrustedNetworkManager) interfaces.NodeService

func NewOffLedgerService

func NewOffLedgerService(chainService interfaces.ChainService, networkProvider peering.NetworkProvider, requestCacheTTL time.Duration) interfaces.OffLedgerService

func NewRegistryService

func NewRegistryService(chainsProvider chains.Provider, chainRecordRegistryProvider registry.ChainRecordRegistryProvider) interfaces.RegistryService

func NewUserService

func NewUserService(userManager *users.UserManager) interfaces.UserService

func NewVMService

func NewVMService(chainsProvider chains.Provider, chainRecordRegistryProvider registry.ChainRecordRegistryProvider) interfaces.VMService

func ShouldBeProcessed

func ShouldBeProcessed(ch chain.ChainCore, req isc.OffLedgerRequest) error

implemented this way so we can re-use the same state, and avoid the overhead of calling views

Types

type ChainService

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

func (*ChainService) ActivateChain

func (c *ChainService) ActivateChain(chainID isc.ChainID) error

func (*ChainService) DeactivateChain

func (c *ChainService) DeactivateChain(chainID isc.ChainID) error

func (*ChainService) GetAllChainIDs

func (c *ChainService) GetAllChainIDs() ([]isc.ChainID, error)

func (*ChainService) GetChainByID

func (c *ChainService) GetChainByID(chainID isc.ChainID) chainpkg.Chain

func (*ChainService) GetChainInfoByChainID

func (c *ChainService) GetChainInfoByChainID(chainID isc.ChainID) (*dto.ChainInfo, error)

func (*ChainService) GetContracts

func (c *ChainService) GetContracts(chainID isc.ChainID) (dto.ContractsMap, error)

func (*ChainService) GetEVMChainID

func (c *ChainService) GetEVMChainID(chainID isc.ChainID) (uint16, error)

func (*ChainService) GetState

func (c *ChainService) GetState(chainID isc.ChainID, stateKey []byte) (state []byte, err error)

func (*ChainService) HasChain

func (c *ChainService) HasChain(chainID isc.ChainID) bool

func (*ChainService) SetChainRecord

func (c *ChainService) SetChainRecord(chainRecord *registry.ChainRecord) error

func (*ChainService) WaitForRequestProcessed

func (c *ChainService) WaitForRequestProcessed(ctx context.Context, chainID isc.ChainID, requestID isc.RequestID, waitForL1Confirmation bool, timeout time.Duration) (*isc.Receipt, *isc.VMError, error)

type CommitteeService

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

func (*CommitteeService) GetCommitteeInfo

func (c *CommitteeService) GetCommitteeInfo(chainID isc.ChainID) (*dto.ChainNodeInfo, error)

func (*CommitteeService) GetPublicKey

func (c *CommitteeService) GetPublicKey() *cryptolib.PublicKey

type DKGService

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

func NewDKGService

func NewDKGService(dkShareRegistryProvider registry.DKShareRegistryProvider, dkgNodeProvider dkg.NodeProvider, trustedNetworkManager peering.TrustedNetworkManager) *DKGService

func (*DKGService) GenerateDistributedKey

func (d *DKGService) GenerateDistributedKey(peerPubKeysOrNames []string, threshold uint16, timeout time.Duration) (*models.DKSharesInfo, error)

func (*DKGService) GetShares

func (d *DKGService) GetShares(sharedAddress iotago.Address) (*models.DKSharesInfo, error)

type EVMService

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

func (*EVMService) GetRequestID

func (e *EVMService) GetRequestID(chainID isc.ChainID, hash string) (isc.RequestID, error)

func (*EVMService) HandleJSONRPC

func (e *EVMService) HandleJSONRPC(chainID isc.ChainID, request *http.Request, response *echo.Response) error

func (*EVMService) HandleWebsocket

func (e *EVMService) HandleWebsocket(chainID isc.ChainID, request *http.Request, response *echo.Response) error

type MetricsService

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

func (*MetricsService) GetChainConsensusPipeMetrics

func (c *MetricsService) GetChainConsensusPipeMetrics(chainID isc.ChainID) *models.ConsensusPipeMetrics

func (*MetricsService) GetChainConsensusWorkflowMetrics

func (c *MetricsService) GetChainConsensusWorkflowMetrics(chainID isc.ChainID) *models.ConsensusWorkflowMetrics

func (*MetricsService) GetChainMessageMetrics

func (c *MetricsService) GetChainMessageMetrics(chainID isc.ChainID) *dto.ChainMessageMetrics

func (*MetricsService) GetNodeMessageMetrics

func (c *MetricsService) GetNodeMessageMetrics() *dto.NodeMessageMetrics

type NodeService

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

func (*NodeService) AddAccessNode

func (n *NodeService) AddAccessNode(chainID isc.ChainID, peerPubKeyOrName string) error

func (*NodeService) DeleteAccessNode

func (n *NodeService) DeleteAccessNode(chainID isc.ChainID, peerPubKeyOrName string) error

func (*NodeService) SetNodeOwnerCertificate

func (n *NodeService) SetNodeOwnerCertificate(publicKey *cryptolib.PublicKey, ownerAddress iotago.Address) ([]byte, error)

func (*NodeService) ShutdownNode

func (n *NodeService) ShutdownNode()

type OffLedgerService

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

func (*OffLedgerService) EnqueueOffLedgerRequest

func (c *OffLedgerService) EnqueueOffLedgerRequest(chainID isc.ChainID, binaryRequest []byte) error

func (*OffLedgerService) ParseRequest

func (c *OffLedgerService) ParseRequest(binaryRequest []byte) (isc.OffLedgerRequest, error)

type PeeringService

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

func NewPeeringService

func NewPeeringService(chainsProvider chains.Provider, networkProvider peering.NetworkProvider, trustedNetworkManager peering.TrustedNetworkManager) *PeeringService

func (*PeeringService) DistrustPeer

func (p *PeeringService) DistrustPeer(name string) (*dto.PeeringNodeIdentity, error)

func (*PeeringService) GetIdentity

func (p *PeeringService) GetIdentity() *dto.PeeringNodeIdentity

func (*PeeringService) GetRegisteredPeers

func (p *PeeringService) GetRegisteredPeers() []*dto.PeeringNodeStatus

func (*PeeringService) GetTrustedPeers

func (p *PeeringService) GetTrustedPeers() ([]*dto.PeeringNodeIdentity, error)

func (*PeeringService) IsPeerTrusted

func (p *PeeringService) IsPeerTrusted(publicKey *cryptolib.PublicKey) error

func (*PeeringService) TrustPeer

func (p *PeeringService) TrustPeer(name string, publicKey *cryptolib.PublicKey, peeringURL string) (*dto.PeeringNodeIdentity, error)

type RegistryService

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

func (*RegistryService) GetChainRecordByChainID

func (c *RegistryService) GetChainRecordByChainID(chainID isc.ChainID) (*registry.ChainRecord, error)

type UserService

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

func (*UserService) AddUser

func (u *UserService) AddUser(username, password string, permissions []string) error

func (*UserService) DeleteUser

func (u *UserService) DeleteUser(username string) error

func (*UserService) GetUser

func (u *UserService) GetUser(username string) (*models.User, error)

func (*UserService) GetUsers

func (u *UserService) GetUsers() []*models.User

func (*UserService) UpdateUserPassword

func (u *UserService) UpdateUserPassword(username, password string) error

func (*UserService) UpdateUserPermissions

func (u *UserService) UpdateUserPermissions(username string, permissions []string) error

type VMService

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

func (*VMService) CallView

func (v *VMService) CallView(chainState state.State, chain chainpkg.Chain, contractName, functionName isc.Hname, params dict.Dict) (dict.Dict, error)

func (*VMService) CallViewByChainID

func (v *VMService) CallViewByChainID(chainID isc.ChainID, contractName, functionName isc.Hname, params dict.Dict) (dict.Dict, error)

func (*VMService) GetReceipt

func (v *VMService) GetReceipt(chainID isc.ChainID, requestID isc.RequestID) (*isc.Receipt, *isc.VMError, error)

func (*VMService) ParseReceipt

func (v *VMService) ParseReceipt(chain chainpkg.Chain, receipt *blocklog.RequestReceipt) (*isc.Receipt, *isc.VMError, error)

Jump to

Keyboard shortcuts

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