Been minting NFTs thru platforms like Rarible and OS for a few months now but have decided to take a leap of faith and develop my own smart contract for a GAN project.
Currently I have a .py script which generates X amount of images, uploads and pins to IPFS, then generates a JSON file for the token metadata.
My dilemma is how do I host this metadata, currently I’ve been playing around with fake REST apis but have ran into the problem of Heroku’s temporary storage, I’m thinking I need to somehow push my JSON metadata from Python into a Mongo or Postgres DB which can then be resolved as the db.JSON file on my token metadata api, is this the correct way to do this?
Alternatively my last resort will be simply generating a final JSON output of all token metadata and deploying it from Heroku at the start as static data, this breaks the data flow so would be preferable to have it all linked from image/metadata generation to minting tokens as opposed to manually uploading db.json.
My final question is how do I read my smart contract from my metadata api?
For example I’d like the API to only show token ids up to the totalSupply read from the contract, is there an easy way to do this? or an easy way to pull totalSupply int?
I’m learning on the fly here coming from very basic Python knowledge so would appreciate any resources or any push in the right direction.