Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
3510597
refactor: remove legacy test workflow and add CI for testing and publ…
Emmo00 Jan 28, 2026
a8dc875
refactor: update preferred prover node configuration to allow null fa…
Emmo00 Feb 2, 2026
04dc70d
refactor: integrate meter pruning into Streamr cron job for improved …
Emmo00 Feb 3, 2026
000f8d7
refactor: modularize Streamr configuration and remove legacy console …
Emmo00 Feb 4, 2026
358fee7
refactor: update database path handling in setupDatabase and deleteDa…
Emmo00 Feb 4, 2026
4260071
refactor: enhance module configuration handling and add warnings for …
Emmo00 Feb 4, 2026
56ff384
refactor: update Dockerfile and entrypoint script for improved module…
Emmo00 Feb 4, 2026
5109ffd
Merge branch 'main' into refactor/modular
Emmo00 Feb 4, 2026
75f99b4
refactor: reorganize environment variables in README and .env.example…
Emmo00 Feb 4, 2026
f814226
Merge branch 'refactor/modular' of https://github.com/M3tering/Consol…
Emmo00 Feb 4, 2026
edd1509
refactor: adjust retry delay for Streamr connection to improve stability
Emmo00 Feb 4, 2026
5238af2
refactor: log pending transactions count in handleMessage function
Emmo00 Feb 4, 2026
73477e6
refactor: add .private file for sensitive data management
Emmo00 Feb 4, 2026
cb557fb
refactor: update database path and manage sensitive data with .privat…
Emmo00 Feb 4, 2026
68397c6
refactor: add env_file configuration to docker-compose for environmen…
Emmo00 Feb 4, 2026
d2eb3d2
refactor: enhance logging for Streamr cron job and extend wait time f…
Emmo00 Feb 4, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file added .data/.private
Empty file.
29 changes: 22 additions & 7 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,8 +1,23 @@
PORT="3000"
API_TOKEN="..."
APPLICATION_ID="..."
CONTRACT_LABEL="M3ters"
CHIRPSTACK_HOST="localhost"
MAINNET_RPC="https://sepolia.drpc.org"
PREFERRED_PROVER_NODE="http://prover.m3ter.ing"
# Server Configuration
PORT=3000

# Module Configuration
BACKEND_MODULES="core/arweave,core/is_on,core/prover,core/streamr"
UI_MODULES="streamr:core/streamr/ui"

# ChirpStack Configuration
API_TOKEN=...
APPLICATION_ID=...
CHIRPSTACK_HOST=localhost

# Contract & Network Configuration
CONTRACT_LABEL=M3ters
MAINNET_RPC=https://sepolia.drpc.org
ETHEREUM_PRIVATE_KEY="..."

# Streamr Configuration
STREAMR_STREAM_ID="0x567853282663b601bfdb9203819b1fbb3fe18926/m3tering/test"
STREAMR_CRONSCHEDULE="0 * * * *" # Every hour

# Optional: Prover Node (disabled publishing to prover if not set)
# PREFERRED_PROVER_NODE="http://prover.m3ter.ing"
151 changes: 151 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
name: M3tering Console Test and Publish Docker Image

on:
workflow_dispatch:
push:
pull_request:
branches:
- main

env:
REGISTRY: ghcr.io

permissions:
contents: read
packages: write
attestations: write
id-token: write

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: "20"

- name: Install dependencies
run: npm install

- name: Run tests
run: npm test

build-platform:
needs: [test]
strategy:
matrix:
include:
- platform: linux/amd64
runner: ubuntu-latest
arch: amd64
- platform: linux/arm64
runner: ubuntu-24.04-arm
arch: arm64

runs-on: ${{ matrix.runner }}

steps:
- name: Checkout repository
uses: actions/checkout@v5

- name: Normalize image names
run: |
echo "CONSOLE_IMAGE_NAME=${GITHUB_REPOSITORY,,}" >> $GITHUB_ENV

- name: Free disk space
uses: jlumbroso/free-disk-space@main
with:
tool-cache: true
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to GitHub Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

# Console image - push by digest with repository name
- name: Build Console image (single platform)
id: build-console
uses: docker/build-push-action@v6
with:
context: .
platforms: ${{ matrix.platform }}
push: ${{ github.event_name != 'pull_request' }}
outputs: type=image,name=${{ env.REGISTRY }}/${{ env.CONSOLE_IMAGE_NAME }},push-by-digest=true
cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.CONSOLE_IMAGE_NAME }}:buildcache-${{ matrix.arch }}
cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ env.CONSOLE_IMAGE_NAME }}:buildcache-${{ matrix.arch }},mode=max

- name: Save digests to files
if: github.event_name != 'pull_request'
run: |
echo ${{ steps.build-console.outputs.digest }} > digests-${{ matrix.arch }}-console-digest.txt

- name: Upload digests artifact
if: github.event_name != 'pull_request'
uses: actions/upload-artifact@v4
with:
name: digests-${{ matrix.arch }}
path: |
digests-${{ matrix.arch }}-console-digest.txt

create-manifests:
needs: build-platform
if: github.event_name != 'pull_request'
runs-on: ubuntu-latest

steps:
- name: Normalize image names
run: |
echo "CONSOLE_IMAGE_NAME=${GITHUB_REPOSITORY,,}" >> $GITHUB_ENV

- name: Download all digests
uses: actions/download-artifact@v4
with:
pattern: digests-*
merge-multiple: true

- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Extract metadata for Console image
id: meta-console
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.CONSOLE_IMAGE_NAME }}

- name: Create multi-arch manifest for Console
run: |
AMD64_DIGEST=$(cat digests-amd64-console-digest.txt)
ARM64_DIGEST=$(cat digests-arm64-console-digest.txt)
echo AMD64_DIGEST=$AMD64_DIGEST
echo ARM64_DIGEST=$ARM64_DIGEST
TAGS=(${{ steps.meta-console.outputs.tags }})
TAG_ARGS=""
for tag in "${TAGS[@]}"; do
TAG_ARGS="$TAG_ARGS --tag $tag"
done
docker buildx imagetools create $TAG_ARGS \
${{ env.REGISTRY }}/${{ env.CONSOLE_IMAGE_NAME }}@$AMD64_DIGEST \
${{ env.REGISTRY }}/${{ env.CONSOLE_IMAGE_NAME }}@$ARM64_DIGEST
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# console configuration file
# console.config.json

#test scripts
emulate.ts
test-database.ts
Expand Down
7 changes: 4 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
"cSpell.words": [
"ardrive",
"arweave",
"m3ters",
"Emmo00",
"ccip",
"Mauchly",
"CRONSCHEDULE",
"Emmo00",
"m3ters",
"Mauchly"
]
}
8 changes: 6 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM node:20-alpine
# Create working directory
WORKDIR /opt/app

RUN apk add --no-cache cmake make g++ python3 openssl-dev py3-setuptools
RUN apk add --no-cache cmake make g++ python3 openssl-dev py3-setuptools git

# Copy and install dependencies
COPY package*.json ./
Expand All @@ -14,13 +14,17 @@ RUN npm install --include=dev && npm cache clean --force
COPY babel.config.js .
COPY tsconfig.json .
COPY src ./src
COPY console.config.json .

# Build project
RUN npm run build

# Expose application port
EXPOSE 3000

COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh

ENTRYPOINT ["/entrypoint.sh"]

# Start app
CMD [ "npm", "start" ]
Loading
Loading