Closed lucasvo closed 2 years ago
will take a look soon, thanks for this
If I run your version locally I get the following errors. The output in the terminal is still produced properly, I guess there is some bug in creating the folder or writing files into a non-existing folder (?). Could you please check.
yarn run v1.22.17
$ node src/index.js
Error: ENOENT: no such file or directory, open 'out/Account 1 G1rrUNQSk7CjjEmLSGcpNu72tVtyzbWdUvgmSer9eBitXWf.json'
at Object.openSync (fs.js:462:3)
at Object.writeFileSync (fs.js:1384:35)
at exportVariable (file:///home/jonas/Documents/test/staking-rewards-collector/src/fileWorker.js:8:12)
at main (file:///home/jonas/Documents/test/staking-rewards-collector/src/index.js:63:7) {
errno: -2,
syscall: 'open',
code: 'ENOENT',
path: 'out/Account 1 G1rrUNQSk7CjjEmLSGcpNu72tVtyzbWdUvgmSer9eBitXWf.json'
}
Error: ENOENT: no such file or directory, open 'out/Account 1 G1rrUNQSk7CjjEmLSGcpNu72tVtyzbWdUvgmSer9eBitXWf.csv'
at Object.openSync (fs.js:462:3)
at Object.writeFileSync (fs.js:1384:35)
at writeCSV (file:///home/jonas/Documents/test/staking-rewards-collector/src/fileWorker.js:24:13)
at main (file:///home/jonas/Documents/test/staking-rewards-collector/src/index.js:64:7) {
errno: -2,
syscall: 'open',
code: 'ENOENT',
path: 'out/Account 1 G1rrUNQSk7CjjEmLSGcpNu72tVtyzbWdUvgmSer9eBitXWf.csv'
}
Error: ENOENT: no such file or directory, open 'out/Account 2 15fTw39Ju2jJiHeGe1fJ5DtgugUauy9tr2HZuiRNFwqnGQ1Q.json'
at Object.openSync (fs.js:462:3)
at Object.writeFileSync (fs.js:1384:35)
at exportVariable (file:///home/jonas/Documents/test/staking-rewards-collector/src/fileWorker.js:8:12)
at main (file:///home/jonas/Documents/test/staking-rewards-collector/src/index.js:63:7) {
errno: -2,
syscall: 'open',
code: 'ENOENT',
path: 'out/Account 2 15fTw39Ju2jJiHeGe1fJ5DtgugUauy9tr2HZuiRNFwqnGQ1Q.json'
}
Error: ENOENT: no such file or directory, open 'out/Account 2 15fTw39Ju2jJiHeGe1fJ5DtgugUauy9tr2HZuiRNFwqnGQ1Q.csv'
at Object.openSync (fs.js:462:3)
at Object.writeFileSync (fs.js:1384:35)
at writeCSV (file:///home/jonas/Documents/test/staking-rewards-collector/src/fileWorker.js:24:13)
at main (file:///home/jonas/Documents/test/staking-rewards-collector/src/index.js:64:7) {
errno: -2,
syscall: 'open',
code: 'ENOENT',
path: 'out/Account 2 15fTw39Ju2jJiHeGe1fJ5DtgugUauy9tr2HZuiRNFwqnGQ1Q.csv'
}
Error: ENOENT: no such file or directory, open 'out/Overview.csv'
at Object.openSync (fs.js:462:3)
at Object.writeFileSync (fs.js:1384:35)
at writeOverviewCSV (file:///home/jonas/Documents/test/staking-rewards-collector/src/fileWorker.js:85:12)
at main (file:///home/jonas/Documents/test/staking-rewards-collector/src/index.js:71:11) {
errno: -2,
syscall: 'open',
code: 'ENOENT',
path: 'out/Overview.csv'
}
@jonasW3F yeah I did not add "out" to git but had it in the config - I added the folder, another way to fix this would be to just leave the prefix empty in the config. Let me if this solution is fine!
This PR adds support for Centrifuge to the rewards collector. I also modified the script to allow customizing the output directory.