#
Uploading data to IPFSYou can use the Idena Network for uploading and sharing your content. You can access the uploaded data by its cid
using Idena node or IPFS node connected to the Idena Network or using any public Idena IPFS gateway (e.g: https://ipfs.idena.io)
Example: https://ipfs.idena.io/ipfs/bafkreicfjmxqcmzqt7yvl6ljpwl3kbkvh2einxpilggbczsx44giha6dua
#
How to upload your content to IPFS?Let's upload the following html
file into Idena IPFS network:
#
1. Convert text into bytesYou can use online tool to convert text into bytes: https://onlineasciitools.com/convert-ascii-to-bytes
#
2. Add prefixAdd 0x
prefix to data as follows:
#
3. Upload dataCall Idena Node ipfs_add
method to upload data to your Idena node.
You can use https://rpc.idena.io to call methods of your Idena node.
Example:
Parameters:
data
: bytespin
: bool
Result of the method is cid
which is also the hash of the data which should be used to access it.
The uploaded html is now accessible at the following URL address: https://ipfs.idena.io/ipfs/bafkreicfjmxqcmzqt7yvl6ljpwl3kbkvh2einxpilggbczsx44giha6dua
#
Data availabilityThe uploaded data is available as long as at least one Idena node stores it.
You should use the pin
parameter when uploading your content to make sure that your own node stores it permanently.
Your Idena nodes will automatically delete all the unpinned data if there is a new data is uploaded (e.g. flips or blocks) and no free space left in your /ipfs
folder.
By default /ipfs
folder data is limited by 10Gb
.
#
Broadcasting your dataYou can call the dna_storeToIpfs
method if you want other nodes to download your data.
Transaction StoreToIpfsTx
will be sent automatically for the specified cid
.
Example:
Once the StoreToIpfsTx
transaction is confirmed, 20% of nodes are randomly selected to download the specified data.
These Idena nodes do not pin your data so it may be deleted if there is no free space left in their /ipfs
folder.
#
FeesFee for StoreToIpfsTx
transaction is calculated automatically depending on the size of the data.
The total transaction fee is calculated as following:
See more about currFeeRate