Skip to content

HeshuEU/likelib-hackathon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1,687 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LikeLib 2.0

Build and run node

  1. Run: sudo doc/prepare_build.sh. It will install cmake, g++, conan and its dependencies wait SUCCESS.
  2. To generate CMake files use cmake -DCMAKE_BUILD_TYPE=Release -S <path to project root folder> -B <path to exists build folder> command.
  3. To build project go to build folder and use make command.
  4. For start node need config JSON file (default config.json in executing folder). File format look below.
  5. Run node executable (after build you can find node in bin folder). Keys for the node will be created automatically. If you want to use already existing ones - put your key in node executable folder with the name lkkey or change keys_dir value in config file.

config.json

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.

About

likelib for hackaton 2021

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published