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

init cli doc #489

Merged
merged 2 commits into from
Jul 17, 2023
Merged
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
3 changes: 2 additions & 1 deletion docs/website/pages/docs/developer/_meta.en-US.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"installation": "Installation"
"installation": "Installation",
"rooch-cli": "Rooch CLI"
}
3 changes: 2 additions & 1 deletion docs/website/pages/docs/developer/_meta.zh-CN.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"installation": "安装"
"installation": "安装",
"rooch-cli": "Rooch CLI"
}
74 changes: 74 additions & 0 deletions docs/website/pages/docs/developer/rooch-cli.en-US.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# Rooch CLI

Learn how to set up, configure, and use the Rooch Command Line Interface (CLI). You can use the Rooch CLI to experiment with Rooch features using a command line interface.

## Set up

The Rooch CLI installs when you install Rooch. See the [Install](./installation.en-US.mdx) topic for prerequisites and installation instructions.

## Using the Rooch CLI

The Rooch CLI supports the following commands:

```shell
rooch 0.1.0
Rooch Contributors <[email protected]>

USAGE:
rooch <SUBCOMMAND>

OPTIONS:
-h, --help Print help information
-V, --version Print version information

SUBCOMMANDS:
account Tool for interacting with accounts
event Tool for interacting with event
help Print this message or the help of the given subcommand(s)
init Tool for init with rooch
move CLI frontend for the Move compiler and VM
object Get object by object id
resource Get account resource by tag
server Start Rooch network
state Get states by accessPath
transaction Tool for interacting with transaction
```
Use ```rooch -h``` to see a list of supported commands.

Use ```rooch help <command>``` to see more information on each command.


## Initialize CLI

By default, The configuration file is saved in your home directory.

Use ```rooch init``` to Initialize Rooch CLI, The configuration file location is specified through ``` --config-dir```

The response resembles the following:

```
Creating config file ["/Users/sven/.rooch/rooch_config/rooch.yaml"] with default (local) server and ed25519 key scheme.
Generated new keypair for address with scheme "ed25519" [0xeb417f9091c77c8c1a9c6a7683ee1eb5883fbae5128eae5ab414c0de5f050d08]
Secret Recovery Phrase : [grab infant behave ugly erosion grief file arrange unit ship iron garage]
"Rooch config file generated at /Users/sven/.rooch/rooch_config/rooch.yaml"
```

## Start the local network

Use ```rooch server start``` to start the local network.

**Important**: Each time you start the Rooch server, the network starts as a new network with no previous data. The local network is not persistent.

The response resembles the following:

```
Documentation generation successful!
2023-07-17T05:34:49.963869Z INFO rooch_rpc_server: JSON-RPC HTTP Server start listening 0.0.0.0:50051
2023-07-17T05:34:49.963893Z INFO rooch_rpc_server: Available JSON-RPC methods : ["wallet_accounts", "eth_blockNumber", "eth_getBalance", "eth_gasPrice", "net_version", "eth_getTransactionCount", "eth_sendTransaction", "rooch_sendRawTransaction", "rooch_getAnnotatedStates", "eth_sendRawTransaction", "rooch_getTransactionByIndex", "rooch_executeRawTransaction", "rooch_getEventsByEventHandle", "rooch_getTransactionByHash", "rooch_executeViewFunction", "eth_getBlockByNumber", "rooch_getEvents", "eth_feeHistory", "eth_getTransactionByHash", "eth_getBlockByHash", "eth_getTransactionReceipt", "rooch_getTransactionInfosByTxOrder", "eth_estimateGas", "eth_chainId", "rooch_getTransactionInfosByTxHash", "wallet_sign", "rooch_getStates"]
```

## More Examples

TODO


74 changes: 74 additions & 0 deletions docs/website/pages/docs/developer/rooch-cli.zh-CN.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# Rooch CLI

了解如何设置、配置和使用 Rooch 命令行接口(CLI)。您可以使用 Rooch CLI 使用命令行界面来试验 Rooch 特性。

## Set up

在安装 Rooch 时,将安装 Rooch CLI(命令行)。有关先决条件和安装说明,请参阅[安装](./installation.zh-CN.mdx)主题。


## Using the Rooch CLI

Rooch CLI(命令行) 支持以下命令:


```shell
rooch 0.1.0
Rooch Contributors <[email protected]>

USAGE:
rooch <SUBCOMMAND>

OPTIONS:
-h, --help Print help information
-V, --version Print version information

SUBCOMMANDS:
account Tool for interacting with accounts
event Tool for interacting with event
help Print this message or the help of the given subcommand(s)
init Tool for init with rooch
move CLI frontend for the Move compiler and VM
object Get object by object id
resource Get account resource by tag
server Start Rooch network
state Get states by accessPath
transaction Tool for interacting with transaction
```

使用 ```rooch -h``` 来查看支持的命令列表。

使用 ```rooch help <command>``` 来查看每个命令的更多信息。

## 初始化CLI(命令行)

默认情况下,配置文件保存在您的 Home 目录。

使用 ```rooch init``` 来初始化Rooch CLI(命令行),配置文件的位置通过 ``` --config-dir``` 指定。

响应类似于以下内容:

```
Creating config file ["/Users/sven/.rooch/rooch_config/rooch.yaml"] with default (local) server and ed25519 key scheme.
Generated new keypair for address with scheme "ed25519" [0xeb417f9091c77c8c1a9c6a7683ee1eb5883fbae5128eae5ab414c0de5f050d08]
Secret Recovery Phrase : [grab infant behave ugly erosion grief file arrange unit ship iron garage]
"Rooch config file generated at /Users/sven/.rooch/rooch_config/rooch.yaml"
```

## 启动本地服务

使用 ```rooch server start``` 来启动一个本地服务。

**重要提示**:每次启动Rooch服务器时,该网络都作为一个新网络启动,没有以前的数据。

响应类似于以下内容:

```
Documentation generation successful!
2023-07-17T05:34:49.963869Z INFO rooch_rpc_server: JSON-RPC HTTP Server start listening 0.0.0.0:50051
2023-07-17T05:34:49.963893Z INFO rooch_rpc_server: Available JSON-RPC methods : ["wallet_accounts", "eth_blockNumber", "eth_getBalance", "eth_gasPrice", "net_version", "eth_getTransactionCount", "eth_sendTransaction", "rooch_sendRawTransaction", "rooch_getAnnotatedStates", "eth_sendRawTransaction", "rooch_getTransactionByIndex", "rooch_executeRawTransaction", "rooch_getEventsByEventHandle", "rooch_getTransactionByHash", "rooch_executeViewFunction", "eth_getBlockByNumber", "rooch_getEvents", "eth_feeHistory", "eth_getTransactionByHash", "eth_getBlockByHash", "eth_getTransactionReceipt", "rooch_getTransactionInfosByTxOrder", "eth_estimateGas", "eth_chainId", "rooch_getTransactionInfosByTxHash", "wallet_sign", "rooch_getStates"]
```

## 更多示例

TODO