Use the Token Metadata API archive
Discover how to use the Hiro Archive to spin up a Token Metadata API.
Prerequisites
Since the Token Metadata API depends on a Stacks Blockchain API, you will need to first launch a Stacks Blockchain API configured for the same Stacks network.
If you don't already have one, you can follow these instructions to launch one with an archive.
Where to download archives
Token Metadata API archives for each network can be found at the following locations:
- mainnet: https://archive.hiro.so/mainnet/token-metadata-api-pg/
- testnet: https://archive.hiro.so/testnet/token-metadata-api-pg/
The file name patterns are as follows:
- archive:
token-metadata-api-pg-<DATABASE VERSION>-<API VERSION>-<DATE(YYYYMMDD)>.dump
- shasum:
token-metadata-api-pg-<DATABASE VERSION>-<API VERSION>-<DATE(YYYYMMDD)>.sha256
There is a continually updated archive and shasum which always points to the most recent upload:
- archive:
token-metadata-api-pg-<DATABASE VERSION>-latest.dump
- shasum:
token-metadata-api-pg-<DATABASE VERSION>-latest.sha256
or the most recent upload for a particular version:
- archive:
token-metadata-api-pg-<DATABASE VERSION>-<API VERSION>-latest.dump
- shasum:
token-metadata-api-pg-<DATABASE VERSION>-<API VERSION>-latest.sha256
Restoring the Token Metadata API using the Hiro Archive
- Download the archive and shasum for the appropriate network.
- Verify the archive with the shasum.
- Import the archive file into a running Postgres database (may take up to an hour depending on database specs and tuning):
- Launch the Token Metadata API service.
- Verify the restoration was successful by viewing the total number of tokens and contracts tracked in the service. If the total number of each property is greater than zero, the restoration was successful.
- It may take a few minutes for the local node to respond on this endpoint.