Documentation
¶
Index ¶
- func ConstructModule(coreCfg *core.Config) fx.Option
- type API
- func (api *API) Deposit(ctx context.Context, amount sdktypes.Coin, cfg *txclient.TxConfig) error
- func (api *API) Download(ctx context.Context, blobID appfibre.BlobID) (*GetBlobResult, error)
- func (api *API) PendingWithdrawals(ctx context.Context, signer string) ([]fibre.PendingWithdrawal, error)
- func (api *API) QueryEscrowAccount(ctx context.Context, signer string) (*fibre.EscrowAccount, error)
- func (api *API) Submit(ctx context.Context, ns libshare.Namespace, data []byte, ...) (*SubmitResult, error)
- func (api *API) Upload(ctx context.Context, ns libshare.Namespace, data []byte, ...) (*UploadResult, error)
- func (api *API) Withdraw(ctx context.Context, amount sdktypes.Coin, cfg *txclient.TxConfig) error
- type GetBlobResult
- type Module
- type PaymentPromise
- type SubmitResult
- type UploadResult
- type ValidatorSignature
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type API ¶
type API struct {
Internal struct {
Submit func(
context.Context,
libshare.Namespace,
[]byte,
*txclient.TxConfig,
) (*SubmitResult, error) `perm:"write"`
Upload func(
ctx context.Context,
ns libshare.Namespace,
data []byte,
config *txclient.TxConfig,
) (*UploadResult, error) `perm:"write"`
Download func(
ctx context.Context,
blobID appfibre.BlobID,
) (*GetBlobResult, error) `perm:"read"`
QueryEscrowAccount func(
ctx context.Context,
signer string,
) (*fibre.EscrowAccount, error) `perm:"read"`
Deposit func(
ctx context.Context,
amount sdktypes.Coin,
cfg *txclient.TxConfig,
) error `perm:"write"`
Withdraw func(
ctx context.Context,
amount sdktypes.Coin,
cfg *txclient.TxConfig,
) error `perm:"write"`
PendingWithdrawals func(
ctx context.Context,
signer string,
) ([]fibre.PendingWithdrawal, error) `perm:"read"`
}
}
API is a wrapper around Module for the RPC.
func (*API) PendingWithdrawals ¶
func (*API) QueryEscrowAccount ¶
type GetBlobResult ¶
type GetBlobResult struct {
Data []byte `json:"data"`
}
GetBlobResult holds a blob reconstructed from FSPs.
type Module ¶
type Module interface {
// Submit runs the full flow: upload to FSPs, aggregate validator signatures,
// and settle MsgPayForFibre on-chain. Requires a Fibre-capable core endpoint.
Submit(context.Context, libshare.Namespace, []byte, *txclient.TxConfig) (*SubmitResult, error)
// Upload does the off-chain half (encode, promise, upload, aggregate
// signatures) and then sumbits MsgPayForFibre on-chain
// asynchronously in the background. Use Submit for the full flow.
Upload(context.Context, libshare.Namespace, []byte, *txclient.TxConfig) (*UploadResult, error)
// Download reconstructs a blob from FSPs by blobID.
Download(context.Context, appfibre.BlobID) (*GetBlobResult, error)
// QueryEscrowAccount returns the escrow account for the given signer.
QueryEscrowAccount(_ context.Context, signer string) (*fibre.EscrowAccount, error)
// Deposit adds funds to the node's escrow account.
Deposit(context.Context, sdktypes.Coin, *txclient.TxConfig) error
// Withdraw requests a withdrawal; funds unbond before becoming claimable.
Withdraw(context.Context, sdktypes.Coin, *txclient.TxConfig) error
// PendingWithdrawals returns not-yet-claimable withdrawals for the signer.
PendingWithdrawals(_ context.Context, signer string) ([]fibre.PendingWithdrawal, error)
}
Module is the RPC API for the Fibre network: off-chain blob storage via Fibre Storage Providers (FSPs) with on-chain payment settlement. Only v0 blobs are supported for now. The signer for escrow/settlement operations is resolved from the TxConfig (SignerAddress or KeyName), falling back to the node's default account.
type PaymentPromise ¶
type PaymentPromise struct {
ChainID string `json:"chain_id"`
Namespace libshare.Namespace `json:"namespace"`
BlobSize uint32 `json:"blob_size"`
Commitment appfibre.Commitment `json:"commitment"`
RowVersion uint32 `json:"row_version"`
ValsetHeight uint64 `json:"valset_height"`
CreationTimestamp time.Time `json:"creation_timestamp"`
Signature []byte `json:"signature"`
}
PaymentPromise is the signed user↔network promise, settled on-chain via MsgPayForFibre.
type SubmitResult ¶
type SubmitResult struct {
UploadResult
Height uint64 `json:"height"`
TxHash string `json:"tx_hash"`
}
SubmitResult is an UploadResult plus the on-chain inclusion details of its settlement.
type UploadResult ¶
type UploadResult struct {
BlobID appfibre.BlobID `json:"blob_id"`
ValidatorSignatures []ValidatorSignature `json:"validator_signatures"`
PaymentPromise *PaymentPromise `json:"payment_promise,omitempty"`
}
UploadResult is returned by an off-chain Fibre upload; PaymentPromise can later settle it on-chain via MsgPayForFibre.
type ValidatorSignature ¶
type ValidatorSignature []byte
ValidatorSignature is a validator's blob-availability attestation.