p2p

package
v0.2300.11 Latest Latest
Warning

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

Go to latest
Published: May 6, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MethodCallEnclave     = "CallEnclave"
	MaxCallEnclaveRetries = 15
)

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: 2, Minor: 0, Patch: 0}

KeyManagerProtocolVersion is the supported version of the keymanager protocol.

Functions

func NewServer

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

NewServer creates a new keymanager protocol server.

Types

type CallEnclaveRequest

type CallEnclaveRequest struct {
	Data []byte          `json:"data"`
	Kind enclaverpc.Kind `json:"kind,omitempty"`
}

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.
	//
	// The peer to which the call will be routed is chosen at random from the given list.
	CallEnclave(ctx context.Context, request *CallEnclaveRequest, peers []core.PeerID) (*CallEnclaveResponse, rpc.PeerFeedback, error)
}

Client is a keymanager protocol client.

func NewClient

func NewClient(p2p p2p.Service, chainContext string, 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, kind enclaverpc.Kind) ([]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