It allows you to upload and share link to download large file.
This contract consist of two components, client loader (HTML/JS static) and contract code.
Find /client/index.html and serve it locally in secure context or host it on your domain, yes just that file (low bandwith). This is only file required to load your smart contract to the web browser.
In index.html
there is const ws_endpoint = 'wss://localhost:8081';
which you can change to point to your instance in production.
npm start
(requires Docker - see Evernode official documentation)
It allows you to upload and share link to download large file.
File is chunked in web browser and chunks are uploaded to the contract. Same goes to download, it downloads chunks and web browser rearranges chunks to whole file.
Additional implemented options is to track metadata of uploaded file where you can add additional context, in this contract we are using password protection and adding note with uploaded file.
This contract in whole is showcasing few things:
- Keeping website logic (layout, javascript, ...) INSIDE contract
- Using static loader file (index.html) to load contract - it can be reused for many types of contract which follow same convention
- Chunking and rearranging files in web browser (working with buffers...)
- Saving and serving files from Evernode Contract
- Serving various request from Evernode Contract
XRPLWin (xrplwin.com)