注意:用户仅需要复制带$
前缀后的内容即可,不需要复制$
例:
$ ls
您仅需复制 “ls” 即可
1. 安装docker
Platform |
x86_64/amd64 |
ARM |
ARM64/AARCH64 |
yes |
no |
yes |
|
yes |
yes |
yes |
|
yes |
no |
yes |
|
yes |
yes |
yes |
|
yes |
no |
no |
|
no |
no |
no |
2. 配置目录结构
Linux下的示例:
# Get root right
$ su
# make a run time directory for mount
$ mkdir /agent
# make log dir for store log files
$ cd /agent
$ mkdir log
下面是建立好的目录结构
/
`-- agent
`-- log
3. 新增配置文件
新建一个agent_conf.json
的文件。注意 agent_conf.json
名字不要错。
$ cd /agent
$ touch agent_conf.json
现在目录结构是这样的:
/
`-- agent
|-- agent_conf.json
`-- log
全路径应该是
/agent/agent_conf.json
/agent/log/
注意 配置文件agent_conf.json
与目录log
是同一级别的,即都在agent
目录下。
4. 修改配置文件
配置文件格式如下,可以复制到agent_conf.json
中然后进行修改。
{
"account":[
{
"name":"novablock",
"weight":1
}
],
"account_mode":0,
"agent_listen_ip":"0.0.0.0",
"agent_listen_port":8888,
"agent_rpc_port":16580,
"auto_start":false,
"offline_keep_mining":false,
"pools":[
{
"address":"btc.s.novablock.com",
"port":443
}
]
}
配置文件含义如下
- account
[array]
: 代理子账号。如果account_mode 是1的话,代理会用这个作为子账号在矿池挖矿而不会使用矿机中的子账号。- name
[string]
: 子账号 - weight
[int 1-99]
: 权重 ,如果有多个子账号,代理会把权重求和,然后计算每个账号对应的算力百分比.
- name
- account_mode
[int 0-1]
: 代理的账号模式- 0 : 将会使用每个矿机中的子账号。 本配置文件中的account字段则无效。
- 1 : 将会使用本配置文件中account字段的子账号并且根据权重分配算力。矿机中的子账号无效。
- agent_rpc_port
[int 0 - 65535]
: 在linux下无用 - agent_listen_ip
[string]
: 代理监听的ip。 - agent_listen_port
[int 0 - 65535]
: 代理监听的端口. - auto_start
[bool]
: 在linux 下无用. - offline_keep_mining
[bool]
: 断网保持负载。建议为false。 - pools
[array]
: 矿池地址的是相关配置。最多写三个。- address
[string]
: 矿池地址:btc.s.novablock.com
- port
[int 0-65535]
: 矿池端口1883,443,25
- address
5. 下载docker镜像
$ docker pull registry.cn-hongkong.aliyuncs.com/mining_smart_agent/btcagent:3.0.5
6. 运行代理镜像
- 确保刚刚新建的文件夹是
/agent
- 确保建立了配置文件的
agent_conf.json
$ docker run -d -v /agent/:/work/agent --name btcagent --network="host" --restart=always registry.cn-hongkong.aliyuncs.com/mining_smart_agent/btcagent:3.0.5
7. 矿机连接
- 地址是代理服务器的 内网 IP
- 端口是
agent_listen_port
。代理监听的端口,在agent_conf.json
中配置的。
8. 查看日志
查看日志有2种方法。
- 在
/agent/log/
文件夹下有所有日志 - 输入下面命令以查看实时日志
$ docker logs --tail=50 --follow btcagent
评论
0 条评论
文章评论已关闭。