TITLE: Deploying CKB Contracts using ckb-cli DESCRIPTION: This snippet provides the bash commands to deploy CKB contracts. It first removes any existing deployment transaction file, sets the CKB testnet API URL, then generates the deployment transactions based on a configuration file and migrations, signs them, and finally applies the generated transactions. SOURCE: https://github.com/ickb/contracts/blob/master/scripts/deployment/Readme.md#_snippet_0 LANGUAGE: bash CODE: ``` rm deploy-tx.json; export API_URL="https://testnet.ckb.dev"; ckb-cli deploy gen-txs --deployment-config ./deployment.toml --migration-dir ./migrations --from-address ckt1qzda0cr08m85hc8jlnfp3zer7xulejywt49kt2rr0vthywaa50xwsqt39x0xz5k9qy90ah9v8880j29a72qmrtqrduh0m --sign-now --info-file deploy-tx.json ckb-cli deploy apply-txs --info-file ./deploy-tx.json --migration-dir ./migrations ``` ---------------------------------------- TITLE: Build CKB contracts in release mode with Capsule DESCRIPTION: This command uses the `capsule` tool to build the CKB contracts in release mode. Building in release mode optimizes the compiled output for production use, reducing size and improving performance. SOURCE: https://github.com/ickb/contracts/blob/master/scripts/README.md#_snippet_2 LANGUAGE: bash CODE: ``` capsule build --release ``` ---------------------------------------- TITLE: Install ckb-capsule for CKB contract development DESCRIPTION: This command installs the `ckb-capsule` tool using Cargo, pointing to its Git repository and a specific revision. `ckb-capsule` is a crucial tool for building and managing CKB contracts. SOURCE: https://github.com/ickb/contracts/blob/master/scripts/README.md#_snippet_1 LANGUAGE: bash CODE: ``` cargo install ckb-capsule --git https://github.com/nervosnetwork/capsule --rev=04fd58c --locked ``` ---------------------------------------- TITLE: Install cross-rs for cross-compilation DESCRIPTION: This command installs the `cross` tool using Cargo, specifying a particular Git repository and revision. `cross` is essential for cross-compilation, ensuring builds are reproducible across different environments. SOURCE: https://github.com/ickb/contracts/blob/master/scripts/README.md#_snippet_0 LANGUAGE: bash CODE: ``` cargo install cross --git https://github.com/cross-rs/cross --rev=6982b6c --locked ```