A complete development environment for building, testing, and deploying Hathor nano contracts using Docker and Make commands.
This project provides a full Hathor blockchain development stack with:
- Hathor Full Node - Local blockchain node for development
- Transaction Mining Service - Handles transaction mining
- Wallet Headless - API-based wallet for transactions
- Traefik Reverse Proxy - Routes traffic to services
- CPU Miner - Mines blocks for the local network
-
Start the development environment:
make up
-
Start your wallet:
make start-wallet
-
Deploy nano contracts:
make deploy-blueprints
Run make help to see all available commands with descriptions.
| Command | Description |
|---|---|
make up |
Start all services |
make down |
Stop all services |
make logs |
Show all services logs |
make status |
Show service status |
| Command | Description | Example |
|---|---|---|
make start-wallet |
Start wallet with default seed | make start-wallet |
make get-addresses |
Get wallet addresses | make get-addresses |
make get-balance |
Get wallet balance | make get-balance |
make send-tx <address> <value> [token] |
Send transaction | make send-tx WjhZorHgJ73PGmCndvrciMvPUkzyrRNEZ4 1000 |
Wallet ID Configuration:
All wallet commands use the WALLET_ID parameter (default: test-wallet). Override with:
make get-balance WALLET_ID=456| Command | Description | Example |
|---|---|---|
make get-last-tx-hash |
Get hash of last transaction | make get-last-tx-hash |
make get-last-tx |
Get complete last transaction | make get-last-tx |
make get-tx-by-id <hash> |
Get transaction by ID | make get-tx-by-id 0000012dfb... |
| Command | Description |
|---|---|
make deploy-blueprints |
Deploy all contracts from nano_contracts/ folder |
This command:
- Automatically finds all
.pyfiles innano_contracts/ - Deploys each contract to the blockchain
- Saves deployment results to
deployments.txt - Shows contract name and hash for each deployment
The environment supports both .localhost (no setup required) and .hathor.local (requires /etc/hosts) domains:
- Traefik Dashboard: http://localhost:1339
- Fullnode: http://fullnode.localhost:1337 or http://fullnode.hathor.local:1337
- Mining Service: http://mining.localhost:1337 or http://mining.hathor.local:1337
- Wallet: http://wallet.localhost:1337 or http://wallet.hathor.local:1337
nano-headers-env/
├── docker-compose.yml # Docker services configuration
├── Makefile # Development commands
├── deployments.txt # Contract deployment results
├── nano_contracts/ # Nano contract blueprints
│ ├── authority.py # Authority management contract
│ └── token_manager.py # Token management contract
└── README.md # This file
- Add your
.pyfile to thenano_contracts/folder - Follow the blueprint pattern (see existing contracts)
- Run
make deploy-blueprintsto deploy all contracts
- Default Wallet ID:
test-wallet - Seed Phrase: Pre-configured for development
- Network:
testnet(nano-testnet-alpha)
- Blockchain: Private Hathor testnet
- Mining: Automatic CPU mining enabled
- Consensus: Test mode with reduced difficulty
-
Start Environment:
make up make start-wallet
-
Check Wallet Status:
make get-addresses make get-balance
-
Develop Contracts:
- Create new
.pyfiles innano_contracts/ - Follow existing blueprint patterns
- Create new
-
Deploy Contracts:
make deploy-blueprints
-
Test Transactions:
make send-tx <address> <amount> make get-last-tx-hash
make status
make logs# Check if wallet is started
make get-addresses
# Restart wallet
make start-wallet- Ensure Docker is running
- Check if ports 1337-1339 are available
- Verify
/etc/hostsentries for.hathor.localdomains
- Check
deployments.txtfor error details - Verify contract syntax in
nano_contracts/files - Ensure wallet has sufficient balance
Base URL: http://wallet.localhost:1337
POST /start- Start walletGET /wallet/address/- Get addressesGET /wallet/balance- Get balancePOST /wallet/simple-send-tx- Send transactionPOST /wallet/nano-contracts/create-on-chain-blueprint- Deploy contract
Base URL: http://fullnode.localhost:1337/v1a
GET /transaction?count=1- Get recent transactionsGET /transaction?id=<hash>- Get transaction by IDGET /status- Node status
- Add new nano contracts to
nano_contracts/ - Update this README for new features
- Test with
make deploy-blueprints - Ensure all commands work as expected
This project uses the Apache License 2.0 for nano contracts and follows Hathor Labs licensing.