Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aurora-is-near/caching-proxies-cache
https://github.com/aurora-is-near/caching-proxies-cache
Last synced: 10 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/aurora-is-near/caching-proxies-cache
- Owner: aurora-is-near
- Created: 2023-11-15T10:27:48.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2024-06-06T05:55:34.000Z (7 months ago)
- Last Synced: 2024-06-06T07:12:12.456Z (7 months ago)
- Language: Go
- Size: 4.95 MB
- Stars: 0
- Watchers: 8
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Support: support/cache/cache.go
Awesome Lists containing this project
README
# Caching Proxies Cache
## Overview
The Caching Proxies Cache is a Go-based solution aimed to give access to cached chunks submitted by [Caching Proxies Terminal](https://github.com/aurora-is-near/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.## Installation
### Prerequisites
- Go 1.20 or higher
- Access to a NATS server### Steps
1. Clone the repository:
```bash
git clone https://github.com/aurora-is-near/caching-proxies-cache
```
2. Navigate to the project directory:
```bash
cd caching-proxies-cache
```
3. Build the project using the Makefile:
```bash
make build
```## Configuration Options
The service can be configured using command-line flags:- **`-nats`** (string): Specifies the NATS context.
```bash
./caching-proxies-cache -nats=[context]
```- **`-server`** (string): Sets the NATS server address.
```bash
./caching-proxies-cache -server=[server_address]
```- **`-creds`** (string): Path to the NATS credentials file.
```bash
./caching-proxies-cache -creds=[path_to_credentials]
```- **`-shard-prefix`** (string): Prefix for shard subjects.
```bash
./caching-proxies-cache -shard-prefix=[prefix]
```- **`-shards-to-listen`** (string): List of shards to listen to, separated by commas.
```bash
./caching-proxies-cache -shards-to-listen=1,2,3
```- **`-cache-ttl`** (duration): Time-to-live for the cache.
```bash
./caching-proxies-cache -cache-ttl=1m
```## Usage
### Running the Service
- Start the service using the configured flags as needed:
```bash
./caching-proxies-cache -shards-to-listen=1,2,3 -shard-prefix=shards -nats=context -cache-ttl=1m
```### Interacting with the Service
- Retrieve a cached chunk:
```bash
curl -v -XGET localhost:1324/get?previous_hash_id=[id]&shard_id=[id]
```