Reference: Run a CKB Dev Blockchain
-
Download the Latest CKB Binary.
-
Import your account into ckb-cli.
echo 33b08bb054d5dd04013156dced8ba2ce4d8cc5973e10d905a228ea1abc267e60 >> privkey ckb-cli account import --privkey-path privkey
-
Start the CKB dev Blockchain.
cd dev-chain // start the ckb node ckb run // start the ckb miner ckb miner
Reference: axon-contract readme
Compile axon contracts.
git clone https://github.com/axonweb3/axon-contract
cd axon-contract
capsule build --release
cp axon-contract/build/release/* deploy-spark-contract/bin/
Compile other contracts.
git clone https://github.com/nervosnetwork/ckb-production-scripts
cd ckb-production-scripts
make all-via-docker
cp ckb-production-scripts/build/omni_lock deploy-spark-contract/bin/
cp ckb-production-scripts/build/xudt_rce deploy-spark-contract/bin/
cp ckb-production-scripts/build/always_success deploy-spark-contract/bin/
ckb-cli
config --url http://127.0.0.1:8114
Reference: How to use ckb-cli to deploy a contract
Create migration directories.
bash create-migrations.sh
Taking deploying contract stake
as an example.
bash cmd.sh -c stake -f g
bash cmd.sh -c stake -f s
bash cmd.sh -c stake -f a
Taking upgrading contract stake
as an example.
bash cmd.sh -c stake -f g -v 1
bash cmd.sh -c stake -f s -v 1
bash cmd.sh -c stake -f a -v 1