rpc

package
v0.0.0-...-f39f649 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RPCEnclave

type RPCEnclave struct {
	// contains filtered or unexported fields
}

RPCEnclave communicates with a rpc.Server's enclave.

func DialEnclave

func DialEnclave(address string) (*RPCEnclave, error)

DialEnclave dials an enclave at the given TCP/IP address.

func NewRPCEnclave

func NewRPCEnclave(conn io.ReadWriteCloser) *RPCEnclave

NewRPCEnclave communicates with a rpc.Server via conn.

func (*RPCEnclave) BalanceProofs

func (re *RPCEnclave) BalanceProofs() (res []*tee.BalanceProof, err error)

func (*RPCEnclave) Close

func (re *RPCEnclave) Close() error

Close closes the connection to the remote enclave.

func (*RPCEnclave) DepositProofs

func (re *RPCEnclave) DepositProofs() (res []*tee.DepositProof, err error)

func (*RPCEnclave) Init

func (re *RPCEnclave) Init() (common.Address, []byte, error)

func (*RPCEnclave) ProcessBlocks

func (re *RPCEnclave) ProcessBlocks(blocks ...*tee.Block) error

func (*RPCEnclave) ProcessTXs

func (re *RPCEnclave) ProcessTXs(txs ...*tee.Transaction) error

func (*RPCEnclave) Run

func (re *RPCEnclave) Run(p tee.Parameters) error

func (*RPCEnclave) Shutdown

func (re *RPCEnclave) Shutdown()

func (*RPCEnclave) Stop

func (re *RPCEnclave) Stop() error

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server is a server that exposes an Enclave as a slave.

func NewServer

func NewServer(impl tee.Enclave) *Server

NewServer creates a new server which is not yet running.

func (*Server) BalanceProofs

func (n *Server) BalanceProofs(_ Void, res *[]*tee.BalanceProof) (err error)

BalanceProofs wraps Enclave.BalanceProofs.

func (*Server) DepositProofs

func (n *Server) DepositProofs(_ Void, res *[]*tee.DepositProof) (err error)

DepositProofs wraps Enclave.DepositProofs.

func (*Server) Init

func (n *Server) Init(_ Void, res *TeeInitRes) (err error)

Init wraps Enclave.Init.

func (*Server) IsStopped

func (n *Server) IsStopped() bool

IsStopped returns whether Stop() has been called.

func (*Server) ProcessBlocks

func (n *Server) ProcessBlocks(blocks []*tee.Block, _ *Void) error

ProcessBlocks wraps Enclave.ProcessBlocks.

func (*Server) ProcessTXs

func (n *Server) ProcessTXs(txs *[]*tee.Transaction, _ *Void) error

ProcessTXs wraps Enclave.ProcessTX.

func (*Server) Run

func (n *Server) Run(p tee.Parameters, _ *Void) (err error)

Run wraps Enclave.Run.

func (*Server) Shutdown

func (n *Server) Shutdown(Void, *Void) error

Shutdown wraps Enclave.Shutdown.

func (*Server) Start

func (n *Server) Start(l net.Listener)

Start starts the server and sets its listener. Call only once. Starts listening for new connections in the background.

func (*Server) Stop

func (n *Server) Stop(Void, *Void) error

Stop stops the server from accepting new connections.

func (*Server) Stopped

func (n *Server) Stopped() <-chan struct{}

Stopped returns a channel that will be closed once the server is stopped.

type TeeInitRes

type TeeInitRes struct {
	Addr common.Address
	Sig  []byte
}

TeeInitRes holds the result for Enclave.Init requests.

type Void

type Void struct{}

Void indicates that a function has no arguments or no return value.

Jump to

Keyboard shortcuts

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