Extremely low-latency chain data to Stackers, with a dose of mild humour on the side

Related tags

Cryptography ronin
Overview

Ronin

Rust

Hello there!

Ronin is a ultra-speed Stacks API server. It's super lightweight, but scales easily.

Why are we making this?

Because we don't like slow APIs. Also because it's super hard to set up one using current codebases.

Live footage of us trying to deploy a Stacks API

Live footage of us trying to deploy a Stacks API before Ronin

What's the plan?

Simple stuff: Ronin will use the event dispatcher from a Stacks node to hydrate it with that sweet, sweet data.

Smug face

  • Built in Rust
  • Uses Redis as primary datastore (which will fill up all of that juicy RAM of yours)
  • Uses the Rocket web framework for speeeeed
  • Sometimes you won't be able to run it entirely in memory because some people don't have enough RAM to store an entire blockchain in it (what are you doing???).

Jokes aside, Ronin eats RAM up. By the very nature of its design, it stores the entire Stacks chain data (plus all the other parsed data that an API needs) in-memory. This means that the API can access the data way, way faster than using something like PostgreSQL.

Instead of taking 1-15ms to find a transaction from its TXID, then loading it from disk and passing it back to the API server, an in-memory store works a lot quicker. On my M1 Max MacBook, I get around 175746.92 GETs per second for a value size of 5KB (more than the parsed response for 95%+ of Stacks transactions), so a latency of 5.69 microseconds. For reference, if you're sitting a foot away from your laptop, the time it takes the sound waves to travel to your ears is around 880 microseconds. So, it's really fast.

The disadvantages to this are here too - everything has to be stored in RAM in the first place. RAM is limited and expensive, so most people won't be able to run Ronin optimally, entirely in memory (the API data is probably around 30-50GB). Though, many people have SSDs or even NVME drives, which are pretty fast too.

After your real memory fills up, Ronin runs exactly the same, but your operating system will start pushing data from the datastore into "virtual memory" which is actually on your disk in a swap file. When the API receives a request for a tx, it asks the datastore for it, who then asks the OS' memory for it, who then has to swap it from the (relatively) slow disk to RAM. It's less efficient, but it's still way faster than using PostgreSQL or something similiar.

This is one of the ways Ronin can run on anything from a Raspberry Pi to a very powerful cloud server in an efficient way. Obviously, the cloud server will be orders of magnitude faster than a Raspberry Pi, but at that point, the biggest latency will originate from the fiber cables to your home. If you want the fastest experience, run Ronin on a decently high performance server at home.

But please, at least run it on an SSD or NVME... HDDs aren't good for your health I beg you

It scales, it descales (is that even a word...) and yeah it's like really fast.

It uses one of those lovely cores on your computer to run the event handler (it handles events from the Stacks node... duh) and uses the rest for the primary API. This means it will run on a Raspberry Pi with an SD card OR you can run it on a 60 core and 128GB RAM monster.

Anyways I'm still working on this so it doesn't work fully yet or at all (lol...).

You might also like...
Basilisk node - cross-chain liquidity protocol built on Substrate

Basilisk node Local Development Follow these steps to prepare a local Substrate development environment 🛠️ Simple Setup Install all the required depe

The Solana Program Library (SPL) is a collection of on-chain programs targeting the Sealevel parallel runtime.

Solana Program Library The Solana Program Library (SPL) is a collection of on-chain programs targeting the Sealevel parallel runtime. These programs a

Examples of Solana on-chain programs

spl-examples List of Solana on-chain programs which demonstrate different aspects of Solana architecture. 01__state It's a counter program. Each user

Synchronized shadow state of Solana programs available for off-chain processing.

Solana Shadow The Solana Shadow crate adds shadows to solana on-chain accounts for off-chain processing. This create synchronises all accounts and the

🔗 Tool for rebasing a chain of local git branches.

git-chain Tool for rebasing a chain of local git branches. Motivation Suppose you have branches, each depending on a parent branch (usually called "st

Making composability with the Zeta DEX a breeze, FuZe provides CPI interfaces and sample implementations for on-chain program integration.
Making composability with the Zeta DEX a breeze, FuZe provides CPI interfaces and sample implementations for on-chain program integration.

Zeta FuZe 🧬 Zeta FuZe FuZe is Zeta's cross-program integration ecosystem. This repository contains the Zeta Cross Program Invocation (CPI) interface

A collection of Solana-maintained on-chain programs

Solana Program Library The Solana Program Library (SPL) is a collection of on-chain programs targeting the Sealevel parallel runtime. These programs a

The protocol are designed and made for the future of cross-IP, cross-chain metaverse.

Avatar-protocol 化身协议 This project demonstrates how to use the Solana Javascript API to interact with programs on the Solana blockchain. The project co

Cross-chain bridge message delivery network. We are hiring, [email protected]

Introduction Implementation of a https://darwinia.network node in Rust based on the Substrate framework. This repository contains runtimes for the Dar

Owner
Syvita Guild
A force for global good of unprecedented proportions, unified through Bitcoin and following the implicit values behind it.
Syvita Guild
A network bandwidth and latency tester.

Crusader Network Tester Setup Run cargo build --release to build the executables which are placed in target/release. Command line usage To host a serv

null 29 Dec 25, 2022
An extremely high performance matching engine written in Rust.

Galois Introduction Galois is an extremely high performance matching engine written in Rust, typically used for the crypto currency exchange service.

UINB Tech 66 Jan 7, 2023
A guide for Mozilla's developers and data scientists to analyze and interpret the data gathered by our data collection systems.

Mozilla Data Documentation This documentation was written to help Mozillians analyze and interpret data collected by our products, such as Firefox and

Mozilla 75 Dec 1, 2022
Koofr Vault is an open-source, client-side encrypted folder for your Koofr cloud storage offering an extra layer of security for your most sensitive files.

Koofr Vault https://vault.koofr.net Koofr Vault is an open-source, client-side encrypted folder for your Koofr cloud storage offering an extra layer o

Koofr 12 Dec 30, 2022
Draw routes in MapLibre snapped to a street network using client-side routing

MapLibre route snapper This plugin lets you draw routes in MapLibre GL that snap to some network (streets, usually). Unlike similar plugins that send

Dustin Carlino 32 Jan 17, 2023
🦀 Hop server side SDK for Rust

hop-rs (wip) Hop's Rust library. Requires Rust 1.61+ Installation [dependencies] hop = "0.0.0" Usage Create a project token or personal access token.

Tom 17 Jan 31, 2023
High-level networking library that extends the bevy_replicon library to allow snapshot interpolation and client-side prediction

bevy_replicon_snap A Snapshot Interpolation plugin for the networking solution bevy_replicon in the Bevy game engine. This library is a very rough pro

Ben 3 Oct 15, 2023
Cross-chain hub for Crypto Asset on Polkadot

ChainX ChainX is a community-driven project built on the next-generation blockchain framework substrate, the largest Layer-2 network of Bitcoin using

ChainX 261 Dec 28, 2022
Official implementation of the YeeCo Root Chain (Layer 1)

yeeroot Official implementation of the YeeCo Root Chain (Layer 1) YeeCo is a permissionless, secure, high performance and scalable public blockchain p

YeeCo 29 Sep 20, 2022
EVM compatible chain with NPoS/PoC consensus

Reef Chain Reef chain is written in Rust. A basic familiarity with Rust tooling is required. To learn more about Reef chain, please refer to Documenta

Reef Finance 148 Dec 31, 2022