Open kic0 opened 3 days ago
Hmm, I'll have to check it again, but this line should convert it to proper json array so I don't think that's the issue:
const jsonLines = data.split('\n').filter(Boolean);
Can you double check your .env variable? Does it work if you don't set the variable and it defaults to https://solo.ckpool.org
Hello @mrv777 thanks for the reply.
I tried setting the .env variable as requested although the issue persists, same error while running pnpm seed:
~/ckstats$ pnpm seed
> ckstats@0.2.3 seed /home/user/ckstats
> node scripts/seed.js
Fetching pool stats...
Fetching pool stats...
Error seeding database: SyntaxError: Unexpected token < in JSON at position 0
at JSON.parse (<anonymous>)
at /home/user/ckstats/scripts/seed.js:11:73
at Array.reduce (<anonymous>)
at fetchPoolStats (/home/user/ckstats/scripts/seed.js:11:32)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async seed (/home/user/ckstats/scripts/seed.js:18:19)
I noticed while running "pnpm build" that:
✓ Finalizing page optimization
Route (app) Size First Load JS
┌ ○ / 2.14 kB 197 kB
├ ○ /_not-found 146 B 87.6 kB
├ ƒ /api/resetUser 0 B 0 B
├ ƒ /api/users 0 B 0 B
├ ƒ /api/users/togglePrivacy 0 B 0 B
├ ○ /top-difficulties 179 B 94.4 kB
├ ○ /top-hashrates 179 B 94.4 kB
├ ƒ /users/[address] 2.89 kB 202 kB
└ ƒ /users/[address]/workers/[[...name]] 1.43 kB 196 kB
+ First Load JS shared by all 87.4 kB
├ chunks/111-fed466ce3ba24250.js 31.8 kB
├ chunks/3067790c-b8794aaead367cb1.js 53.7 kB
└ other shared chunks (total) 2 kB
/api/* shows 0B which seems strange to me could this be related?
Some info that could help:
$ uname -ar
Linux btc-node 6.8.0-48-generic #48-Ubuntu SMP PREEMPT_DYNAMIC Fri Sep 27 14:04:52 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
$ pnpm --version
9.13.2
$ pnpm next --version
Next.js v14.2.14
Let me know if you need something else from my side, thanks in advance.
Hi,
I installed ckpool-solo and then this repo, everything seems fine with instalation of both repos although the file provided under ~/ckpool-solo/src/logs/pool/pool.status seems to be broken for a valid json file and this breaks the instalation of ckstats when running pnpm seed:
The API seems correctly setup from this request:
https://pool.address/api/users/btcaddress
Shows a correctly parsed json:
While https://pool.address/api/pool/pool.status shows:
Error:
Same reply from an online Json parser:
Either the file under ~/ckpool-solo/src/logs/pool/pool.status needs to be generated in another way to make it a valid Json file or it needs to be parsed differently under ~/ckstats/scripts/seed.js in order to be correctly parsed.
After fiddling around with the Json output a bit it seems it should be:
This parses to:
Given this the issue seems to be in the way the log file "json" is being created under ~/ckpool-solo/src/logs/pool/pool.status and maybe this issue belongs on the other repo?
Any help would be great, thanks in advance!