fix/podman-postgres-integration (#37)

resolves #25

Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: johba <johba@harb.eth>
Reviewed-on: https://codeberg.org/johba/harb/pulls/37
This commit is contained in:
johba 2025-10-01 20:26:49 +02:00
parent 8947ec11ca
commit b4c829e4d6
25 changed files with 187 additions and 144 deletions

View file

@ -11,6 +11,8 @@ Automation service that maintains liquidity alignment and tax enforcement for th
- `service.js` - Main loop that polls the GraphQL endpoint, evaluates triggers, and submits transactions.
- `generateKey.js` - Utility for provisioning dedicated bot wallets.
- `package.json` scripts - `npm install`, `npm start`, and debug runs via `DEBUG=* npm start`.
- **ES Module**: This service uses `"type": "module"` and imports kraiken-lib as an ES module. All imports use ES module syntax (`import` instead of `require()`).
- **Node.js Compatibility**: Requires Node.js ≥14 with ES module support. The `__dirname` and `__filename` globals are not available; use `import.meta.url` with `fileURLToPath()` instead.
## Configuration
Set the following environment variables (automatically generated when the stack script is used):

View file

@ -1,6 +1,7 @@
{
"name": "marketMaker",
"version": "0.0.1",
"type": "module",
"main": "index.js",
"license": "GPL3",
"scripts": {

View file

@ -1,13 +1,19 @@
const path = require('path');
import path from 'path';
import { fileURLToPath } from 'url';
import dotenv from 'dotenv';
import { ethers } from 'ethers';
import express from 'express';
import { decodePositionId } from 'kraiken-lib/ids';
import { isPositionDelinquent } from 'kraiken-lib/staking';
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const dotenvPath = process.env.TXN_BOT_ENV_FILE
? path.resolve(process.env.TXN_BOT_ENV_FILE)
: path.resolve(__dirname, '.env');
require('dotenv').config({ path: dotenvPath });
const { ethers } = require('ethers');
const express = require('express');
const { decodePositionId } = require('kraiken-lib/ids');
const { isPositionDelinquent } = require('kraiken-lib/staking');
dotenv.config({ path: dotenvPath });
const ACTIVE_POSITIONS_QUERY = `
query ActivePositions {