signer

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2023 License: MIT Imports: 34 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultSignerLevelDBFolder = "signer_data"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ConstantsProvider

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

ConstantsProvider which will query ddchain to get the constants value per request it will also cache the constant values internally

func NewConstantsProvider

func NewConstantsProvider(bridge ddclient.DdchainBridge) *ConstantsProvider

NewConstantsProvider create a new instance of ConstantsProvider

func (*ConstantsProvider) EnsureConstants

func (cp *ConstantsProvider) EnsureConstants(ddchainBlockHeight int64) error

func (*ConstantsProvider) GetInt64Value

func (cp *ConstantsProvider) GetInt64Value(ddchainBlockHeight int64, key constants.ConstantName) (int64, error)

GetInt64Value get the constant value that match the given key

type DdchainBlockScan added in v0.2.0

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

func NewDdchainBlockScan added in v0.2.0

NewDdchainBlockScan create a new instance of ddchain block scanner

func (*DdchainBlockScan) FetchMemPool added in v0.2.0

func (c *DdchainBlockScan) FetchMemPool(height int64) (types.TxIn, error)

func (*DdchainBlockScan) FetchTxs added in v0.2.0

func (b *DdchainBlockScan) FetchTxs(height, _ int64) (types.TxIn, error)

func (*DdchainBlockScan) GetHeight added in v0.2.0

func (b *DdchainBlockScan) GetHeight() (int64, error)

func (*DdchainBlockScan) GetKeygenMessages added in v0.2.0

func (b *DdchainBlockScan) GetKeygenMessages() <-chan ttypes.KeygenBlock

func (*DdchainBlockScan) GetTxOutMessages added in v0.2.0

func (b *DdchainBlockScan) GetTxOutMessages() <-chan types.TxOut

GetMessages return the channel

type Signer

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

Signer will pull the tx out from ddchain and then forward it to chain

func NewSigner

func NewSigner(cfg config.BifrostSignerConfiguration,
	ddchainBridge ddclient.DdchainBridge,
	ddKeys *ddclient.Keys,
	pubkeyMgr pubkeymanager.PubKeyValidator,
	tssServer *tssp.TssServer,
	chains map[common.Chain]chainclients.ChainClient,
	m *metrics.Metrics,
	tssKeysignMetricMgr *metrics.TssKeysignMetricMgr,
	obs *observer.Observer,
) (*Signer, error)

NewSigner create a new instance of signer

func (*Signer) Start

func (s *Signer) Start() error

Start signer process

func (*Signer) Stop

func (s *Signer) Stop() error

Stop the signer process

type SignerStorage

type SignerStorage interface {
	Set(item TxOutStoreItem) error
	Batch(items []TxOutStoreItem) error
	Get(key string) (TxOutStoreItem, error)
	Has(key string) bool
	Remove(item TxOutStoreItem) error
	List() []TxOutStoreItem
	OrderedLists() map[string][]TxOutStoreItem
	Close() error
}

type SignerStore

type SignerStore struct {
	*blockscanner.LevelDBScannerStorage
	// contains filtered or unexported fields
}

func NewSignerStore

func NewSignerStore(levelDbFolder string, opts config.LevelDBOptions, passphrase string) (*SignerStore, error)

NewSignerStore create a new instance of SignerStore. If no folder is given, an in memory implementation is used.

func (*SignerStore) Batch

func (s *SignerStore) Batch(items []TxOutStoreItem) error

func (*SignerStore) Close

func (s *SignerStore) Close() error

Close underlying db

func (*SignerStore) Get

func (s *SignerStore) Get(key string) (item TxOutStoreItem, err error)

func (*SignerStore) GetInternalDb

func (s *SignerStore) GetInternalDb() *leveldb.DB

func (*SignerStore) Has

func (s *SignerStore) Has(key string) (ok bool)

Has check whether the given key exist in key value store

func (*SignerStore) List

func (s *SignerStore) List() []TxOutStoreItem

List send back tx out to retry depending on arg failed only

func (*SignerStore) OrderedLists

func (s *SignerStore) OrderedLists() map[string][]TxOutStoreItem

OrderedLists

func (*SignerStore) Remove

func (s *SignerStore) Remove(item TxOutStoreItem) error

Remove remove the given item from key values store

func (*SignerStore) Set

func (s *SignerStore) Set(item TxOutStoreItem) error

type TxOutStoreItem

type TxOutStoreItem struct {
	TxOutItem   types.TxOutItem
	Status      TxStatus
	Height      int64
	Index       int64
	Round7Retry bool
	Checkpoint  []byte
	SignedTx    []byte
}

func NewTxOutStoreItem

func NewTxOutStoreItem(height int64, item types.TxOutItem, idx int64) TxOutStoreItem

func (*TxOutStoreItem) Key

func (s *TxOutStoreItem) Key() string

type TxStatus

type TxStatus int
const (
	TxUnknown TxStatus = iota
	TxAvailable
	TxUnavailable
	TxSpent
)

Jump to

Keyboard shortcuts

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