VitePortal is a scaling solution to help process the increasing amount of Remote Procedure Calls (RPCs). This is achieved by introducing a load balancer responsible for spawning relayers as needed. A relayer is a standalone application which forwards every RPC request to multiple full nodes and handles the responses. By determining the majority result (consensus) it is possible to reward honest or punish malicious full nodes and thus incentivize them to partake in the process.
From a user perspective the basic flow is:
- Send request to
portal.vite.net
(e.g. AWS Elastic Load Balancer) - AWS ELB forwards the request to one of the available relayers
- Relayer forwards the request to multiple, randomly selected full nodes
- Relayer returns the fastest response to the user via AWS ELB
- Relayer collects all responses and pushes a summary to e.g. Apache Kafka for further processing by the orchestrator and worker
From a full node perspective the basic flow is:
- Full node establishes a WebSocket connection with the orchestrator based on the
DashboardTargetURL
configured innode_config.json
- Orchestrator gets the HTTP + WS ports and verifies if the full node is "legitimate"
- Orchestrator broadcasts the new full node (public ip address + ports) to all relayers
- Relayer can use the new full node to serve requests of users
This monorepo is organized as follows:
- relayer - the relayer forwards every RPC request to multiple full nodes and handles the responses
- orchestrator - the orchestrator keeps track of the global state such as participating full nodes
- test - contains all integration tests and the logic to start a cluster of nodes locally
Depending on the operation system it might be needed to install gettext
for envsubst first.
apt-get update && apt-get install gettext
docker-compose build
docker-compose up -d
docker-compose down
docker exec -it vite-portal_r1_1 /bin/bash
- docker-compose build
- docker-compose up -d
- Insert node(s) with the curl command
- Test relay request with the curl command
- Setup test AWS Load Balancer which serves requests from e.g. https://portal-buidl.vite.net
- Point AWS Load Balancer to the relay request endpoint
Step 3 is optional. All nodes connect to the orchestrator automatically and the orchestrator broadcasts newly added or updated nodes to all relayers.