Documentation ¶
Index ¶
- func Connect(host string, port string, timeout time.Duration, logger log.Logger) (*grpc.ClientConn, error)
- type LockableStream
- type Mgr
- func (mgr *Mgr) ProcessHeartBeatEvent(e tmEvents.Event) error
- func (mgr *Mgr) ProcessKeygenMsg(e tmEvents.Event) error
- func (mgr *Mgr) ProcessKeygenStart(e tmEvents.Event) error
- func (mgr *Mgr) ProcessNewBlockHeader(blockHeight int64)
- func (mgr *Mgr) ProcessSignMsg(e tmEvents.Event) error
- func (mgr *Mgr) ProcessSignStart(e tmEvents.Event) error
- func (mgr *Mgr) Recover(recoverJSON []byte) error
- func (mgr *Mgr) RefreshKeys(ctx context.Context) error
- type Session
- type Stream
- type TimeoutQueue
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type LockableStream ¶
type LockableStream struct {
// contains filtered or unexported fields
}
LockableStream is a thread-safe Stream
func NewLockableStream ¶
func NewLockableStream(stream Stream) *LockableStream
NewLockableStream return a new thread-safe stream instance
func (*LockableStream) CloseSend ¶
func (l *LockableStream) CloseSend() error
CloseSend implements the Stream interface
func (*LockableStream) Recv ¶
func (l *LockableStream) Recv() (*tofnd.MessageOut, error)
Recv implements the Stream interface
type Mgr ¶
type Mgr struct { Timeout time.Duration Logger log.Logger // contains filtered or unexported fields }
Mgr represents an object that manages all communication with the external tss process
func NewMgr ¶
func NewMgr(client rpc.Client, multiSigClient rpc.MultiSigClient, cliCtx sdkClient.Context, timeout time.Duration, principalAddr string, broadcaster broadcasterTypes.Broadcaster, logger log.Logger, cdc *codec.LegacyAmino) *Mgr
NewMgr returns a new tss manager instance
func (*Mgr) ProcessHeartBeatEvent ¶
ProcessHeartBeatEvent broadcasts the heartbeat
func (*Mgr) ProcessKeygenMsg ¶
ProcessKeygenMsg forwards blockchain messages to the keygen protocol
func (*Mgr) ProcessKeygenStart ¶
ProcessKeygenStart starts the communication with the keygen protocol
func (*Mgr) ProcessNewBlockHeader ¶
ProcessNewBlockHeader handles timeout on new block header
func (*Mgr) ProcessSignMsg ¶
ProcessSignMsg forwards blockchain messages to the sign protocol
func (*Mgr) ProcessSignStart ¶
ProcessSignStart starts the communication with the sign protocol
type Session ¶
Session defines a tss session which is either signing or keygen
func (*Session) WaitForTimeout ¶
func (s *Session) WaitForTimeout()
WaitForTimeout waits until the session has timed out
type Stream ¶
type Stream interface { Send(in *tofnd.MessageIn) error Recv() (*tofnd.MessageOut, error) CloseSend() error }
Stream is the abstracted communication stream with tofnd
type TimeoutQueue ¶
type TimeoutQueue struct {
// contains filtered or unexported fields
}
TimeoutQueue is a queue of sessions order by timeoutAt
func NewTimeoutQueue ¶
func NewTimeoutQueue() *TimeoutQueue
NewTimeoutQueue is the constructor for TimeoutQueue
func (*TimeoutQueue) Dequeue ¶
func (q *TimeoutQueue) Dequeue() *Session
Dequeue pops the first session in queue
func (*TimeoutQueue) Enqueue ¶
func (q *TimeoutQueue) Enqueue(ID string, timeoutAt int64) *Session
Enqueue adds a new session with ID and timeoutAt into the queue
func (*TimeoutQueue) Top ¶
func (q *TimeoutQueue) Top() *Session
Top returns the first session in queue