安装部署 单节点开发环境搭建 - assetcloud/AssetChain GitHub Wiki

获得安装包

  1. 从代码仓库打包
  2. 配置文件使用 assetchain.solo.toml, 而不是 assetchain.toml
    1. assetchain.solo.toml 是提供单节点测试用的.

配置文件

主链根据需要配置监听端口,也可直接使用默认端口

[rpc]
jrpcBindAddr=":8801"
grpcBindAddr=":8802"

搭建单节点主链

windows

执行启动命令

assetchain.exe -f assetchain.solo.toml

如果执行成功,执行命令查询主链网络信息


assetchain-cli.exe net peer

输出节点信息,例如:

{
    "peers": [
        {
            "addr": "192.168.0.157",
            "port": 13802,
            "name": "03a2314f11d5f78b93f13aba18618d61a652720003d8941415c6e8008761d58452",
            "mempoolSize": 0,
            "self": true,
            "header": {
                "version": 0,
                "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
                "txHash": "0xe34a933c5abf350db4db5122abbf43f6a54da2dbd67d214f67362c36bd70d23e",
                "stateHash": "0x88f0b06df8cd2cd6da81e1580e6f179128e42aa8c66e2dba9c38af3e18f9fa44",
                "height": 0,
                "blockTime": 1514533394,
                "txCount": 1,
                "hash": "0xfd39dbdbd2cdeb9f34bcec3612735671b35e2e2dbf9a4e6e3ed0c34804a757bb",
                "difficulty": 0
            }
        }
    ]
}

如果执行出错,请检查logs/assetchain.log文件中的错误信息

linux

打开终端,进入到软件包解压目录,执行启动命令

nohup ./assetchain -f assetchain.solo.toml >/dev/null 2>&1 &

查看进程

ps -ef | grep -v grep | grep assetchain

如果进程已经启动,执行命令查询主链网络信息

./assetchain-cli net peer

输出节点信息,例如:

{
    "peers": [
        {
            "addr": "192.168.0.157",
            "port": 13802,
            "name": "03a2314f11d5f78b93f13aba18618d61a652720003d8941415c6e8008761d58452",
            "mempoolSize": 0,
            "self": true,
            "header": {
                "version": 0,
                "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
                "txHash": "0xe34a933c5abf350db4db5122abbf43f6a54da2dbd67d214f67362c36bd70d23e",
                "stateHash": "0x88f0b06df8cd2cd6da81e1580e6f179128e42aa8c66e2dba9c38af3e18f9fa44",
                "height": 0,
                "blockTime": 1514533394,
                "txCount": 1,
                "hash": "0xfd39dbdbd2cdeb9f34bcec3612735671b35e2e2dbf9a4e6e3ed0c34804a757bb",
                "difficulty": 0
            }
        }
    ]
}

如果执行出错,请检查logs/assetchain.log文件中的错误信息