CLI Reference
Complete reference for the chainlaunch command-line interface.
Global Flags
--help, -h Show help
--version, -v Show version
Commands
serve
Start the ChainLaunch server.
chainlaunch serve [flags]
| Flag | Description | Default |
|---|---|---|
--port | HTTP server port | 8100 |
--db | SQLite database path | chainlaunch.db |
--data | Data directory for node configs and certs | ./data |
--tls-cert | TLS certificate file path | (none) |
--tls-key | TLS private key file path | (none) |
Environment variables:
CHAINLAUNCH_USER— Initial admin username (default:admin)CHAINLAUNCH_PASSWORD— Initial admin password (default:admin)KEY_ENCRYPTION_KEY— Key encryption key (auto-generated if not set)SESSION_ENCRYPTION_KEY— Session encryption key (auto-generated if not set)ANTHROPIC_API_KEY— Claude AI integrationOPENAI_API_KEY— OpenAI integration
install
Install ChainLaunch as a systemd service.
chainlaunch install [flags]
| Flag | Description | Default |
|---|---|---|
--user | System user to run as | chainlaunch |
version
Print the ChainLaunch version.
chainlaunch version
migrate
Run database migrations manually.
chainlaunch migrate --db=./chainlaunch.db
Testnet Commands
testnet fabric
Create a complete Fabric network in one command.
chainlaunch testnet fabric [flags]
| Flag | Description | Example |
|---|---|---|
--name | Network name | my-fabric |
--org | Comma-separated organization MSP IDs | Org1MSP,Org2MSP |
--peerOrgs | Orgs that will have peers | Org1MSP,Org2MSP |
--ordererOrgs | Orgs that will have orderers | OrdererOrg |
--channels | Channel names | mychannel |
--peerCounts | Peers per org | Org1MSP=2,Org2MSP=1 |
--ordererCounts | Orderers per org | OrdererOrg=3 |
Example:
chainlaunch testnet fabric \
--name demo \
--org "Org1MSP,Org2MSP" \
--peerOrgs "Org1MSP,Org2MSP" \
--ordererOrgs "Org1MSP" \
--channels mychannel \
--peerCounts "Org1MSP=1,Org2MSP=1" \
--ordererCounts "Org1MSP=3"
testnet besu
Create a complete Besu network in one command.
chainlaunch testnet besu [flags]
| Flag | Description | Default |
|---|---|---|
--name | Network name | (required) |
--nodes | Number of validator nodes | 4 |
--mode | Deployment mode | docker |
Example:
chainlaunch testnet besu --name my-besu --nodes 4 --mode docker
Metrics Commands
metrics enable
Enable Prometheus metrics collection.
chainlaunch metrics enable [flags]
| Flag | Description | Default |
|---|---|---|
--version | Prometheus version | v3.4.0 |
--port | Metrics port | 9091 |
Node Sharing Commands (Pro)
nodesharing generate-node-invitation
Generate an invitation for another ChainLaunch instance.
chainlaunch nodesharing generate-node-invitation [flags]
| Flag | Description | Default |
|---|---|---|
--bidirectional | Both sides share nodes | false |
nodesharing accept-node-invitation
Accept an invitation from another instance.
chainlaunch nodesharing accept-node-invitation --invitation_jwt "eyJ..."
nodesharing sync-external-nodes
Sync nodes from a connected peer.
chainlaunch nodesharing sync-external-nodes --peer_node_id "1"
Chaincode Commands
chaincode install
Install chaincode on peers.
chainlaunch chaincode install [flags]
| Flag | Description |
|---|---|
--name | Chaincode name |
--version | Chaincode version |
--lang | Language (golang, node, java) |
--path | Path to chaincode source |
--peers | Comma-separated peer names |
chaincode approve
Approve chaincode for an organization.
chainlaunch chaincode approve [flags]
| Flag | Description |
|---|---|
--name | Chaincode name |
--version | Chaincode version |
--sequence | Sequence number |
--channel | Channel name |
--org | Organization MSP ID |
chaincode commit
Commit chaincode to a channel.
chainlaunch chaincode commit [flags]
| Flag | Description |
|---|---|
--name | Chaincode name |
--version | Chaincode version |
--sequence | Sequence number |
--channel | Channel name |
Next Steps
- Quick Start for your first deployment
- API Reference for the REST API
- Terraform Provider for infrastructure as code