ekiden

package
v0.0.0-...-0001d10 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeserializeResponse

func DeserializeResponse(r io.Reader, res *ResponsePayload) error

DeserializeResponse deserializes an ekiden response

func MarshalRequest

func MarshalRequest(req *RequestPayload) ([]byte, error)

MarshalRequest serializes an ekiden request to he specified format

func SerializeRequest

func SerializeRequest(w io.Writer, req *RequestPayload) error

SerializeRequest serializes an ekiden request to he specified format

func UnmarshalResponse

func UnmarshalResponse(p []byte, res *ResponsePayload) error

UnmarshalResponse deserializes an ekiden response

Types

type Address

type Address [32]byte

Address of a service

type CallEnclaveRequest

type CallEnclaveRequest struct {
	// Method to be invoked by the request
	Method string

	// Data is the RLP encoded representation of the data that
	// is sent
	Data []byte
}

CallEnclaveRequest

type CallEnclaveResponse

type CallEnclaveResponse struct {
	// Result contains the resulting value of a successful response
	Payload interface{}
}

CallEnclaveResponse

type Enclave

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

func DialEnclaveContext

func DialEnclaveContext(ctx context.Context, props *EnclaveProps) (*Enclave, error)

func (*Enclave) CallEnclave

func (e *Enclave) CallEnclave(ctx context.Context, req *CallEnclaveRequest) (*CallEnclaveResponse, error)

func (*Enclave) GetCode

func (e *Enclave) GetCode(ctx context.Context, req *GetCodeRequest) (*GetCodeResponse, error)

GetCode retrieves the code associated with a service along with its metadata

func (*Enclave) GetPublicKey

func (e *Enclave) GetPublicKey(ctx context.Context, req *GetPublicKeyRequest) (*GetPublicKeyResponse, error)

GetPublicKeyRequest retrieves the public key associated with a service along with its metadata

type EnclaveProps

type EnclaveProps struct {
	Endpoint string
	URL      string
}

type EthereumTransactionRequest

type EthereumTransactionRequest struct {
	// RuntimeID is the ID of the runtime that will handle the request
	RuntimeID []byte

	// Data is the RLP encoded representation of the data that
	// is sent
	Data []byte
}

EthereumTransactionRequest is the request to submit an ethereum transaction to ekiden

type EthereumTransactionResponse

type EthereumTransactionResponse struct {
	// Result contains the resulting value of a successful response
	Result interface{}
}

EthereumTransactionResponse is the runtime's response to a successfully processed request

type GetCodeRequest

type GetCodeRequest struct {
	Address Address
}

GetCodeRequest is a request from a client to retrieve the source code associated with a specific service

type GetCodeResponse

type GetCodeResponse struct {
	Payload []byte
}

GetCodeResponse contains the source code associated with the address

type GetPublicKeyRequest

type GetPublicKeyRequest struct {
	Address Address
}

GetPublicKeyRequest is a request from a client to retrieve the public key associated with a specific service

type GetPublicKeyResponse

type GetPublicKeyResponse struct {
	Payload []byte
}

GetPublicKeyResponse contains the public key associated with the address along with the expiration time

type RequestPayload

type RequestPayload struct {
	// Method is the method that the request will invoke
	Method string `codec:"method"`

	// Args are the arguments for invocation
	Args interface{} `codec:"args"`
}

RequestPayload is the representation of an ekiden request used for serialization/deserialization

type ResponsePayload

type ResponsePayload struct {
	// Success is the field that is set in case of a successful
	// response
	Success interface{} `codec:"Success"`

	// Error is the field that is set in case of a failed
	// response with information on the error's cause
	Error string `codec:"Error"`
}

ResponsePayload is the representation of an ekiden response used for serialization/deserialization

type Runtime

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

func DialRuntimeContext

func DialRuntimeContext(ctx context.Context, url string) (*Runtime, error)

func (*Runtime) EthereumTransaction

func (r *Runtime) EthereumTransaction(
	ctx context.Context,
	req *EthereumTransactionRequest,
) (*EthereumTransactionResponse, error)

Submit a transaction to the ekiden node and handle the response

func (*Runtime) Submit

func (r *Runtime) Submit(ctx context.Context, req *SubmitRequest) (*SubmitResponse, error)

Submit a transaction to the ekiden node and handle the response

type SubmitRequest

type SubmitRequest struct {
	// Method to be invoked for the request
	Method string

	// RuntimeID is the ID of the runtime that will handle the request
	RuntimeID []byte

	// Data is the RLP encoded representation of the data that
	// is sent
	Data []byte
}

SubmitRequest is the request to submit a transaction to ekiden

type SubmitResponse

type SubmitResponse struct {
	// Result contains the resulting value of a successful response
	Result interface{}
}

SubmitResponse is the runtime's response to a successfully processed request

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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