-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
102 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# RPC Subnet | ||
|
||
It is the RPC provider subnet of JungoAI and functions as a decentralized, free and | ||
open-source solution. It could serve as a replacement for centralized solutions such as | ||
Infura, Alchemy, and others. | ||
|
||
Key features: | ||
- **Permissionless**: Anyone can run an RPC node and receive rewards in JUNGO. | ||
- **Trustless**: Requests propagate to all nodes, and the result follows the majority. | ||
Thus, the results from minority nodes are considered invalid in the presence of malicious nodes. | ||
- **Efficient**: Nodes are ranked based on performance, latency, and trust, ensuring that | ||
clients receive responses from the node with the lowest latency and highest trust. | ||
|
||
Note: Currently just Ethereum RPC supported. | ||
|
||
## How it works? | ||
|
||
Worker nodes are RPC providers that anyone can run. On the other hand, | ||
monitor nodes measure the performance of worker nodes. Workers with | ||
higher uptime and accuracy gain more trust. On the client side, they can | ||
see the ranking of workers based on performance and trust. Additionally, | ||
the client receives responses from the geographically closest node with | ||
the lowest latency. | ||
|
||
In the end, the client can choose to receive results in two ways: | ||
- **Optimistic**: The client receives the result and processes it immediately. After a short delay, it receives validation. | ||
This method is more efficient and can be used on nodes with high trust. | ||
- **Pessimistic**: The client receives a validated result, ensuring it follows the majority of nodes. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
# Run RPC Worker/Monitor | ||
|
||
<div class="warning"> | ||
Pre requirements | ||
|
||
Before continuing make sure you have met [Registering UID](register-uid.md). | ||
</div> | ||
|
||
Clone rpc-subnet: | ||
```bash | ||
git clone https://github.com/jungoai/rpc-subnet.git | ||
``` | ||
```bash | ||
cd rpc-subnet | ||
``` | ||
|
||
## Configuration | ||
|
||
Create `.env` file | ||
```bash | ||
cp .env.example .env | ||
``` | ||
|
||
Customize the parameters in the .env file. Some of these parameters are for Workers, | ||
others are for Monitors, and some are needed for both. | ||
|
||
Create `.providers.json` | ||
```bash | ||
cp ./.providers.json ~/.providers.json | ||
``` | ||
|
||
Open `.providers.json` in your favorite editor and add your RPC endpoints under `providers` field. | ||
```bash | ||
code ~/.providers.json | ||
``` | ||
|
||
E.g: | ||
```json | ||
{ | ||
"providers": [ | ||
"https://eth-mainnet.public.blastapi.io", | ||
"https://eth.llamarpc.com", | ||
] | ||
} | ||
``` | ||
|
||
## Run with Docker | ||
|
||
Run Worker: | ||
```bash | ||
. ./scripts/run_rpc_worker_docker.sh | ||
``` | ||
|
||
Run Monitor: | ||
```bash | ||
. ./scripts/run_rpc_monitor_docker.sh | ||
``` | ||
|
||
**Note**: | ||
If you are connecting to a local jungochain node with `fast-blocks` enabled, you should pass | ||
`--fast_blocks` into `./scripts/run_rpc_monitor_docker.sh` | ||
|
||
Also you can customize scripts. | ||
|
||
## Development | ||
|
||
See [here](https://github.com/jungoai/rpc-subnet?tab=readme-ov-file#rpc-subnet). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters