Documentation ¶
Overview ¶
Package blocksigner implements remote block signing.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrConsensusChange = errors.New("consensus program has changed")
ErrConsensusChange is returned from ValidateAndSignBlock when a new consensus program is detected.
var ErrInvalidKey = errors.New("misconfigured signer public key")
ErrInvalidKey is returned from SignBlock when the key specified on the Signer is invalid. It may be not found by the mock HSM or not paired to a valid private key.
Functions ¶
This section is empty.
Types ¶
type BlockSigner ¶
BlockSigner validates and signs blocks.
func (*BlockSigner) SignBlock ¶
SignBlock computes the signature for the block using the private key in s. It does not validate the block.
This function fails if this node has ever signed a different block at the same height as b.
func (*BlockSigner) String ¶
func (s *BlockSigner) String() string
func (*BlockSigner) ValidateAndSignBlock ¶
ValidateAndSignBlock validates the given block against the current blockchain and, if valid, computes and returns a signature for the block. It is used as the httpjson handler for /rpc/signer/sign-block.
type EnclaveClient ¶
type EnclaveClient struct { // URLs is called on every Sign call to retrieve the URLs // and access tokens for Chain Enclave. URLs func() [][]string BaseClient rpc.Client }
EnclaveClient implements the Signer interface by calling Chain Enclave to sign blocks.