This script loads the IPFS hashes for contributors and contributions and pins them on the connected IPFS node.
First it loads the latest data and pins those and then it subscribes to relevant contract events and pins new hashes.
usage:
$ node script/ipfs-pinner.js
$ ETH_RPC_URL=http://localhost:7545 APM_DOMAIN=aragonpm.eth node scripts/ipfs-pinner.js
I'm getting an unhandled promise rejection error when running this script against a local devchain with fresh seeds:
(feature/ipfs-pinner) ~/src/kosmos/kredits/kredits-contracts $ ETH_RPC_URL=http://localhost:7547 APM_DOMAIN=aragonpm.eth node scripts/ipfs-pinner.js
Using IPFS: { host: 'localhost', port: '5001', protocol: 'http' }
(node:25517) UnhandledPromiseRejectionWarning: Error: invalid response - 0
at exports.XMLHttpRequest.request.onreadystatechange (/home/basti/src/kosmos/kredits/kredits-contracts/node_modules/ethers/utils/web.js:84:29)
at exports.XMLHttpRequest.dispatchEvent (/home/basti/src/kosmos/kredits/kredits-contracts/node_modules/xmlhttprequest/lib/XMLHttpRequest.js:591:25)
at setState (/home/basti/src/kosmos/kredits/kredits-contracts/node_modules/xmlhttprequest/lib/XMLHttpRequest.js:610:14)
at exports.XMLHttpRequest.handleError (/home/basti/src/kosmos/kredits/kredits-contracts/node_modules/xmlhttprequest/lib/XMLHttpRequest.js:532:5)
at ClientRequest.errorHandler (/home/basti/src/kosmos/kredits/kredits-contracts/node_modules/xmlhttprequest/lib/XMLHttpRequest.js:459:14)
at ClientRequest.emit (events.js:182:13)
at Socket.socketErrorListener (_http_client.js:392:9)
at Socket.emit (events.js:182:13)
at emitErrorNT (internal/streams/destroy.js:82:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:50:3)
I'm getting an unhandled promise rejection error when running this script against a local devchain with fresh seeds:
```
(feature/ipfs-pinner) ~/src/kosmos/kredits/kredits-contracts $ ETH_RPC_URL=http://localhost:7547 APM_DOMAIN=aragonpm.eth node scripts/ipfs-pinner.js
Using IPFS: { host: 'localhost', port: '5001', protocol: 'http' }
(node:25517) UnhandledPromiseRejectionWarning: Error: invalid response - 0
at exports.XMLHttpRequest.request.onreadystatechange (/home/basti/src/kosmos/kredits/kredits-contracts/node_modules/ethers/utils/web.js:84:29)
at exports.XMLHttpRequest.dispatchEvent (/home/basti/src/kosmos/kredits/kredits-contracts/node_modules/xmlhttprequest/lib/XMLHttpRequest.js:591:25)
at setState (/home/basti/src/kosmos/kredits/kredits-contracts/node_modules/xmlhttprequest/lib/XMLHttpRequest.js:610:14)
at exports.XMLHttpRequest.handleError (/home/basti/src/kosmos/kredits/kredits-contracts/node_modules/xmlhttprequest/lib/XMLHttpRequest.js:532:5)
at ClientRequest.errorHandler (/home/basti/src/kosmos/kredits/kredits-contracts/node_modules/xmlhttprequest/lib/XMLHttpRequest.js:459:14)
at ClientRequest.emit (events.js:182:13)
at Socket.socketErrorListener (_http_client.js:392:9)
at Socket.emit (events.js:182:13)
at emitErrorNT (internal/streams/destroy.js:82:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:50:3)
```
I think the example script was just using a wrong port. However it doesn't say how to define the contract address and I don't see it in the code. With the correct port (and ipfs-pinner filename), as well as error handling, I now get:
Error: Address or ABI not found for Kernel
I think the example script was just using a wrong port. However it doesn't say how to define the contract address and I don't see it in the code. With the correct port (and ipfs-pinner filename), as well as error handling, I now get:
```
Error: Address or ABI not found for Kernel
```
I can not reproduce that error. Also tried it with the local network.
does your lib/addresses/dao.json include the correct address for the current network? Do you have the correct APM domain set?
I can not reproduce that error. Also tried it with the local network.
does your `lib/addresses/dao.json` include the correct address for the current network? Do you have the correct APM domain set?
does your lib/addresses/dao.json include the correct address for the current network?
Yes.
Do you have the correct APM domain set?
I don't know. I used it from your example, and you can see it in the copied command that I posted. But I was pretty sure that this is the one for development.
> does your `lib/addresses/dao.json` include the correct address for the current network?
Yes.
> Do you have the correct APM domain set?
I don't know. I used it from your example, and you can see it in the copied command that I posted. But I was pretty sure that this is the one for development.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
This script loads the IPFS hashes for contributors and contributions and pins them on the connected IPFS node.
First it loads the latest data and pins those and then it subscribes to relevant contract events and pins new hashes.
usage:
I'm getting an unhandled promise rejection error when running this script against a local devchain with fresh seeds:
Adding some error handling...
I think the example script was just using a wrong port. However it doesn't say how to define the contract address and I don't see it in the code. With the correct port (and ipfs-pinner filename), as well as error handling, I now get:
I can not reproduce that error. Also tried it with the local network.
does your
lib/addresses/dao.jsoninclude the correct address for the current network? Do you have the correct APM domain set?Yes.
I don't know. I used it from your example, and you can see it in the copied command that I posted. But I was pretty sure that this is the one for development.
it looks like an error indicating a local miss-configuration. I can not reproduce it.
maybe you can try again, and also try rinkeby?
I tried to make an
npxscript out of this, but it seems it only supports commands that are equal to the package name.Hooray, tested successfully on my machine now! 🎉