Open jondubois opened 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.
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.
Link to DB Spec Document = https://gist.github.com/jondubois/22581a5ab6b6bd64d8385fbc2a17d5db
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
accounts
,votes
,blocks
,transactions
,delegates
,multisig_memberships
(feel free to use alternative naming convention).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 thennpm install
the dependencies thennpm 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 customname
andtype
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
then
blocks).DAL
class methods here (use the samename
andtype
properties): https://github.com/Leasehold/ldpos-chain/blob/master/test/utils/dal.jspg-promise
would be ideal. No need for fancy database ORM entities.timetamp
(for blocks and transactions),height
(for blocks),id
,balance
(for accounts), ...