Distributed storage CLI implementation leveraging IPFS and Ethereum chain
- Node.js installed locally (version 18 or higher).
- IPFS node running locally. Setup instructions can be found here.
- Ganache running locally. Setup instructions can be found here.
- Clone the repository
- Install dependencies
npm i
- Deploy smart contract
npm run deploy-contract
- Build cli application
npm run build-cli
- File can be uploaded using the upload command. Make sure the cli is built, and the smart contract is deployed before running the command.
Command will prompt for the Ethereum account private key. Private key can be read from ganache UI (In the top menu select Account and press on the key icon on the right).
npm run cli upload <path_to_file>
(eg.npm run cli upload ./doc-images/file-upload-example.png
)
- List uploaded files. Only the files uploaded by the selected account are listed.
npm run cli ls