- 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
make
command. - For start node need config JSON file (default config.json in executing folder). File format look below.
- Run
node
executable (after build you can findnode
inbin
folder). Keys for the node will be created automatically. If you want to use already existing ones - put your key innode
executable folder with the namelkkey
or changekeys_dir
value 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:
{
"net": {
"listen_addr": "0.0.0.0:20203",
"public_port": 20203,
"peers_db": "likelib/peers"
},
"rpc": {
"grpc_address": "0.0.0.0:50051",
"http_address": "0.0.0.0:50052"
},
"miner": {
"threads": 4
},
"nodes": [
"127.0.0.1:20204",
"127.0.0.1:20205"
],
"keys_dir": ".",
"database": {
"path": "likelib/database",
"clean": false
}
}
Notes on parameters:
net.listen_addr
- specifies local address and port that the server will listen on;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;net.peers_db
- folder, in which peers database will be stored;rpc.grpc_address
- address on which RPC (GRPC) is listening on. Enabled when the field is present;rpc.http_address
- address on which RPC (HTTP) is listening on. Enabled when the field is present;miner.threads
- optional parameter, sets the number of threads that miner is using;nodes
- list of known nodes.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.database.path
- path to folder with database files (will be created if not exists).database.clean
- if true - cleans database; otherwise does nothing.
For using client read instructions:
Allowed commands: client call_contract [ --help ] create message to call smart contract --help Print help message --host arg address of host --to arg address of "to" contract --amount arg amount count --fee arg fee count --keys arg path to a directory with keys --message arg message for call smart contract --http is set enable http client call
client compile_contract [ --help ] compile smart contract --help Print help message --code arg path to a Solidity code
client connection_test [ --help ] test RPC connection --help Print help message --host arg address of host --http is set enable http client call
client decode_message [ --help ] decode smart contract message --help Print help message --code arg path to folder with compiled Solidity code --method arg call code --message arg data to decode
client encode_message [ --help ] encode smart contract message --help Print help message --code arg path to folder with compiled Solidity code --message arg call code
client generate_keys [ --help ] generate a pair of keys --help Print help message --keys arg directory in which a key pair will be generated
client get_account_info [ --help ] use for get account info from remote by account address --help Print help message --host arg address of host --address arg address of target account --http is set enable http client call
client get_balance [ --help ] use for get balance from remote by account address --help Print help message --host arg address of host --address arg address of target account --http is set enable http client call
client get_block [ --help ] get block information --help Print help message --host arg address of host --hash arg block hash hex --number arg block number --http is set enable http client call
client get_transaction [ --help ] get transaction information --help Print help message --host arg address of host --hash arg transaction hash hex --http is set enable http client call
client get_transaction_status [ --help ] get transaction result information --help Print help message --host arg address of host --hash arg transaction hash hex --http is set enable http client call
client keys_info [ --help ] show info on keys --help Print help message --keys arg directory with a key pair
client node_info [ --help ] get LK info --help Print help message --host arg address of host --http is set enable http client call
client push_contract [ --help ] deploy a smart contract --help Print help message --host arg address of host --amount arg amount of Lk to transfer --fee arg fee count --keys arg path to a directory with keys --message arg message for initialize smart contract --code arg compiled contract code folder --http is set enable http client call
client transfer [ --help ] use transfer balance from one address to another address --help Print help message --host arg address of host --to arg address of recipient account --amount arg amount count --keys arg path to a directory with keys --fee arg fee count --http is set enable http client call