2019-12-01 08:21:20 +00:00
# Storing Data
2019-12-18 21:46:09 +00:00
> There are recent bug reports with these instructions. If you happen to encounter any problems, please create a [GitHub issue](https://github.com/filecoin-project/lotus/issues/new) and a maintainer will address the problem as soon as they can.
2019-12-06 15:26:03 +00:00
2019-12-18 18:46:11 +00:00
Here are instructions for how to store data on the **Lotus Testnet** .
2019-12-06 15:26:03 +00:00
2019-12-11 15:38:04 +00:00
## Adding a file locally
2019-12-18 18:46:11 +00:00
Adding a file locally allows you to make miner deals on the **Lotus Testnet** .
2019-12-06 15:26:03 +00:00
```sh
lotus client import ./your-example-file.txt
```
Upon success, this command will return a **Data CID** .
2019-12-11 15:38:04 +00:00
## List your local files
2019-12-06 15:26:03 +00:00
2019-12-18 21:46:09 +00:00
The command to see a list of files by `CID` , `name` , `size` in bytes, and `status` :
2019-12-06 15:26:03 +00:00
```sh
lotus client local
```
An example of the output:
```sh
bafkreierupr5ioxn4obwly4i2a5cd2rwxqi6kwmcyyylifxjsmos7hrgpe Development/sample-1.txt 2332 ok
bafkreieuk7h4zs5alzpdyhlph4lxkefowvwdho3a3pml6j7dam5mipzaii Development/sample-2.txt 30618 ok
```
2019-12-18 18:46:11 +00:00
## Make a Miner Deal on Lotus Testnet
2019-12-06 15:26:03 +00:00
Get a list of all miners that can store data:
```sh
lotus state list-miners
```
Get the requirements of a miner you wish to store data with:
2019-12-01 08:21:20 +00:00
```sh
2019-12-06 15:26:03 +00:00
lotus client query-ask < miner >
2019-12-01 08:21:20 +00:00
```
2019-12-06 15:26:03 +00:00
Store a **Data CID** with a miner:
2019-12-01 08:21:20 +00:00
```sh
2019-12-06 15:26:03 +00:00
lotus client deal < Data CID > < miner > < price > < duration >
2019-12-01 08:21:20 +00:00
```
2020-01-29 08:51:05 +00:00
Check the status of a deal:
```sh
lotus client list-deals
```
2019-12-18 21:46:09 +00:00
- The `duration` , which represents how long the miner will keep your file hosted, is represented in blocks. Each block represents 45 seconds.
2019-12-06 15:26:03 +00:00
2019-12-18 18:40:47 +00:00
Upon success, this command will return a **Deal CID** .
2019-12-06 15:26:03 +00:00
2019-12-18 21:46:09 +00:00
The storage miner will need to **seal** the file before it can be retrieved. If the **Lotus Storage Miner** is not running on a machine designed for sealing, the process will take a very long time.