consensus

package
v0.2.2-test.16 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2023 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Consensus

type Consensus interface {
	// CurrentHeight returns the current greenfield height - 1,
	CurrentHeight(ctx context.Context) (uint64, error)
	// HasAccount returns an indicator whether the account has been created.
	HasAccount(ctx context.Context, account string) (bool, error)
	// ListSPs returns all SP info.
	ListSPs(ctx context.Context) ([]*sptypes.StorageProvider, error)
	// ListBondedValidators returns all bonded validators info.
	ListBondedValidators(ctx context.Context) ([]stakingtypes.Validator, error)
	// QueryStorageParams returns the storage params.
	QueryStorageParams(ctx context.Context) (params *storagetypes.Params, err error)
	// QueryStorageParamsByTimestamp returns the storage params by block create time.
	QueryStorageParamsByTimestamp(ctx context.Context, timestamp int64) (params *storagetypes.Params, err error)
	// QueryBucketInfo returns the bucket info by bucket name.
	QueryBucketInfo(ctx context.Context, bucket string) (*storagetypes.BucketInfo, error)
	// QueryObjectInfo returns the object info by bucket and object name.
	QueryObjectInfo(ctx context.Context, bucket, object string) (*storagetypes.ObjectInfo, error)
	// QueryObjectInfoByID returns the object info by object ID.
	QueryObjectInfoByID(ctx context.Context, objectID string) (*storagetypes.ObjectInfo, error)
	// QueryBucketInfoAndObjectInfo returns the bucket and object info by bucket and object name.
	QueryBucketInfoAndObjectInfo(ctx context.Context, bucket, object string) (*storagetypes.BucketInfo, *storagetypes.ObjectInfo, error)
	// QueryPaymentStreamRecord returns the account payment status.
	QueryPaymentStreamRecord(ctx context.Context, account string) (*paymenttypes.StreamRecord, error)
	// VerifyGetObjectPermission returns an indicator whether the account has permission to get object.
	VerifyGetObjectPermission(ctx context.Context, account, bucket, object string) (bool, error)
	// VerifyPutObjectPermission returns an indicator whether the account has permission to put object.
	VerifyPutObjectPermission(ctx context.Context, account, bucket, object string) (bool, error)
	// ListenObjectSeal returns an indicator whether the object is successfully sealed before timeOutHeight.
	ListenObjectSeal(ctx context.Context, objectID uint64, timeOutHeight int) (bool, error)
	// Close the Consensus interface.
	Close() error
}

Consensus is the interface to query greenfield consensus data. the consensus data can come from validator, full-node, or other off-chain data service

type NullConsensus

type NullConsensus struct{}

func (*NullConsensus) Close

func (*NullConsensus) Close() error

func (*NullConsensus) CurrentHeight

func (*NullConsensus) CurrentHeight(context.Context) (uint64, error)

func (*NullConsensus) HasAccount

func (*NullConsensus) HasAccount(context.Context, string) (bool, error)

func (*NullConsensus) ListBondedValidators

func (*NullConsensus) ListBondedValidators(context.Context) ([]stakingtypes.Validator, error)

func (*NullConsensus) ListSPs

func (*NullConsensus) ListenObjectSeal

func (*NullConsensus) ListenObjectSeal(context.Context, uint64, int) (bool, error)

func (*NullConsensus) QueryBucketInfo

func (*NullConsensus) QueryBucketInfoAndObjectInfo

func (*NullConsensus) QueryObjectInfo

func (*NullConsensus) QueryObjectInfoByID

func (*NullConsensus) QueryObjectInfoByID(context.Context, string) (*storagetypes.ObjectInfo, error)

func (*NullConsensus) QueryPaymentStreamRecord

func (*NullConsensus) QueryPaymentStreamRecord(context.Context, string) (*paymenttypes.StreamRecord, error)

func (*NullConsensus) QueryStorageParams

func (*NullConsensus) QueryStorageParams(context.Context) (*storagetypes.Params, error)

func (*NullConsensus) QueryStorageParamsByTimestamp

func (*NullConsensus) QueryStorageParamsByTimestamp(context.Context, int64) (*storagetypes.Params, error)

func (*NullConsensus) VerifyGetObjectPermission

func (*NullConsensus) VerifyGetObjectPermission(context.Context, string, string, string) (bool, error)

func (*NullConsensus) VerifyPutObjectPermission

func (*NullConsensus) VerifyPutObjectPermission(context.Context, string, string, string) (bool, error)

Jump to

Keyboard shortcuts

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