Capitalisk / ldpos-pg-dal

Knex Data Access Layer for LDPoS
MIT License
2 stars 0 forks source link

Project specification #1

Open jondubois opened 3 years ago

jondubois commented 3 years ago

Project description

A postgres adapter for the LDPoS chain module which allows it to persist transactions, blocks, accounts, votes and multisignature groups to Postgres.

Overview

LDPoS is a simple and lightweight DPoS blockchain which uses a hash-based signature scheme (Lamport OTS with Merkle Signature Scheme) which is believed to be resistant to potential quantum computing attacks. LDPoS has the following features:

This module implements the Lisk custom module specification (LIP5) and is designed to run inside LDEM (Lisk/Leasehold Decentralized Exchange Manager). LDEM a controller/process manager for running different blockchain modules on multiple processes in order to make use all available CPU cores.

Other features of LDEM

We expect to run LDPoS on Leasehold core nodes initially: https://github.com/Leasehold/leasehold-core - This will allow us to use the existing Leasehold network infrastructure. Installation is just a matter of doing npm install then adding an entry to a config file.

Deliverables

Background work

This repo contains a PostgresDAL class (https://github.com/Leasehold/ldpos-postgres-dal/blob/master/index.js) which declares most of the relevant methods (but not yet implemented):

There is also a mocha integration test script inside the test/ directory which can be used.

You can git clone the LDPoS Chain repo https://github.com/Leasehold/ldpos-chain then npm install the dependencies then npm run test to run the tests to get an idea for how the LDPoS chain module will work.

When running the tests, the LDPoS module uses a mock class as the Data Access Layer: https://github.com/Leasehold/ldpos-chain/blob/master/test/utils/dal.js - For errors, it throws an Error object with custom name and type properties. You can run the tests and log the arguments and return values of the mock class methods to understand what kinds of inputs and outputs the postgres adapter needs to support.

Additional requirements

sacOO7 commented 3 years ago

@jondubois I will need a schema for tables accounts, votes, blocks, transactions, delegates, multisig_memberships Currently, as a part of code, it's difficult to find data models and respective types for fields. It will be great if I can get model attributes along with their types.

sacOO7 commented 3 years ago

Also, if you can provide sample JSON data for each table, will be really helpful. I can use it for seeding in the database for running on the local and seeding purpose.

sacOO7 commented 3 years ago

Link to DB Spec Document = https://gist.github.com/jondubois/22581a5ab6b6bd64d8385fbc2a17d5db