Skip to main content

Getting started

This guide takes you from an empty wallet to a stored file and a published website, on IOTA testnet.

1. Install an IOTA wallet​

You need an IOTA wallet in your browser, for example the IOTA Wallet browser extension. Create an account and switch the wallet to testnet.

You only need this wallet: you pay in IOTA and sign with it. There is no other token and no other chain involved.

2. Get testnet IOTA​

Testnet IOTA has no value and comes from the faucet:

  1. Copy your address from the wallet.
  2. Open faucet.testnet.iota.cafe, paste the address and solve the captcha.

The faucet only works from its web page. One request is more than enough to try everything here. For reference, with the current test prices:

  • storing a small file for a few epochs costs a few thousand nanos of IOTA (1 IOTA is 10⁹ nanos) plus about 0.006 IOTA of gas;
  • publishing a small site costs a few hundredths of an IOTA, almost all of it a deposit that comes back when you destroy the site.

See Economics for the details.

3. Connect the wallet to the app​

Open app.iotastorage.com and connect your wallet. The app has three sections:

SectionWhat you do there
Publish a siteChoose or drag a folder, review its files, the number of epochs and the estimated cost, and publish it as a site (or update one of yours), paying in IOTA from your wallet.
My sitesThe Site objects of your wallet, with their URL. You can update, renew or destroy each one.
My blobsStore a file as a blob, and list the blobs of your wallet to renew or delete them.

Every operation is an IOTA transaction that you approve in your wallet; your keys stay in the wallet.

4. Store a file​

  1. Go to My blobs and choose a file under Store a file.
  2. Choose for how many epochs to store it (1 to 53; on testnet an epoch is 1 day) and whether it is deletable.
  3. Approve the transactions in your wallet. The app encodes the file in your browser and registers and pays for the blob on IOTA. The slivers are stored on the storage nodes and, once the nodes confirm, the blob is certified on IOTA.

When it finishes you get the blob ID, a link to read it from the aggregator and what it cost. The blob now appears in your list, where you can renew it or, if it is deletable, delete it.

5. Read it through the aggregator​

Anyone can read a blob through the public aggregator, by blob ID:

curl -o my-file https://aggregator.iotastorage.com/v1/blobs/<blob ID>

or by the ID of its Blob object:

curl -o my-file https://aggregator.iotastorage.com/v1/blobs/by-object-id/<object ID>

The aggregator answers with content-type: application/octet-stream, so a browser downloads the file instead of displaying it. To serve web pages, publish a site. See the aggregator API.

6. Publish a site​

  1. Prepare a folder with your static site: at least an index.html, and optionally a 404.html and a ws-resources.json with headers, routes and redirects.
  2. Go to Publish a site and choose or drag the folder. The app lists the files that will be published, the number of epochs and the cost.
  3. Publish and approve the transactions in your wallet. The files are stored in quilts (blobs owned by you) and a Site object is created in your wallet.

Your site is then available at https://<site ID in base36>.iotastorage.com/. My sites shows that URL, and lets you update the site (only changed files are uploaded), renew it or destroy it. To give it a readable address, point an IOTA Names name to it.

Keep your site alive

A site is available as long as its blobs are. Renew it before its end epoch: one purchase covers at most 53 epochs (53 days on testnet).

Reference tools​

Besides the app, the project has reference tools in Node.js, in its repository (not public yet):

  • sitio.mjs, a command line to publish and manage sites. See Sites CLI.
  • A JavaScript client (ClienteAlmacen) that stores and reads blobs and manages the Blob objects. Its method names are in Spanish:
const client = new ClienteAlmacen({ red }); // `red`: the network (package and object IDs)
const stored = await client.guardar(bytes, { firmante, epocas: 5, borrable: true }); // store
const copy = await client.leer(stored.texto); // read by blob ID
await client.renovar(stored.objeto, 3, { firmante }); // extend_blob: 3 more epochs
await client.transferir(stored.objeto, bobAddress, { firmante }); // the Blob now belongs to Bob
await client.borrar(stored.objeto, { firmante: bob }); // delete_blob, by its new owner

firmante (the signer) is a key pair or a wallet: any object with toIotaAddress() and firmarTransaccion(bytes), which returns the bytes the wallet signed and the signature. Each signer pays the gas of its own transactions.