nervosnetwork / ckb-cli

CKB command line interface
MIT License
55 stars 35 forks source link

feat: add deploy subcommand #515

Closed TheWaWaR closed 1 year ago

TheWaWaR commented 1 year ago

Features

A brief usage

#### Init config
ckb-cli deploy init-config --deployment-config deployment.toml

# >>>> Then edit deployment.toml file

#### Generate intermedium information
ckb-cli deploy gen-txs \
    --deployment-config ./deployment.toml \
    --migration-dir ./migrations \
    --from-address ckt1qyqvsv5240xeh85wvnau2eky8pwrhh4jr8ts8vyj37 \
    --sign-now \
    --info-file info.json

#### sign with key
ckb-cli deploy sign-txs \
    --from-account ckt1qyqvsv5240xeh85wvnau2eky8pwrhh4jr8ts8vyj37 \
    --add-signatures \
    --info-file info.json 

#### sign with another key (support multisig and offline sign)
ckb-cli deploy sign-txs \
    --from-account ckt1qyqyqnuss20vpevzrt46n0886h5yrn5l07jsgz7kfp \
    --add-signatures \
    --info-file info.json 

#### Explain the deploy action
ckb-cli deploy explain-txs --info-file info.json
# ==== Cell transaction ====
# [cell] Changed   name:      my_cell, old-capacity: 43026.0, new-capacity: 43006.0
# [cell] Unchanged name: genesis_cell, old-capacity:   202.0, new-capacity:   202.0
# > old total capacity: 43228.0 (CKB) (removed items not included)
# > new total capacity: 43208.0 (CKB)
# ==== DepGroup transaction ====
# [dep_group] Changed   name: my_dep_group, old-capacity:   137.0, new-capacity:   137.0
# > old total capacity: 137.0 (CKB) (removed items not included)
# > new total capacity: 137.0 (CKB)

#### Set signatures to witnesses and send to CKB node
ckb-cli deploy apply-txs \
    --migration-dir ./migrations \
    --info-file info.json