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

Add vega network docs #218

Merged
merged 1 commit into from
Jun 26, 2024
Merged

Add vega network docs #218

merged 1 commit into from
Jun 26, 2024

Conversation

sanlee42
Copy link
Member

@sanlee42 sanlee42 commented Jun 26, 2024

Summary by CodeRabbit

  • Documentation
    • Added detailed setup guide for participating in the Vega network launched by Starcoin 2.0, covering Windows, Linux, and Docker environments.
    • Instructions include starting nodes, checking synchronization progress, managing accounts, exporting private keys, and connecting to the Starcoin console.

Copy link

coderabbitai bot commented Jun 26, 2024

Walkthrough

The new file vega-network.md introduces comprehensive instructions for engaging with the Vega network of Starcoin 2.0, covering environments for Windows, Linux, and Docker. This update enhances node setup, synchronization, account management, and console connectivity with advanced features like FlexiDag and TurboSTM, boosting flexibility, performance, and transaction efficiency.

Changes

Files / Paths Change Summary
docs/02-getting-started/.../08-vega-network.md Added detailed setup and usage instructions for the Vega network on Windows, Linux, and Docker.
starcoin.exe (Windows Setup) Updated functions for network config, viewing IPC file path, node sync progress, and account details.
starcoin (Linux Setup) Similar function updates to Windows for starting nodes, viewing sync progress, exporting private keys, and console connectivity.
docker Added Docker-specific commands for pulling images, starting containers, and accessing the Starcoin console.
Seed Node JSON-RPC Added constants for HTTP, HTTPS, and WebSocket endpoints.

Sequence Diagrams

sequenceDiagram
    participant User
    participant VegaNodeWindows
    participant StarCoinConsole
    Note over User, VegaNodeWindows: Setup Node
    User->>VegaNodeWindows: Start node with "starcoin.exe"
    VegaNodeWindows-->>StarCoinConsole: Connect via IPC
    User->>StarCoinConsole: View sync progress, manage accounts

    Note over User, VegaNodeWindows: Export Private Key
    User->>VegaNodeWindows: Export private key
    VegaNodeWindows-->>User: Private key data
    User->>StarCoinConsole: Perform transaction operations

    Note over User, Docker: Docker Environment
    User->>Docker: Pull Docker image
    User->>Docker: Start Vega node in container
    Docker-->>StarCoinConsole: Connect via Docker IPC
    User->>StarCoinConsole: View sync, manage accounts
Loading

Poem

In fields of code where starcoins bloom,
A network rises, dispelling gloom.
Nodes in Windows, Linux, Docker play,
With FlexiDag to lead the way.
TurboSTM speeds transactions through,
The Vega network sings anew. 🌟


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 8

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between c102a5b and 75abe62.

Files selected for processing (2)
  • docs/02-getting-started/02-setup/08-vega-network.md (1 hunks)
  • i18n/zh/docusaurus-plugin-content-docs/current/02-getting-started/02-setup/08-vega-network.md (1 hunks)
Additional context used
Markdownlint
i18n/zh/docusaurus-plugin-content-docs/current/02-getting-started/02-setup/08-vega-network.md

217-217: null (MD034, no-bare-urls)
Bare URL used


218-218: null (MD034, no-bare-urls)
Bare URL used


9-9: null (MD036, no-emphasis-as-heading)
Emphasis used instead of a heading


30-30: null (MD036, no-emphasis-as-heading)
Emphasis used instead of a heading


41-41: null (MD036, no-emphasis-as-heading)
Emphasis used instead of a heading


57-57: null (MD036, no-emphasis-as-heading)
Emphasis used instead of a heading


66-66: null (MD036, no-emphasis-as-heading)
Emphasis used instead of a heading


74-74: null (MD036, no-emphasis-as-heading)
Emphasis used instead of a heading


82-82: null (MD036, no-emphasis-as-heading)
Emphasis used instead of a heading


98-98: null (MD036, no-emphasis-as-heading)
Emphasis used instead of a heading


114-114: null (MD036, no-emphasis-as-heading)
Emphasis used instead of a heading


123-123: null (MD036, no-emphasis-as-heading)
Emphasis used instead of a heading


131-131: null (MD036, no-emphasis-as-heading)
Emphasis used instead of a heading


151-151: null (MD036, no-emphasis-as-heading)
Emphasis used instead of a heading


163-163: null (MD036, no-emphasis-as-heading)
Emphasis used instead of a heading


182-182: null (MD036, no-emphasis-as-heading)
Emphasis used instead of a heading


192-192: null (MD036, no-emphasis-as-heading)
Emphasis used instead of a heading


201-201: null (MD036, no-emphasis-as-heading)
Emphasis used instead of a heading


209-209: null (MD036, no-emphasis-as-heading)
Emphasis used instead of a heading

docs/02-getting-started/02-setup/08-vega-network.md

226-226: null (MD034, no-bare-urls)
Bare URL used


227-227: null (MD034, no-bare-urls)
Bare URL used


9-9: null (MD036, no-emphasis-as-heading)
Emphasis used instead of a heading


30-30: null (MD036, no-emphasis-as-heading)
Emphasis used instead of a heading


41-41: null (MD036, no-emphasis-as-heading)
Emphasis used instead of a heading


58-58: null (MD036, no-emphasis-as-heading)
Emphasis used instead of a heading


67-67: null (MD036, no-emphasis-as-heading)
Emphasis used instead of a heading


75-75: null (MD036, no-emphasis-as-heading)
Emphasis used instead of a heading


83-83: null (MD036, no-emphasis-as-heading)
Emphasis used instead of a heading


99-99: null (MD036, no-emphasis-as-heading)
Emphasis used instead of a heading


116-116: null (MD036, no-emphasis-as-heading)
Emphasis used instead of a heading


125-125: null (MD036, no-emphasis-as-heading)
Emphasis used instead of a heading


133-133: null (MD036, no-emphasis-as-heading)
Emphasis used instead of a heading


153-153: null (MD036, no-emphasis-as-heading)
Emphasis used instead of a heading


165-165: null (MD036, no-emphasis-as-heading)
Emphasis used instead of a heading


184-184: null (MD036, no-emphasis-as-heading)
Emphasis used instead of a heading


201-201: null (MD036, no-emphasis-as-heading)
Emphasis used instead of a heading


210-210: null (MD036, no-emphasis-as-heading)
Emphasis used instead of a heading


218-218: null (MD036, no-emphasis-as-heading)
Emphasis used instead of a heading

LanguageTool
docs/02-getting-started/02-setup/08-vega-network.md

[uncategorized] ~5-~5: Commas set off the year in a month-day-year date. (MISSING_COMMA_BETWEEN_DAY_AND_YEAR)
Context: ...n the vega network ## Introduction On June 21 2024, Starcoin launched the Vega networ...


[uncategorized] ~20-~20: Loose punctuation mark. (UNLIKELY_OPENING_PUNCTUATION)
Context: ...0.0.0 --stratum-port 9880 ``` - --net: Specifies the network. - `--disable-met...


[uncategorized] ~21-~21: Loose punctuation mark. (UNLIKELY_OPENING_PUNCTUATION)
Context: ...ifies the network. - --disable-metrics: Whether to disable the metrics monitori...


[uncategorized] ~22-~22: Loose punctuation mark. (UNLIKELY_OPENING_PUNCTUATION)
Context: ... false not to disable. - --node-name: The node name is only used for display....


[uncategorized] ~23-~23: Loose punctuation mark. (UNLIKELY_OPENING_PUNCTUATION)
Context: ...ll be randomly generated. - --data-dir: The data storage directory, it is recom...


[uncategorized] ~24-~24: Loose punctuation mark. (UNLIKELY_OPENING_PUNCTUATION)
Context: ... easy to find. - --logger-disable-file: Whether to disable the file log collect...


[uncategorized] ~25-~25: Loose punctuation mark. (UNLIKELY_OPENING_PUNCTUATION)
Context: ...enot to disable. ---stratum-address`: Specify the address of the mining pool,...


[uncategorized] ~26-~26: Loose punctuation mark. (UNLIKELY_OPENING_PUNCTUATION)
Context: ...default is 0.0.0.0. - --stratum-port: Specify the port number of the mining p...


[uncategorized] ~89-~89: Possible missing preposition found. (AI_EN_LECTOR_MISSING_PREPOSITION)
Context: ...efault, the mining pool is not listened by default, and the data directory default...


[uncategorized] ~161-~161: Loose punctuation mark. (UNLIKELY_OPENING_PUNCTUATION)
Context: ...atest /starcoin/starcoin ``` - --name: Specifies the container name. - `-v`: B...


[uncategorized] ~162-~162: Loose punctuation mark. (UNLIKELY_OPENING_PUNCTUATION)
Context: ...e: Specifies the container name. - -v`: Bind mounted volume for persisting data...


[uncategorized] ~163-~163: Loose punctuation mark. (UNLIKELY_OPENING_PUNCTUATION)
Context: ...persisting data in Docker. - --network: Let the network of the Docker container...


[uncategorized] ~173-~173: Loose punctuation mark. (UNLIKELY_OPENING_PUNCTUATION)
Context: .../vega/starcoin.ipc console ``` - --rm: Automatically remove the container when...


[uncategorized] ~174-~174: Loose punctuation mark. (UNLIKELY_OPENING_PUNCTUATION)
Context: ...en exiting the Starcoin console. - -it: Enter the container interactively, assi...

Additional comments not posted (2)
i18n/zh/docusaurus-plugin-content-docs/current/02-getting-started/02-setup/08-vega-network.md (1)

1-6: Introduction section looks good.

The introduction effectively sets the context for the Vega network and its technological enhancements.

docs/02-getting-started/02-setup/08-vega-network.md (1)

1-6: Introduction section looks good.

The introduction effectively sets the context for the Vega network and its technological enhancements.

Tools
LanguageTool

[uncategorized] ~5-~5: Commas set off the year in a month-day-year date. (MISSING_COMMA_BETWEEN_DAY_AND_YEAR)
Context: ...n the vega network ## Introduction On June 21 2024, Starcoin launched the Vega networ...

Comment on lines +215 to +219
## 种子节点地址

- HTTP: http://vega.seed.starcoin.org
- HTTPS: https://vega-seed.starcoin.org
- WebSocket: ws://vega.seed.starcoin.org:9870
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Address bare URLs in the document.

Markdown guidelines suggest avoiding bare URLs. Adding descriptions can improve readability and accessibility.

- - HTTP: http://vega.seed.starcoin.org
+ - HTTP: [Vega Seed Node - HTTP](http://vega.seed.starcoin.org)
- - HTTPS: https://vega-seed.starcoin.org
+ - HTTPS: [Vega Seed Node - HTTPS](https://vega-seed.starcoin.org)
- - WebSocket: ws://vega.seed.starcoin.org:9870
+ - WebSocket: [Vega Seed Node - WebSocket](ws://vega.seed.starcoin.org:9870)
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
## 种子节点地址
- HTTP: http://vega.seed.starcoin.org
- HTTPS: https://vega-seed.starcoin.org
- WebSocket: ws://vega.seed.starcoin.org:9870
## 种子节点地址
- HTTP: [Vega Seed Node - HTTP](http://vega.seed.starcoin.org)
- HTTPS: [Vega Seed Node - HTTPS](https://vega-seed.starcoin.org)
- WebSocket: [Vega Seed Node - WebSocket](ws://vega.seed.starcoin.org:9870)
Tools
Markdownlint

217-217: null (MD034, no-bare-urls)
Bare URL used


218-218: null (MD034, no-bare-urls)
Bare URL used

Comment on lines +7 to +27
## Windows 加入主网络

**1. 启动**

```shell
starcoin.exe --net vega ^
--disable-metrics true ^
--node-name starcoin-vega ^
--data-dir D:\starcoin\data ^
--logger-disable-file true ^
--stratum-address 0.0.0.0 --stratum-port 9880
```

- `--net`:指定网络。
- `--disable-metrics`:是否要禁用指标监控服务,`true` 禁用,`false` 不禁用。
- `--node-name`:节点名称,仅用于显示,可根据自己的喜好取个有特色的名字。若不指定,则随机生成。
- `--data-dir`:数据存放目录,建议选择一个容易查找的路径。
- `--logger-disable-file`:是否要禁用文件日志采集器,`true` 禁用,`false` 不禁用。
- `--stratum-address`:指定矿池地址,默认为 `0.0.0.0`。
- `--stratum-port`:指定矿池端口号,默认为 `9880`。

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Convert emphasis to headings for better document structure.

Using emphasis (**text**) instead of headings for sections like "启动", "查看 IPC 文件路径", etc., is not semantically correct in Markdown.

- **1. 启动**
+ ## 1. 启动

Apply similar changes to other emphasized sections.

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
## Windows 加入主网络
**1. 启动**
```shell
starcoin.exe --net vega ^
--disable-metrics true ^
--node-name starcoin-vega ^
--data-dir D:\starcoin\data ^
--logger-disable-file true ^
--stratum-address 0.0.0.0 --stratum-port 9880
```
- `--net`:指定网络。
- `--disable-metrics`:是否要禁用指标监控服务,`true` 禁用,`false` 不禁用。
- `--node-name`:节点名称,仅用于显示,可根据自己的喜好取个有特色的名字。若不指定,则随机生成。
- `--data-dir`:数据存放目录,建议选择一个容易查找的路径。
- `--logger-disable-file`:是否要禁用文件日志采集器,`true` 禁用,`false` 不禁用。
- `--stratum-address`:指定矿池地址,默认为 `0.0.0.0`
- `--stratum-port`:指定矿池端口号,默认为 `9880`
## Windows 加入主网络
## 1. 启动
```shell
starcoin.exe --net vega ^
--disable-metrics true ^
--node-name starcoin-vega ^
--data-dir D:\starcoin\data ^
--logger-disable-file true ^
--stratum-address 0.0.0.0 --stratum-port 9880
```
- `--net`:指定网络。
- `--disable-metrics`:是否要禁用指标监控服务,`true` 禁用,`false` 不禁用。
- `--node-name`:节点名称,仅用于显示,可根据自己的喜好取个有特色的名字。若不指定,则随机生成。
- `--data-dir`:数据存放目录,建议选择一个容易查找的路径。
- `--logger-disable-file`:是否要禁用文件日志采集器,`true` 禁用,`false` 不禁用。
- `--stratum-address`:指定矿池地址,默认为 `0.0.0.0`
- `--stratum-port`:指定矿池端口号,默认为 `9880`
Tools
Markdownlint

9-9: null (MD036, no-emphasis-as-heading)
Emphasis used instead of a heading

Comment on lines +80 to +137
## Linux 加入主网络(推荐)

**1. 启动**

```shell
starcoin
```

`starcoin` 命令,默认使用 `vega` 网络,默认禁用挖矿客户端,默认不监听矿池,数据目录默认为主目录下的 `.starcoin/vega`。

```shell
# 数据目录,ubuntu 是演示的用户名,请根据你的实际情况变更
2022-05-24T10:07:29.069207121+08:00 INFO - Final data-dir is : "/home/ubuntu/.starcoin/vega"

# IPC 文件路径
2022-05-24T10:07:29.061062410+08:00 INFO - Ipc file path: "/home/ubuntu/.starcoin/vega/starcoin.ipc"
```

**2. 查看节点同步进度**

打开一个新的命令行窗口,输入:

```shell
starcoin -c ~/.starcoin/vega/starcoin.ipc console
```

在 Starcoin 控制台中输入:

```shell
node sync status
```

在输出的 JSON 数据中可以找到一些关键信息,`chain_status.head.number` 和 `state.Synchronizing.target.number` 相等时,同步才完成。

**3. 查看默认账号**

每个新启动的节点,都初始化有一个默认账户,密码为空。

```shell
# 查看默认账户,找到账户地址
account default
```

**4. 导出默认账户的私钥**

```shell
account export <ADDRESS>
```

注意:请妥善保管好私钥!

**5. 退出控制台**

```shell
exit
```

## Docker 加入主网络
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consistency maintained across OS-specific instructions.

The Linux setup instructions are well-aligned with the Windows section, ensuring consistency. However, the same markdown issue with emphasis applies here.

- **1. 启动**
+ ## 1. 启动

Apply similar changes to other emphasized sections.

Committable suggestion was skipped due to low confidence.

Tools
Markdownlint

82-82: null (MD036, no-emphasis-as-heading)
Emphasis used instead of a heading


98-98: null (MD036, no-emphasis-as-heading)
Emphasis used instead of a heading


114-114: null (MD036, no-emphasis-as-heading)
Emphasis used instead of a heading


123-123: null (MD036, no-emphasis-as-heading)
Emphasis used instead of a heading


131-131: null (MD036, no-emphasis-as-heading)
Emphasis used instead of a heading

Comment on lines +138 to +213

**1. 拉取 [Docker 镜像](https://hub.docker.com/r/starcoin/starcoin/)**

```shell
docker pull starcoin/starcoin:latest
```

如果你想使用指定版本,可以更改拉取的标签,比如 `v2.0.0`:

```shell
docker pull starcoin/starcoin:v2.0.0
```

**2. 启动**

`starcoin` 的二进制文件在镜像中的 `/starcoin` 目录下。

```shell
docker run --name starcoin -v ~/.starcoin/:/root/.starcoin/ --network host starcoin/starcoin:latest /starcoin/starcoin
```

- `--name`:指定容器名称。
- `-v`:绑定挂载卷,用于持久化 Docker 中的数据。
- `--network`:让 Docker 容器的网络附属在主机上,两者互通。

**3. 通过 Docker 连接到 Starcoin 控制台**

打开一个新的命令行窗口,输入:

```shell
docker run --rm -it -v ~/.starcoin/:/root/.starcoin/ starcoin/starcoin:latest /starcoin/starcoin -c /root/.starcoin/vega/starcoin.ipc console
```

- `--rm`:退出 Starcoin 控制台时,自动移除容器。
- `-it`:交互式进入容器,分配虚拟终端。

如果不想启用新的容器,可以直接接入启动 Starcoin 的容器:

```shell
docker container exec -it starcoin bash

/starcoin/starcoin -c /root/.starcoin/vega/starcoin.ipc console
```

**4. 查看节点同步进度**

在 Starcoin 控制台中输入:

```shell
node sync status
```

在输出的 JSON 数据中可以找到一些关键信息,`chain_status.head.number` 和 `state.Synchronizing.target.number` 相等时,同步才完成。

**5. 查看默认账号**

每个新启动的节点,都初始化有一个默认账户,密码为空。

```shell
# 查看默认账户,找到账户地址
account default
```

**6. 导出默认账户的私钥**

```shell
account export <ADDRESS>
```

注意:请妥善保管好私钥!

**7. 退出控制台**

```shell
exit
```
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docker instructions are clear and concise.

The Docker setup instructions are detailed and provide specific commands for users to follow. However, the document structure could be improved by using proper headings.

- **1. 拉取 [Docker 镜像](https://hub.docker.com/r/starcoin/starcoin/)**
+ ## 1. 拉取 [Docker 镜像](https://hub.docker.com/r/starcoin/starcoin/)

Apply similar changes to other emphasized sections.

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
**1. 拉取 [Docker 镜像](https://hub.docker.com/r/starcoin/starcoin/)**
```shell
docker pull starcoin/starcoin:latest
```
如果你想使用指定版本,可以更改拉取的标签,比如 `v2.0.0`
```shell
docker pull starcoin/starcoin:v2.0.0
```
**2. 启动**
`starcoin` 的二进制文件在镜像中的 `/starcoin` 目录下。
```shell
docker run --name starcoin -v ~/.starcoin/:/root/.starcoin/ --network host starcoin/starcoin:latest /starcoin/starcoin
```
- `--name`:指定容器名称。
- `-v`:绑定挂载卷,用于持久化 Docker 中的数据。
- `--network`:让 Docker 容器的网络附属在主机上,两者互通。
**3. 通过 Docker 连接到 Starcoin 控制台**
打开一个新的命令行窗口,输入:
```shell
docker run --rm -it -v ~/.starcoin/:/root/.starcoin/ starcoin/starcoin:latest /starcoin/starcoin -c /root/.starcoin/vega/starcoin.ipc console
```
- `--rm`:退出 Starcoin 控制台时,自动移除容器。
- `-it`:交互式进入容器,分配虚拟终端。
如果不想启用新的容器,可以直接接入启动 Starcoin 的容器:
```shell
docker container exec -it starcoin bash
/starcoin/starcoin -c /root/.starcoin/vega/starcoin.ipc console
```
**4. 查看节点同步进度**
在 Starcoin 控制台中输入:
```shell
node sync status
```
在输出的 JSON 数据中可以找到一些关键信息,`chain_status.head.number``state.Synchronizing.target.number` 相等时,同步才完成。
**5. 查看默认账号**
每个新启动的节点,都初始化有一个默认账户,密码为空。
```shell
# 查看默认账户,找到账户地址
account default
```
**6. 导出默认账户的私钥**
```shell
account export <ADDRESS>
```
注意:请妥善保管好私钥!
**7. 退出控制台**
```shell
exit
```
## 1. 拉取 [Docker 镜像](https://hub.docker.com/r/starcoin/starcoin/)
```shell
docker pull starcoin/starcoin:latest
```
如果你想使用指定版本,可以更改拉取的标签,比如 `v2.0.0`
```shell
docker pull starcoin/starcoin:v2.0.0
```
**2. 启动**
`starcoin` 的二进制文件在镜像中的 `/starcoin` 目录下。
```shell
docker run --name starcoin -v ~/.starcoin/:/root/.starcoin/ --network host starcoin/starcoin:latest /starcoin/starcoin
```
- `--name`:指定容器名称。
- `-v`:绑定挂载卷,用于持久化 Docker 中的数据。
- `--network`:让 Docker 容器的网络附属在主机上,两者互通。
**3. 通过 Docker 连接到 Starcoin 控制台**
打开一个新的命令行窗口,输入:
```shell
docker run --rm -it -v ~/.starcoin/:/root/.starcoin/ starcoin/starcoin:latest /starcoin/starcoin -c /root/.starcoin/vega/starcoin.ipc console
```
- `--rm`:退出 Starcoin 控制台时,自动移除容器。
- `-it`:交互式进入容器,分配虚拟终端。
如果不想启用新的容器,可以直接接入启动 Starcoin 的容器:
```shell
docker container exec -it starcoin bash
/starcoin/starcoin -c /root/.starcoin/vega/starcoin.ipc console
```
**4. 查看节点同步进度**
在 Starcoin 控制台中输入:
```shell
node sync status
```
在输出的 JSON 数据中可以找到一些关键信息,`chain_status.head.number``state.Synchronizing.target.number` 相等时,同步才完成。
**5. 查看默认账号**
每个新启动的节点,都初始化有一个默认账户,密码为空。
```shell
# 查看默认账户,找到账户地址
account default
```
**6. 导出默认账户的私钥**
```shell
account export <ADDRESS>
```
注意:请妥善保管好私钥!
**7. 退出控制台**
```shell
exit
```
Tools
Markdownlint

151-151: null (MD036, no-emphasis-as-heading)
Emphasis used instead of a heading


163-163: null (MD036, no-emphasis-as-heading)
Emphasis used instead of a heading


182-182: null (MD036, no-emphasis-as-heading)
Emphasis used instead of a heading


192-192: null (MD036, no-emphasis-as-heading)
Emphasis used instead of a heading


201-201: null (MD036, no-emphasis-as-heading)
Emphasis used instead of a heading


209-209: null (MD036, no-emphasis-as-heading)
Emphasis used instead of a heading

Comment on lines +225 to +228

- HTTP: http://vega.seed.starcoin.org
- HTTPS: https://vega-seed.starcoin.org
- WebSocket: ws://vega.seed.starcoin.org:9870
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Address bare URLs in the document.

Markdown guidelines suggest avoiding bare URLs. Adding descriptions can improve readability and accessibility.

- - HTTP: http://vega.seed.starcoin.org
+ - HTTP: [Vega Seed Node - HTTP](http://vega.seed.starcoin.org)
- - HTTPS: https://vega-seed.starcoin.org
+ - HTTPS: [Vega Seed Node - HTTPS](https://vega-seed.starcoin.org)
- - WebSocket: ws://vega.seed.starcoin.org:9870
+ - WebSocket: [Vega Seed Node - WebSocket](ws://vega.seed.starcoin.org:9870)
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- HTTP: http://vega.seed.starcoin.org
- HTTPS: https://vega-seed.starcoin.org
- WebSocket: ws://vega.seed.starcoin.org:9870
- HTTP: [Vega Seed Node - HTTP](http://vega.seed.starcoin.org)
- HTTPS: [Vega Seed Node - HTTPS](https://vega-seed.starcoin.org)
- WebSocket: [Vega Seed Node - WebSocket](ws://vega.seed.starcoin.org:9870)
Tools
Markdownlint

226-226: null (MD034, no-bare-urls)
Bare URL used


227-227: null (MD034, no-bare-urls)
Bare URL used

Comment on lines +7 to +27
## Windows joins vega network

**1. Start**

```shell
starcoin.exe --net vega ^
--disable-metrics true ^
--node-name starcoin-vega ^
--data-dir D:\starcoin\data ^
--logger-disable-file true ^
--stratum-address 0.0.0.0 --stratum-port 9880
```

- `--net`: Specifies the network.
- `--disable-metrics`: Whether to disable the metrics monitoring service, `true` to disable, `false` not to disable.
- `--node-name`: The node name is only used for display. You can choose a unique name according to your own preferences. If not specified, it will be randomly generated.
- `--data-dir`: The data storage directory, it is recommended to choose a path that is easy to find.
- `--logger-disable-file`: Whether to disable the file log collector, `true` to disable, `false` not to disable.
- `--stratum-address`: Specify the address of the mining pool, the default is `0.0.0.0`.
- `--stratum-port`: Specify the port number of the mining pool, the default is `9880`.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Convert emphasis to headings for better document structure.

Using emphasis (**text**) instead of headings for sections like "Start", "View the IPC file path", etc., is not semantically correct in Markdown.

- **1. Start**
+ ## 1. Start

Apply similar changes to other emphasized sections.

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
## Windows joins vega network
**1. Start**
```shell
starcoin.exe --net vega ^
--disable-metrics true ^
--node-name starcoin-vega ^
--data-dir D:\starcoin\data ^
--logger-disable-file true ^
--stratum-address 0.0.0.0 --stratum-port 9880
```
- `--net`: Specifies the network.
- `--disable-metrics`: Whether to disable the metrics monitoring service, `true` to disable, `false` not to disable.
- `--node-name`: The node name is only used for display. You can choose a unique name according to your own preferences. If not specified, it will be randomly generated.
- `--data-dir`: The data storage directory, it is recommended to choose a path that is easy to find.
- `--logger-disable-file`: Whether to disable the file log collector, `true` to disable, `false` not to disable.
- `--stratum-address`: Specify the address of the mining pool, the default is `0.0.0.0`.
- `--stratum-port`: Specify the port number of the mining pool, the default is `9880`.
## Windows joins vega network
## 1. Start
```shell
starcoin.exe --net vega ^
--disable-metrics true ^
--node-name starcoin-vega ^
--data-dir D:\starcoin\data ^
--logger-disable-file true ^
--stratum-address 0.0.0.0 --stratum-port 9880
```
- `--net`: Specifies the network.
- `--disable-metrics`: Whether to disable the metrics monitoring service, `true` to disable, `false` not to disable.
- `--node-name`: The node name is only used for display. You can choose a unique name according to your own preferences. If not specified, it will be randomly generated.
- `--data-dir`: The data storage directory, it is recommended to choose a path that is easy to find.
- `--logger-disable-file`: Whether to disable the file log collector, `true` to disable, `false` not to disable.
- `--stratum-address`: Specify the address of the mining pool, the default is `0.0.0.0`.
- `--stratum-port`: Specify the port number of the mining pool, the default is `9880`.
Tools
LanguageTool

[uncategorized] ~20-~20: Loose punctuation mark. (UNLIKELY_OPENING_PUNCTUATION)
Context: ...0.0.0 --stratum-port 9880 ``` - --net: Specifies the network. - `--disable-met...


[uncategorized] ~21-~21: Loose punctuation mark. (UNLIKELY_OPENING_PUNCTUATION)
Context: ...ifies the network. - --disable-metrics: Whether to disable the metrics monitori...


[uncategorized] ~22-~22: Loose punctuation mark. (UNLIKELY_OPENING_PUNCTUATION)
Context: ... false not to disable. - --node-name: The node name is only used for display....


[uncategorized] ~23-~23: Loose punctuation mark. (UNLIKELY_OPENING_PUNCTUATION)
Context: ...ll be randomly generated. - --data-dir: The data storage directory, it is recom...


[uncategorized] ~24-~24: Loose punctuation mark. (UNLIKELY_OPENING_PUNCTUATION)
Context: ... easy to find. - --logger-disable-file: Whether to disable the file log collect...


[uncategorized] ~25-~25: Loose punctuation mark. (UNLIKELY_OPENING_PUNCTUATION)
Context: ...enot to disable. ---stratum-address`: Specify the address of the mining pool,...


[uncategorized] ~26-~26: Loose punctuation mark. (UNLIKELY_OPENING_PUNCTUATION)
Context: ...default is 0.0.0.0. - --stratum-port: Specify the port number of the mining p...

Markdownlint

9-9: null (MD036, no-emphasis-as-heading)
Emphasis used instead of a heading

Comment on lines +81 to +137
## Linux joins vega network (recommendation)

**1. Start**

```shell
starcoin
```

The `starcoin` command uses the `vega` network by default, the mining client is disabled by default, the mining pool is not listened by default, and the data directory defaults to `.starcoin/vega` under the vega directory.

```shell
# Data directory, ubuntu is the username of the demo, please change it according to your actual situation
2022-05-24T10:07:29.069207121+08:00 INFO - Final data-dir is : "/home/ubuntu/.starcoin/vega"

# IPC file path
2022-05-24T10:07:29.061062410+08:00 INFO - Ipc file path: "/home/ubuntu/.starcoin/vega/starcoin.ipc"
```

**2. View node synchronization progress**

Open a new command line window and enter:

```shell
starcoin -c ~/.starcoin/vega/starcoin.ipc console
```

In the Starcoin console enter:

```shell
node sync status
```

Some key information can be found in the output JSON data.
The synchronization is completed when `chain_status.head.number` and `state.Synchronizing.target.number` are equal.

**3. View default account**

Each newly started node is initialized with a default account with an empty password.

```shell
# View the default account and find the account address
account default
```

**4. Export the private key of the default account**

```shell
account export <ADDRESS>
```

Note: Please keep the private key safe!

**5. Exit the console**

```shell
exit
```
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consistency maintained across OS-specific instructions.

The Linux setup instructions are well-aligned with the Windows section, ensuring consistency. However, the same markdown issue with emphasis applies here.

- **1. Start**
+ ## 1. Start

Apply similar changes to other emphasized sections.

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
## Linux joins vega network (recommendation)
**1. Start**
```shell
starcoin
```
The `starcoin` command uses the `vega` network by default, the mining client is disabled by default, the mining pool is not listened by default, and the data directory defaults to `.starcoin/vega` under the vega directory.
```shell
# Data directory, ubuntu is the username of the demo, please change it according to your actual situation
2022-05-24T10:07:29.069207121+08:00 INFO - Final data-dir is : "/home/ubuntu/.starcoin/vega"
# IPC file path
2022-05-24T10:07:29.061062410+08:00 INFO - Ipc file path: "/home/ubuntu/.starcoin/vega/starcoin.ipc"
```
**2. View node synchronization progress**
Open a new command line window and enter:
```shell
starcoin -c ~/.starcoin/vega/starcoin.ipc console
```
In the Starcoin console enter:
```shell
node sync status
```
Some key information can be found in the output JSON data.
The synchronization is completed when `chain_status.head.number` and `state.Synchronizing.target.number` are equal.
**3. View default account**
Each newly started node is initialized with a default account with an empty password.
```shell
# View the default account and find the account address
account default
```
**4. Export the private key of the default account**
```shell
account export <ADDRESS>
```
Note: Please keep the private key safe!
**5. Exit the console**
```shell
exit
```
## Linux joins vega network (recommendation)
## 1. Start
```shell
starcoin
```
The `starcoin` command uses the `vega` network by default, the mining client is disabled by default, the mining pool is not listened by default, and the data directory defaults to `.starcoin/vega` under the vega directory.
```shell
# Data directory, ubuntu is the username of the demo, please change it according to your actual situation
2022-05-24T10:07:29.069207121+08:00 INFO - Final data-dir is : "/home/ubuntu/.starcoin/vega"
# IPC file path
2022-05-24T10:07:29.061062410+08:00 INFO - Ipc file path: "/home/ubuntu/.starcoin/vega/starcoin.ipc"
```
## 2. View node synchronization progress
Open a new command line window and enter:
```shell
starcoin -c ~/.starcoin/vega/starcoin.ipc console
```
In the Starcoin console enter:
```shell
node sync status
```
Some key information can be found in the output JSON data.
The synchronization is completed when `chain_status.head.number` and `state.Synchronizing.target.number` are equal.
## 3. View default account
Each newly started node is initialized with a default account with an empty password.
```shell
# View the default account and find the account address
account default
```
## 4. Export the private key of the default account
```shell
account export <ADDRESS>
```
Note: Please keep the private key safe!
## 5. Exit the console
```shell
exit
```
Tools
LanguageTool

[uncategorized] ~89-~89: Possible missing preposition found. (AI_EN_LECTOR_MISSING_PREPOSITION)
Context: ...efault, the mining pool is not listened by default, and the data directory default...

Markdownlint

83-83: null (MD036, no-emphasis-as-heading)
Emphasis used instead of a heading


99-99: null (MD036, no-emphasis-as-heading)
Emphasis used instead of a heading


116-116: null (MD036, no-emphasis-as-heading)
Emphasis used instead of a heading


125-125: null (MD036, no-emphasis-as-heading)
Emphasis used instead of a heading


133-133: null (MD036, no-emphasis-as-heading)
Emphasis used instead of a heading

Comment on lines +139 to +213
## Docker joins vega network

**1. Pull the [Docker image](https://hub.docker.com/r/starcoin/starcoin/)**

```shell
docker pull starcoin/starcoin:latest
```

If you want to use a specific version, you can change the pull tag, such as `v2.0.0`:

```shell
docker pull starcoin/starcoin:v2.0.0
```

**2. Start**

The `starcoin` binaries are in the `/starcoin` directory in the mirror.

```shell
docker run --name starcoin -v ~/.starcoin/:/root/.starcoin/ --network host starcoin/starcoin:latest /starcoin/starcoin
```

- `--name`: Specifies the container name.
- `-v`: Bind mounted volume for persisting data in Docker.
- `--network`: Let the network of the Docker container be attached to the host, and the two can communicate with each other.

**3. Connect to the Starcoin console via Docker**

Open a new command line window and enter:

```shell
docker run --rm -it -v ~/.starcoin/:/root/.starcoin/ starcoin/starcoin:latest /starcoin/starcoin -c /root/.starcoin/vega/starcoin.ipc console
```

- `--rm`: Automatically remove the container when exiting the Starcoin console.
- `-it`: Enter the container interactively, assigning a pseudo terminal.

If you don't want to start a new container, you can directly access the container that started Starcoin:

```shell
docker container exec -it starcoin bash

/starcoin/starcoin -c /root/.starcoin/vega/starcoin.ipc console
```

**4. View node synchronization progress**

Open a new command line window and enter:

```shell
starcoin -c ~/.starcoin/vega/starcoin.ipc console
```

In the Starcoin console enter:

```shell
node sync status
```

Some key information can be found in the output JSON data.
The synchronization is completed when `chain_status.head.number` and `state.Synchronizing.target.number` are equal.

**5. View default account**

Each newly started node is initialized with a default account with an empty password.

```shell
# View the default account and find the account address
account default
```

**6. Export the private key of the default account**

```shell
account export <ADDRESS>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docker instructions are clear and concise.

The Docker setup instructions are detailed and provide specific commands for users to follow. However, the document structure could be improved by using proper headings.

- **1. Pull the [Docker image](https://hub.docker.com/r/starcoin/starcoin/)**
+ ## 1. Pull the [Docker image](https://hub.docker.com/r/starcoin/starcoin/)

Apply similar changes to other emphasized sections.

Committable suggestion was skipped due to low confidence.

Tools
LanguageTool

[uncategorized] ~161-~161: Loose punctuation mark. (UNLIKELY_OPENING_PUNCTUATION)
Context: ...atest /starcoin/starcoin ``` - --name: Specifies the container name. - `-v`: B...


[uncategorized] ~162-~162: Loose punctuation mark. (UNLIKELY_OPENING_PUNCTUATION)
Context: ...e: Specifies the container name. - -v`: Bind mounted volume for persisting data...


[uncategorized] ~163-~163: Loose punctuation mark. (UNLIKELY_OPENING_PUNCTUATION)
Context: ...persisting data in Docker. - --network: Let the network of the Docker container...


[uncategorized] ~173-~173: Loose punctuation mark. (UNLIKELY_OPENING_PUNCTUATION)
Context: .../vega/starcoin.ipc console ``` - --rm: Automatically remove the container when...


[uncategorized] ~174-~174: Loose punctuation mark. (UNLIKELY_OPENING_PUNCTUATION)
Context: ...en exiting the Starcoin console. - -it: Enter the container interactively, assi...

Markdownlint

153-153: null (MD036, no-emphasis-as-heading)
Emphasis used instead of a heading


165-165: null (MD036, no-emphasis-as-heading)
Emphasis used instead of a heading


184-184: null (MD036, no-emphasis-as-heading)
Emphasis used instead of a heading


201-201: null (MD036, no-emphasis-as-heading)
Emphasis used instead of a heading


210-210: null (MD036, no-emphasis-as-heading)
Emphasis used instead of a heading

@sanlee42 sanlee42 merged commit 75abe62 into main Jun 26, 2024
2 of 3 checks passed
@sanlee42 sanlee42 deleted the vega branch June 26, 2024 09:05
@4everland 4everland bot requested a deployment to production June 26, 2024 09:05 Abandoned
Copy link
Contributor

@timyangnet timyangnet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants