@@ -9,169 +9,188 @@ tags:
9
9
- ' abtnode'
10
10
---
11
11
12
- 为了方便用户使用 ABT 节点,我们为其量身定制了一个 CLI 工具: ` abtnode cli ` , 我们先看看它长什么样 :
12
+ ABT Node 提供了 ` abtnode ` 命令行工具,用于控制和管理节点。使用以下语法可以从您的终端运行 ` abtnode ` 命令 :
13
13
14
14
``` bash
15
- ➜ ~ abtnode -h
16
- Usage: abtnode [options] [command]
17
-
18
- Options:
19
- -V, --version output the version number
20
- -c --config [node-config] ABT Node configuration file
21
- -s --silent Should we run in silent mode (default: false)
22
- (default: false)
23
- -y --yes Automatic yes to prompts (default: false)
24
- (default: false)
25
- -h, --help display help for command
26
-
27
- Commands:
28
- bundle [options] Bundle a blocklet that can run in ABT Node
29
- start [options] Start ABT Node Daemon
30
- init Init ABT Node config
31
- status Show ABT Node and blocklet status
32
- logs Show ABT Node and blocklet logs
33
- stop| kill [options] Stop ABT Node and blocklets
34
- info [options] Get environment information for debugging and
35
- issue reporting
36
- deploy [options] < folder> Deploy blocklet from local directory to ABT Node
37
- blocklet:init Create an empty blocklet project
38
- upgrade Self-Upgrade ABTNode
39
- help [command] display help for command
15
+ abtnode [options] [command]
40
16
```
41
17
42
- 可以看到它提供了丰富的命令供用户使用,主要的命令有:
18
+ 你可以使用 ` -h ` 或 ` --help ` 来查看所有支持的命令。
19
+
20
+ ### 版本
21
+
22
+ 查看当前 ABTNode 版本。
23
+
24
+ ``` bash
25
+ $ abtnode -V
26
+ 1.4.1
27
+ ```
43
28
44
- ### 1. abtnode bundle [ options ]
29
+ ### 初始化
45
30
46
- 用来打包一个 Blocklet
31
+ 启动 ABTNode 的配置。配置包含节点层级的基本属性,如端口。
47
32
48
- ![ ] ( ./images/abtnode-cli-2.png )
33
+ ``` bash
34
+ $ abtnode init
35
+ ? Are you sure to initialize a ABT Node instance in the current directory(/home/arcblock) Yes
36
+ ✔ ABT Node configuration is successfully generated /home/arcblock/.abtnode/abtnode.yml
37
+ ℹ abtnode start
38
+ ```
49
39
50
- ### 2. start [ options ]
40
+ ### 启动
51
41
52
- 启动 ABT 节点
42
+ 启动 ABT Node 守护进程。
53
43
54
44
``` bash
55
45
➜ abtnode start
56
- ℹ Load config from /Users/naterobinson/.abtnode.yml
57
- ℹ Node did from config zNKjPn1W28J6AVQdJjLhjYjmLtyvq7dSvE12
58
- ✔ ABT Node Daemon started successfully: http://192.168.31.189/
46
+ ℹ Node did from config zNKhyzGJfngmBvwQiwHtBinUNiwL2SE85yAE
47
+ ℹ Load config from /data/abtnode/.abtnode/abtnode.yml
48
+ ✔ ABT Node DB Proxy ready on port 40404
49
+ ✔ ABT Node Event Hub ready on port 40407
50
+ ✔ ABT Node Updater ready on port 40405
51
+ ✔ ABT Node config updated with version 1.4.1
52
+ ✔ ABT Node state updated with version 1.4.1
53
+ ✔ Update blocklet environments success
54
+ ✔ Starting ABT Node Service... Done in 9.195s
55
+ ✔ Starting ABT Node Daemon... Done in 9.067s
59
56
```
60
57
61
- ### 3. init
58
+ ABT Node 必须在启动前初始化,否则启动将失败。可以通过 ` --auto-init / -a ` 参数来自动初始化。
59
+
60
+ ### 停止
62
61
63
- 初始化 ABT 节点
62
+ 停止 ABT Node。该命令支持 ` -f ` 选项来强制停止节点。
64
63
65
64
``` bash
66
- ➜ abtnode init
65
+ $ abtnode stop
66
+ ℹ Node did from config zNKp3NUU4BJG7Q2aQc93oN2CVHCdK2dNU5t5
67
+ ℹ Load config from /data/abtnode/.abtnode/abtnode.yml
68
+ ✔ Sending shutdown notification to web dashboard users Done in 2.07s
69
+ ✔ Routing engine is stopped successfully
70
+ ✔ abt-node-daemon is stopped successfully
71
+ ✔ abt-node-service is stopped successfully
72
+ ✔ abt-node-updater is stopped successfully
73
+ ✔ abt-node-db-hub is stopped successfully
74
+ ✔ abt-node-log-rotate is stopped successfully
75
+ ✔ abt-node-event-hub is stopped successfully
67
76
✔ Done!
68
- ? Please name your Node ABT Node [naterobinson]
69
- ? Give a concise description of your node Container of useful blocklets from Arc
70
- Block and its Developer Community
71
- ? Which IP do you want your node to serve on? 192.168.31.189
72
- ? Which port do you want your node to listen on? 8089
73
- ? Choose routing engine none
74
- ? Where does your Node fetch blocklet from? https://blocklet.arcblock.io
75
- ? Where do you want ABT Node to store data? /Users/naterobinson/.abtnode
76
- ? Where do you want to save config file? /Users/naterobinson/.abtnode.yml
77
- ✔ ABT Node configuration is successfully generated /Users/naterobinson/.abtnode.yml
78
- ℹ Now you can start your ABT Node with the following command
79
- ℹ abtnode start
80
77
```
81
78
82
- ### 4. status
79
+ ### 状态
83
80
84
- 查看当前节点的状态
81
+ 查看 ABT Node 状态。
85
82
86
83
``` bash
87
- ➜ abtnode status
88
- ℹ Load config from /Users/naterobinson/.abtnode.yml
89
- ℹ Node did from config zNKmPHwdoymyz7p5AxeSR6qu7z4aRKEn5sih
84
+ $ abtnode status
85
+ ℹ Node did from config zNKp3NUU4BJG7Q2aQc93oN2CVHCdK2dNU5t5
86
+ ℹ Load config from /data/abtnode/.abtnode/abtnode.yml
90
87
91
- ABT Node is: Running
88
+ ABT Node status: Running
89
+ ABT Node Data Directory: /data/abtnode/.abtnode
92
90
93
91
Blocklets Status
94
- ⚠ No blocklets installed yet.
92
+ ┌──────────────────────────────┬──────────┬───────────────┐
93
+ │ Name │ Version │ Status │
94
+ ├──────────────────────────────┼──────────┼───────────────┤
95
+ │ static-demo-blocklet │ 1.1.10 │ installed │
96
+ └──────────────────────────────┴──────────┴───────────────┘
95
97
```
96
98
97
- ### 5. logs
99
+ ### 日志
98
100
99
- 查看当前节点的日志
101
+ 查看 ABT Node 和 Blocklet 的日志位置。你可以从显示的位置中查看日志文件。
100
102
101
103
``` bash
102
- ➜ abtnode logs
103
- ℹ Load config from /Users/naterobinson/.abtnode.yml
104
- ℹ Node did from config zNKmPHwdoymyz7p5AxeSR6qu7z4aRKEn5sih
104
+ $ abtnode logs
105
+ ℹ Node did from config zNKp3NUU4BJG7Q2aQc93oN2CVHCdK2dNU5t5
106
+ ℹ Load config from /data/abtnode/.abtnode/abtnode.yml
105
107
106
108
ABT Node Logs
107
- - Output: /Users/naterobinson/.abtnode/core/output.log
108
- - Error: /Users/naterobinson/.abtnode/core/error.log
109
- ⚠ No blocklets installed yet.
109
+ - Latest logs: /data/abtnode/.abtnode/logs/_abtnode/daemon-2021-08-03.log
110
+ - Daemon Logs Directory: /data/abtnode/.abtnode/logs/_abtnode
111
+
112
+ Daemon Logs
113
+ - access-< date> .log: access logs rotated by day
114
+ - daemon-< date> .log: business logs rotated by day
115
+ - daemon-error-< date> .log: error logs rotated by day
116
+ - service.log: abtnode service logs
117
+ - stderr.log: stderr logs
118
+ - stdout.log: stdout logs
119
+
120
+
121
+ - Output: /data/abtnode/.abtnode/logs/static-demo-blocklet/output.log
122
+ - Error: /data/abtnode/.abtnode/logs/static-demo-blocklet/error.log
110
123
```
111
124
112
- ### 6. stop|kill [ options ]
125
+ ### 升级
113
126
114
- 停止 ABT 节点
127
+ 升级 ABT Node 到最新版本。它执行所有必要的步骤,如停止当前版本,安装新版本,并启动它。
115
128
116
129
``` bash
117
- ➜ abtnode stop
118
- ℹ Load config from /Users/naterobinson/.abtnode.yml
119
- ℹ Node did from config zNKmPHwdoymyz7p5AxeSR6qu7z4aRKEn5sih
120
- ✔ abt-node-daemon is stopped successfully
121
- ✔ abt-node-db-hub is stopped successfully
122
- ✔ Routing engine is stopped successfully
123
- ✔ Done!
130
+ $ abtnode upgrade
131
+ ℹ Using abtnode from /home/arcblock/.local/bin/abtnode
132
+ ℹ Checking permissions...
133
+ Current version is 1.4.1, found latest version 1.4.4
134
+ Begin upgrade
135
+ ℹ Stopping ABT Node ...
136
+ ℹ Installing ABT Node ...
137
+
138
+ # Truncated for Brevity
124
139
```
125
140
126
- ### 7. info [ options ]
141
+ ### 环境变量
127
142
128
- 查看当前节点的信息
143
+ 打印环境信息以便调试和报告问题
129
144
130
145
``` bash
131
- ➜ abtnode info
146
+ $ abtnode info
132
147
133
148
System:
134
- OS: macOS 10.15.5
135
- CPU: (12 ) x64 Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
136
- Shell: 5.7.1 - /bin/zsh
149
+ OS: Linux 5.10 Ubuntu 18.04.5 LTS (Bionic Beaver)
150
+ CPU: (6 ) x64 Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
151
+ Shell: 4.4.20 - /bin/bash
137
152
Binaries:
138
- Node: 12.7.0 - ~ /.nvm/versions/node/v12.7.0/bin/node
139
- Yarn: 1.22.4 - ~ /.nvm/versions/node/v12.7.0/bin/yarn
140
- npm: 6.10.0 - ~ /.nvm/versions/node/v12.7.0/bin/npm
153
+ Node: 12.20.0 - /usr/bin/node
154
+ npm: 6.14.8 - /usr/bin/npm
141
155
Servers:
142
- Apache: 2.4.41 - /usr/sbin/apachectl
143
- Nginx: 1.19.1 - /usr/local/bin/nginx
144
- Virtualization:
145
- Docker: 19.03.2 - /usr/local/bin/docker
146
- Browsers:
147
- Chrome: 84.0.4147.125
148
- Safari: 13.1.1
149
- npmGlobalPackages:
150
- npm: 6.10.0
151
- pm2: 4.4.0
152
- yarn: 1.22.4
156
+ Nginx: 1.18.0 - /usr/sbin/nginx
153
157
```
154
158
155
- ### 8. deploy [ options] <folder >
156
-
157
- 部署 blocklet
158
-
159
- ![ ] ( ./images/abtnode-cli-3.png )
159
+ ### 导出
160
160
161
- ### 9. blocklet : init
161
+ 导出 ABT Node 的完整状态,包括 ABT Node 配置、Blocklets 配置和路由,以便可以分享。
162
162
163
- 初始化一个空的 blocklet 项目
164
-
165
- ![ ] ( ./images/abtnode-cli-4.png )
166
-
167
- ### 10. upgrade
163
+ ``` bash
164
+ $ abtnode export
165
+ ℹ Node did from config zNKhyzGJfngmBvwQiwHtBinUNiwL2SE85yAE
166
+ ℹ Load config from /data/abtnode/.abtnode/abtnode.yml
167
+ ⚠ Will only export the blocklets that installed from blocklet registry or url.
168
+ ✔ Copy ABT Node configurations file successfully!
169
+ ℹ Copying blocklet data...
170
+ ✔ Copy blocklet data successfully!
171
+ ℹ Copying other files...
172
+ ℹ Copying routing rule files...
173
+ ℹ No routing rule data
174
+ ℹ Copying blocklet running data files...
175
+ ✔ Copy blocklet running data files successfully!
176
+ ℹ Copying blocklet extras db data files...
177
+ ✔ Copy blocklet extras db data files successfully!
178
+ ✔ Copy other files successfully!
179
+
180
+ ✔ The exported data is in directory: /data/abtnode/exported_abtnode/.abtnode
181
+ ✔ Exported successfully!
182
+ ```
168
183
169
- 升级 ABT 节点
184
+ ### 帮助
170
185
171
- ![ ] ( ./images/abtnode-cli-5.png )
186
+ ` help ` 命令可以帮助你查看某个命令的帮助信息。同时,你也可以通过 ` -h ` 参数传递给子命令来获取相同的信息。
172
187
173
- ### 11. help [ command]
188
+ ``` bash
189
+ $ abtnode help logs
190
+ Usage: abtnode logs [options]
174
191
175
- 查看帮助命令
192
+ Show ABT Node and blocklet logs
176
193
177
- ![ ] ( ./images/docs-help.png )
194
+ Options:
195
+ -h, --help display help for command
196
+ ```
0 commit comments