Implementation of logpass blockchain node
Every command listed below should be run from repository root.
Generate private key with openssl
command:
openssl genpkey -algorithm ed25519 -outform PEM -out key.pem
Prepare custom config.ini
file for local development:
cp config.ini.example config.ini
Now, adjust all values in config.ini
(especially threads
) according to your
preferences.
To build logpass node
with Visual Studio, you need to:
-
Get and install Microsoft Visual Studio 2019 with C++ development option
-
Get, install and integrate vcpkg
-
Copy directories from project
vcpkg
directory to yourvcpkg/ports
-
Install vcpkg dependencies:
On Linux:
vcpkg install \ boost-algorithm \ boost-asio \ boost-bimap \ boost-endian \ boost-exception \ boost-filesystem \ boost-log \ boost-program-options \ boost-stacktrace \ boost-system \ boost-test \ cppcodec \ iroha-ed25519 \ nlohmann-json \ openssl \ rocksdb \ usockets \ uwebsockets
On Windows:
vcpkg install ^ boost-algorithm ^ boost-asio ^ boost-bimap ^ boost-endian ^ boost-exception ^ boost-filesystem ^ boost-log ^ boost-program-options ^ boost-stacktrace ^ boost-system ^ boost-test ^ cppcodec ^ iroha-ed25519 ^ nlohmann-json ^ openssl ^ rocksdb ^ usockets ^ uwebsockets
-
Open
node.sln
, select configuration and press build
BuildKit
is required to build node
image . To enable BuildKit
builds for docker
and docker-compose
let's
export (or even better add it to your .bashrc
) following environment
variables:
DOCKER_BUILDKIT=1
COMPOSE_DOCKER_CLI_BUILD=1
When BuildKit
is setup, let's move to create a custom
docker-compose.override.yml
file:
cp \
.devops/docker/docker-compose.override.yml.example \
docker-compose.override.yml
To build Dockerfile
that won't mess up with your local file permissions you
need to find your current user id - UID
, by running following command:
echo $UID
Replace all repetitions of !!UID!!
in docker-compose.override.yml
with
above found value.
Finally setup global docker's network:
curl \
https://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@raw.githubusercontent.com/LogPass/logpass_docker_network/main/scripts/setup_global_network.sh \
| bash
This network is used to connect all LogPass services together when developing locally.
To build all services simply run:
docker-compose build
To run all services in the background:
docker-compose up --detach
To run node
tests:
docker-compose run --rm node ./build/Debug/node_tests