p2p

package
v0.2202.2 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MethodCallEnclave          = "CallEnclave"
	MaxCallEnclaveResponseTime = 5 * time.Second
	MaxCallEnclaveRetries      = 15
	CallEnclaveRetryInterval   = 1 * time.Second
)

Constants related to the GetDiff method.

View Source
const KeyManagerProtocolID = "keymanager"

KeyManagerProtocolID is a unique protocol identifier for the keymanager protocol.

Variables

View Source
var KeyManagerProtocolVersion = version.Version{Major: 1, Minor: 0, Patch: 0}

KeyManagerProtocolVersion is the supported version of the keymanager protocol.

Functions

func NewServer

func NewServer(runtimeID common.Namespace, km KeyManager) rpc.Server

NewServer creates a new keymanager protocol server.

Types

type CallEnclaveRequest

type CallEnclaveRequest struct {
	Data []byte `json:"data"`
}

CallEnclaveRequest is a CallEnclave request.

type CallEnclaveResponse

type CallEnclaveResponse struct {
	Data []byte `json:"data"`
}

CallEnclaveResponse is a response to a CallEnclave request.

type Client

type Client interface {
	// CallEnclave calls a key manager enclave with the provided data.
	CallEnclave(ctx context.Context, request *CallEnclaveRequest) (*CallEnclaveResponse, rpc.PeerFeedback, error)

	// Stop asks the client to stop.
	Stop()

	// Initialized returns a channel that gets closed when the client is initialized.
	Initialized() <-chan struct{}
}

Client is a keymanager protocol client.

func NewClient

func NewClient(p2p p2p.Service, consensus consensus.Backend, keymanagerID common.Namespace) Client

NewClient creates a new keymanager protocol client.

type KeyManager

type KeyManager interface {
	// CallEnclave calls the keymanager enclave with the provided data.
	CallEnclave(ctx context.Context, data []byte) ([]byte, error)
}

KeyManager is the keymanager service interface.

Jump to

Keyboard shortcuts

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