vmrpc

package
v0.2.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NodeType_name = map[int32]string{
		0: "EDGE_NODE",
		1: "BINARY_NODE",
	}
	NodeType_value = map[string]int32{
		"EDGE_NODE":   0,
		"BINARY_NODE": 1,
	}
)

Enum value maps for NodeType.

View Source
var StorageAdapter_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "StorageAdapter",
	HandlerType: (*StorageAdapterServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetPatriciaNode",
			Handler:    _StorageAdapter_GetPatriciaNode_Handler,
		},
		{
			MethodName: "GetContractState",
			Handler:    _StorageAdapter_GetContractState_Handler,
		},
		{
			MethodName: "GetContractDefinition",
			Handler:    _StorageAdapter_GetContractDefinition_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "vm.proto",
}

StorageAdapter_ServiceDesc is the grpc.ServiceDesc for StorageAdapter service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

View Source
var VM_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "VM",
	HandlerType: (*VMServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Call",
			Handler:    _VM_Call_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "vm.proto",
}

VM_ServiceDesc is the grpc.ServiceDesc for VM service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func NewStorageRPCServer

func NewStorageRPCServer(stateManager *statedb.Manager) *storageRPCServer

func RegisterStorageAdapterServer

func RegisterStorageAdapterServer(s grpc.ServiceRegistrar, srv StorageAdapterServer)

func RegisterVMServer

func RegisterVMServer(s grpc.ServiceRegistrar, srv VMServer)

Types

type GetValueRequest

type GetValueRequest struct {
	Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	// contains filtered or unexported fields
}

func (*GetValueRequest) Descriptor deprecated

func (*GetValueRequest) Descriptor() ([]byte, []int)

Deprecated: Use GetValueRequest.ProtoReflect.Descriptor instead.

func (*GetValueRequest) GetKey

func (x *GetValueRequest) GetKey() []byte

func (*GetValueRequest) ProtoMessage

func (*GetValueRequest) ProtoMessage()

func (*GetValueRequest) ProtoReflect

func (x *GetValueRequest) ProtoReflect() protoreflect.Message

func (*GetValueRequest) Reset

func (x *GetValueRequest) Reset()

func (*GetValueRequest) String

func (x *GetValueRequest) String() string

type NodeType

type NodeType int32
const (
	NodeType_EDGE_NODE   NodeType = 0
	NodeType_BINARY_NODE NodeType = 1
)

func (NodeType) Descriptor

func (NodeType) Descriptor() protoreflect.EnumDescriptor

func (NodeType) Enum

func (x NodeType) Enum() *NodeType

func (NodeType) EnumDescriptor deprecated

func (NodeType) EnumDescriptor() ([]byte, []int)

Deprecated: Use NodeType.Descriptor instead.

func (NodeType) Number

func (x NodeType) Number() protoreflect.EnumNumber

func (NodeType) String

func (x NodeType) String() string

func (NodeType) Type

type StorageAdapterClient

type StorageAdapterClient interface {
	GetPatriciaNode(ctx context.Context, in *GetValueRequest, opts ...grpc.CallOption) (*VMTrieNode, error)
	GetContractState(ctx context.Context, in *GetValueRequest, opts ...grpc.CallOption) (*VMContractState, error)
	GetContractDefinition(ctx context.Context, in *GetValueRequest, opts ...grpc.CallOption) (*VMContractDefinition, error)
}

StorageAdapterClient is the client API for StorageAdapter service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

type StorageAdapterServer

type StorageAdapterServer interface {
	GetPatriciaNode(context.Context, *GetValueRequest) (*VMTrieNode, error)
	GetContractState(context.Context, *GetValueRequest) (*VMContractState, error)
	GetContractDefinition(context.Context, *GetValueRequest) (*VMContractDefinition, error)
	// contains filtered or unexported methods
}

StorageAdapterServer is the server API for StorageAdapter service. All implementations must embed UnimplementedStorageAdapterServer for forward compatibility

type UnimplementedStorageAdapterServer

type UnimplementedStorageAdapterServer struct {
}

UnimplementedStorageAdapterServer must be embedded to have forward compatible implementations.

func (UnimplementedStorageAdapterServer) GetContractDefinition

func (UnimplementedStorageAdapterServer) GetContractState

func (UnimplementedStorageAdapterServer) GetPatriciaNode

type UnimplementedVMServer

type UnimplementedVMServer struct {
}

UnimplementedVMServer must be embedded to have forward compatible implementations.

func (UnimplementedVMServer) Call

type UnsafeStorageAdapterServer

type UnsafeStorageAdapterServer interface {
	// contains filtered or unexported methods
}

UnsafeStorageAdapterServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to StorageAdapterServer will result in compilation errors.

type UnsafeVMServer

type UnsafeVMServer interface {
	// contains filtered or unexported methods
}

UnsafeVMServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to VMServer will result in compilation errors.

type VMCallRequest

type VMCallRequest struct {
	Calldata        [][]byte `protobuf:"bytes,1,rep,name=calldata,proto3" json:"calldata,omitempty"`
	CallerAddress   []byte   `protobuf:"bytes,2,opt,name=caller_address,json=callerAddress,proto3" json:"caller_address,omitempty"`
	ContractAddress []byte   `protobuf:"bytes,3,opt,name=contract_address,json=contractAddress,proto3" json:"contract_address,omitempty"`
	ClassHash       []byte   `protobuf:"bytes,4,opt,name=class_hash,json=classHash,proto3" json:"class_hash,omitempty"`
	Root            []byte   `protobuf:"bytes,5,opt,name=root,proto3" json:"root,omitempty"`
	Selector        []byte   `protobuf:"bytes,6,opt,name=selector,proto3" json:"selector,omitempty"`
	Sequencer       []byte   `protobuf:"bytes,7,opt,name=sequencer,proto3" json:"sequencer,omitempty"`
	// contains filtered or unexported fields
}

func (*VMCallRequest) Descriptor deprecated

func (*VMCallRequest) Descriptor() ([]byte, []int)

Deprecated: Use VMCallRequest.ProtoReflect.Descriptor instead.

func (*VMCallRequest) GetCalldata

func (x *VMCallRequest) GetCalldata() [][]byte

func (*VMCallRequest) GetCallerAddress

func (x *VMCallRequest) GetCallerAddress() []byte

func (*VMCallRequest) GetClassHash

func (x *VMCallRequest) GetClassHash() []byte

func (*VMCallRequest) GetContractAddress

func (x *VMCallRequest) GetContractAddress() []byte

func (*VMCallRequest) GetRoot

func (x *VMCallRequest) GetRoot() []byte

func (*VMCallRequest) GetSelector

func (x *VMCallRequest) GetSelector() []byte

func (*VMCallRequest) GetSequencer

func (x *VMCallRequest) GetSequencer() []byte

func (*VMCallRequest) ProtoMessage

func (*VMCallRequest) ProtoMessage()

func (*VMCallRequest) ProtoReflect

func (x *VMCallRequest) ProtoReflect() protoreflect.Message

func (*VMCallRequest) Reset

func (x *VMCallRequest) Reset()

func (*VMCallRequest) String

func (x *VMCallRequest) String() string

type VMCallResponse

type VMCallResponse struct {
	Retdata [][]byte `protobuf:"bytes,1,rep,name=retdata,proto3" json:"retdata,omitempty"`
	// contains filtered or unexported fields
}

func (*VMCallResponse) Descriptor deprecated

func (*VMCallResponse) Descriptor() ([]byte, []int)

Deprecated: Use VMCallResponse.ProtoReflect.Descriptor instead.

func (*VMCallResponse) GetRetdata

func (x *VMCallResponse) GetRetdata() [][]byte

func (*VMCallResponse) ProtoMessage

func (*VMCallResponse) ProtoMessage()

func (*VMCallResponse) ProtoReflect

func (x *VMCallResponse) ProtoReflect() protoreflect.Message

func (*VMCallResponse) Reset

func (x *VMCallResponse) Reset()

func (*VMCallResponse) String

func (x *VMCallResponse) String() string

type VMClient

type VMClient interface {
	Call(ctx context.Context, in *VMCallRequest, opts ...grpc.CallOption) (*VMCallResponse, error)
}

VMClient is the client API for VM service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

func NewVMClient

func NewVMClient(cc grpc.ClientConnInterface) VMClient

type VMContractDefinition

type VMContractDefinition struct {
	Value []byte `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

func (*VMContractDefinition) Descriptor deprecated

func (*VMContractDefinition) Descriptor() ([]byte, []int)

Deprecated: Use VMContractDefinition.ProtoReflect.Descriptor instead.

func (*VMContractDefinition) GetValue

func (x *VMContractDefinition) GetValue() []byte

func (*VMContractDefinition) ProtoMessage

func (*VMContractDefinition) ProtoMessage()

func (*VMContractDefinition) ProtoReflect

func (x *VMContractDefinition) ProtoReflect() protoreflect.Message

func (*VMContractDefinition) Reset

func (x *VMContractDefinition) Reset()

func (*VMContractDefinition) String

func (x *VMContractDefinition) String() string

type VMContractState

type VMContractState struct {
	ContractHash []byte `protobuf:"bytes,1,opt,name=contractHash,proto3" json:"contractHash,omitempty"`
	StorageRoot  []byte `protobuf:"bytes,2,opt,name=storageRoot,proto3" json:"storageRoot,omitempty"`
	Height       uint32 `protobuf:"varint,3,opt,name=height,proto3" json:"height,omitempty"`
	// contains filtered or unexported fields
}

func (*VMContractState) Descriptor deprecated

func (*VMContractState) Descriptor() ([]byte, []int)

Deprecated: Use VMContractState.ProtoReflect.Descriptor instead.

func (*VMContractState) GetContractHash

func (x *VMContractState) GetContractHash() []byte

func (*VMContractState) GetHeight

func (x *VMContractState) GetHeight() uint32

func (*VMContractState) GetStorageRoot

func (x *VMContractState) GetStorageRoot() []byte

func (*VMContractState) ProtoMessage

func (*VMContractState) ProtoMessage()

func (*VMContractState) ProtoReflect

func (x *VMContractState) ProtoReflect() protoreflect.Message

func (*VMContractState) Reset

func (x *VMContractState) Reset()

func (*VMContractState) String

func (x *VMContractState) String() string

type VMServer

type VMServer interface {
	Call(context.Context, *VMCallRequest) (*VMCallResponse, error)
	// contains filtered or unexported methods
}

VMServer is the server API for VM service. All implementations must embed UnimplementedVMServer for forward compatibility

type VMTrieNode

type VMTrieNode struct {
	Len    uint32   `protobuf:"varint,1,opt,name=len,proto3" json:"len,omitempty"`
	Bottom []byte   `protobuf:"bytes,2,opt,name=bottom,proto3" json:"bottom,omitempty"`
	Path   []byte   `protobuf:"bytes,3,opt,name=path,proto3" json:"path,omitempty"`
	Left   []byte   `protobuf:"bytes,4,opt,name=left,proto3" json:"left,omitempty"`
	Right  []byte   `protobuf:"bytes,5,opt,name=right,proto3" json:"right,omitempty"`
	Type   NodeType `protobuf:"varint,6,opt,name=type,proto3,enum=NodeType" json:"type,omitempty"`
	// contains filtered or unexported fields
}

func (*VMTrieNode) Descriptor deprecated

func (*VMTrieNode) Descriptor() ([]byte, []int)

Deprecated: Use VMTrieNode.ProtoReflect.Descriptor instead.

func (*VMTrieNode) GetBottom

func (x *VMTrieNode) GetBottom() []byte

func (*VMTrieNode) GetLeft

func (x *VMTrieNode) GetLeft() []byte

func (*VMTrieNode) GetLen

func (x *VMTrieNode) GetLen() uint32

func (*VMTrieNode) GetPath

func (x *VMTrieNode) GetPath() []byte

func (*VMTrieNode) GetRight

func (x *VMTrieNode) GetRight() []byte

func (*VMTrieNode) GetType

func (x *VMTrieNode) GetType() NodeType

func (*VMTrieNode) ProtoMessage

func (*VMTrieNode) ProtoMessage()

func (*VMTrieNode) ProtoReflect

func (x *VMTrieNode) ProtoReflect() protoreflect.Message

func (*VMTrieNode) Reset

func (x *VMTrieNode) Reset()

func (*VMTrieNode) String

func (x *VMTrieNode) String() string

Jump to

Keyboard shortcuts

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