RIF Storage Pinning service - Local setup with storage dev CLI
This guide is quite advanced and assumes a greater knowledge of how to setup local blockchain environment, IFPS, etc.
Repositories
- Storage Smart Contracts: github.com/rsksmart/rif-marketplace-storage
- Storage Development CLI: github.com/rsksmart/rif-storage-cli
Steps
- Clone all repos, run
npm install
globally. - Start up Ganache
- In Smart Contracts repo using
truffle deploy
deploy contracts and take note of theStorageManager
contract address. - Go to Storage Development CLI and create an Offer for the given contract address (use the
npm run bin
script) - Go to Pinning Service repo and configure it to use the deployed contract. You can use environment variables,
local.json
or CLI parameters for this. - Run
npm run init
- this will bootstrap IPFS repos in.repos
folder and configure the ports settings. - In one tab run
npm run ipfs:consumer daemon
- In another tab run
npm run ipfs:provider daemon
- Create Offer. Suggested way is using the Storage Development CLI. Use
npm run bin
and don't forget to configure the correct contract address. Note the Offer ID (which is the address of your RSK account from which you have created the Offer) - Run
npm run bin -- --offerId <offerId>
to start the service.
Consumer IPFS API runs on 5002
.
Provider IPFS API runs on 5003
.