How to upload a file on RecordsKeeper Blockchain?

RecordsKeeper Public Blockchain comes with a functionality where you can upload large data over the RecordsKeeper Blockchain. Currently, the maximum stream size that can be uploaded over the RecordsKeeper Blockchain is 4 Mb and the maximum block size is 10 Mb. RecordsKeeper team recommends uploading hash of the file over the Blockchain as it will increase the performance of the application where you are using the file, but still, you can upload files over the Blockchain itself.

Files up to 4 megabytes

RecordsKeeper provides you with a key-value based database on top of the Blockchain. You can upload the file to the same database. The value allowed in the RecordsKeeper Blockchain has to be in the hex format. So to upload a file over the RecordsKeeper Blockchain, you need to convert your file into the hex format. All the files can be converted and represented in hex format be it CSV, JSON, XML, JPEG, PNG or any other format. You can use your in-house tools or some other online tools to convert the file to hex format before upload. If you are familiar with programming or has your own RecordsKeeper node setup then you can directly use this command below to publish the file over the RecordsKeeper Blockchain.

rk-cli recordskeeper publish root file1 `xxd -p PublishMe.txt | tr -d ‘\n’`

The command above uses the shell function to convert the file to the hex format and then upload it over the RecordsKeeper Blockchain. Here we have taken an example of .txt file.

While retrieving the file you need to make sure to convert the hex format back to your file format. You can also use the file name as the key for easy retrieval or publish the key as the hash of the file to create a check process in order to verify the file. You can also store the file type in your key as to specify which file is to be recreated on retrieval.

Files bigger than 4 megabytes

If you have files bigger than 4 megabytes and you want to publish over the RecordsKeeper Blockchain, then after converting the file into hex format, you can divide the file into blocks of 4 megabytes each and then publish it over the blockchain with paths defined in the key. On retrieval, you can get all part files hex values using the key and then you can join them together to re-create your file.

Please note: All the data you publish over the RecordsKeeper Blockchain requires XRK tokens as fees. Currently, you can publish 10 KiloByte of data with 1 XRK token. You can also check the basic demo for publishing and retrieve records here:

Leave a Reply

Your email address will not be published. Required fields are marked *