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.
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
| Name | Description | Type |
|---|---|---|
PEER_ID | The peer ID under which the registered provider will be tracked | String |
POST_PROOF | The 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
registerextrinsic 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
| Name | Description | Type |
|---|---|---|
PRE_COMMIT_SECTORS | The sector we are committing to | JSON 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:
| Name | Description |
|---|---|
sector_number | Sector number |
sealed_cid | Byte encoded CID |
deal_ids | List of deal IDs |
expiration | Sector expiration |
unsealed_cid | Byte encoded CID |
seal_proof | Sector seal proof |
seal_randomness_height | The 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_commitextrinsic 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
| Name | Description | Type |
|---|---|---|
PROVE_COMMIT_SECTORS | The sector we are proving | JSON 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:
| Name | Description |
|---|---|
sector_number | Sector number |
proof | Hex 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_commitextrinsic 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
| Name | Description | Type |
|---|---|---|
WINDOWED_POST | The proof for some partition | JSON 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:
| Name | Description |
|---|---|
deadline | Deadline ID |
partition | Partition ID |
PROOF | JSON object |
The PROOF JSON object has the following structure:
| Name | Description |
|---|---|
post_proof | Proof type ("2KiB" or "StackedDRGWindow2KiBV1P1") |
proof_bytes | Hex 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_postextrinsic 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
| Name | Description | Type |
|---|---|---|
FAULTS | List of declared faults | JSON 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:
| Name | Description |
|---|---|
deadline | Deadline ID |
partition | Partition ID |
sectors | Faulty 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_faultsextrinsic is available in Pallets/Storage Provider/Declare Faults.
declare-faults-recovered
The declare-faults-recovered command declares recovered faulty sectors.
Parameters
| Name | Description | Type |
|---|---|---|
RECOVERIES | List of declared recoveries | JSON 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:
| Name | Description |
|---|---|
deadline | Deadline ID |
partition | Partition ID |
sectors | Faulty 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_recoveredextrinsic is available in Pallets/Storage Provider/Declare Faults Recovered.
terminate-sectors
The terminate-sectors command terminates sectors and fully removes them.
Parameters
| Name | Description | Type |
|---|---|---|
TERMINATIONS | List of declared TERMINATIONS | JSON 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:
| Name | Description |
|---|---|
deadline | Deadline ID |
partition | Partition ID |
sectors | IDs 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_sectorsextrinsic 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-keyflags.