# Deploy CKB Scripts
## Metadata
**Status**:: #x
**Zettel**:: #zettel/literature
**Created**:: [[2023-12-21]]
## Synopsis
### CKB Cli
#### Step 1: gen-txs
```
ckb-cli --url https://testnet.ckbapp.dev/ deploy gen-txs --from-address ckt1... --fee-rate 1000 --deployment-config deployment.toml --info-file migrations/testnet/deployment.json --migration-dir migrations/testnet
```
#### Step 2: sign-txs
```
ckb-cli --url https://testnet.ckbapp.dev/ deploy sign-txs --info-file migrations/testnet/deployment.json --privkey-path priv.key --output-format json
```
Then edit migrations/testnet/deployment.json. replace `cell_tx_signatures` with the one returned from `sign-txs`. Attention to replace the object values to array. For example, if `sign-txs` returns
```json
{
"cell_tx_signatures": {
"0xe463d7c4cb28457b3a2f735d1d92a971b0f5a751": "0xcb..."
}
}
```
Set `cell_tx_signatures` in migrations/testnet/deployment.json to following object instead:
```json
...
"cell_tx_signatures": {
"0xe463d7c4cb28457b3a2f735d1d92a971b0f5a751": ["0xcb..."]
},
...
```
#### Step 3: apply-txs
The last step is `apply-txs`
```
ckb-cli --url https://testnet.ckbapp.dev/ deploy apply-txs --info-file migrations/testnet/deployment.json --migration-dir migrations/testnet --output-format json
```
### Capsule
> [!attention] Capsule deploy is broken.
> [Deploy errors out on capacity parsing · Issue #131 · nervosnetwork/capsule (github.com)](https://github.com/nervosnetwork/capsule/issues/131)
Edit `deployment.toml` and run the command
```
capsule deploy --api https://testnet.ckbapp.dev/ --address ckt1...
```