Skip to main content

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]
FlagDescriptionDefault
--portHTTP server port8100
--dbSQLite database pathchainlaunch.db
--dataData directory for node configs and certs./data
--tls-certTLS certificate file path(none)
--tls-keyTLS 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 integration
  • OPENAI_API_KEY — OpenAI integration

install

Install ChainLaunch as a systemd service.

chainlaunch install [flags]
FlagDescriptionDefault
--userSystem user to run aschainlaunch

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]
FlagDescriptionExample
--nameNetwork namemy-fabric
--orgComma-separated organization MSP IDsOrg1MSP,Org2MSP
--peerOrgsOrgs that will have peersOrg1MSP,Org2MSP
--ordererOrgsOrgs that will have orderersOrdererOrg
--channelsChannel namesmychannel
--peerCountsPeers per orgOrg1MSP=2,Org2MSP=1
--ordererCountsOrderers per orgOrdererOrg=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]
FlagDescriptionDefault
--nameNetwork name(required)
--nodesNumber of validator nodes4
--modeDeployment modedocker

Example:

chainlaunch testnet besu --name my-besu --nodes 4 --mode docker

Metrics Commands

metrics enable

Enable Prometheus metrics collection.

chainlaunch metrics enable [flags]
FlagDescriptionDefault
--versionPrometheus versionv3.4.0
--portMetrics port9091

Node Sharing Commands (Pro)

nodesharing generate-node-invitation

Generate an invitation for another ChainLaunch instance.

chainlaunch nodesharing generate-node-invitation [flags]
FlagDescriptionDefault
--bidirectionalBoth sides share nodesfalse

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]
FlagDescription
--nameChaincode name
--versionChaincode version
--langLanguage (golang, node, java)
--pathPath to chaincode source
--peersComma-separated peer names

chaincode approve

Approve chaincode for an organization.

chainlaunch chaincode approve [flags]
FlagDescription
--nameChaincode name
--versionChaincode version
--sequenceSequence number
--channelChannel name
--orgOrganization MSP ID

chaincode commit

Commit chaincode to a channel.

chainlaunch chaincode commit [flags]
FlagDescription
--nameChaincode name
--versionChaincode version
--sequenceSequence number
--channelChannel name

Next Steps