Documentation ¶
Index ¶
- Constants
- Variables
- type Gnfd
- func (g *Gnfd) Close() error
- func (g *Gnfd) CurrentHeight(ctx context.Context) (uint64, error)
- func (g *Gnfd) HasAccount(ctx context.Context, address string) (bool, error)
- func (g *Gnfd) ListBondedValidators(ctx context.Context) ([]stakingtypes.Validator, error)
- func (g *Gnfd) ListSPs(ctx context.Context) ([]*sptypes.StorageProvider, error)
- func (g *Gnfd) ListenObjectSeal(ctx context.Context, objectID uint64, timeoutHeight int) (bool, error)
- func (g *Gnfd) QueryBucketInfo(ctx context.Context, bucket string) (*storagetypes.BucketInfo, error)
- func (g *Gnfd) QueryBucketInfoAndObjectInfo(ctx context.Context, bucket, object string) (*storagetypes.BucketInfo, *storagetypes.ObjectInfo, error)
- func (g *Gnfd) QueryObjectInfo(ctx context.Context, bucket, object string) (*storagetypes.ObjectInfo, error)
- func (g *Gnfd) QueryObjectInfoByID(ctx context.Context, objectID string) (*storagetypes.ObjectInfo, error)
- func (g *Gnfd) QueryPaymentStreamRecord(ctx context.Context, account string) (*paymenttypes.StreamRecord, error)
- func (g *Gnfd) QueryStorageParams(ctx context.Context) (params *storagetypes.Params, err error)
- func (g *Gnfd) QueryStorageParamsByTimestamp(ctx context.Context, timestamp int64) (params *storagetypes.Params, err error)
- func (g *Gnfd) VerifyGetObjectPermission(ctx context.Context, account, bucket, object string) (bool, error)
- func (g *Gnfd) VerifyPutObjectPermission(ctx context.Context, account, bucket, object string) (bool, error)
- type GnfdChainConfig
- type GreenfieldClient
Constants ¶
const ( GreenFieldChain = "GreenfieldChain" // UpdateClientInternal defines the period of updating the best chain client UpdateClientInternal = 60 // ExpectedOutputBlockInternal defines the time of estimating output block time ExpectedOutputBlockInternal = 2 )
Variables ¶
var ( ErrNoSuchBucket = gfsperrors.Register(GreenFieldChain, http.StatusBadRequest, 500001, "no such bucket") ErrSealTimeout = gfsperrors.Register(GreenFieldChain, http.StatusBadRequest, 500002, "seal failed") )
Functions ¶
This section is empty.
Types ¶
type Gnfd ¶
type Gnfd struct {
// contains filtered or unexported fields
}
func NewGnfd ¶
func NewGnfd(cfg *GnfdChainConfig) (*Gnfd, error)
NewGnfd returns the Greenfield instance.
func (*Gnfd) CurrentHeight ¶
CurrentHeight the block height sub one as the stable height.
func (*Gnfd) HasAccount ¶
HasAccount returns an indication of the existence of address.
func (*Gnfd) ListBondedValidators ¶
ListBondedValidators returns the list of bonded validators.
func (*Gnfd) ListenObjectSeal ¶
func (g *Gnfd) ListenObjectSeal(ctx context.Context, objectID uint64, timeoutHeight int) (bool, error)
ListenObjectSeal returns an indication of the object is sealed. TODO:: retrieve service support seal event subscription
func (*Gnfd) QueryBucketInfo ¶
func (g *Gnfd) QueryBucketInfo(ctx context.Context, bucket string) (*storagetypes.BucketInfo, error)
QueryBucketInfo returns the bucket info by name.
func (*Gnfd) QueryBucketInfoAndObjectInfo ¶
func (g *Gnfd) QueryBucketInfoAndObjectInfo(ctx context.Context, bucket, object string) (*storagetypes.BucketInfo, *storagetypes.ObjectInfo, error)
QueryBucketInfoAndObjectInfo returns bucket info and object info, if not found, return the corresponding error code
func (*Gnfd) QueryObjectInfo ¶
func (g *Gnfd) QueryObjectInfo(ctx context.Context, bucket, object string) (*storagetypes.ObjectInfo, error)
QueryObjectInfo returns the object info by name.
func (*Gnfd) QueryObjectInfoByID ¶
func (g *Gnfd) QueryObjectInfoByID(ctx context.Context, objectID string) (*storagetypes.ObjectInfo, error)
QueryObjectInfoByID returns the object info by name.
func (*Gnfd) QueryPaymentStreamRecord ¶
func (g *Gnfd) QueryPaymentStreamRecord(ctx context.Context, account string) (*paymenttypes.StreamRecord, error)
QueryPaymentStreamRecord returns the steam record info by account.
func (*Gnfd) QueryStorageParams ¶
QueryStorageParams returns storage params
func (*Gnfd) QueryStorageParamsByTimestamp ¶
func (g *Gnfd) QueryStorageParamsByTimestamp(ctx context.Context, timestamp int64) (params *storagetypes.Params, err error)
QueryStorageParamsByTimestamp returns storage params by block create time.
type GnfdChainConfig ¶
type GreenfieldClient ¶
type GreenfieldClient struct { Provider string // contains filtered or unexported fields }
GreenfieldClient the greenfield chain client, only use to query.
func (*GreenfieldClient) GnfdClient ¶
func (client *GreenfieldClient) GnfdClient() *chainClient.GreenfieldClient
GnfdClient returns the greenfield chain client.