🤖 ThirdWeb Engine Configuration
Set up ThirdWeb Engine for automated transaction execution - the self-hosted automation service that handles automated bidding for your Stylus contracts.
🎯 What is ThirdWeb Engine?
ThirdWeb Engine is a self-hosted automation service that:
- 🤖 Executes Transactions: Places backend triggered automated bids based on configured rules
- 🔒 Secure Execution: Handles private keys securely in isolated containers
- 📊 Monitoring: Provides transaction history and status tracking
- 🌐 Multi-Network: Supports multiple blockchain networks simultaneously
Why Self-Hosted?
Self-hosting Engine v2 gives you full control over your automation infrastructure while maintaining security and reliability.
🔧 Prerequisites
Before configuring ThirdWeb Engine, ensure you have:
- Docker & Docker Compose installed and running
- ThirdWeb Account (free registration at thirdweb.com)
- Deployed CMA Contracts from the previous step
- Access to a deployment wallet for configuration
📋 Setup Overview
The configuration process involves:
- 🏗️ Create ThirdWeb Project - Set up your workspace
- 🔑 Configure Environment - Set up local environment variables
- 🐳 Deploy Engine Services - Start the self-hosted automation
- 🔗 Link to ThirdWeb Dashboard - Connect local instance to web interface
- 💰 Configure Wallets - Set up backend wallet for transactions
- 🌐 Add Custom Networks - Configure your Arbitrum networks
🏗️ Step 1: Create ThirdWeb Project
1.1 Login to ThirdWeb
Visit thirdweb.com and log in using your wallet
1.2 Create New Project
Create a new project for your automation setup:


Domain Configuration
For testing, you can allow all domains. For production, specify your backend domain and thirdweb domain for enhanced security.
1.3 Save Project Keys
Copy and save your project keys securely - you'll need them for configuration:

Key Security
The wallet you use to log in will become the project admin. Keep your keys secure and never share them publicly.
🔑 Step 2: Configure Environment
2.1 Copy Environment Files
Copy the example environment files:
cp src/docker/.env.engine.example src/docker/.env.engine
cp src/docker/.env.engine-db.example src/docker/.env.engine-db
2.2 Configure Engine Environment
Edit src/docker/.env.engine
with your ThirdWeb configuration:
# Required: Complex password for database encryption
ENCRYPTION_PASSWORD=your_complex_encryption_password_here
# Required: Your ThirdWeb API secret key
THIRDWEB_API_SECRET_KEY=your_thirdweb_api_secret_key
# Required: Admin wallet address (use your ThirdWeb login wallet)
ADMIN_WALLET_ADDRESS=0xYourThirdWebLoginWalletAddress
# Required: Backend wallet address (can be same as admin for testing)
BACKEND_WALLET_ADDRESS=0xYourThirdWebLoginWalletAddress
# Optional: Keep defaults for local deployment
POSTGRES_CONNECTION_URL=postgresql://scm-engine-db-user:scm-engine-db-pwd@scm-engine-db:5432/scm_engine_db?sslmode=disable
REDIS_URL=redis://scm-engine-redis:6381?family=0
PORT=3005
HOST=::
2.3 Configure Database Environment
Edit src/docker/.env.engine-db
(keep defaults for local deployment):
POSTGRES_CONNECTION_URL=postgresql://scm-engine-db-user:scm-engine-db-pwd@scm-engine-db:5432/scm_engine_db?sslmode=disable
REDIS_URL=redis://scm-engine-redis:6381?family=0
PORT=3005
🐳 Step 3: Deploy Engine Services
3.1 Start Engine Services
Use the automated script to start all Engine services:
Or manually start with Docker Compose:
3.2 Verify Services
Check that all services are running:
You should see:
scm-engine-db
- PostgreSQL databasescm-engine-redis
- Redis cachescm-engine
- ThirdWeb Engine service
3.3 Service Management
Additional commands for managing Engine services:
# Pause services
npm run engine:pause
# Stop and remove services
npm run engine:delete
# View logs
docker compose -f src/docker/docker-compose.yaml logs -f scm-engine
🔗 Step 4: Link to ThirdWeb Dashboard
4.1 Allow HTTP Requests
HTTP Access Required
To allow the ThirdWeb frontend to communicate with your local Engine instance, visit this URL in your browser:
Accept the HTTP security warning and allow insecure navigation.
4.2 Access Project Transactions
Navigate to your project's transactions page:
4.3 View Dedicated Engine
Click on "View Dedicated Engine" to access Engine management:

4.4 Import Local Engine
Click "Import Engine" to connect your local instance:

4.5 Configure Engine Settings
Configure your local Engine instance:

Local Access Only
Only you can manage this instance since it's running on localhost. For team access, deploy to cloud or create a tunnel.
4.6 Verify Instance
After importing, you should see your Engine instance in your list.
💰 Step 5: Configure Backend Wallet
5.1 Import Backend Wallet
For testing, you can import the admin wallet as the backend wallet:


Production Security
For production, use a separate wallet for backend operations. Backend wallets only need balance - if compromised, you can replace them easily.
5.2 Verify Wallet Import
Confirm the wallet is successfully imported:

🔑 Step 6: Create Access Token
6.1 Generate Access Token
Go to the Access Tokens section and create a new token:

6.2 Save Token
Copy and save your access token securely:

Token Security
Keep this token secure - it's required for backend communication with Engine.
🌐 Step 7: Add Custom Networks
7.1 Add Local Testnode
Use your access token to add your local Arbitrum testnode:
ACCESS_TOKEN=<PASTE_YOUR_ACCESS_TOKEN>
curl --location 'http://localhost:3005/configuration/chains' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer '$ACCESS_TOKEN \
--data '{
"chainOverrides": [
{
"name": "Arbitrum Local",
"chain": "ETH",
"rpc": [
"http://host.docker.internal:8547"
],
"nativeCurrency": {
"name": "Ether",
"symbol": "ETH",
"decimals": 18
},
"chainId": 412346,
"slug": "arbitrum-local"
}
]
}'
Docker Networking
We use host.docker.internal:8547
instead of localhost:8547
because Engine runs in Docker containers and needs to access the host machine's localhost.
7.2 Add Other Networks
You can add any custom network to Engine by using the same request we used for adding Arbitrum Local Testnode
✅ Configuration Complete
Congratulations! Your ThirdWeb Engine is now configured and ready to:
- 🤖 Execute automated transactions for cache bidding
- 📊 Monitor transaction status through the ThirdWeb dashboard
- 🔒 Securely manage private keys in isolated containers
- 🌐 Support multiple networks for different environments
🔧 Next Steps
With Engine configured, proceed to SCM UI Backend - Configure the backend API service