signer

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2020 License: BlueOak-1.0.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitSerialization

func InitSerialization()

InitSerialization initalizes the private codec encoder/decoder

func ReadMsg

func ReadMsg(reader io.Reader) (msg privval.SignerMessage, err error)

ReadMsg reads a message from an io.Reader

func WriteMsg

func WriteMsg(writer io.Writer, msg interface{}) (err error)

WriteMsg writes a message to an io.Writer

Types

type NodeClient

type NodeClient struct {
	svc.BaseService
	// contains filtered or unexported fields
}

NodeClient dials a node responds to signature requests using its privVal.

func NewNodeClient

func NewNodeClient(
	address string,
	logger log.Logger,
	chainID string,
	privVal types.PrivValidator,
	dialer net.Dialer,
) *NodeClient

NewNodeClient return a NodeClient that will dial using the given dialer and respond to any signature requests over the connection using the given privVal.

If the connection is broken, the NodeClient will attempt to reconnect.

func (*NodeClient) OnStart

func (rs *NodeClient) OnStart() error

OnStart implements svc.Service.

type PvGuard

type PvGuard struct {
	PrivValidator types.PrivValidator
	// contains filtered or unexported fields
}

PvGuard guards access to an underlying PrivValidator by using mutexes for each of the PrivValidator interface functions

func (*PvGuard) GetPubKey

func (pv *PvGuard) GetPubKey() (crypto.PubKey, error)

GetPubKey implementes types.PrivValidator

func (*PvGuard) SignProposal

func (pv *PvGuard) SignProposal(chainID string, proposal *types.Proposal) error

SignProposal implementes types.PrivValidator

func (*PvGuard) SignVote

func (pv *PvGuard) SignVote(chainID string, vote *types.Vote) error

SignVote implementes types.PrivValidator

Jump to

Keyboard shortcuts

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