epic-wallet.toml
钱包配置文件的完整参考。所示默认值为全新mainnet钱包写入的内容。
文件位置
- 如果当前工作目录中存在
./epic-wallet.toml,则使用该文件。 - 否则使用
~/.epic/<network>/epic-wallet.toml。
<network>为main、floo、user或auto。
该文件由epic-wallet init写入,运行其他命令不会生成此文件。如果目标目录(impls/src/lifecycle/default.rs:132)中epic-wallet.toml和wallet_data/已同时存在,init将拒绝继续执行。
首次运行时,钱包还会在钱包目录中创建两个凭据文件.owner_api_secret和.api_secret,各为20个字符的随机字符串。
完整示例
生成的文件包含所有键。同一台机器上第二个钱包的最小配置:
[wallet]
chain_type = "Mainnet"
api_listen_interface = "127.0.0.1"
api_listen_port = 3415
# 不按网络偏移,因此同一台机器上的第二个钱包必须更改此端口。
owner_api_listen_port = 3421
api_secret_path = "/home/you/wallets/bob/.owner_api_secret"
node_api_secret_path = "/home/you/.epic/main/.api_secret"
check_node_api_http_addr = "http://127.0.0.1:3413"
data_file_dir = "/home/you/wallets/bob/wallet_data"
[tor]
# 默认值true需要在钱包可执行文件旁边放置tor二进制文件。
use_tor_listener = false
socks_proxy_addr = "127.0.0.1:9050"
send_config_dir = "/home/you/wallets/bob"
[epicbox]
epicbox_domain = "epicbox.epiccash.com"
epicbox_port = 443
epicbox_protocol_unsecure = false
[logging]
log_to_stdout = true
stdout_log_level = "Info"
log_to_file = true
file_log_level = "Debug"
log_file_path = "/home/you/wallets/bob/epic-wallet.log"
[wallet]
| Key | 类型 | Default | 用途 |
|---|---|---|---|
chain_type | 枚举,可选 | Mainnet | Mainnet, Floonet, UserTesting, AutomatedTesting |
api_listen_interface | string | 127.0.0.1 | Foreign API监听器的绑定地址。设为0.0.0.0以接受来自其他主机的转账 |
api_listen_port | u16 | 3415,floonet为13415,usernet为23415 | Foreign API端口,供listen使用 |
owner_api_listen_port | u16,可选 | 每个网络上的3420 | Owner API端口 |
owner_api_interface | string,可选 | 127.0.0.1 | Owner API绑定地址。默认以注释形式输出 |
api_secret_path | string,可选 | <wallet dir>/.owner_api_secret | Owner监听器Foreign路径的基本身份验证机密。/v3/owner从open_wallet获取令牌;参见authentication |
node_api_secret_path | string,可选 | <wallet dir>/.api_secret | 钱包调用节点时所用的Basic auth机密 |
check_node_api_http_addr | string | http://127.0.0.1:3413 | 钱包查询的节点。可通过-r在每次运行时覆盖 |
owner_api_include_foreign | bool,可选 | false | 在Owner API端口上同时提供Foreign API,适用于单端口环境 |
data_file_dir | string | <wallet dir>/wallet_data | 种子文件和数据库的存储位置 |
no_commit_cache | bool,可选 | false | 已预留 |
tls_certificate_file | string,可选 | unset | 监听器的TLS证书 |
tls_certificate_key | string,可选 | unset | TLS私钥。设置了证书但未设置此项将导致启动错误 |
dark_background_color_scheme | bool,可选 | true | CLI表格的配色方案 |
keybase_notify_ttl | 分钟,可选 | 1440 | Keybase接收通知的有效期。0表示禁用 |
owner_api_listen_port不像api_listen_port和check_node_api_http_addr那样按网络调整。mainnet钱包和floonet钱包都使用3420,因此同时运行多个实例需要覆盖该值。参见端口表。
[tor]
生成的文件将此部分标记为实验性。参见此版本未涵盖的内容。
| Key | 类型 | Default | 用途 |
|---|---|---|---|
use_tor_listener | bool | true | 在listen上启动隐藏服务。可通过-n/--no_tor在每次运行时覆盖 |
socks_proxy_addr | string | 127.0.0.1:9050 | SOCKS代理地址 |
send_config_dir | string | <wallet dir> | 已预留 |
use_tor_listener不可省略。[tor]部分若缺少该键则解析失败,因此要么为其赋值,要么将整个部分省略。
true的默认值需要在钱包可执行文件旁放置一个tor二进制文件,而发布版本归档中不包含该文件。请提供该二进制文件,或设置use_tor_listener = false并在listen上传入-n。
[epicbox]
| Key | 类型 | Default | 用途 |
|---|---|---|---|
epicbox_domain | string,可选 | epicbox.epiccash.com | 中继主机,以及epicbox地址中@后显示的域名 |
epicbox_port | u16,可选 | 443 | 中继端口 |
epicbox_protocol_unsecure | bool,可选 | false | false使用wss://,true使用ws:// |
epicbox_address_index | u32,可选 | 0 | 已预留。所有派生均使用索引0 |
地址和发送路径直接读取epicbox_domain和epicbox_port,没有回退机制,因此需要显式设置两者,或省略整个[epicbox]部分并使用代码中的默认值。
参见epicbox协议了解中继的作用。
[logging]
| Key | 类型 | Default | 用途 |
|---|---|---|---|
log_to_stdout | bool | true | 输出到标准输出 |
stdout_log_level | enum | Info | Error, Warning, Info, Debug, Trace |
log_to_file | bool | false | 输出到文件 |
file_log_level | enum | Debug | 文件日志级别 |
log_file_path | string | <wallet dir>/epic-wallet.log | 日志文件路径 |
log_file_append | bool | true | 每次运行时追加而非截断 |
log_max_size | bytes,可选 | 16777216 | 超过此大小时轮转。注释掉以禁用轮转 |
log_max_files | u32,可选 | 32 | 保留的轮转文件数量 |
tui_running | bool,可选 | unset | 启动时从节点的run_tui中设置 |
全新钱包不写入日志文件,因为log_to_file为false而log_file_path已填充。设置log_to_file = true可将日志写入磁盘。
各网络默认值
| 网络 | api_listen_port | check_node_api_http_addr | 钱包目录 |
|---|---|---|---|
| Mainnet | 3415 | http://127.0.0.1:3413 | ~/.epic/main |
| Floonet | 13415 | http://127.0.0.1:13413 | ~/.epic/floo |
| UserTesting | 23415 | http://127.0.0.1:23413 | ~/.epic/user |
| AutomatedTesting | 3415 | http://127.0.0.1:3413 | ~/.epic/auto |
首次运行时设置的路径
代码中的相对默认值在文件创建时会被重写为绝对路径:
| Key | 写入值 |
|---|---|
wallet.data_file_dir | <wallet dir>/wallet_data |
wallet.api_secret_path | <wallet dir>/.owner_api_secret |
wallet.node_api_secret_path | <wallet dir>/.api_secret |
logging.log_file_path | <wallet dir>/epic-wallet.log |
tor.send_config_dir | <wallet dir> |
<wallet dir>为~/.epic/<network>,除非通过--current_dir或init --cwd提供了自定义值。
来源
config/src/types.rs用于查看结构体及其默认值config/src/types.rs:223用于[logging],即节点共享的日志配置config/src/comments.rs用于查看写入磁盘的带注释模板config/src/config.rs用于文件发现、按网络覆盖及路径重写