A Python script to pin Tezos tokens on IPFS. The data are retrieved through Teztok.
Install the python dependencies.
python3 -m pip install -r requirements.txt
Here's a breakdown of the parameters of the script:
Wallet of the creator/collector
Pinning tokens created by the creator
's or collected by the collector
's wallet.
Contract on which the tokens were minted, comma separated. You can also use these shortcuts instead of the contract addresses:
akaswap
, fxhash
, hicetnunc
, kalamint
, rarible
, typed
, versum
This script allows you to pin tokens using different services.
- Pinata
pinata
: see https://nftbiker.xyz/pin for instructions on how to generate an api key. - Infura
infura
: once you have created an account, create a new IPFS project. In the project settings, look for 'PROJECT ID' and 'PROJECT SECRET'. That's what you need to use asapi_key
andapi_secret
respectively. - NFT.Storage
nftstorage
: once you have created an account, go to https://nft.storage/manage/ to create anapi_key
.api_secret
is not required. - Filebase
filebase
: once you have created an account, create a bucket and go to https://console.filebase.com/keys to generate a token for this bucket. Use this token asapi_key
.api_secret
is not required. - Local Node
ipfs
: You can also use these scripts to pin to your own locally-running IPFS node.api_key
andapi_secret
are not required.
Example:
python3 pin_tokens.py --wallet tz1NgN7FCrSzs4vfMroKXyKE32WsReYD4WPd --role creator --KT versum --service_type infura --api_key <key> --api_secret <secret>