diff --git a/docs/02-getting-started/02-setup/08-vega-network.md b/docs/02-getting-started/02-setup/08-vega-network.md new file mode 100644 index 00000000..984b9375 --- /dev/null +++ b/docs/02-getting-started/02-setup/08-vega-network.md @@ -0,0 +1,228 @@ +# How to participate in the vega network + +## Introduction + +On June 21 2024, Starcoin launched the Vega network for Starcoin 2.0. This marks a new chapter for Starcoin, integrating FlexiDag and TurboSTM technologies to boost flexibility, performance, and transaction efficiency. This significant upgrade reflects Starcoin's commitment to continuous innovation and excellence in the blockchain space, setting the stage for future advancements and opportunities. + +## 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`. + +After entering the above command in the cmd window of Windows, press Enter, and the node will start to synchronize the block data, just wait for the synchronization to complete. + +**2. View the IPC file path** + +Drag the sidebar to the top with the mouse, and you can see that the output shows the storage path of the IPC file: + +```shell +2022-05-23T16:40:06.642907500+08:00 INFO - Ipc file path: "\\\\.\\pipe\\starcoin\\vega\\starcoin.ipc + +# IPC file path is: +\\\\.\\pipe\\starcoin\\vega\\starcoin.ipc +``` + +**3. View node synchronization progress** + +If you want to know the progress of the node synchronization data, you can open a new cmd window at this time and use the IPC file to connect to the Starcoin console: + +```shell +starcoin.exe -c \\.\pipe\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. + +**4. 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 +``` + +**5. Export the private key of the default account** + +```shell +account export
+``` + +Note: Please keep the private key safe! + +**6. 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 +``` + +Note: Please keep the private key safe! + +**5. Exit the console** + +```shell +exit +``` + +## 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 +``` + +Note: Please keep the private key safe! + +**7. Exit the console** + +```shell +exit +``` + +## Seed Node JSON-RPC + +- HTTP: http://vega.seed.starcoin.org +- HTTPS: https://vega-seed.starcoin.org +- WebSocket: ws://vega.seed.starcoin.org:9870 diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/02-getting-started/02-setup/08-vega-network.md b/i18n/zh/docusaurus-plugin-content-docs/current/02-getting-started/02-setup/08-vega-network.md new file mode 100644 index 00000000..3cf430a8 --- /dev/null +++ b/i18n/zh/docusaurus-plugin-content-docs/current/02-getting-started/02-setup/08-vega-network.md @@ -0,0 +1,219 @@ +# 如何参与主网络 + +## 简介 + +2024年6月21日,Starcoin 推出了 Vega 网络,标志着 Starcoin 2.0 的新时代开启。此次升级引入了FlexiDag和TurboSTM技术,极大地提升了灵活性、性能和交易效率。这次升级展示了 Starcoin 在区块链领域持续创新的决心,并为未来的进步和机遇奠定了坚实的基础。 + +## 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 的 cmd 窗口输入上述命令后,回车,节点就开始同步区块数据了,等待同步完成即可。 + +**2. 查看 IPC 文件路径** + +用鼠标拖拽侧边栏到顶部,可以看到输出中显示有 IPC 文件的存放路径: + +```shell +2022-05-23T16:40:06.642907500+08:00 INFO - Ipc file path: "\\\\.\\pipe\\starcoin\\vega\\starcoin.ipc + +# IPC 文件路径为: +\\\\.\\pipe\\starcoin\\vega\\starcoin.ipc +``` + +**3. 查看节点同步进度** + +如果想知道节点同步数据的进度,此时可以再打开一个新的 cmd 窗口,用 IPC 文件来连接到 Starcoin 控制台: + +```shell +starcoin.exe -c \\.\pipe\starcoin\vega\starcoin.ipc console +``` + +在 Starcoin 控制台中输入: + +```shell +node sync status +``` + +在输出的 JSON 数据中可以找到一些关键信息,`chain_status.head.number` 和 `state.Synchronizing.target.number` 相等时,同步才完成。 + +**4. 查看默认账号** + +每个新启动的节点,都初始化有一个默认账户,密码为空。 + +```shell +# 查看默认账户,找到账户地址 +account default +``` + +**5. 导出默认账户的私钥** + +```shell +account export +``` + +注意:请妥善保管好私钥! + +**6. 退出控制台** + +```shell +exit +``` + +## 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 +``` + +注意:请妥善保管好私钥! + +**5. 退出控制台** + +```shell +exit +``` + +## Docker 加入主网络 + +**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 +``` + +注意:请妥善保管好私钥! + +**7. 退出控制台** + +```shell +exit +``` + +## 种子节点地址 + +- HTTP: http://vega.seed.starcoin.org +- HTTPS: https://vega-seed.starcoin.org +- WebSocket: ws://vega.seed.starcoin.org:9870