Replies: 18 comments
-
Hi @silaslang Here is an example of an NFT with an image from our block explorer: https://explorer.gochain.io/token/0x29af464A1099Ddf11C5770d8E05CBa18cAeF47d4/asset/458574755479668142737315416416 You can try viewing any GoChain NFT asset by plugging in you own token contract address and asset ID: |
Beta Was this translation helpful? Give feedback.
-
Hi
Thank you ever so much for the reply. I followed this guide https://medium.com/gochain/how-to-create-and-deploy-an-nft-smart-contract-in-10-minutes-e0d7ef8e59fc
I can mint the token and view it on the Gochain explorer.
https://explorer.gochain.io/addr/0x7A5c15B8df397EF5aeDe2ef971f72838F663Ea51?addr_tab=interact
But I cannot see the test image I used in the uri base (below), I followed the guide above.
https://gateway.pinata.cloud/ipfs/QmZQr6dYSNXdrLtCMzjAvipUFHT7QygsW5kAP1XFujY7W1
I really want to make art nfts on gochain network but cant figure what Im doing wrong. How do I create an NFT like the 'jmank88's robot' NFT?
Thank you for your time and patience.
Silas
…---- On Mon, 05 Apr 2021 18:50:46 +0100 Jordan Krage ***@***.***> wrote ----
Hi https://github.com/silaslang
Here is an example of an NFT with an image from our block explorer: https://explorer.gochain.io/token/0x29af464A1099Ddf11C5770d8E05CBa18cAeF47d4/asset/458574755479668142737315416416
You can try viewing any GoChain NFT asset by plugging in you own token contract address and asset ID:
https://explorer.gochain.io/token/<CONTRACT>/asset/<ID>
—
You are receiving this because you were mentioned.
Reply to this email directly, #196 (comment), or https://github.com/notifications/unsubscribe-auth/ATRCOU2K54LAFF2KLDZSK3TTHHZ7NANCNFSM42NEPATA.
|
Beta Was this translation helpful? Give feedback.
-
Your token is here: https://explorer.gochain.io/token/0x7A5c15B8df397EF5aeDe2ef971f72838F663Ea51/asset/0 Which looks like your contract is returning a metadata URL here: https://i.ibb.co/bNDvqdM/Qm-ZQr6d-YSNXdr-Lt-CMzj-Avip-UFHT7-Qygs-W5k-AP1-XFuj-Y7-W1.png0 Which looks like a bad image URL, not a metadata URL. You should read this so you understand how they work: https://eips.ethereum.org/EIPS/eip-721 |
Beta Was this translation helpful? Give feedback.
-
Look at this example: https://ipfs.io/ipfs/QmYP4SZMWLQ5ZcrkwTVK1v3NUK6fxvVDEHtTCyUAupg3jt *do not change this part |
Beta Was this translation helpful? Give feedback.
-
I don't think that's right either, the To use IPFS, it makes it quite a bit more complicated. You'll have to modify the contract web3 generates to use ERC721URIStorage and you can read more about why and how here. This should also have a new function like:
Then to actually mint a token you have to do the following:
|
Beta Was this translation helpful? Give feedback.
-
@treeder What did you mean by this "and pass in the cid" ? |
Beta Was this translation helpful? Give feedback.
-
To the Anyways, looks like you got it working. Want to share what you did? Your contract code? |
Beta Was this translation helpful? Give feedback.
-
@treeder |
Beta Was this translation helpful? Give feedback.
-
Oh, I think I see what you're doing, but it won't work properly. Every token you mint will be the exact same, ie:
So unless you want 1 contract per token (which you don't), you have to do it differently. |
Beta Was this translation helpful? Give feedback.
-
Thanks everyone for all the input and help. It appears I am getting somewhat closer to grasping this. I am new to all this but I am enjoying the learning. I couldn't grasp https://ipfs.io/ so I created the .json and pinned it at pinata . { "name": "Never Liked This Banksy", "description": "Silent Bill's streetart in reply to Banksys Never Liked The Beatles", } web3 generate contract erc721 --symbol SBFTW --name "Never Liked This Banksy" --base-uri https://gateway.pinata.cloud/ipfs/QmUxM3EZ7GdK6cxCyX8L8ajspnPCHJqn3FPnQAHYCZND9D?filename=banksy.json The sample contract has been successfully written to SBFTW.sol file web3 contract build SBFTW.sol NAME: SBFTW web3 contract deploy SBFTW.bin export WEB3_ADDRESS=0x933f5c97a357B7574a2763249A1157D70Fed8b3d web3 contract call --wait --abi SBFTW.abi --gas-limit 2000000 --function mint 0x03f42d46a09b922FD3D98CaC46B5B52F7a3cB98C However, when viewed at Gochain Explorer I am getting this error: I feel as if I am almost there , what do I need to fix? * EDIT, its the comma isnt it in this { "name": "Never Liked This Banksy", "description": "Silent Bill's streetart in reply to Banksys Never Liked The Beatles", } |
Beta Was this translation helpful? Give feedback.
-
yes, it's the comma. And again, you're doing it wrong. that base-uri won't allow you to have more than one NFT in your contract. |
Beta Was this translation helpful? Give feedback.
-
I'm so happy , I finally got it to work. Thank you for all the help. I appreciate your patience and assistance. It has been fun experimenting. https://explorer.gochain.io/token/0x521e5CFc5bF50f46d61375cB466f2B8a89d204b2/asset/0 To mint more than 1 of these would do the following web3 contract call --wait --abi BANSKY.abi --gas-limit 2000000 --function mint 0x03f42d46a09b922FD3D98CaC46B5B52F7a3cB98C (INSERT THE AMOUNT TO MINT HERE?) |
Beta Was this translation helpful? Give feedback.
-
no, you can only mint 1 at a time. |
Beta Was this translation helpful? Give feedback.
-
hi @treeder your right need to update the contract mint function which is getting pulled using docker |
Beta Was this translation helpful? Give feedback.
-
@ranjithSts not sure what you mean, can you explain? |
Beta Was this translation helpful? Give feedback.
-
i mean this should be the actuall format but in the web3 gentrate contract erc721 when this is called in mint function the metadatauri is not getting passed or there is no variable as tokenuri in mint function |
Beta Was this translation helpful? Give feedback.
-
i think i have found a solution over here ... fix erc721 for latest openzeppelin changes (#182)
}` i just need to know how to call this function , is this should be correct .. need an example of this web3 contract call --amount AMOUNT --address CONTRACT_ADDRESS --abi CONTRACT_ABI_FILE --function setTokenURI "tokenId" "tokenURI" |
Beta Was this translation helpful? Give feedback.
-
Looks right, you probably don't need the |
Beta Was this translation helpful? Give feedback.
-
Hi all, firstly thank you for all the hard work you put in on this. I have a question that I'm not sure if is appropriate for here but I cant find the answers anywhere else. Its not an issue with the software.
I minted an NFT on gochain network but I cant work out how to view it as an image. What wallet will show the image I linked to via ipfs pinning at pinata?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions