The Caching Proxies Cache is a Go-based solution aimed to give access to cached chunks submitted by Caching Proxies Terminal. This service is a key component of the RPC Speedup project and is designed to handle HTTP requests from RPC nodes efficiently. It does not require authentication, simplifying the interaction with RPC nodes.
- Go 1.20 or higher
- Access to a NATS server
- Clone the repository:
git clone https://github.com/aurora-is-near/caching-proxies-cache
- Navigate to the project directory:
cd caching-proxies-cache
- Build the project using the Makefile:
make build
The service can be configured using command-line flags:
-
-nats
(string): Specifies the NATS context../caching-proxies-cache -nats=[context]
-
-server
(string): Sets the NATS server address../caching-proxies-cache -server=[server_address]
-
-creds
(string): Path to the NATS credentials file../caching-proxies-cache -creds=[path_to_credentials]
-
-shard-prefix
(string): Prefix for shard subjects../caching-proxies-cache -shard-prefix=[prefix]
-
-shards-to-listen
(string): List of shards to listen to, separated by commas../caching-proxies-cache -shards-to-listen=1,2,3
-
-cache-ttl
(duration): Time-to-live for the cache../caching-proxies-cache -cache-ttl=1m
- Start the service using the configured flags as needed:
./caching-proxies-cache -shards-to-listen=1,2,3 -shard-prefix=shards -nats=context -cache-ttl=1m
- Retrieve a cached chunk:
curl -v -XGET localhost:1324/get?previous_hash_id=[id]&shard_id=[id]