Hot answers tagged

4

The Ethereum blockchain is an entirely separate system from IPFS, it does not understand what IPFS is or what it does. In most DApps, what usually happens is that the file is uploaded to IPFS via the UI, and then the resulting IPFS hash is fed to the smart contract as a string for on-chain storage and aggregation. That should be enough to cover most ...


3

Set your _baseURI as "ipfs://" and put the content hash into _tokenURI. The relevant code is at https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC721/ERC721.sol#L141-L144 The result is your tokenURI(tokenID) will be the full IPFS URI.


2

It would be very useful for a number of use cases if a function in a contract could directly upload to IPFS, Swarm, or similar and retrieve the hash. It would be useful, but what you are asking is impossible in computer science theory, and practice. Ethereum, like all other blockchains, is deterministic. They cannot communicate with any off-chain resources, ...


1

Looks like your math is in the ballpark: 32 bytes in a single storage slot 32 slots to hold 1Kb 25,000 gas to write a single slot 800,000 gas to write one KB. $17 per KB at this moment's prices You might want to consider using a carefully compressed JPG rather than writing raw pixels. The savings could be considerable.


1

Seems what I need is this https://dweb-primer.ipfs.io/files-on-ipfs/wrap-directories-around-content to wrap directory around files, this gives base URL.


1

The issue was that I had RemixIDE running on port 5001 and subgraph didn't give me a "port unavailable" error or anything. Turning of RemixIDE solved the problem.


1

From the SuperRare page you can see the history of the NFT, the first entry being the creation. You can view the transaction in Etherscan by clicking the link. This is the creation transaction: https://etherscan.io/tx/0xcbe836b09b0483cf552b5671ce1f6bf7cb6270cec4a65c8b53df96fc7c0a078f From Etherscan you can see it's an ERC-721 token with an ID of 23896. You ...


1

No, it isn't mandatory to use IPFS on ERC721 - as you already know, other than the token URI, typically, very little data about the asset is stored in the token on the blockchain, and the actual content linked to the token (i.e. MetaData and Image) can be served from anywhere on the internet. However, IPFS is often used on NFTs to further the spirit of ...


1

Along the lines of the "Don't Trust. Verify.™" maxim, you can verify the IPFS hash yourself through a known, trustworthy IPFS gateway. For example, the following URL routes through an IPFS node hosted by Cloudflare, which may or may not be trustworthy (it is, but let's pretend it might not be): https://cloudflare-ipfs.com/ipfs/...


1

ipfs.add(fileUploaded) works for me. buffer is not required. We can load the file directly. I am using "ipfs-http-client": "^50.1.2" and ipfs = create({ host: "ipfs.infura.io", port: 5001, protocol: "https" });


1

I'd like to make this work without IPFS / Swarm From my research and experimentation, this isn't possible without IPFS. If you look at DNS A record for spacex.eth.link you will see that it points to a Cloudflare IP, as Cloudflare provides the eth.link gateway to IPFS. % drill spacex.eth.link <snip> ;; ANSWER SECTION: spacex.eth.link. 106 IN A ...


1

According to this recent post by Infura on September 23, 2020: https://blog.infura.io/part-2-getting-started-with-ipfs-on-infura/ Data is currently pinned until it’s been 6 months since it was last used, so as long as you’re accessing your data within that time frame, it’ll be there for you!


Only top voted, non community-wiki answers of a minimum length are eligible