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 “rpch_dp”
createdb -U postgres -h 127.0.0.1 rpch_dp
cd apps/discovery-platform/; DEBUG=rpch:* ADMIN_SECRET=topsecret SESSION_SECRET=toppersecret PORT=3020 URL="http://127.0.0.1:3020" GOOGLE_CLIENT_ID="foo" GOOGLE_CLIENT_SECRET="bar" DATABASE_URL=postgres://postgres:[email protected]:5432/rpch_dp yarn start
-
Download the sql file that contains metadata of entry and exits nodes to
NODES_SQL_FILEPATH
and 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 rpch_dp < $NODES_SQL_FILEPATH
This command should return
COPY 25
-
Check that the
registered_nodes
table has been populated as expected. . Connect to the database, then run commands in postgrespsql -U postgres -h 127.0.0.1 -d rpch_dp
-
List all the tables. 20+ rows should be returned.
\d
-
Check 25 entries are in the
registered_nodes
tableselect * 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 DATABASE_URL=postgres://postgres:[email protected]:5432/rpch_dp yarn start
In 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:[email protected]:5432/rpch_dp yarn start | tee ~/Downloads/rpch-test/test.log