@mmyyrroonn/crust-pin
v1.0.0
Published
Decentralized pin on Crust Network
Downloads
5
Maintainers
Readme
📌 Crust Pin
This node package allows you to place a storage order on Crust Network, and the whole network's IPFS storage nodes will help you to pin your site/file in a super decentralized way.
Getting Started
- Install dependency
yarn add @crustio/crust-pin
- Create
CrustPinner
Typescript sample
import CrustPinner from '@crustio/crust-pin';
const crust = new CrustPinner(`${CRUST_ACCOUNT_SEEDS}`);
async function main() {
await crust.pin('QmVAjL5AkQJ6uwWnJ78YXCVK6FB1cgPtYPRyjnPvoVmb3K');
}
main();
or Commonjs sample
const crustPin = require('@crustio/crust-pin').default;
const crust = new crustPin(`${CRUST_ACCOUNT_SEEDS}`);
const main = async () => {
await crust.pin('QmVAjL5AkQJ6uwWnJ78YXCVK6FB1cgPtYPRyjnPvoVmb3K');
}
main();
Workflow
The whole workflow shows like blew:
Simply to say, Crust Pin only handles the tx-sending. After that, the storage nodes which received this tx will pull the site from user's IPFS.
Contribution
Please send a PR(Pull Request) to contribute this repo and read the following rules:
- No
--force
pushes or modifying the master branch history in any way. If you need to rebase, ensure you do it in your own repo. - Non-main branches, prefixed with a short name moniker (e.g. zik/my-feature) must be used for ongoing work.
- All modifications must be made in pull-request to solicit feedback from other contributors.
- A pull-request must not be merged until CI has finished successfully.
- Contributors should adhere to the Google Typescript Style Guide.