Deterministic Intelligent Chain Executor, a Python TUI for EVM job orchestration.
Project description
DICE
Licensed under the Apache License 2.0.
DICE means Deterministic Intelligent Chain Executor. It is a Python 3.12+ terminal application for managing independent blockchain execution jobs.
This first build provides:
- JSON-backed job storage
- Async job lifecycle management
- A daemon/client architecture so jobs can outlive the TUI
- A workflow model built from triggers, conditions, and actions
- A job plugin registry for extensible automation templates
- Job-type form schemas used by the TUI for dynamic wizard guidance
- Chain adapter interfaces and EVM chain profiles
- A Web3-based EVM adapter for real RPC execution
- Encrypted private-key references and a signer layer
- A reusable wallet vault for named encrypted wallet keys
- Preflight checks before jobs start
- Non-broadcast transaction simulation with gas and max-cost estimates
- Workflow action handlers for contract calls, transfers, waits, notifications, withdrawals, and sweeps
- Watcher, trigger, builder, broadcaster, and executor boundaries
- A Textual dashboard for viewing and starting/stopping jobs
- A
mock://execution path suitable for local development
Setup
For local development from the project root:
py -3.12 -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
python -m pip install -e .
After DICE is published, install the packaged app with:
python -m pip install dice-chain-executor
Then run:
dice
dice-daemon
Note: pip install dice installs an existing unrelated PyPI package. This project uses the PyPI
distribution name dice-chain-executor while keeping the command name dice.
If PowerShell blocks activation scripts, run this once:
Set-ExecutionPolicy -Scope CurrentUser RemoteSigned
After setup, activate the environment in every new terminal before running DICE:
.\.venv\Scripts\Activate.ps1
Before creating jobs with private keys, set the secret password in the daemon terminal:
$env:DICE_SECRET_PASSWORD = "use-a-long-random-password"
DICE encrypts imported private keys into storage/secrets and stores only a secret://...
reference in each job file. New jobs can reuse an existing vault reference such as
secret://wallets/base-sweeper instead of re-entering the private key.
DICE_SECRET_PASSWORD is the master password for that encryption. When you enter a private key,
DICE derives an encryption key from this password, encrypts the private key, and writes only the
encrypted ciphertext to storage/secrets/<job-id>.json. If someone opens the job JSON, they will
only see a reference such as:
"private_key_ref": "secret://wallets/job-0001"
Keep this password safe. If you lose it, DICE cannot decrypt the saved private key later. If someone gets both the encrypted secret file and this password, they can unlock the private key.
Run
dice-daemon
dice
If you do not install the package, you can run the daemon and TUI directly:
python -m dice.service.daemon
python -m dice.app.main
You can also launch the TUI package entry point directly:
python -m dice
The TUI attaches to the daemon at 127.0.0.1:8765 when it is running. If no daemon is available,
the TUI falls back to embedded development mode.
Real RPC Vs Mock RPC
Use mock://local when testing the DICE workflow without sending blockchain transactions.
Use a real HTTP RPC URL when you want the Web3 EVM adapter:
https://...
http://...
Real execution currently requires:
- a supported EVM chain profile
- a reachable RPC whose chain ID matches the selected chain
- an encrypted private-key reference
- a staking/target contract address
- an ABI file path
- a function name and arguments that exist in the ABI
Before a job starts, DICE runs preflight checks. The manager verifies the saved configuration,
plugin rules, RPC connectivity, wallet key availability, signer address, contract bytecode, ABI
function, and transaction simulation where those checks apply. Real EVM simulation builds the
transaction, estimates gas, and shows the maximum native-token fee without signing or broadcasting.
If any required check fails, the job is marked error and does not start.
Job Plugins
DICE treats job types as plugins. Built-in plugins include:
- Stake Sweep
- Token Sweep
- Scheduled Transfer
- Wallet Watch
- Contract Call
- Balance Trigger
- Event Trigger
- Custom Workflow
Each plugin provides metadata, form hints, and a default workflow. The UI flow is:
Select Job Type
|
v
Select Chain
|
v
Dynamic Configuration Form
|
v
Validation
|
v
Summary
|
v
Save
Current TUI Workflow
The interface uses a sidebar for primary navigation and a job action strip above the jobs table. The first screen is the operator home:
Welcome to DICE
Create Job
View Jobs
Global Settings
Exit
Create Job opens a guided wizard that follows this flow:
- Select job type from the plugin registry.
- Select blockchain: Ethereum, BNB Chain, Arbitrum, Base, Optimism, Polygon.
- Configure RPC endpoint: HTTP RPC and optional WebSocket RPC.
- Configure wallet: wallet name, private key, wallet address, destination wallet.
- Choose sweep type: native coin or ERC20 token.
- Enter staking information: staking contract and optional ABI path.
- Choose unlock method: manual, event, timestamp, block, claimable function, or balance change.
- Enter withdrawal function and arguments.
- Choose gas strategy: standard, aggressive, ultra, or custom.
- Review retry policy and summary, then save the job.
The sidebar contains:
HomeCreate JobView JobsLogsSettingsExit
The jobs table is the operator control panel. Select a job row, then use the action strip:
StartCheckStopEditDuplicateDeleteRefresh
Use Check before Start to run preflight manually and see the result in the workflow panel.
Start also runs the same checks automatically.
The TUI asks for fields, but execution still belongs to the daemon/job manager. The UI does not own long-running job state.
Test
python -m pytest
Project Layout
src/
dice/
adapters/ Chain profiles and adapter interfaces
app/ Textual app entry point
core/ Job models, storage, manager, and runtime state
execution/ Transaction build/broadcast orchestration
service/ Long-running daemon and local control client
ui/ Textual screens and widgets
watcher/ Watchers and trigger evaluation
docs/ Architecture and operations notes
storage/
jobs/ Local job JSON files
logs/ Runtime logs
tests/ Core tests
Docs
Open Source
DICE is licensed under the Apache License 2.0.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dice_chain_executor-0.1.0.tar.gz.
File metadata
- Download URL: dice_chain_executor-0.1.0.tar.gz
- Upload date:
- Size: 59.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
594391e4975e3ad906537915afb62bd97112612912297dc9db4ddf2eac796b9d
|
|
| MD5 |
10e56e79a8a34bb4a9a7f340d7e7eb82
|
|
| BLAKE2b-256 |
082dd78c6187e1e83a7e9bd6285ab8ff19ad2ad769323ead73636dc02bd92c93
|
Provenance
The following attestation bundles were made for dice_chain_executor-0.1.0.tar.gz:
Publisher:
publish.yml on aadaam17/DICE
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dice_chain_executor-0.1.0.tar.gz -
Subject digest:
594391e4975e3ad906537915afb62bd97112612912297dc9db4ddf2eac796b9d - Sigstore transparency entry: 2114623363
- Sigstore integration time:
-
Permalink:
aadaam17/DICE@0a1a42b894a61640d01fef49b3504069510aafed -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/aadaam17
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@0a1a42b894a61640d01fef49b3504069510aafed -
Trigger Event:
push
-
Statement type:
File details
Details for the file dice_chain_executor-0.1.0-py3-none-any.whl.
File metadata
- Download URL: dice_chain_executor-0.1.0-py3-none-any.whl
- Upload date:
- Size: 55.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a65ec5338f91b1b1bd6ef75c8c7bfc1ba185870a2162204ec2665781cb30dfa3
|
|
| MD5 |
93e52a30222c50b93f62b5ed2a0c6425
|
|
| BLAKE2b-256 |
af0fd01dcb20540dde1243e950b017e2384d9fee13b0cdfa4b62eb71dc8288d7
|
Provenance
The following attestation bundles were made for dice_chain_executor-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on aadaam17/DICE
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dice_chain_executor-0.1.0-py3-none-any.whl -
Subject digest:
a65ec5338f91b1b1bd6ef75c8c7bfc1ba185870a2162204ec2665781cb30dfa3 - Sigstore transparency entry: 2114623573
- Sigstore integration time:
-
Permalink:
aadaam17/DICE@0a1a42b894a61640d01fef49b3504069510aafed -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/aadaam17
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@0a1a42b894a61640d01fef49b3504069510aafed -
Trigger Event:
push
-
Statement type: