1. 主页
  2. 文档
  3. Monero-Doc 门罗币教程...
  4. 第一章 交互
  5. 9 配置文件

9 配置文件

适用性

默认情况下,Monero 在门罗币数据目录中查找 bitmonero.conf。 要使用特定的配置文件 add -- config-file 选项:

./monerod --config-file=/etc/monerod.conf

-- config-file 选项可用于:

  • monerod
  • monero-wallet-cli
  • monero-wallet-rpc
  • monero-gen-trusted-multisig

 

语法

option-name=value
valueless-option-name=1 适用于非期望值
# comment
  • whitespace is ignored

 

参考

所有配置选项与二进制文件的命令行选项相同。

从 -- option-name 中跳过。 例子:

./monerod --log-level=4 --stagenet

翻译过来是:

log-level=4
stagenet=1     # use value "1" to enable the value-less options like --stagenet

 

示例

 

monerod.conf

这个配置是为生产服务器的使用量身定制的。

# /etc/monero/monerod.conf

# Data directory (blockchain db and indices)
data-dir=/home/monero/.monero  # Remember to create the monero user first

# Log file
log-file=/var/log/monero/monerod.log
max-log-file-size=0            # Prevent monerod from managing the log files; we want logrotate to take care of that

# P2P full node
p2p-bind-ip=0.0.0.0            # Bind to all interfaces (the default)
p2p-bind-port=18080            # Bind to default port

# RPC open node
rpc-bind-ip=0.0.0.0            # Bind to all interfaces
rpc-bind-port=18081            # Bind on default port
confirm-external-bind=1        # Open node (confirm)
restricted-rpc=1               # Prevent unsafe RPC calls
no-igd=1                       # Disable UPnP port mapping

# Slow but reliable db writes
db-sync-mode=safe

# Emergency checkpoints set by MoneroPulse operators will be enforced to workaround potential consensus bugs
# Check https://monerodocs.org/infrastructure/monero-pulse/ for explanation and trade-offs
enforce-dns-checkpointing=1

out-peers=64              # This will enable much faster sync and tx awareness; the default 8 is suboptimal nowadays
in-peers=1024             # The default is unlimited; we prefer to put a cap on this

limit-rate-up=1048576     # 1048576 kB/s == 1GB/s; a raise from default 2048 kB/s; contribute more to p2p network
limit-rate-down=1048576   # 1048576 kB/s == 1GB/s; a raise from default 8192 kB/s; allow for faster initial sync

 

monero-wallet-cli.conf

这个配置是为 stagenet 上的桌面版量身定制的。

# $HOME/.bitmonero/stagenet/monero-wallet-cli.conf

# Pick network
stagenet=1

# Connect to a remote full node    
daemon-address=monero-stagenet.exan.tech:38081
untrusted-daemon=1

# Log file
log-file=/tmp/monero-wallet-cli.log

# wallet-file=/home/YOUR-USER/.bitmonero/stagenet/wallets/MoneroExampleStagenetWallet


本章内容由akio翻译制作,欢迎打赏作者。akio的门罗币钱包地址为:

85dcjUpwzAXKWtA4UcZqGUYmehrUoRfW7WUMHCTPEB7f1SvPq52Y4SoEwvB3nbniFtEnFgByFDQxuVwp1pfJbuMFK5EKM4f

我们要如何帮助您?