OpenStore Client consists of two main components:
Synchronizes data from the blockchain and stores it in the database. The daemon continuously monitors blockchain events and updates the local database with the latest information.
Retrieves synced data from the database and provides it to users through REST API endpoints. The API serves as the interface for applications to access the synchronized blockchain data.
# Start both client services
docker compose up api-client daemon-client
# Start only API service
docker compose up api-client
# Start only daemon service
docker compose up daemon-client
# View logs
docker compose logs -f api-client
docker compose logs -f daemon-clientThe Docker containers automatically read environment variables from your .env file. Make sure to set up the .env file in the project root with all required variables listed below.
The following environment variables are required:
ETH_NODE_URL- Ethereum node URL for blockchain connectionGF_NODE_URL- Greenfield node URL for additional blockchain dataETHSCAN_API_KEY- Etherscan API key for blockchain data verificationCHAIN_ID- Blockchain chain ID (e.g., 1 for mainnet, 31337 for local)
WALLET_PK- Private key for wallet operations
ORACLE_ADDRESS- Address of the Oracle smart contractSTORE_ADDRESS- Address of the OpenStore smart contract
HISTORICAL_SYNC_THRESHOLD- Block threshold for historical sync (default: 500)HISTORICAL_SYNC_BLOCK- Starting block for historical synchronization (default: 0)
CLIENT_HOST_URL- Host URL for the client API (default: 127.0.0.1:8080)
DATABASE_URL- PostgreSQL database connection URLREDIS_URL- Redis connection URL for caching
TG_TOKEN- Telegram bot token for notificationsTG_INFO_CHAT_ID- Chat ID for info notificationsTG_ALERT_CHAT_ID- Chat ID for alert notifications