运行私有链
您可能希望在单节点链上运行Conflux以开发和测试智能合约。 您也可以使用多台计算机将Conflux作为私有链来运行。
运行单节点开发链
为了运行一个单节点的Conflux链用于开发,您可以按照以下步骤进行:
- Get executable Conflux binary file (use precompiled binary or build from the latest source code). You can refer to the document Downloading.
- Create a directory and prepare a configuration file
devnode.toml
. You can copy thehydra.toml
provided in the directory and start from there following the guide Configuration Files. - Set the
bootnodes
parameter in the configuration file to empty (or comment the setting line). - Set the
mode
parameter to "dev". If you copy fromhydra.toml
, you should find the line being commented and you can uncomment it. - Set the
dev_block_interval_ms
parameter to the block generation interval you want. In the development mode, Conflux will automatically generate a block in a fixed interval. - Generate PoS related configurations according this guide
- Set history CIPs enable height to make sure the history CIPs are enabled. Check here for an example.
- Run Conflux binary with
devnode.toml
as the configuration file. 例如:
$ ./conflux --config devnode.toml
You can download all sample configuration file here