greenfield

package
v0.1.3-test-1 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// UpdateClientInternal defines the period of updating the best chain client
	UpdateClientInternal = 60
	// ExpectedOutputBlockInternal defines the time of estimating output block time
	ExpectedOutputBlockInternal = 2
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Greenfield

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

Greenfield is an encapsulation of greenfield chain go sdk which supports for more query request

func NewGreenfield

func NewGreenfield(cfg *GreenfieldChainConfig) (*Greenfield, error)

NewGreenfield return the Greenfield instance.

func (*Greenfield) Close

func (greenfield *Greenfield) Close() error

Close the Greenfield instance.

func (*Greenfield) GetCurrentHeight

func (greenfield *Greenfield) GetCurrentHeight(ctx context.Context) (uint64, error)

GetCurrentHeight the block height sub one as the stable height.

func (*Greenfield) HasAccount

func (greenfield *Greenfield) HasAccount(ctx context.Context, address string) (bool, error)

HasAccount returns an indication of the existence of address.

func (*Greenfield) ListenObjectSeal

func (greenfield *Greenfield) ListenObjectSeal(ctx context.Context, bucket, object string, timeOutHeight int) (err error)

ListenObjectSeal return an indication of the object is sealed. TODO:: retrieve service support seal event subscription

func (*Greenfield) QueryBucketInfo

func (greenfield *Greenfield) QueryBucketInfo(ctx context.Context, bucket string) (*storagetypes.BucketInfo, error)

QueryBucketInfo return the bucket info by name.

func (*Greenfield) QueryBucketInfoAndObjectInfo

func (greenfield *Greenfield) QueryBucketInfoAndObjectInfo(ctx context.Context, bucket, object string) (*storagetypes.BucketInfo, *storagetypes.ObjectInfo, error)

QueryBucketInfoAndObjectInfo return bucket info and object info, if not found, return the corresponding error code

func (*Greenfield) QueryObjectInfo

func (greenfield *Greenfield) QueryObjectInfo(ctx context.Context, bucket, object string) (*storagetypes.ObjectInfo, error)

QueryObjectInfo return the object info by name.

func (*Greenfield) QueryObjectInfoByID added in v0.1.1

func (greenfield *Greenfield) QueryObjectInfoByID(ctx context.Context, objectID string) (*storagetypes.ObjectInfo, error)

QueryObjectInfoByID return the object info by name.

func (*Greenfield) QuerySPInfo

func (greenfield *Greenfield) QuerySPInfo(ctx context.Context) ([]*sptypes.StorageProvider, error)

QuerySPInfo returns the list of storage provider info.

func (*Greenfield) QueryStorageParams

func (greenfield *Greenfield) QueryStorageParams(ctx context.Context) (params *storagetypes.Params, err error)

QueryStorageParams returns storage params

func (*Greenfield) QueryStreamRecord

func (greenfield *Greenfield) QueryStreamRecord(ctx context.Context, account string) (*paymenttypes.StreamRecord, error)

QueryStreamRecord return the steam record info by account.

func (*Greenfield) VerifyGetObjectPermission

func (greenfield *Greenfield) VerifyGetObjectPermission(ctx context.Context, account, bucket, object string) (bool, error)

VerifyGetObjectPermission verify get object permission.

func (*Greenfield) VerifyPutObjectPermission

func (greenfield *Greenfield) VerifyPutObjectPermission(ctx context.Context, account, bucket, object string) (bool, error)

VerifyPutObjectPermission verify put object permission.

type GreenfieldChainConfig

type GreenfieldChainConfig struct {
	ChainID  string
	NodeAddr []*NodeConfig
}

type GreenfieldClient

type GreenfieldClient struct {
	Provider []string
	// contains filtered or unexported fields
}

GreenfieldClient the greenfield chain client, only use to query.

func (*GreenfieldClient) GnfdClient added in v0.1.2

func (client *GreenfieldClient) GnfdClient() *chainClient.GreenfieldClient

GnfdClient return the greenfield chain client

type NodeConfig

type NodeConfig struct {
	GreenfieldAddresses []string
	TendermintAddresses []string
}

Jump to

Keyboard shortcuts

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