See architecture overview https://docs.rpch.net/docs/tutorial-basics/Architecture-overview
The following step orchestrates all the components (except for entry & exit nodes) locally and use the remote entry and exit nodes.
Ensure that node v18 is used
nvm use 18-
Install Postgres
docker run --name postgres -e POSTGRES_HOST_AUTH_METHOD=trust -p 5432:5432 -d postgres
-
Verify Connect to the postgres server and create a database of name "gnosisvpnjs"
createdb -U postgres -h 127.0.0.1 gnosisvpnjs
cd apps/discovery-platform/; DEBUG=rpch:discovery-platform:* ADMIN_SECRET=topsecret PORT=3020 URL="http://127.0.0.1:3020" PGHOST=localhost PGPORT=5432 PGDATABASE=gnosisvpnjs PGUSER=postgres PGPASSWORD=postgres yarn start-
Download the sql file that contains metadata of entry and exits nodes to
NODES_SQL_FILEPATHand run in a new terminal tabexport NODES_SQL_FILEPATH=~/Downloads/rpch-test/nodes.sql
-
Populate the database with the downloaded file.
psql -U postgres -h 127.0.0.1 -d gnosisvpnjs < $NODES_SQL_FILEPATH
This command should return
COPY 25 -
Check that the
registered_nodestable has been populated as expected. . Connect to the database, then run commands in postgrespsql -U postgres -h 127.0.0.1 -d gnosisvpnjs
-
List all the tables. 20+ rows should be returned.
\d
-
Check 25 entries are in the
registered_nodestableselect * from registered_nodes ;
-
Check 0 pairing between entry and exit nodes
select * from zero_hop_pairings ;
-
-
In the same session, populate user in the db
select * from users ; insert into users (id, name) values (gen_random_uuid(), 'loadtest'); insert into clients (id, user_id, external_token) values (gen_random_uuid(), (select id from users), 'loadtesting-secret'); select * from clients ;
-
Now there should be 150 pairing between entry and exit nodes
select * from zero_hop_pairings ;
In a new terminal tab, run
cd apps/availability-monitor/; DEBUG=rpch:availability-monitor:* PORT=9080 PGHOST=localhost PGPORT=5432 PGDATABASE=gnosisvpnjs PGUSER=postgres PGPASSWORD=postgres yarn startIn a new terminal tab, run
cd apps/rpc-server/; DEBUG=* FORCE_ZERO_HOP=true PORT=45740 DISCOVERY_PLATFORM_API_ENDPOINT="http://127.0.0.1:3020" CLIENT=loadtesting-secret DATABASE_URL=postgres://postgres:postgres@127.0.0.1:5432/rpch_dp yarn start | tee ~/Downloads/rpch-test/test.log