VMDocker is a high-performance, Docker-based virtual machine implementation designed for the HyMatrix computing network. It serves as a universal virtual machine extension that can be seamlessly mounted to HyMatrix nodes, enabling scalable and verifiable computation execution.
- π Universal VM Interface: Compatible with standard HyMatrix VM protocol
- π³ Docker-based: Leverages Docker containers for isolated computation environments
- π Multi-Architecture Support: Supports EVM, WASM, AO, LLM model services, and more
- π Checkpoint & Restore: Advanced state management with CRIU integration
- β‘ High Performance: Optimized for scalable computation workloads
- π AO Compatible: Full support for AO protocol containers
βββββββββββ ββββββββββββ βββββββββββββ
β HyMatrixβββββΆβVMDocker βββββΆβContainer β
β Node β β Manager β β(EVM/WASM) β
βββββββββββ ββββββββββββ βββββββββββββ
HyMatrix is an infinitely scalable decentralized computing network that decouples computation from consensus by anchoring execution logs in immutable storage (Arweave), enabling verifiable, trustless computation anywhere.
π Learn more: https://hymatrix.com/
VMDocker implements the standard HyMatrix VM interface:
// hymx/vmm/schema/schema.go
type Vm interface {
Apply(from string, meta Meta) (res *Result, err error)
Checkpoint() (data string, err error)
Restore(data string) error
Close() error
}Supported Container Types:
- π· EVM: Ethereum Virtual Machine
- π¦ WASM: WebAssembly runtime
- π AO: Arweave AO protocol (Container Repository)
- π€ LLM: Large Language Model services
- β Custom: Any containerized computation environment
| Component | Version | Platform | Required |
|---|---|---|---|
| Operating System | Linux | Any | β |
| Go | 1.24.0+ | Any | β |
| Docker | 27.3.x | Any | β |
| Redis | Latest | Any | β |
| Clang/GCC | Latest | Any | β (for CGO) |
| CRIU | v4.1 | Linux only |
β οΈ Note: CRIU is only required for checkpoint functionality and is Linux-specific. macOS users can skip CRIU installation.
git clone https://github.com/cryptowizard0/vmdocker.git
cd vmdockergo mod tidygo build -o ./build/hymx-node ./cmdUbuntu/Debian:
sudo apt-get update
sudo apt-get install gcc build-essential redis-serverCentOS/RHEL:
sudo yum install gcc gcc-c++ make redisπ Required for: Checkpoint and restore functionality π₯οΈ Platform: Linux systems only
# Download CRIU v4.1 source code
wget https://github.com/checkpoint-restore/criu/archive/criu_v4.1.tar.gz
tar -xzf criu_v4.1.tar.gz
cd criu-criu_v4.1
# Compile and install
make
sudo make install
# Verify installation
criu check
# Expected output: "Looks good."
β οΈ Important: Docker version27.3.xis required for optimal compatibility.
Docker checkpoint requires experimental features to be enabled:
# Create Docker daemon configuration
sudo mkdir -p /etc/docker
# Enable experimental features
sudo tee /etc/docker/daemon.json <<-'EOF'
{
"experimental": true
}
EOF
# Restart Docker service
sudo systemctl restart docker
# Verify experimental features are enabled
docker info | grep "Experimental"
# Expected output: "Experimental: true"VMDocker uses standard HyMatrix configuration format. Create a config.yaml file:
# π Node Service Configuration
port: :8080
ginMode: release # Options: "debug", "release"
# π΄ Redis Configuration
redisURL: redis://@localhost:6379/0
# π Storage & Network
arweaveURL: https://arweave.net
hymxURL: http://127.0.0.1:8080
# π Node Identity (Wallet)
prvKey: 0x64dd2342616f385f3e8157cf7246cf394217e13e8f91b7d208e9f8b60e25ed1b
keyfilePath: # Optional: path to keyfile instead of prvKey
# βΉοΈ Node Information
nodeName: test1
nodeDesc: first test node
nodeURL: http://127.0.0.1:8080
# π Network Participation
joinNetwork: false # Set to true for production network| Field | Type | Description | Example |
|---|---|---|---|
port |
string | HTTP server port | :8080 |
ginMode |
string | Gin framework mode | release or debug |
redisURL |
string | Redis connection URL | redis://@localhost:6379/0 |
arweaveURL |
string | Arweave gateway URL | https://arweave.net |
hymxURL |
string | Local node URL for SDK calls | http://127.0.0.1:8080 |
prvKey |
string | Ethereum private key (hex) | 0x64dd... |
keyfilePath |
string | Alternative to prvKey | ./keyfile.json |
nodeName |
string | Node identifier | my-node |
nodeDesc |
string | Node description | Production node |
nodeURL |
string | Public node URL | https://my-node.com |
joinNetwork |
boolean | Join HyMatrix network | false (testing), true (production) |
π For detailed configuration options, see HyMatrix Configuration Documentation
VMDocker modules must follow specific format requirements to ensure proper container execution:
- Required Prefix:
web.vmdocker- - Format Pattern:
web.vmdocker-{runtime}-{version} - Examples:
web.vmdocker-golua-ao.v0.0.1web.vmdocker-wasm-ao.v1.0.0web.vmdocker-evm-ao.v2.1.0
Every VMDocker module MUST include the following tags:
| Tag Name | Description | Example |
|---|---|---|
Image-Name |
Docker image name and tag | chriswebber/docker-golua:v0.0.2 |
Image-ID |
Docker image SHA256 digest | sha256:b2e104cdcb5c09a8f213aefcadd451cbabfda1f16c91107e84eef051f807d45b |
β οΈ Important: BothImage-NameandImage-IDtags are mandatory. Missing either tag will cause module validation to fail.
Follow these steps to create and deploy your custom VMDocker module:
Step 1: Modify Module Configuration
Edit the examples/module.go file and fill in your module information:
// examples/module.go
item, _ := s.GenerateModule([]byte{}, schema.Module{
Base: schema.DefaultBaseModule,
ModuleFormat: "web.vmdocker-golua-ao.v0.0.1", // Must start with "web.vmdocker-"
Tags: []arSchema.Tag{
{Name: "Image-Name", Value: "chriswebber/docker-golua:v0.0.2"},
{Name: "Image-ID", Value: "sha256:b2e104cdcb5c09a8f213aefcadd451cbabfda1f16c91107e84eef051f807d45b"},
},
})Step 2: Generate Module File
Run the command in the examples directory to generate the module configuration file:
cd examples
go run ./ moduleThis will generate a mod-xxxx.json file containing your module configuration.
Step 3: Deploy Module
Copy the generated module file to the VMDocker modules directory:
# Copy the generated module file to cmd/mod/ directory
cp mod-*.json ../cmd/mod/Step 4: Verify Deployment
Check if the module file is correctly deployed:
ls ../cmd/mod/mod-*.jsonNow your custom module is ready to use in VMDocker!
VMDocker automatically validates modules using the checkModule function:
- β
ModuleFormat Check: Verifies format starts with
web.vmdocker- - β
Image-Name Check: Ensures
Image-Nametag exists and is not empty - β
Image-ID Check: Ensures
Image-IDtag exists and is not empty
If any validation fails, the module will be rejected and container creation will fail.
To obtain the correct Image-ID value:
# Pull the image
docker pull chriswebber/docker-golua:v0.0.2
# Get the SHA256 digest
docker inspect chriswebber/docker-golua:v0.0.2 --format='{{.Id}}'
# Output: sha256:b2e104cdcb5c09a8f213aefcadd451cbabfda1f16c91107e84eef051f807d45b-
Configure Example Settings
Edit the configuration in
examples/main.go:// examples/main.go var ( url = "http://127.0.0.1:8080" // Your node URL prvKey = "0x64dd2342616f385f3e8157cf7246cf394217e13e8f91b7d208e9f8b60e25ed1b" // Your private key signer, _ = goether.NewSigner(prvKey) bundler, _ = goar.NewBundler(signer) s = sdk.NewFromBundler(url, bundler) )
-
Generate Module File
cd examples go run ./ moduleThis will generate a
mod-xxxx.jsonfile containing your module configuration. -
Install Module
# Copy the generated module file to the modules directory cp mod-*.json ../cmd/mod/
Ensure Redis is running before starting VMDocker:
# Ubuntu/Debian
sudo systemctl start redis-server
sudo systemctl enable redis-server
# CentOS/RHEL
sudo systemctl start redis
sudo systemctl enable redis
# macOS (with Homebrew)
brew services start redis# From the project root directory
./build/hymx-node --config ./config.yamlSuccessful startup will display:
INFO[07-25|00:00:01] server is running module=node-v0.0.1 wallet=0x... port=:8080
To participate as a network node operator:
-
Configure for Production
joinNetwork: true nodeURL: https://your-public-domain.com # Your public URL
-
Stake HMX Tokens
- Acquire the required HMX tokens
- Complete the staking process
-
Complete Registration
- Submit node registration
- Wait for network acceptance
Participating nodes earn rewards for:
- β‘ Computation execution
- π Log submission
- π Network services
- π‘οΈ Network security
π For detailed network joining instructions, see HyMatrix Network Documentation
vmdocker is an AO-compatible system. Use the modified AOS to connect to vmdocker.
-
Clone AOS repository:
git clone https://github.com/cryptowizard0/aos
-
Install Node.js dependencies:
npm install
-
Start AOS client:
cu-urlandmu-urlshould be the same as the vmdocker node urlscheduleris the vmdocker node id
DEBUG=true node src/index.js \ --cu-url=http://127.0.0.1:8080 \ --mu-url=http://127.0.0.1:8080 \ --scheduler=0x972AeD684D6f817e1b58AF70933dF1b4a75bfA51 \ test_name
After the first launch, please record your Process ID. To reconnect to the specific process later, use the following command:
DEBUG=true node src/index.js \ --cu-url=http://127.0.0.1:8080 \ --mu-url=http://127.0.0.1:8080 \ --scheduler=0x972AeD684D6f817e1b58AF70933dF1b4a75bfA51 \ {{pricessid}}
Reference implementations are available in the examples directory.