The storage-provider command

Under the storage-provider subcommand Storage Provider related extrinsics are available. This chapter covers the provided commands and how to use them.

The storagext-cli getting started page covers the basic flags necessary to operate the CLI and should be read first.

register

The register command registers as a storage provider. Before a user can start providing storage, they need to register to be able to deal with the clients and perform any storage provider duties.

Parameters

NameDescriptionType
PEER_IDThe peer ID under which the registered provider will be trackedString
POST_PROOFThe proof type that the provider will use to prove storage (Default: 2KiB)String

Example

Registering the provider with the specific peer_id

storagext-cli --sr25519-key <key> storage-provider register <peer_id>

More information about the register extrinsic is available in Pallets/Storage Provider/Register.

pre-commit

The pre-commit command pre-commits a sector with deals that have been published by market publish-storage-deals. The pre-committed sector has to be proven or the deals will not activate and will be slashed.

Parameters

NameDescriptionType
PRE_COMMIT_SECTORSThe sector we are committing toJSON object. Can be passed as a string, or as a file path prefixed with @ pointing to the file containing the JSON object.

The PRE_COMMIT_SECTORS JSON object has the following structure:

NameDescription
sector_numberSector number
sealed_cidByte encoded CID
deal_idsList of deal IDs
expirationSector expiration
unsealed_cidByte encoded CID
seal_proofSector seal proof
seal_randomness_heightThe block number used in the PoRep proof

Example

Pre-commits a sector with specified deals.

storagext-cli --sr25519-key <key> storage-provider pre-commit \
    "@pre-commit-sector.json"

Where pre-commit-sector.json is a file with contents similar to:

[
  {
    "sector_number": 0,
    "sealed_cid": "bafk2bzaceajreoxfdcpdvitpvxm7vkpvcimlob5ejebqgqidjkz4qoug4q6zu",
    "deal_ids": [0],
    "expiration": 100,
    "unsealed_cid": "bafkreibme22gw2h7y2h7tg2fhqotaqjucnbc24deqo72b6mkl2egezxhvy",
    "seal_proof": "StackedDRG2KiBV1P1",
    "seal_randomness_height": 85
  }
]

More information about the pre_commit extrinsic is available in Pallets/Storage Provider/Pre-commit sector.

prove-commit

The prove-commit command proves a sector commitment. Currently, any proof that is a hex encoded string of length >= 1 is accepted. After the sector is proven, the deals will become Active.

Parameters

NameDescriptionType
PROVE_COMMIT_SECTORSThe sector we are provingJSON object. Can be passed as a string, or as a file path prefixed with @ pointing to the file containing the JSON object.

The PROVE_COMMIT_SECTORS JSON object has the following structure:

NameDescription
sector_numberSector number
proofHex encoded proof

Example

Proves a sector commitment.

storagext-cli --sr25519-key <key> storage-provider prove-commit \
    "@prove-commit-sector.json"

Where prove-commit-sector.json is a file with contents similar to:

[
  {
    "sector_number": 0,
    "proof": "beef"
  }
]

More information about prove_commit extrinsic is available in Pallets/Storage Provider/Prove-commit sector.

submit-windowed-post

The submit-windowed-post command submits a windowed PoSt proof. The post proof needs to be periodically submitted to prove that some sector is still stored. Sectors are proven in batches called partitions.

Parameters

NameDescriptionType
WINDOWED_POSTThe proof for some partitionJSON object. Can be passed as a string, or as a file path prefixed with @ pointing to the file containing the JSON object.

The WINDOWED_POST JSON object has the following structure:

NameDescription
deadlineDeadline ID
partitionPartition ID
PROOFJSON object

The PROOF JSON object has the following structure:

NameDescription
post_proofProof type ("2KiB" or "StackedDRGWindow2KiBV1P1")
proof_bytesHex encoded proof

Example

Proves partitions in a specific deadline.

storagext-cli --sr25519-key <key> storage-provider submit-windowed-post \
    "@window-proof.json"

Where window-proof.json is a file with contents similar to:

{
  "deadline": 0,
  "partitions": [0],
  "proof": {
    "post_proof": "2KiB",
    "proof_bytes": "07482439"
  }
}

More information about the submit_windowed_post extrinsic is available in Pallets/Storage Provider/Submit Windowed Post.

declare-faults

The declare-faults command declares faulty sectors. This is required to avoid penalties for not submitting Window PoSt at the required time.

Parameters

NameDescriptionType
FAULTSList of declared faultsJSON array. Can be passed as a string, or as a file path prefixed with @ pointing to the file containing the JSON array.

The FAULTS JSON object has the following structure:

NameDescription
deadlineDeadline ID
partitionPartition ID
sectorsFaulty sectors IDs

Example

Declares a list of faulty sectors in a specific deadline and partition.

storagext-cli --sr25519-key <key> storage-provider declare-faults \
    "@faults.json"

Where faults.json is a file with contents similar to:

[
  {
    "deadline": 0,
    "partition": 0,
    "sectors": [0]
  }
]

More information about the declare_faults extrinsic is available in Pallets/Storage Provider/Declare Faults.

declare-faults-recovered

The declare-faults-recovered command declares recovered faulty sectors.

Parameters

NameDescriptionType
RECOVERIESList of declared recoveriesJSON array. Can be passed as a string, or as a file path prefixed with @ pointing to the file containing the JSON array.

The RECOVERIES JSON object has the following structure:

NameDescription
deadlineDeadline ID
partitionPartition ID
sectorsFaulty sectors IDs

Example

Declares a list of sectors as recovered in a specific deadline and partition.

storagext-cli --sr25519-key <key> storage-provider declare-faults-recovered \
    "@recoveries.json"

Where recoveries.json is a file with contents similar to:

[
  {
    "deadline": 0,
    "partition": 0,
    "sectors": [0]
  }
]

More information about the declare_faults_recovered extrinsic is available in Pallets/Storage Provider/Declare Faults Recovered.

terminate-sectors

The terminate-sectors command terminates sectors and fully removes them.

Parameters

NameDescriptionType
TERMINATIONSList of declared TERMINATIONSJSON array. Can be passed as a string, or as a file path prefixed with @ pointing to the file containing the JSON array.

The RECOVERIES JSON object has the following structure:

NameDescription
deadlineDeadline ID
partitionPartition ID
sectorsIDs of sectors to be terminated

Example

Declares a list of sectors as recovered in a specific deadline and partition.

storagext-cli --sr25519-key <key> storage-provider terminate-sectors \
    "@terminations.json"

Where terminations.json is a file with contents similar to:

[
  {
    "deadline": 0,
    "partition": 0,
    "sectors": [0]
  }
]

More information about the terminate_sectors extrinsic is available in Pallets/Storage Provider/Terminate Sectors.

retrieve-storage-providers

The retrieve-storage-providers command retrieves all registered storage providers.

Example

Retrieving all registered storage providers

storagext-cli storage-provider retrieve-storage-providers

This command is not signed, and does not need to be called using any of the --X-key flags.