The GIVpower Bot is a service that automates the unlocking of GIVpower positions in the Giveth ecosystem. It monitors and manages the unlocking process of staked GIV tokens, ensuring smooth operation of the GIVpower system.
- Automated unlocking of GIVpower positions
- Integration with EVM blockchains
- Subgraph querying for position data
- Configurable service intervals
- Configurable unlock batch size
- Mainnet: Giveth Platform
- Documentation: Giveth Docs
graph TD
A[GIVpower Bot] --> B[Ethereum Blockchain]
A --> C[The Graph Subgraph]
A --> D[Logger]
B --> E[Smart Contracts]
C --> F[Position Data]
- TypeScript
- Ethers.js for blockchain interaction
- GraphQL for subgraph queries
- Winston for logging
- PM2 for process management
- Bot queries subgraph for unlockable positions
- Executes unlock transactions when conditions are met
- Logs all actions and results
- Node.js (v18 or higher)
- Yarn package manager
- TypeScript (v4.7.4 or higher)
- Access to Ethereum node (Infura/Alchemy)
- PM2 (for production deployment)
-
Clone the repository:
git clone https://github.com/Giveth/givpower-bot.git cd givpower-bot
-
Install dependencies:
yarn install
-
Build the project:
yarn build
Create a .env
file in the config directory by copying the .env.example
file.
NOTE: You can create <NODE_ENV>.env
file and set NODE_ENV
in command line to read the correct environment variables.
-
Development mode:
Create a
develop.env
file in the config directory by copying the.env.example
file. Fill in the correct values for the environment variables.yarn start-dev
-
Production mode:
Create
.env
file in the config directory by copying the.env.example
file. Fill in the correct values for the environment variables.yarn serve
-
Clean build directory:
yarn clean
-
Rebuild project:
yarn build
- Copy
.env.example
file to.env
in the config directory.
- Run
docker compose up -d
to start the service.
The project uses GitHub Actions for CI/CD. Workflows are defined in the .github/workflows
directory.
- Connection Issues: Ensure your NODE_URL is working
- Transaction Failures: Check gas prices, account corresponding to
PRIVATE_KEY
has enough balance, GIVPOWER_CONTRACT_ADDRESS, and network congestion - Subgraph Errors: Verify subgraph health and synchronization
- Logs are stored in the
logs
directory - Use Winston logger for detailed debugging