Skip to content

jsnewby/rust_middleware

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

68 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

æternity middleware

Overview

This is a first implementation of a caching layer for Epoch. It reads the chain and records key- and micro-blocks, and transactions in a PostgreSQL database.

How to use

  • Install a postgresql DB somewhere. Works with versions >= 9.5, at least.
  • as the admin user, execute scripts/prepare-db.sql which will create the DB and user
  • if you want to use a different DB name, edit scripts/prepare-db.sql and .env

How to build

You need a nightly rust build

rustup default nightly

then

cargo build

and to install the database

cargo install diesel_cli
diesel database reset

How to run

cargo run -- + flags below

FLAGS:
        --help        Prints help information
    -p, --populate    Populate DB
    -s, --server      Start server
    -V, --version     Prints version information

OPTIONS:
    -h, --start <START_HASH>    Hash to start from.
    -u, --url <URL>             URL of æternity node.

Supported queries

GET /transactions/account/<account> all transactioms for account GET /transactions/interval/<from>/<to> transactions from block to block inclusive GET /key-blocks/height//gas-price` get the average gas price for a certain block (currently super inaccurate)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published