- Run:
sudo doc/prepare_build.sh. It will install cmake, g++, conan and its dependencies wait SUCCESS. - To generate CMake files use
cmake -DCMAKE_BUILD_TYPE=Release -S <path to project root folder> -B <path to exists build folder>command. - To build project go to build folder and use
makecommand. - For start node need config JSON file (default config.json in executing folder). File format look below.
- Run
nodeexecutable (after build you can findnodeinbinfolder). Keys for the node will be created automatically. If you want to use already existing ones - put your key innodeexecutable folder with the namelkkeyor changekeys_dirvalue in config file.
To run the node, a configuration file must be specified for it. By default it is config.json file of the following format:
{
"core": {
"net": {
"listen_addr": "0.0.0.0:20203",
"public_port": 20203,
"peers_db": "likelib/peers",
"nodes": [
"127.0.0.1:20204",
"127.0.0.1:20205"
]
},
"database": {
"path": "likelib/database",
"clean": false
},
"keys_dir": "."
},
"miner": {
"threads": 4
},
"websocket": {
"listen_addr": "0.0.0.0:50051"
}
}
Notes on parameters:
core.net.listen_addr- specifies local address and port that the server will listen on;core.net.public_port- when node is connected to a remote machine over Internet, its public IP gets known, but port - doesn't. We only know the client-socket IP address. Such things as port-forwarding with NAT, may change the port we need to connect to;core.net.peers_db- folder, in which peers database will be stored;core.nodes- list of known nodes.core.database.path- path to folder with database files (will be created if not exists).core.database.clean- if true - cleans database; otherwise does nothing.miner.threads- optional parameter, sets the number of threads that miner is using;websocket.listen_addr- address on which WebSocket is listening on.keys_dir- key(public and private that was generated by client) folder path. if file not exists generate new key pair and save by this path.