Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: split cli-tool and bump 0ffckb v0.3.0 #485

Open
wants to merge 1 commit into
base: v2
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions website/docs/getting-started/installation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ This installation guide provides a step-by-step setup of all essential tools nee

This section covers the essential tools you need to develop CKB applications, including setting up the local development environment and JavaScript SDK.

### 1. OffCKB (≥v0.3.0-rc2)
### 1. OffCKB (≥v0.3.0)

OffCKB sets up a local CKB Devnet, allowing you to test dApps without connecting to the main network. We recommend using **≥v0.3.0-rc2**.
OffCKB sets up a local CKB Devnet, allowing you to test dApps without connecting to the main network. We recommend using **≥v0.3.0**.

```bash
npm install -g @offckb/cli
Expand Down
4 changes: 2 additions & 2 deletions website/docs/getting-started/quick-start.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ npm install -g @offckb/cli
```

:::info
Throughout this documentation, we use offckb/cli version **>=0.3.0-rc2**. You can always run the above command to update to the latest version.
Throughout this documentation, we use offckb/cli version **>=0.3.0**. You can always run the above command to update to the latest version.
:::

## Create a New Project
Expand Down Expand Up @@ -159,7 +159,7 @@ npm i && npm run dev

Once the server is up and running, you can view the dApp by visiting [localhost:3000](http://localhost:3000). You can start editing the page by modifying `app/page.tsx`. As you make changes to the file, the page will automatically update to reflect your edits. For detailed instructions on how to start the dApp and explore additional config options, please see the `README.md` file.

![dapp-screenshot](/img/quick-start/next-js-dapp.jpg)
![dapp-screenshot](/img/quick-start/remix-vite-dapp.png)

---

Expand Down
83 changes: 83 additions & 0 deletions website/docs/sdk-and-devtool/ckb-cli.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
---
id: ckb-cli
title: CKB-CLI
---

import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
import Tooltip from "@components/Tooltip";

# CKB-CLI

[ckb-cli](https://github.com/nervosnetwork/ckb-cli) is a CKB command-line tool developed in Rust.

If you need to interact with Mainnet blockchain from the command line, `ckb-cli` is an ideal choice to manage accounts, deploy Scripts and send Transactions.

### Features

```
rpc Invoke RPC call to node
account Manage accounts
mock-tx Handle mock transactions (verify/send)
tx Handle common sighash/multisig transaction
util Utilities
molecule Molecule encode/decode utilities
wallet Transfer / query balance (with local index) / key utils
dao Deposit / prepare / withdraw / query NervosDAO balance (with local index) / key utils
```

All second-level sub-commands are listed on the [wiki page](https://github.com/nervosnetwork/ckb-cli/wiki/Sub-Commands).

### Install

```
git clone https://github.com/nervosnetwork/ckb-cli.git
cd ckb-cli
cargo install --path . -f --locked
```

### Usage

Better export an env first (or give in argument)

```
export API_URL=http://127.0.0.1:8114
```

Directly go to **gorgeous** interactive mode:

```
ckb-cli
```

Show available commands

```shell
# Top level help doc
ckb-cli --help
# RPC help doc
ckb-cli rpc --help
```

#### Example: Get Live Cell (JSON Output Format)

```
ckb-cli rpc get_live_cell --tx-hash 0x4ec75b5a8de8d180853d5046760a99285c73283a5dc528f81d6ee056f5335172 --index 0
```

**Response:**

```json
{
"cell": {
"capacity": "125000000000",
"lock": {
"args": ["0x64257f00b6b63e987609fa9be2d0c86d351020fb"],
"code_hash": "0x1892ea40d82b53c678ff88312450bbb17e164d7a3e0a90941aa58839f56f8df2",
"hash_type": "type"
},
"type": null
},
"status": "live"
}
```
269 changes: 0 additions & 269 deletions website/docs/sdk-and-devtool/cli-tool.mdx

This file was deleted.

Loading
Loading