Skip to main content

Update, renew and destroy

A site belongs to the address that owns its Site object and its blobs. Only that address can change it: the tools and the network reject changes from anyone else.

In the app, My sites lists the Site objects of your wallet with their URL and offers these three operations (step by step in Update a site and Renew and destroy a site). In the CLI they are update/deploy, renew and destroy (see Sites CLI). Both work the same way, described below.

Update​

Updating publishes a new version of the folder on the same Site, so the URL does not change.

  1. The files are compared with the published site by their SHA-256. Files with the same content are not uploaded again: they keep their blob and their patch. If only their headers change, the resource is recreated on IOTA with the same patch.
  2. The blobs still in use are renewed up to the current epoch plus the epochs you choose. If one of them no longer belongs to you or has expired, its files are uploaded again.
  3. New and changed files are uploaded in new quilts.
  4. The Site is updated: resources, routes, redirects, name and metadata.
  5. Finally, the deletable blobs that no resource uses any more are deleted, with the same rules as when destroying: a blob that another of your sites also uses is kept, and nothing is deleted from a site that another account sent you. In the CLI, --keep-blobs keeps them all.

All of this takes two transactions: one registers and pays for the new quilts, and the other, once the storage nodes confirm, certifies them and does steps 2, 4 and 5. Updating with the same files and more epochs uploads nothing: it only renews the blobs, in one transaction. Very large changes need more (each transaction takes up to about 900 calls and 100 KB). The portal shows the new version within 5 seconds of its review: it keeps what it reads from IOTA for that long.

In the app, choose the site in Publish as (or press Update in My sites) before or after choosing the folder; otherwise the folder is published as a new site. Before you sign, the app shows:

  • the estimated cost of everything the update pays for: the new quilts, the renewal of the blobs still in use and the files uploaded again because their blob expired (plus gas);
  • the files of the site that are not in the folder and will be removed, and how many of your blobs will be deleted in step 5.

Renew​

Renewing extends the blobs that the site uses, without uploading anything: each blob whose end epoch is earlier than the current epoch plus the chosen epochs is extended up to that epoch, paying only storage (no write fee). All the blobs are renewed in one transaction.

  • One purchase covers at most 53 epochs from now.
  • If you no longer have a valid Blob for some file of the site (it expired or you transferred it), it cannot be renewed: publish the site again (update) to upload those files.
  • There is no automatic renewal service for user sites yet. Renew before the end epoch.

Destroy​

Destroying removes the site for good:

  1. The deletable blobs of the site that you own are deleted, with two exceptions:

    • A blob that another of your sites also uses (two sites published from the same files have the same quilts) is not deleted: of the Blob objects you own with that blob ID, the one that lasts longest is kept, which is the one that serves the other site and the one renewing extends.
    • A site that another account sent you deletes none of your blobs. Anyone can create a Site listing any blob ID, yours included, and transfer it to you; the app marks these sites as «sent by another account» (the last transaction that touched the Site was not signed by your wallet). Delete such blobs, if you want to, from My blobs, one by one.

    Before you confirm, the app tells you how many blobs will be deleted and lets you keep them; the CLI has --keep-blobs.

  2. The resources, routes and redirects are removed from the Site, so their storage deposits come back to you.

  3. The Site object is burned.

All of it goes in one transaction, except for very large sites. It cannot be undone: publishing the folder again creates a new Site, with a new ID and URL. Any IOTA Names name that pointed to the old one must be pointed to the new one (Add a name; see IOTA Names).

The nodes delete the data of a blob only when no Blob registers that blob ID any more. If another site (yours or someone else's) has exactly the same files, its quilt has the same blob ID and stays available.

Sites sent by other accounts​

Anyone can create a Site and transfer it to your wallet, with whatever name and content they want, including a name that looks like a message («Your wallet is at risk…»). In My sites the app shows them apart, after your own, in a group that is closed by default and starts with a warning: their name and content were chosen by that account, not by you or by the app. Their names go in quotes and without the characters that would reverse or hide text, and in Publish as they are listed apart too. You can renew, update or destroy them like your own; destroying one deletes none of your blobs.

Costs​

  • Updating pays storage for the new quilts, the renewal of the blobs in use and the gas of the transactions. Each new resource has a deposit of about 0.005 IOTA; replaced resources return theirs.
  • Renewing pays only storage and gas.
  • Destroying pays gas and returns the deposits: on testnet, destroying a small example site of 4 files returned 0.019 IOTA net.