Documentation
¶
Index ¶
- func PeriodicWalletsSyncTrigger(ctx context.Context, c chan bool, d time.Duration)
- type IDPair
- type Service
- func (s *Service) FetchBackup(ctx context.Context, idHash common.Hash) (*wallets.TEEBackupResponse, error)
- func (s *Service) FetchLatestBackup(ctx context.Context, idPair IDPair) (*wallets.TEEBackupResponse, error)
- func (s *Service) InitiateBackups(ctx context.Context) error
- func (s *Service) KeyData(walletID common.Hash, keyID uint64) (*pkgwallets.KeyData, error)
- func (s *Service) KeyProof(walletID common.Hash, keyID uint64) (*wallets.SignedKeyExistenceProof, error)
- func (s *Service) RunUpdateInfo(ctx context.Context, walletSyncTrigger, backupTrigger <-chan bool, ...)
- func (s *Service) WalletInfo(walletID common.Hash) (*pkgwallets.KeyExistence, error)
- func (s *Service) WalletsInfo() WalletsInfoResponse
- type WalletsInfoResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Service ¶
type Service struct {
KeysForWallet map[common.Hash][]uint64 // slice of keyIDs per walletID
Keys map[IDPair]*pkgwallets.KeyData // key data per IDPair
sync.RWMutex
// contains filtered or unexported fields
}
func NewService ¶
func NewService(aq *queue.ActionQueues, rs *result.ResultStorage, index storage.Storage[common.Hash], backups storage.Storage[*wallets.TEEBackupResponse]) *Service
func (*Service) FetchBackup ¶
func (s *Service) FetchBackup(ctx context.Context, idHash common.Hash) (*wallets.TEEBackupResponse, error)
FetchBackup fetches backup for backupIDHash
func (*Service) FetchLatestBackup ¶
func (s *Service) FetchLatestBackup(ctx context.Context, idPair IDPair) (*wallets.TEEBackupResponse, error)
FetchLatestBackup fetches latest backup for id pair.
func (*Service) InitiateBackups ¶
InitiateBackups triggers TEE_BACKUP action for all stored keys.
func (*Service) KeyProof ¶
func (s *Service) KeyProof(walletID common.Hash, keyID uint64) (*wallets.SignedKeyExistenceProof, error)
KeyProof returns the signed key existence proof for the given wallet/key pair.
The returned pointer is safe to use after the lock is released because SignedKeyExistenceProof values are immutable once created: updateOrAddKey replaces the Proof field with a new pointer rather than writing through the existing one. If that invariant ever changes this must be updated to return a copy.
func (*Service) RunUpdateInfo ¶
func (s *Service) RunUpdateInfo(ctx context.Context, walletSyncTrigger, backupTrigger <-chan bool, keyActions <-chan *types.ActionResult, backups chan *types.ActionResult, keyInfo <-chan *types.ActionResult)
func (*Service) WalletInfo ¶
func (s *Service) WalletInfo(walletID common.Hash) (*pkgwallets.KeyExistence, error)
func (*Service) WalletsInfo ¶ added in v0.0.16
func (s *Service) WalletsInfo() WalletsInfoResponse
WalletsInfo returns summary information about all stored wallets and keys.
type WalletsInfoResponse ¶ added in v0.0.16
type WalletsInfoResponse struct {
Wallets int `json:"wallets"`
Keys int `json:"keys"`
Pairs []IDPair `json:"pairs"`
}
WalletsInfoResponse contains summary information about stored wallets.