Documentation
¶
Index ¶
Constants ¶
View Source
const ( LocalstateFileName = "localstate-%s.json" PoolPkAddrFileName = "poolPk.addr" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileStateMgr ¶
type FileStateMgr struct {
// contains filtered or unexported fields
}
FileStateMgr save the local state to file
func NewFileStateMgr ¶
func NewFileStateMgr(folder string) (*FileStateMgr, error)
NewFileStateMgr create a new instance of the FileStateMgr which implements LocalStateManager
func (*FileStateMgr) GetLocalState ¶
func (fsm *FileStateMgr) GetLocalState(pubAddr string) (*KeygenLocalState, error)
GetLocalState read the local state from file system
func (*FileStateMgr) SaveLocalState ¶
func (fsm *FileStateMgr) SaveLocalState(state *KeygenLocalState) error
SaveLocalState save the local state to file
type KeygenLocalState ¶
type KeygenLocalState struct {
// TSS pool pubkey raw byte
PubKeyData []byte `json:"pub_key_data"`
// TSS pool pubkey addr
PubKeyAddr string `json:"pub_key_addr"`
// the library method returns information that needs to be stored at the end of the keyGen
LocalData keygen.LocalPartySaveData `json:"local_data"`
// partyID.id -> pubkey
ParticipantPksMap map[string][]byte `json:"participant_pks_map"` // the paticipant of last key gen
LocalPartyPk []byte `json:"local_party_pk"`
}
KeygenLocalState is a structure used to represent the data we saved locally for different keygen A TSS public key address stores a corresponding KeygenLocalState structure
type LocalStateManager ¶
type LocalStateManager interface {
SaveLocalState(state *KeygenLocalState) error
GetLocalState(pubAddr string) (*KeygenLocalState, error)
}
LocalStateManager provide necessary methods to manage the local state, save it , and read it back LocalStateManager doesn't have any opinion in regards to where it should be persistent to
Click to show internal directories.
Click to hide internal directories.