BTFS

The BTFS Developer Hub

Welcome to the BTFS developer hub. You'll find comprehensive guides and documentation to help you start working with BTFS as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started    

List Host contracts


Viewing Contract Details

As a host in the BTFS network, you can view a list of all active contracts. In the terminal, run the btfs storage contracts list host command:

// Retrieve list of contracts your node stores as a host

btfs storage contracts list host


// Output

{
  "contracts": [
    {
      "contract_id": "3223022b-8aa6-482d-84fa-1cecffdaa765,249e3a07-6734-42e8-8105-09b3f3503d16",
      "host_id": "16Uiu2HAm3Sdp1234XcSAz1234oHBM4321gHbS112345Gsb1nN6hj",
      "renter_id": "16Uiu212345Ga3p12345mWAKs12345Nt554321d6uAuTUrJRxxQ5B",
      "status": 0,
      "start_time": "2020-04-25T23:02:33.167313Z",
      "end_time": "2020-05-25T23:02:33.167313Z",
      "next_escrow_time": "0001-01-01T00:00:00Z",
      "compensation_paid": 0,
      "compensation_outstanding": 0,
      "unit_price": 250000,
      "shard_size": 17179,
      "shard_hash": "QmRACVKCvPtvpq77cxSekTEgPPCKJULSDvbxCAzoYyhQEU",
      "file_hash": "QmZdatooDNrAvQ8CSvdBsnXjnbhffw8wAgn9sRyvYPwqaq"
    },
   
   ...
   
    {
      "contract_id": "3223022b-8aa6-482d-84fa-1cecffdaa765,ee9545c7-d686-4d00-bd8d-1718dbaa80b1",
      "host_id": "16Uiu2HAmEQu5R829qwziii9HgS9tydfH7WsKvG3V1ZGbpiM36LEn",
      "renter_id": "16Uiu2HAmEaGa3pxCqKSmWAKsZVgQJNt5V4nkMd6uAuTUrJRxxQ5B",
      "status": 0,
      "start_time": "2020-04-25T23:17:32.656925Z",
      "end_time": "2020-05-25T23:17:32.656925Z",
      "next_escrow_time": "0001-01-01T00:00:00Z",
      "compensation_paid": 0,
      "compensation_outstanding": 0,
      "unit_price": 250000,
      "shard_size": 17179,
      "shard_hash": "QmfP4qbuLo32ra8u48JwzTJJ14ipvjfkyoJwyLgZQxe6Bs",
      "file_hash": "QmZdatooDNrAvQ8CSvdBsnXjnbhffw8wAgn9sRyvYPwqaq"
    }
  ]
}

The output parameters contain the following details:

  • contract_id: The ID for the file shard contract.
  • host_id: The peer ID for the BTFS host storing the file shard.
  • renter_id: The peer ID for the BTFS renter who uploaded the file shard.
  • start_time: The contract start time.
  • end_time: The contract completion time.
  • next_escrow_time: The next payment time.
  • compensation_paid: Total BTT paid in contract.
  • compensation_outstanding: Outstanding BTT payments remaining in the contract.
  • unit_price: The price in μBTT (10^-6 BTT) of renting 1 GiB/day of storage space.
  • shard_size: The size of the file shard, in bytes.
  • shard_hash: The SHA-256 hash value of the file shard.
  • file_hash: The SHA-256 hash value of the file.

Updated about 15 hours ago

List Host contracts


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.