Skip to content

Commit

Permalink
Add PoP stats service
Browse files Browse the repository at this point in the history
  • Loading branch information
gabmontes committed Aug 21, 2024
1 parent 6b21809 commit 837e7f5
Show file tree
Hide file tree
Showing 10 changed files with 3,256 additions and 0 deletions.
2 changes: 2 additions & 0 deletions popstats/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
redis-data
3 changes: 3 additions & 0 deletions popstats/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.env
node_modules
redis-data
1 change: 1 addition & 0 deletions popstats/.nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
22
12 changes: 12 additions & 0 deletions popstats/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM node:22-alpine

WORKDIR /home/node/app

COPY package.json pnpm-lock.yaml .
RUN corepack enable
RUN pnpm install --prod
COPY . .

USER node

CMD [ "npm", "start"]
48 changes: 48 additions & 0 deletions popstats/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"name": "hemi-pop-stats",
"version": "1.0.0",
"description": "PoP miner stats daemon for Absinthe reporting",
"license": "MIT",
"author": {
"name": "Gabriel Montes"
},
"scripts": {
"docker:build": "docker build -t hemilabs/pop-stats:$npm_package_version -t hemilabs/pop-stats:latest .",
"docker:run": "docker run -it --env-file .env --rm hemilabs/pop-stats:latest",
"redis:start": "docker run -d -p 6379:6379 -v ./redis-data:/data --name pop-stats-redis --rm redis:7-alpine redis-server --save 60 1 --loglevel warning",
"redis:stop": "docker stop $(docker ps -aqf \"name=pop-stats-redis\")"
},
"dependencies": {
"before-exit": "1.0.0",
"hemi-viem": "1.1.0",
"lodash": "^4.17.21",
"p-filter": "^4.1.0",
"p-limit": "^6.1.0",
"p-throttle": "^6.2.0",
"promise-mem": "^1.0.2",
"redis": "4.6.15",
"viem": "2.17.3"
},
"devDependencies": {
"eslint": "^8.57.0",
"eslint-config-bloq": "^4.1.0"
},
"engines": {
"node": ">=12.0.0"
},
"packageManager": "[email protected]+sha512.140036830124618d624a2187b50d04289d5a087f326c9edfc0ccd733d76c4f52c3a313d4fc148794a2a9d81553016004e6742e8cf850670268a7387fc220c903",
"type": "module",
"eslintConfig": {
"extends": [
"bloq",
"bloq/node"
],
"root": true,
"rules": {
"no-console": "off",
"no-process-exit": "off",
"quotes": "off"
}
},
"prettier": {}
}
Loading

0 comments on commit 837e7f5

Please sign in to comment.