Skip to content

Publishing the Unchained Index Manifest

Thomas Jay Rush edited this page Feb 10, 2024 · 17 revisions

- Tasks

  • Update the index to the latest block
  • Pin the chunks (and blooms) to both IPFS and Pinata
  • Update the manifest.json file
  • Publish the manifest.json to the smart contract

- Update the index to the latest block

  • Either chifra scrape
  • Copy the index from the source machine (use get_index)

- Optionally, export an env var so the pinning starts where you want it. Starts at zero otherwise.

  • chifra chunks manifest will show you the last known chunk in the manifest ($lastBlock)
  • subtract a few blocks from the $lastBlock. lastBlock -= 10 for example.
  • export TB_CHUNKS_PINFIRSTBLOCK=$lastBlock
  • Note: it's okay to lower $lastBlock a few blocks to start a little bit earlier to avoid off-by-one. $lastBlock will snap back to the start of the previous chunk if you do so.
  • chifra chunks index --check (do not proceed if it doesn't pass)

- Pin the new chunks, but don't re-write the manifest.json

  • Turn on local IPFS daemon
  • echo no | chifra chunks manifest --chain sepolia --pin --remote --sleep 1 --deep
  • This last command will pin all the chunks after $lastBlock to both local IPFS daemon and Pinata (if local is running), but it will not rewrite the manifest.json file in the unchained folder. It write the manifest.json to the local folder.
  • check the manifest. It should be good before proceeding.

- At this point, all pins should be both local in IPFS and remote at Pinata. Now we re-write the local manifest

  • chifra chunks manifest should report old latest manifest record
  • chifra chunks manifest --remote should report the same lastBlock
  • export TB_CHUNKS_PINFIRSTBLOCK= # start at block zero?
  • echo no | chifra chunks manifest --chain sepolia --pin --remote --rewrite # note that without --deep this just pins manifest and timestamps, so setting to zero is okay

- Publish to the smart contract (do this before running --remote -- it will overwrite otherwise.

  • chifra chunks manifest should report new latest manifest record
  • chifra chunks manifest --remote should report the same lastBlock
Clone this wiki locally