migration

package
v0.0.0-...-365054f Latest Latest
Warning

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

Go to latest
Published: May 16, 2024 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HermesClient

type HermesClient interface {
	GetConsumerData(chainID int64, id string, cacheDuration time.Duration) (pingpong.HermesUserInfo, error)
}

HermesClient responses for receiving info from Hermes

type HermesMigrator

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

HermesMigrator migrate identity from old hermes to new. It opens a new channel for new Hermes and sends all MYST to a new payment channel.

func NewHermesMigrator

func NewHermesMigrator(
	transactor *registry.Transactor,
	addressProvider registry.AddressProvider,
	hermesURLGetter *pingpong.HermesURLGetter,
	hermesCallerFactory pingpong.HermesCallerFactory,
	hps pingpong.HermesPromiseSettler,
	registry registry.IdentityRegistry,
	cbt *pingpong.ConsumerBalanceTracker,
	st *Storage,
	bc blockchain,
) *HermesMigrator

NewHermesMigrator create new HermesMigrator

func (*HermesMigrator) IsMigrationRequired

func (m *HermesMigrator) IsMigrationRequired(id string) (bool, error)

IsMigrationRequired check whether migration required

func (*HermesMigrator) Start

func (m *HermesMigrator) Start(id string) error

Start begins migration from old hermes to new

func (*HermesMigrator) Subscribe

func (m *HermesMigrator) Subscribe(eb eventbus.Subscriber) error

Subscribe for EventBus events

type Storage

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

Storage keeps track of migration progress

func NewStorage

func NewStorage(db respository, ap registry.AddressProvider) *Storage

NewStorage builds and returns a new storage object.

func (*Storage) MarkAsMigrated

func (s *Storage) MarkAsMigrated(chainID int64, identity string)

MarkAsMigrated set migration flag do not try to migrate again

Jump to

Keyboard shortcuts

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