https://drive.google.com/file/d/19oWRpK_AJUo3G3hHYYGN_ZryAT-CSjyd/view?usp=sharing
-
Make sure you have the dev containers extension for vscode.
-
Clone this repo and open it with vscode.
-
From the command palette run Rebuild and Reopen in Container.
-
Once the container builds, open a shell and run
./liberdus-setup.shto clone and configure repos for a local Liberdus test network and web-client-v2. -
Run
./vnc-start.shin the workspace root directory to start a VNC server for remote desktop connection to the container. -
Use a VNC client to connect on localhost to the port mentioned by the vnc server using the provided password.
-
Run
./liberdus-start.shin the workspace root directory to start a local Liberdus test network, the liberdus-proxy, and a http-server to host web-client-v2. -
Navigate to the
playwright-testsdirectory and runnpm installto install dependencies. -
Run
npx playwright open localhost:3000in theplaywright-testsdirectory to see the Liberdus network's progress on the Monitor Client in the VNC Client. -
Run
npx playwright codegen localhost:8080in theplaywright-testsdirectory to create tests for the web-client-v2 in a graphical fashion with the VNC client. -
Run
./liberdus-stop.shin the workspace root directory to stop the local Liberdus test net, proxy, and web-client http-server in the container. -
Run
./vnc-stop.shin the workspace root directory to stop the VNC server in the container.
-
Setup an environment with the following software:
-
Ubuntu 22.04 Jammy
-
C/C++ build-essentials (gcc, make, ld)
-
libssl-dev
-
pkg-config 1.8.0
-
Node.js 18.16.1
-
Rust 1.74
-
Python 3.x
-
-
Clone the following repos:
-
https://github.com/Liberdus/server.git
- Navigate to the repo's root directory and run
npm install.
- Navigate to the repo's root directory and run
-
https://github.com/shardus/tools-cli-shardus-network.git
-
Navigate to the repo's root directory and run
npm install. -
Run
npm linkin the root directory of this repo after installing dependencies to put theshardus-networkcommand into the path.
-
-
https://github.com/Liberdus/web-client-v2.git
- No dependencies to install.
-
https://github.com/Liberdus/liberdus-proxy.git
- Dependencies are installed upon starting it later.
-
-
Start a local network of Liberdus nodes.
-
Navigate to the
Liberdus/serverrepo and runshardus-network start 10to start a local network of 10 nodes.-
The minimum number of nodes needed to process transactions is defined by the
minNodesproperty inserver/src/config/index.ts:... minNodes: process.env.minNodes ? parseInt(process.env.minNodes) : 10, ...
-
-
-
Configure and start the Liberdus proxy.
-
Navigate to the
Liberdus/liberdus-proxyrepo and change the following files:-
Set the
ip,port, andpublicKeyto the correct values for the local network's Archiver inliberdus-proxy/src/archiver_seed.json:[{"publicKey":"758b1c119412298802cd28dbfa394cdfeecc4074492d60844cc192d632d84de3","port":4000,"ip":"127.0.0.1"}] -
Disable
standalone_networkmode inliberdus-proxy/src/config.json:... "standalone_network": { "enabled": false, "replacement_ip": "63.141.233.178" } ...
-
-
Start the proxy with
cargo runand note the port it binds to.
-
-
Configure and serve the Liberdus web client with a local http-server.
-
Navigate to the
Liberdus/web-client-v2repo and configure it to use the port bound by the local Liberdus proxy by editingweb-client-v2/network.js:... "gateways": [ { "protocol": "http", "host": "localhost", "port": 3030 }, ] ...
-
Run
npx http-serverto serve the web client with a local http server.
-
-
Run automated tests against the web client.
-
Install Playwright browser binaries and their dependencies with:
npx playwright install --with-deps
-
Run Playwright tests in UI mode with:
npx playwright test --ui-port=8080 --ui-host=0.0.0.0 -
Use
codegento generate tests with:npx playwright codegen --ui-port=8080 --ui-host=0.0.0.0 [URL]
-
Emulate different viewport sizes with:
npx playwright codegen --viewport-size="800,600" playwright.dev -
Emulate devices with:
npx playwright codegen --device="iPhone 13" playwright.dev
-
-