跳到主要内容

epic-wallet.toml

钱包配置文件的完整参考。所示默认值为全新mainnet钱包写入的内容。

文件位置​

  1. 如果当前工作目录中存在./epic-wallet.toml,则使用该文件。
  2. 否则使用~/.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个字符的随机字符串。

完整示例​

生成的文件包含所有键。同一台机器上第二个钱包的最小配置:

epic-wallet.toml
[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枚举,可选MainnetMainnet, Floonet, UserTesting, AutomatedTesting
api_listen_interfacestring127.0.0.1Foreign API监听器的绑定地址。设为0.0.0.0以接受来自其他主机的转账
api_listen_portu163415,floonet为13415,usernet为23415Foreign API端口,供listen使用
owner_api_listen_portu16,可选每个网络上的3420Owner API端口
owner_api_interfacestring,可选127.0.0.1Owner API绑定地址。默认以注释形式输出
api_secret_pathstring,可选<wallet dir>/.owner_api_secretOwner监听器上除/v2/foreign之外所有端点的Basic auth机密,即/v3/owner和/v2/owner。/v3/owner还需从open_wallet获取令牌。注释掉此项可移除Basic层。参见身份验证
node_api_secret_pathstring,可选<wallet dir>/.api_secret钱包仅在除get_status之外的节点/v2/owner调用中发送的节点机密,实际上用于Tor洋葱地址查询。参见钱包向节点出示的凭据
check_node_api_http_addrstringhttp://127.0.0.1:3413钱包查询的节点。可通过-r在每次运行时覆盖
owner_api_include_foreignbool,可选false在Owner API端口上同时提供Foreign API,适用于单端口环境
data_file_dirstring<wallet dir>/wallet_data种子文件和数据库的存储位置
no_commit_cachebool,可选false已预留
tls_certificate_filestring,可选unset监听器的TLS证书
tls_certificate_keystring,可选unsetTLS私钥。设置了证书但未设置此项将导致启动错误
dark_background_color_schemebool,可选trueCLI表格的配色方案
keybase_notify_ttl分钟,可选1440Keybase接收通知的生存时间。0表示禁用
The Owner API port is the same on every network

owner_api_listen_port不像api_listen_port和check_node_api_http_addr那样按网络调整。mainnet钱包和floonet钱包都使用3420,因此同时运行多个实例需要覆盖该值。参见端口表。

[tor]​

生成的文件将此部分标记为实验性。参见此版本未涵盖的内容。

Key类型Default用途
use_tor_listenerbooltrue在listen上启动隐藏服务。可通过-n/--no_tor在每次运行时覆盖
socks_proxy_addrstring127.0.0.1:9050SOCKS代理地址
send_config_dirstring<wallet dir>已预留

use_tor_listener不是可选项。省略该键的[tor]部分将无法解析,因此要么为其赋值,要么将整个部分省略。

true的默认值需要一个tor二进制文件与钱包可执行文件放在同一目录,而发布版本归档中不包含该文件。要么提供该二进制文件,要么设置use_tor_listener = false并在listen上传入-n。

[epicbox]​

Key类型Default用途
epicbox_domainstring,可选epicbox.epiccash.com中继主机,以及epicbox地址中@之后显示的域名
epicbox_portu16,可选443中继端口
epicbox_protocol_unsecurebool,可选falsefalse使用wss://,true使用ws://
epicbox_address_indexu32,可选0已预留。所有派生均使用索引0

地址和发送路径直接读取epicbox_domain和epicbox_port,没有回退机制,因此要么显式设置两者,要么省略整个[epicbox]部分并使用代码中的默认值。

参见epicbox协议,了解中继的作用。

[logging]​

Key类型Default用途
log_to_stdoutbooltrue输出到标准输出
stdout_log_levelenumInfoError, Warning, Info, Debug, Trace
log_to_fileboolfalse输出到文件
file_log_levelenumDebug文件日志级别
log_file_pathstring<wallet dir>/epic-wallet.log日志文件路径
log_file_appendbooltrue每次运行时追加而非截断
log_max_sizebytes,可选16777216超过此大小时轮转。注释掉以禁用轮转
log_max_filesu32,可选32保留的轮转文件数量
tui_runningbool,可选unset在启动时从节点的run_tui设置

新建钱包不会写入日志文件,因为log_to_file为false而log_file_path已填充。设置log_to_file = true可将日志写入磁盘。

各网络默认值​

网络api_listen_portcheck_node_api_http_addr钱包目录
Mainnet3415http://127.0.0.1:3413~/.epic/main
Floonet13415http://127.0.0.1:13413~/.epic/floo
UserTesting23415http://127.0.0.1:23413~/.epic/user
AutomatedTesting3415http://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提供了自定义值。

来源​

下一步​