server

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IAVLServer

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

IAVLServer implements the gRPC IAVLServiceServer interface. It provides a gRPC API over an IAVL tree. rwLock is used to ensure: 1. No reading while writing, no writing while reading. 2. Unlimited concurrent reads. 3. Sequential writes.

func New

func New(db dbm.DB, cacheSize, version int64) (*IAVLServer, error)

New creates an IAVLServer.

func (*IAVLServer) DeleteVersion

DeleteVersion deletes an IAVL tree version from the DB. The version can then no longer be accessed. It returns a result containing the version and root hash of the versioned tree that was deleted.

func (*IAVLServer) Get

func (s *IAVLServer) Get(_ context.Context, req *pb.GetRequest) (*pb.GetResponse, error)

Get returns a result containing the index and value for a given key based on the current state (version) of the tree. If the key does not exist, Get returns the index of the next value.

func (*IAVLServer) GetAvailableVersions

func (s *IAVLServer) GetAvailableVersions(ctx context.Context, req *empty.Empty) (*pb.GetAvailableVersionsResponse, error)

func (*IAVLServer) GetByIndex

GetByIndex returns a result containing the key and value for a given index based on the current state (version) of the tree.

func (*IAVLServer) GetVersioned

func (s *IAVLServer) GetVersioned(_ context.Context, req *pb.GetVersionedRequest) (*pb.GetResponse, error)

GetVersioned returns a result containing the IAVL tree version and value for a given key at a specific tree version.

func (*IAVLServer) GetVersionedWithProof

func (s *IAVLServer) GetVersionedWithProof(_ context.Context, req *pb.GetVersionedRequest) (*pb.GetWithProofResponse, error)

GetVersionedWithProof returns a result containing the IAVL tree version and value for a given key at a specific tree version including a verifiable Merkle proof.

func (*IAVLServer) GetWithProof

func (s *IAVLServer) GetWithProof(ctx context.Context, req *pb.GetRequest) (*pb.GetWithProofResponse, error)

GetWithProof returns a result containing the IAVL tree version and value for a given key based on the current state (version) of the tree including a verifiable Merkle proof.

func (*IAVLServer) Has

func (s *IAVLServer) Has(_ context.Context, req *pb.HasRequest) (*pb.HasResponse, error)

Has returns a result containing a boolean on whether or not the IAVL tree has a given key in the current version

func (*IAVLServer) HasVersioned

func (s *IAVLServer) HasVersioned(_ context.Context, req *pb.HasVersionedRequest) (*pb.HasResponse, error)

HasVersioned returns a result containing a boolean on whether or not the IAVL tree has a given key at a specific tree version.

func (*IAVLServer) Hash

Hash returns the IAVL tree root hash based on the current state.

func (*IAVLServer) List

func (s *IAVLServer) List(req *pb.ListRequest, stream pb.IAVLService_ListServer) error

func (*IAVLServer) Load

func (s *IAVLServer) Load(ctx context.Context, req *empty.Empty) (*empty.Empty, error)

func (*IAVLServer) LoadVersion

func (s *IAVLServer) LoadVersion(ctx context.Context, req *pb.LoadVersionRequest) (*empty.Empty, error)

func (*IAVLServer) LoadVersionForOverwriting

func (s *IAVLServer) LoadVersionForOverwriting(ctx context.Context, req *pb.LoadVersionForOverwritingRequest) (*empty.Empty, error)

func (*IAVLServer) Remove

Remove returns a result after removing a key/value pair from the IAVL tree based on the current state (version) of the tree.

func (*IAVLServer) Rollback

func (s *IAVLServer) Rollback(ctx context.Context, req *empty.Empty) (*empty.Empty, error)

Rollback resets the working tree to the latest saved version, discarding any unsaved modifications.

func (*IAVLServer) SaveVersion

func (s *IAVLServer) SaveVersion(_ context.Context, _ *empty.Empty) (*pb.SaveVersionResponse, error)

SaveVersion saves a new IAVL tree version to the DB based on the current state (version) of the tree. It returns a result containing the hash and new version number.

func (*IAVLServer) Set

func (s *IAVLServer) Set(_ context.Context, req *pb.SetRequest) (*pb.SetResponse, error)

Set returns a result after inserting a key/value pair into the IAVL tree based on the current state (version) of the tree.

func (*IAVLServer) Size

func (s *IAVLServer) Size(ctx context.Context, req *empty.Empty) (*pb.SizeResponse, error)

func (*IAVLServer) Verify

func (*IAVLServer) Verify(ctx context.Context, req *pb.VerifyRequest) (*empty.Empty, error)

Verify verifies an IAVL range proof returning an error if the proof is invalid.

func (*IAVLServer) VerifyAbsence

func (*IAVLServer) VerifyAbsence(ctx context.Context, req *pb.VerifyAbsenceRequest) (*empty.Empty, error)

VerifyAbsence verifies the absence of a given key in an IAVL range proof returning an error if the proof or key is invalid.

func (*IAVLServer) VerifyItem

func (*IAVLServer) VerifyItem(ctx context.Context, req *pb.VerifyItemRequest) (*empty.Empty, error)

VerifyItem verifies if a given key/value pair in an IAVL range proof returning an error if the proof or key is invalid.

func (*IAVLServer) Version

func (s *IAVLServer) Version(_ context.Context, _ *empty.Empty) (*pb.VersionResponse, error)

Version returns the IAVL tree version based on the current state.

func (*IAVLServer) VersionExists

VersionExists returns a result containing a boolean on whether or not a given version exists in the IAVL tree.

Jump to

Keyboard shortcuts

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