Git Product home page Git Product logo

digibyte-rosetta-server's Introduction

Rosetta

DigiByte Rosetta Server (beta)

Node Version: 1.0.0
Rosetta Version: 1.4.1

DigiByte Rosetta Node offering a unified API according to the standard proposed by Coinbase.

This implementation is a Proof-of-Concept implementation for the NodeJS Rosetta SDK developed by DigiByte

Prerequisites

  1. Install docker and git for your system

Docker Build Steps

  1. Clone the container using git
git clone https://github.com/SmartArray/digibyte-rosetta-server.git
  1. Build the docker image
# Build the docker image for testnet (may take a while).
# Other build args are documented in ./Dockerfile
cd digibyte-rosetta-server
docker build -t digibyte/rosetta:latest --build-arg use_testnet=1 .
  1. Start the docker container
# This command will start the docker container.
# In this example, docker will forward two ports: 8080, and 12026.
# Port 8080/tcp is the port of the rosetta api server.
# Port 12026/tcp is the p2p testnet port.
# If you are using mainnet, make sure you replace the port 12026 with 12024.
docker run -p 12026:12026 -p 8080:8080 digibyte/rosetta:latest

Test

Run npm run test in order to run js unit tests. Run npm run test-api in order to test the data api and construction api in an online/offline environment built with docker-compose.

Several example requests to test the reachability of your node using curl are shown in this document: Example Requests. An example on how to validate a mainnet account balance is shown here: Validation

Current State

Currently, only the Rosetta Data API is implemented by this node. The Construction API will be completed soon.

Implementation Details

This node implementation is using the experimental Rosetta Node SDK.

A UTXO-Indexing Middleware was implemented to enable balance lookups. Historical balance lookups are supported as well. By using the Syncer class of the Rosetta SDK, the sync has become exceptionally reliable and even reorgs are supported very well. LevelDB (the same database that is being used in Bitcoin and its forks) is used to store the UTXO data. A space efficient encoding was chosen in order to avoid redundancy and to save some disk space (usage: 6.7G, as of 08th September, 2020), as described here.

  • Fast, reliable sync
  • Space efficient, non-redundant implementation
  • Tested with addresses that have more than 399k transactions (historical balance calculation may take several seconds for these accounts)
  • Balances are subtracted and UTXOs removed on reorgs (which happen several times a day)

Note, that the addition of an UTXO database is heavily discussed in the official Bitcoin Mailgroup. As soon as this feature is added, many altcoins will probably apply the changes too, and the above UTXO middleware will most likely become obsolete.

ToDos

  • Implement Construction API for Offline and Online Environments
  • Test the node using coinbase's rosetta-cli (Results)
  • Run the mainnet node and wait for full sync
  • Test some utxo balance checks (Results)
  • Setup Continuous Integration

digibyte-rosetta-server's People

Contributors

smartarray avatar elli-kolisnichenko avatar gto90 avatar ycagel avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.