Compare commits
10 Commits
Author | SHA1 | Date | |
---|---|---|---|
bcb46c2b2b | |||
7e7416a8fd | |||
|
b8fa61a434 | ||
1aa2fac3cc | |||
b7d1600c59 | |||
|
ed50e84662 | ||
c7fe50ffa9 | |||
|
83b3045afd | ||
|
3c7bcf038e | ||
|
ca0b870315 |
14
.gitea/release-drafter.yml
Normal file
14
.gitea/release-drafter.yml
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
name-template: 'v$RESOLVED_VERSION'
|
||||||
|
tag-template: 'v$RESOLVED_VERSION'
|
||||||
|
version-resolver:
|
||||||
|
major:
|
||||||
|
labels:
|
||||||
|
- release/major
|
||||||
|
minor:
|
||||||
|
labels:
|
||||||
|
- release/minor
|
||||||
|
- feature
|
||||||
|
patch:
|
||||||
|
labels:
|
||||||
|
- release/patch
|
||||||
|
default: patch
|
11
.gitea/workflows/release_drafter.yml
Normal file
11
.gitea/workflows/release_drafter.yml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
name: Release Drafter
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
types: [closed]
|
||||||
|
jobs:
|
||||||
|
release_drafter_job:
|
||||||
|
name: Update release notes draft
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Release Drafter
|
||||||
|
uses: https://github.com/raucao/gitea-release-drafter@dev
|
18
README.md
18
README.md
@ -27,3 +27,21 @@ Clone the Git repository, then use npm scripts from its root directory.
|
|||||||
Or with debug output:
|
Or with debug output:
|
||||||
|
|
||||||
npm run debug
|
npm run debug
|
||||||
|
|
||||||
|
### CLI options
|
||||||
|
|
||||||
|
Display progress bars:
|
||||||
|
|
||||||
|
kredits-ipfs-pinner --progress
|
||||||
|
|
||||||
|
Or with npm:
|
||||||
|
|
||||||
|
npm start -- --progress
|
||||||
|
|
||||||
|
Keep running and watch for new data/documents:
|
||||||
|
|
||||||
|
kredits-ipfs-pinner --watch
|
||||||
|
|
||||||
|
Multiple options at once:
|
||||||
|
|
||||||
|
kredits-ipfs-pinner --progress --watch
|
||||||
|
@ -29,8 +29,7 @@ class IpfsPinner {
|
|||||||
const contracts = [
|
const contracts = [
|
||||||
this.kredits.Contributor,
|
this.kredits.Contributor,
|
||||||
this.kredits.Contribution,
|
this.kredits.Contribution,
|
||||||
// TODO uncomment once we have data here
|
this.kredits.Reimbursement
|
||||||
// this.kredits.Reimbursement
|
|
||||||
]
|
]
|
||||||
|
|
||||||
for (const contract of contracts) {
|
for (const contract of contracts) {
|
||||||
@ -72,6 +71,11 @@ class IpfsPinner {
|
|||||||
.then(data => { return this.ipfsApi.pin(data); })
|
.then(data => { return this.ipfsApi.pin(data); })
|
||||||
.then(callback);
|
.then(callback);
|
||||||
});
|
});
|
||||||
|
this.kredits.Reimbursement.on('ReimbursementAdded', (id) => {
|
||||||
|
this.kredits.Reimbursement.getData(id)
|
||||||
|
.then(data => { return this.ipfsApi.pin(data); })
|
||||||
|
.then(callback);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async _pinAllFromContract (contract, itemCount, progressBar) {
|
async _pinAllFromContract (contract, itemCount, progressBar) {
|
||||||
@ -91,7 +95,7 @@ class IpfsPinner {
|
|||||||
cid = await ipfsApi.pin(data);
|
cid = await ipfsApi.pin(data);
|
||||||
debug(`Pinned ${contract.constructor.name} #${id} at ${cid}`);
|
debug(`Pinned ${contract.constructor.name} #${id} at ${cid}`);
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
debug(`Error while trying to load an pin ${contract.constructor.name} #${id}:`)
|
debug(`Error while trying to load and pin ${contract.constructor.name} #${id}:`)
|
||||||
debug(e);
|
debug(e);
|
||||||
debug(`\nTrying again...`);
|
debug(`\nTrying again...`);
|
||||||
loadAndPin(id);
|
loadAndPin(id);
|
||||||
|
18
package-lock.json
generated
18
package-lock.json
generated
@ -1,15 +1,15 @@
|
|||||||
{
|
{
|
||||||
"name": "@kredits/ipfs-pinner",
|
"name": "@kredits/ipfs-pinner",
|
||||||
"version": "2.1.0",
|
"version": "2.3.0",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@kredits/ipfs-pinner",
|
"name": "@kredits/ipfs-pinner",
|
||||||
"version": "2.1.0",
|
"version": "2.3.0",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@kredits/contracts": "^7.0.0",
|
"@kredits/contracts": "^7.4.0",
|
||||||
"cli-progress": "^3.11.2",
|
"cli-progress": "^3.11.2",
|
||||||
"debug": "^4.3.4",
|
"debug": "^4.3.4",
|
||||||
"yargs": "^17.6.0"
|
"yargs": "^17.6.0"
|
||||||
@ -721,9 +721,9 @@
|
|||||||
"integrity": "sha512-yOTK5WiXFDNAitPByMabE365aEEzFHgSUSgAssbJWt7BZ80HQSVu8XWrQiTbFbCkoIBmXwPP/RoxgXJQVgZTFQ=="
|
"integrity": "sha512-yOTK5WiXFDNAitPByMabE365aEEzFHgSUSgAssbJWt7BZ80HQSVu8XWrQiTbFbCkoIBmXwPP/RoxgXJQVgZTFQ=="
|
||||||
},
|
},
|
||||||
"node_modules/@kredits/contracts": {
|
"node_modules/@kredits/contracts": {
|
||||||
"version": "7.0.0",
|
"version": "7.4.0",
|
||||||
"resolved": "https://registry.npmjs.org/@kredits/contracts/-/contracts-7.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/@kredits/contracts/-/contracts-7.4.0.tgz",
|
||||||
"integrity": "sha512-UITEkP3njFNI2WS7v5ivGE3ruFwdWPWuJZrhBXBEAZbtmr1t/p1K7jkmmjyLDUeKXJ/udMlH6oQMCgh7P/aHNg==",
|
"integrity": "sha512-J3KGqZTZAcwJwjKziyt9PKOiNhme5e5+vVntusqbvS9BJTq8gFc7wr+l9ZMPEel7dl85KopzfpVesYbQ/+f33Q==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@kosmos/schemas": "^3.1.0",
|
"@kosmos/schemas": "^3.1.0",
|
||||||
"ethers": "^5.4.7",
|
"ethers": "^5.4.7",
|
||||||
@ -2245,9 +2245,9 @@
|
|||||||
"integrity": "sha512-yOTK5WiXFDNAitPByMabE365aEEzFHgSUSgAssbJWt7BZ80HQSVu8XWrQiTbFbCkoIBmXwPP/RoxgXJQVgZTFQ=="
|
"integrity": "sha512-yOTK5WiXFDNAitPByMabE365aEEzFHgSUSgAssbJWt7BZ80HQSVu8XWrQiTbFbCkoIBmXwPP/RoxgXJQVgZTFQ=="
|
||||||
},
|
},
|
||||||
"@kredits/contracts": {
|
"@kredits/contracts": {
|
||||||
"version": "7.0.0",
|
"version": "7.4.0",
|
||||||
"resolved": "https://registry.npmjs.org/@kredits/contracts/-/contracts-7.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/@kredits/contracts/-/contracts-7.4.0.tgz",
|
||||||
"integrity": "sha512-UITEkP3njFNI2WS7v5ivGE3ruFwdWPWuJZrhBXBEAZbtmr1t/p1K7jkmmjyLDUeKXJ/udMlH6oQMCgh7P/aHNg==",
|
"integrity": "sha512-J3KGqZTZAcwJwjKziyt9PKOiNhme5e5+vVntusqbvS9BJTq8gFc7wr+l9ZMPEel7dl85KopzfpVesYbQ/+f33Q==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@kosmos/schemas": "^3.1.0",
|
"@kosmos/schemas": "^3.1.0",
|
||||||
"ethers": "^5.4.7",
|
"ethers": "^5.4.7",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@kredits/ipfs-pinner",
|
"name": "@kredits/ipfs-pinner",
|
||||||
"version": "2.1.0",
|
"version": "2.3.0",
|
||||||
"description": "Pins IPFS data of a Kredits organization on an IPFS node",
|
"description": "Pins IPFS data of a Kredits organization on an IPFS node",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
@ -20,7 +20,7 @@
|
|||||||
],
|
],
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@kredits/contracts": "^7.0.0",
|
"@kredits/contracts": "^7.4.0",
|
||||||
"cli-progress": "^3.11.2",
|
"cli-progress": "^3.11.2",
|
||||||
"debug": "^4.3.4",
|
"debug": "^4.3.4",
|
||||||
"yargs": "^17.6.0"
|
"yargs": "^17.6.0"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user