Skip to content

配置链上主币的名称以及验证

QM edited this page Dec 21, 2020 · 1 revision

配置主币名称, 在搭建平行链时, 基本每次都会用到。

配置主币名称

在链的title配置项下方CoinSymbol 可以配置主币名称

# 配置 title 
Title="user.p.tschain."  
# 配置 主币symbol
CoinSymbol="TSC"

验证配置

通过rpc 接口查看Chain33.GetCoinSymbol配置结果

$ curl -X GET -d '{ "params" : [ {  } ], "id" : 1, "method" : "Chain33.GetCoinSymbol" }' http://192.168.3.8:8801
{"id":1,"result":{"data":"TSC"},"error":null}

常见问题

  1. 拼写错误: CoinSymbol 误写为CoinsSymbol
  2. 版本过低(配置公能做出来不久,才有这种问题)
# curl -X GET -d '{ "params" : [ {  } ], "id" : 1, "method" : "Chain33.GetCoinSymbol" }' http://localhost:8901
{"id":1,"result":null,"error":"rpc: can't find method Chain33.GetCoinSymbol"}
  1. 先启动程序,在修改配置。 这种情况下, 需要清理数据, 重新程序。