@alephium/powfi-backend
v1.0.0
Published
Start timescaledb:
Readme
Powfi Backend
Development
Start timescaledb:
cd docker
docker-compose up -dTo start the server on testnet with a clean db:
bun start:cleanTo target a specific network, set NETWORK_ID before running the command, for example:
NETWORK_ID=testnet bun start:cleanTo simply start the server on devnet:
bun run src/tools/cleanup-database.ts
bun run src/tools/populate-database.ts
bun startSchema Migrations
Create a new SQL migration:
bun run migrate:create -- add_some_changeApply pending migrations:
bun run migrate:upRevert the latest migration:
bun run migrate:downDocker
Build
Build the backend image:
docker build -t powfi-backend -f Dockerfile .Build the tools image:
docker build -t powfi-tools -f Dockerfile.tools .Tools image usage
# Show available commands
docker run --rm powfi-tools
# Drop and recreate the database schema
docker run --rm --network host powfi-tools cleanup
# Discover pools and fetch historical events
docker run --rm --network host powfi-tools populate
# Generate synthetic OHLCV data for all pools
docker run --rm --network host powfi-tools ohlcv generate-all
# Generate synthetic OHLCV for a specific pool
docker run --rm --network host powfi-tools ohlcv generate --pool <poolId>
# Clean up synthetic OHLCV data
docker run --rm --network host powfi-tools ohlcv cleanup-all