3

Complete newbie here so thanks in advance for tolerating the ignorance that follows.

Working on creating a little card game to learn solidity and have reached the part where I need to assign metadata to the token.

I understand that the tokenURI should point to a json file/object on my web server that is formatted to the standard. So, for token 6 it would be something like: "http://mycardgame.com/cards/6".

I also understand how I could use a variable like baseURI to store all but the "6", get the 6 when the token is minted, and put them together to form the entire URI.

What I have no earthly idea on is how to create that "6" json on the server so the URI points to a valid thing.

I imagine it's something either fairly complicated or ridiculously easy to do, otherwise at least one of the many ERC721 tutorials would have covered more than just setting the tokenURI in the contract. I'd bet complicated over easy.

So, where should I start looking to learn what I'll need to do? Not looking for a quick handout, willing to do the work of actually learning.

closed as off-topic by smarx, Achala Dissanayake, Jesse Busman, shane, Ismael Dec 18 '18 at 6:19

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question does not appear to be about Ethereum, the decentralized application platform and smart contract enabled blockchain, within the scope defined in the help center." – smarx, Jesse Busman, shane, Ismael
If this question can be reworded to fit the rules in the help center, please edit the question.

  • This is off-topic here. I think you're just asking "How do I host JSON on my server?" and that's unrelated to Ethereum. You'll find better help on Stack Overflow. – smarx Dec 16 '18 at 21:15
  • I figured there was some crossover here as it would seem I'd need to use some of the data from my solidity file when the creating the json object. – Kevin Phillips Dec 16 '18 at 21:29
1

Here is an example JSON to use as a starting point:

https://tenthousandsu.com/erc721/00001.json

You can see the EIP specification which includes a JSON schema you can validate against.

You will host that file using an Amazon S3 bucket, GitHub Pages static hosting, a commodity cPanel host, or some other web hosting mechanism.

Don’t be shy, I can also help with whatever else you want to add in there.

Not the answer you're looking for? Browse other questions tagged or ask your own question.