Documentation ¶
Index ¶
- Constants
- func MakeCid(data []byte) (string, error)
- func NewMsgServerImpl(keeper Keeper) types.MsgServer
- func VerifyDeal(merkle string, hashList string, num int64, item string) bool
- type Keeper
- func (k Keeper) ActiveDeals(c context.Context, req *types.QueryActiveDealRequest) (*types.QueryActiveDealResponse, error)
- func (k Keeper) ActiveDealsAll(c context.Context, req *types.QueryAllActiveDealsRequest) (*types.QueryAllActiveDealsResponse, error)
- func (k Keeper) ActiveProviders(c context.Context, req *types.QueryActiveProvidersRequest) (*types.QueryActiveProvidersResponse, error)
- func (k Keeper) Attest(ctx sdk.Context, cid string, creator string) error
- func (k Keeper) Attestation(c context.Context, req *types.QueryAttestationRequest) (*types.QueryAttestationResponse, error)
- func (k Keeper) AttestationsAll(c context.Context, req *types.QueryAllAttestationsRequest) (*types.QueryAllAttestationsResponse, error)
- func (k Keeper) CanContract(ctx sdk.Context, root string, creator string) error
- func (k Keeper) ClearDeadFiles(ctx sdk.Context)
- func (k Keeper) Contracts(c context.Context, req *types.QueryContractRequest) (*types.QueryContractResponse, error)
- func (k Keeper) ContractsAll(c context.Context, req *types.QueryAllContractsRequest) (*types.QueryAllContractsResponse, error)
- func (k Keeper) DropDeal(ctx sdk.Context, deal types.ActiveDeals, burn bool) error
- func (k Keeper) FidCid(c context.Context, req *types.QueryFidCidRequest) (*types.QueryFidCidResponse, error)
- func (k Keeper) FidCidAll(c context.Context, req *types.QueryAllFidCidRequest) (*types.QueryAllFidCidResponse, error)
- func (k Keeper) FileUploadCheck(c context.Context, req *types.QueryFileUploadCheckRequest) (*types.QueryFileUploadCheckResponse, error)
- func (k Keeper) FindFile(goCtx context.Context, req *types.QueryFindFileRequest) (*types.QueryFindFileResponse, error)
- func (k Keeper) Freespace(goCtx context.Context, req *types.QueryFreespaceRequest) (*types.QueryFreespaceResponse, error)
- func (k Keeper) GetActiveDeals(ctx sdk.Context, cid string) (val types.ActiveDeals, found bool)
- func (k Keeper) GetActiveProviders(ctx sdk.Context, filterAddress string) []types.ActiveProviders
- func (k Keeper) GetAllActiveDeals(ctx sdk.Context) (list []types.ActiveDeals)
- func (k Keeper) GetAllActiveProviders(ctx sdk.Context) (list []types.ActiveProviders)
- func (k Keeper) GetAllAttestation(ctx sdk.Context) (list []types.AttestationForm)
- func (k Keeper) GetAllCollateral(ctx sdk.Context) (list []types.Collateral)
- func (k Keeper) GetAllContracts(ctx sdk.Context) (list []types.Contracts)
- func (k Keeper) GetAllFidCid(ctx sdk.Context) (list []types.FidCid)
- func (k Keeper) GetAllProviders(ctx sdk.Context) (list []types.Providers)
- func (k Keeper) GetAllReport(ctx sdk.Context) (list []types.ReportForm)
- func (k Keeper) GetAllStoragePaymentInfo(ctx sdk.Context) (list []types.StoragePaymentInfo)
- func (k Keeper) GetAllStrays(ctx sdk.Context) (list []types.Strays)
- func (k Keeper) GetAttestationForm(ctx sdk.Context, cid string) (val types.AttestationForm, found bool)
- func (k Keeper) GetClientFreeSpace(goCtx context.Context, req *types.QueryClientFreeSpaceRequest) (*types.QueryClientFreeSpaceResponse, error)
- func (k Keeper) GetCollateral(ctx sdk.Context, address string) (val types.Collateral, found bool)
- func (k Keeper) GetContracts(ctx sdk.Context, cid string) (val types.Contracts, found bool)
- func (k Keeper) GetFidCid(ctx sdk.Context, fid string) (val types.FidCid, found bool)
- func (k Keeper) GetJklPrice(ctx sdk.Context) (price sdk.Dec)
- func (k Keeper) GetPaidAmount(ctx sdk.Context, address string) int64
- func (k Keeper) GetParams(ctx sdk.Context) (p types.Params)
- func (k Keeper) GetPayData(goCtx context.Context, req *types.QueryPayDataRequest) (*types.QueryPayDataResponse, error)
- func (k Keeper) GetProviderDeals(ctx sdk.Context, provider string) int64
- func (k Keeper) GetProviderUsing(ctx sdk.Context, provider string) int64
- func (k Keeper) GetProviders(ctx sdk.Context, address string) (val types.Providers, found bool)
- func (k Keeper) GetReportForm(ctx sdk.Context, cid string) (val types.ReportForm, found bool)
- func (k Keeper) GetStorageCost(ctx sdk.Context, gbs int64, hours int64) sdk.Int
- func (k Keeper) GetStorageCostKbs(ctx sdk.Context, kbs int64, hours int64) sdk.Int
- func (k Keeper) GetStoragePaymentInfo(ctx sdk.Context, address string) (val types.StoragePaymentInfo, found bool)
- func (k Keeper) GetStrays(ctx sdk.Context, cid string) (val types.Strays, found bool)
- func (k Keeper) HandleRewardBlock(ctx sdk.Context) error
- func (k Keeper) InternalRewards(ctx sdk.Context, allDeals []types.ActiveDeals, address sdk.AccAddress) error
- func (k Keeper) KillOldContracts(ctx sdk.Context)
- func (k Keeper) ListFiles(ctx sdk.Context, fid string) []string
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
- func (k Keeper) PaymentInfo(goCtx context.Context, req *types.QueryStoragePaymentInfoRequest) (*types.QueryStoragePaymentInfoResponse, error)
- func (k Keeper) PriceCheck(c context.Context, req *types.QueryPriceCheckRequest) (*types.QueryPriceCheckResponse, error)
- func (k Keeper) Providers(c context.Context, req *types.QueryProviderRequest) (*types.QueryProviderResponse, error)
- func (k Keeper) ProvidersAll(c context.Context, req *types.QueryAllProvidersRequest) (*types.QueryAllProvidersResponse, error)
- func (k Keeper) RemoveActiveDeals(ctx sdk.Context, cid string)
- func (k Keeper) RemoveAllActiveProviders(ctx sdk.Context)
- func (k Keeper) RemoveAllAttestation(ctx sdk.Context)
- func (k Keeper) RemoveAttestation(ctx sdk.Context, cid string)
- func (k Keeper) RemoveCollateral(ctx sdk.Context, address string)
- func (k Keeper) RemoveContracts(ctx sdk.Context, cid string)
- func (k Keeper) RemoveFidCid(ctx sdk.Context, fid string)
- func (k Keeper) RemoveProviders(ctx sdk.Context, address string)
- func (k Keeper) RemoveReport(ctx sdk.Context, cid string)
- func (k Keeper) RemoveStoragePaymentInfo(ctx sdk.Context, address string)
- func (k Keeper) RemoveStrays(ctx sdk.Context, cid string)
- func (k Keeper) Report(ctx sdk.Context, cid string, creator string) error
- func (k Keeper) Reports(c context.Context, req *types.QueryReportRequest) (*types.QueryReportResponse, error)
- func (k Keeper) ReportsAll(c context.Context, req *types.QueryAllReportRequest) (*types.QueryAllReportResponse, error)
- func (k Keeper) RequestAttestation(ctx sdk.Context, cid string, creator string) ([]string, error)
- func (k Keeper) RequestReport(ctx sdk.Context, cid string) ([]string, error)
- func (k Keeper) SetActiveDeals(ctx sdk.Context, activeDeals types.ActiveDeals)
- func (k Keeper) SetActiveProviders(ctx sdk.Context, providers types.ActiveProviders)
- func (k Keeper) SetAttestationForm(ctx sdk.Context, attestation types.AttestationForm)
- func (k Keeper) SetCollateral(ctx sdk.Context, collateral types.Collateral)
- func (k Keeper) SetContracts(ctx sdk.Context, contracts types.Contracts)
- func (k Keeper) SetFidCid(ctx sdk.Context, fidCid types.FidCid)
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params)
- func (k Keeper) SetProviders(ctx sdk.Context, providers types.Providers)
- func (k Keeper) SetReportForm(ctx sdk.Context, report types.ReportForm)
- func (k Keeper) SetStoragePaymentInfo(ctx sdk.Context, payInfo types.StoragePaymentInfo)
- func (k Keeper) SetStrays(ctx sdk.Context, strays types.Strays)
- func (k Keeper) StoragePaymentInfo(c context.Context, req *types.QueryStoragePaymentInfoRequest) (*types.QueryStoragePaymentInfoResponse, error)
- func (k Keeper) StoragePaymentInfoAll(c context.Context, req *types.QueryAllStoragePaymentInfoRequest) (*types.QueryAllStoragePaymentInfoResponse, error)
- func (k Keeper) StorageStats(c context.Context, req *types.QueryStorageStatsRequest) (*types.QueryStorageStatsResponse, error)
- func (k Keeper) StoreCount(goCtx context.Context, req *types.QueryStoreCountRequest) (*types.QueryStoreCountResponse, error)
- func (k Keeper) Strays(c context.Context, req *types.QueryStrayRequest) (*types.QueryStrayResponse, error)
- func (k Keeper) StraysAll(c context.Context, req *types.QueryAllStraysRequest) (*types.QueryAllStraysResponse, error)
- func (k Keeper) UpgradeStorage(goCtx context.Context, msg *types.MsgUpgradeStorage) (*types.MsgUpgradeStorageResponse, error)
- type Migrator
Constants ¶
const (
Rounds = 20
)
const (
True = "true"
)
Variables ¶
This section is empty.
Functions ¶
func NewMsgServerImpl ¶
NewMsgServerImpl returns an implementation of the MsgServer interface for the provided Keeper.
Types ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
func NewKeeper ¶
func NewKeeper( cdc codec.BinaryCodec, storeKey sdk.StoreKey, ps paramtypes.Subspace, bankkeeper types.BankKeeper, accountkeeper types.AccountKeeper, oraclekeeper types.OracleKeeper, ) *Keeper
func (Keeper) ActiveDeals ¶
func (k Keeper) ActiveDeals(c context.Context, req *types.QueryActiveDealRequest) (*types.QueryActiveDealResponse, error)
func (Keeper) ActiveDealsAll ¶
func (k Keeper) ActiveDealsAll(c context.Context, req *types.QueryAllActiveDealsRequest) (*types.QueryAllActiveDealsResponse, error)
func (Keeper) ActiveProviders ¶
func (k Keeper) ActiveProviders(c context.Context, req *types.QueryActiveProvidersRequest) (*types.QueryActiveProvidersResponse, error)
func (Keeper) Attestation ¶
func (k Keeper) Attestation(c context.Context, req *types.QueryAttestationRequest) (*types.QueryAttestationResponse, error)
func (Keeper) AttestationsAll ¶
func (k Keeper) AttestationsAll(c context.Context, req *types.QueryAllAttestationsRequest) (*types.QueryAllAttestationsResponse, error)
func (Keeper) CanContract ¶
func (Keeper) ClearDeadFiles ¶
func (Keeper) Contracts ¶
func (k Keeper) Contracts(c context.Context, req *types.QueryContractRequest) (*types.QueryContractResponse, error)
func (Keeper) ContractsAll ¶
func (k Keeper) ContractsAll(c context.Context, req *types.QueryAllContractsRequest) (*types.QueryAllContractsResponse, error)
func (Keeper) FidCid ¶
func (k Keeper) FidCid(c context.Context, req *types.QueryFidCidRequest) (*types.QueryFidCidResponse, error)
func (Keeper) FidCidAll ¶
func (k Keeper) FidCidAll(c context.Context, req *types.QueryAllFidCidRequest) (*types.QueryAllFidCidResponse, error)
func (Keeper) FileUploadCheck ¶
func (k Keeper) FileUploadCheck(c context.Context, req *types.QueryFileUploadCheckRequest) (*types.QueryFileUploadCheckResponse, error)
func (Keeper) FindFile ¶
func (k Keeper) FindFile(goCtx context.Context, req *types.QueryFindFileRequest) (*types.QueryFindFileResponse, error)
func (Keeper) Freespace ¶
func (k Keeper) Freespace(goCtx context.Context, req *types.QueryFreespaceRequest) (*types.QueryFreespaceResponse, error)
func (Keeper) GetActiveDeals ¶
GetActiveDeals returns a activeDeals from its index
func (Keeper) GetActiveProviders ¶
GetActiveProviders returns a list of recently active providers in a random order
func (Keeper) GetAllActiveDeals ¶
func (k Keeper) GetAllActiveDeals(ctx sdk.Context) (list []types.ActiveDeals)
GetAllActiveDeals returns all activeDeals
func (Keeper) GetAllActiveProviders ¶
func (k Keeper) GetAllActiveProviders(ctx sdk.Context) (list []types.ActiveProviders)
GetAllActiveProviders returns all providers
func (Keeper) GetAllAttestation ¶
func (k Keeper) GetAllAttestation(ctx sdk.Context) (list []types.AttestationForm)
GetAllAttestation returns all attestations
func (Keeper) GetAllCollateral ¶
func (k Keeper) GetAllCollateral(ctx sdk.Context) (list []types.Collateral)
GetAllCollateral returns all collaterals
func (Keeper) GetAllContracts ¶
GetAllContracts returns all contracts
func (Keeper) GetAllFidCid ¶
GetAllFidCid returns all fidCid
func (Keeper) GetAllProviders ¶
GetAllProviders returns all providers
func (Keeper) GetAllReport ¶
func (k Keeper) GetAllReport(ctx sdk.Context) (list []types.ReportForm)
GetAllReport returns all reports
func (Keeper) GetAllStoragePaymentInfo ¶
func (k Keeper) GetAllStoragePaymentInfo(ctx sdk.Context) (list []types.StoragePaymentInfo)
GetAllStoragePaymentInfo returns all payBlocks
func (Keeper) GetAllStrays ¶
GetAllStrays returns all strays
func (Keeper) GetAttestationForm ¶
func (k Keeper) GetAttestationForm( ctx sdk.Context, cid string, ) (val types.AttestationForm, found bool)
GetAttestationForm returns an attestation from its index
func (Keeper) GetClientFreeSpace ¶
func (k Keeper) GetClientFreeSpace(goCtx context.Context, req *types.QueryClientFreeSpaceRequest) (*types.QueryClientFreeSpaceResponse, error)
func (Keeper) GetCollateral ¶
func (k Keeper) GetCollateral( ctx sdk.Context, address string, ) (val types.Collateral, found bool)
GetCollateral returns a collateral from its index
func (Keeper) GetContracts ¶
GetContracts returns a contracts from its index
func (Keeper) GetJklPrice ¶
GetJklPrice uses oracle module to get jkl price Returns 0.20 if feed doesn't exist or failed to unmarshal data Unmarshal failure is logged
func (Keeper) GetPayData ¶
func (k Keeper) GetPayData(goCtx context.Context, req *types.QueryPayDataRequest) (*types.QueryPayDataResponse, error)
func (Keeper) GetProviderDeals ¶
func (Keeper) GetProviderUsing ¶
func (Keeper) GetProviders ¶
GetProviders returns a providers from its index
func (Keeper) GetReportForm ¶
GetReportForm returns a report from its index
func (Keeper) GetStorageCost ¶
GetStorageCost calculates storage cost in ujkl Uses gigabytes and months to calculate how much user has to pay
func (Keeper) GetStorageCostKbs ¶
GetStorageCostKbs calculates storage cost in ujkl Uses kilobytes and months to calculate how much user has to pay
func (Keeper) GetStoragePaymentInfo ¶
func (k Keeper) GetStoragePaymentInfo( ctx sdk.Context, address string, ) (val types.StoragePaymentInfo, found bool)
GetStoragePaymentInfo returns StoragePaymentInfo from its address
func (Keeper) InternalRewards ¶
func (k Keeper) InternalRewards(ctx sdk.Context, allDeals []types.ActiveDeals, address sdk.AccAddress) error
func (Keeper) KillOldContracts ¶
func (Keeper) Params ¶
func (k Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
func (Keeper) PaymentInfo ¶
func (k Keeper) PaymentInfo(goCtx context.Context, req *types.QueryStoragePaymentInfoRequest) (*types.QueryStoragePaymentInfoResponse, error)
func (Keeper) PriceCheck ¶
func (k Keeper) PriceCheck(c context.Context, req *types.QueryPriceCheckRequest) (*types.QueryPriceCheckResponse, error)
func (Keeper) Providers ¶
func (k Keeper) Providers(c context.Context, req *types.QueryProviderRequest) (*types.QueryProviderResponse, error)
func (Keeper) ProvidersAll ¶
func (k Keeper) ProvidersAll(c context.Context, req *types.QueryAllProvidersRequest) (*types.QueryAllProvidersResponse, error)
func (Keeper) RemoveActiveDeals ¶
RemoveActiveDeals removes a activeDeals from the store
func (Keeper) RemoveAllActiveProviders ¶
RemoveAllActiveProviders removes all active providers
func (Keeper) RemoveAllAttestation ¶
RemoveAllAttestation removes all attestations
func (Keeper) RemoveAttestation ¶
RemoveAttestation removes an attestation from the store
func (Keeper) RemoveCollateral ¶
RemoveCollateral removes a collateral from the store
func (Keeper) RemoveContracts ¶
RemoveContracts removes a contracts from the store
func (Keeper) RemoveFidCid ¶
RemoveFidCid removes a fidCid from the store
func (Keeper) RemoveProviders ¶
RemoveProviders removes a providers from the store
func (Keeper) RemoveReport ¶
RemoveReport removes an attestation from the store
func (Keeper) RemoveStoragePaymentInfo ¶
RemoveStoragePaymentInfo removes a StoragePaymentInfo from the store
func (Keeper) RemoveStrays ¶
RemoveStrays removes a strays from the store
func (Keeper) Reports ¶
func (k Keeper) Reports(c context.Context, req *types.QueryReportRequest) (*types.QueryReportResponse, error)
func (Keeper) ReportsAll ¶
func (k Keeper) ReportsAll(c context.Context, req *types.QueryAllReportRequest) (*types.QueryAllReportResponse, error)
func (Keeper) RequestAttestation ¶
func (Keeper) RequestReport ¶
func (Keeper) SetActiveDeals ¶
func (k Keeper) SetActiveDeals(ctx sdk.Context, activeDeals types.ActiveDeals)
SetActiveDeals set a specific activeDeals in the store from its index
func (Keeper) SetActiveProviders ¶
func (k Keeper) SetActiveProviders(ctx sdk.Context, providers types.ActiveProviders)
SetActiveProviders set a specific providers in the store from its index
func (Keeper) SetAttestationForm ¶
func (k Keeper) SetAttestationForm(ctx sdk.Context, attestation types.AttestationForm)
SetAttestationForm sets a specific attestation in the store from its index
func (Keeper) SetCollateral ¶
func (k Keeper) SetCollateral(ctx sdk.Context, collateral types.Collateral)
SetCollateral sets a specific collateral in the store from its index
func (Keeper) SetContracts ¶
SetContracts set a specific contracts in the store from its index
func (Keeper) SetProviders ¶
SetProviders set a specific providers in the store from its index
func (Keeper) SetReportForm ¶
func (k Keeper) SetReportForm(ctx sdk.Context, report types.ReportForm)
SetReportForm sets a specific report in the store from its index
func (Keeper) SetStoragePaymentInfo ¶
func (k Keeper) SetStoragePaymentInfo(ctx sdk.Context, payInfo types.StoragePaymentInfo)
SetStoragePaymentInfo set a specific payBlocks in the store from its x
func (Keeper) StoragePaymentInfo ¶
func (k Keeper) StoragePaymentInfo(c context.Context, req *types.QueryStoragePaymentInfoRequest) (*types.QueryStoragePaymentInfoResponse, error)
func (Keeper) StoragePaymentInfoAll ¶
func (k Keeper) StoragePaymentInfoAll(c context.Context, req *types.QueryAllStoragePaymentInfoRequest) (*types.QueryAllStoragePaymentInfoResponse, error)
func (Keeper) StorageStats ¶
func (k Keeper) StorageStats(c context.Context, req *types.QueryStorageStatsRequest) (*types.QueryStorageStatsResponse, error)
func (Keeper) StoreCount ¶
func (k Keeper) StoreCount(goCtx context.Context, req *types.QueryStoreCountRequest) (*types.QueryStoreCountResponse, error)
func (Keeper) Strays ¶
func (k Keeper) Strays(c context.Context, req *types.QueryStrayRequest) (*types.QueryStrayResponse, error)
func (Keeper) StraysAll ¶
func (k Keeper) StraysAll(c context.Context, req *types.QueryAllStraysRequest) (*types.QueryAllStraysResponse, error)
func (Keeper) UpgradeStorage ¶
func (k Keeper) UpgradeStorage(goCtx context.Context, msg *types.MsgUpgradeStorage) (*types.MsgUpgradeStorageResponse, error)
type Migrator ¶
type Migrator struct {
// contains filtered or unexported fields
}
Migrator is a struct for handling in-place store migrations.
func NewMigrator ¶
NewMigrator returns a new Migrator
func (Migrator) Migrate1to2 ¶
Migrate1to2 migrates from version 1 to 2.
func (Migrator) Migrate2to3 ¶
Migrate2to3 migrates from version 2 to 3.
func (Migrator) Migrate3to4 ¶
Migrate3to4 migrates from version 3 to 4.
Source Files ¶
- active_deals.go
- attestations.go
- collateral.go
- contract_killing.go
- contracts.go
- fid_cid.go
- grpc_query.go
- grpc_query_active_deals.go
- grpc_query_attestation.go
- grpc_query_contracts.go
- grpc_query_fid_cid.go
- grpc_query_file_upload_check.go
- grpc_query_find_file.go
- grpc_query_freespace.go
- grpc_query_get_client_free_space.go
- grpc_query_get_pay_data.go
- grpc_query_params.go
- grpc_query_pay_info.go
- grpc_query_payment_info.go
- grpc_query_price_check.go
- grpc_query_providers.go
- grpc_query_report.go
- grpc_query_storage_stats.go
- grpc_query_strays.go
- keeper.go
- migrations.go
- msg_server.go
- msg_server_attest.go
- msg_server_buy_storage.go
- msg_server_cancel_contract.go
- msg_server_claim_stray.go
- msg_server_init_provider.go
- msg_server_post_contract.go
- msg_server_postproof.go
- msg_server_provider_claim.go
- msg_server_report.go
- msg_server_set_provider_ip.go
- msg_server_set_provider_keybase.go
- msg_server_set_provider_totalspace.go
- msg_server_sign_contract.go
- msg_server_upgrade_storage.go
- params.go
- payment_info.go
- providers.go
- reports.go
- rewards.go
- strays.go
- utils.go