lotus/documentation/en/storing-data.md

1.6 KiB

Storing Data

There are recent bug reports with these instructions. If you happen to encounter any problems, please create a GitHub issue and a maintainer will address the problem as soon as they can.

Here are instructions for how to store data on the Lotus DevNet.

Adding a file

lotus client import ./your-example-file.txt

Upon success, this command will return a Data CID.

List local files

The command to see a list of files by CID, name, size in bytes, and status:

lotus client local

An example of the output:

bafkreierupr5ioxn4obwly4i2a5cd2rwxqi6kwmcyyylifxjsmos7hrgpe Development/sample-1.txt 2332 ok
bafkreieuk7h4zs5alzpdyhlph4lxkefowvwdho3a3pml6j7dam5mipzaii Development/sample-2.txt 30618 ok

Make a Miner Deal on DevNet

Get a list of all miners that can store data:

lotus state list-miners

Get the requirements of a miner you wish to store data with:

lotus client query-ask <miner>

Store a Data CID with a miner:

lotus client deal <Data CID> <miner> <price> <duration>
# price is in attoFIL/byte/block
# duration is number of blocks.

Upon success, this command will return a Deal CID.

From now on the Data CID is retrievable from the Lotus Storage Miner.

Troubleshooting

WARN  main  lotus/main.go:72  routing: not found
  • This miner is offline.
WARN  main  lotus/main.go:72  failed to start deal: computing commP failed: generating CommP: Piece must be at least 127 bytes
  • There is a minimum file size of 127 bytes.