arkecosystem / core Goto Github PK
View Code? Open in Web Editor NEWThe ARK Core Blockchain Framework. Check https://learn.ark.dev for more information.
Home Page: https://ark.io
License: MIT License
The ARK Core Blockchain Framework. Check https://learn.ark.dev for more information.
Home Page: https://ark.io
License: MIT License
Based on this link, sequelize does not support UNSIGNED values for PostgreSQL. Need to revert the changes that were made.
Part of #182
This requires to either get a PR accepted at https://github.com/fknop/hapi-pagination or fix the issue itself by including the package manually and modified.
We are currently using https://github.com/SBoudrias/Inquirer.js for the bip38 encryption but I found https://github.com/terkelg/prompts today which is more lightweight and offers much more for building interactive experiences.
A few things I could come up with that we could do with interative prompts are:
This would make the process of a node setup really easy.
Should also consider removing emojis as logging is meant to provide plain informations and nothing else.
Regular export block and transactions table.
Unfinished work is here: https://github.com/fix/ark-core/blob/master/packages/core/lib/snapshot.js
Cross-distribute snaps for faster download
Upon restore:
Part of #182
We currently have API endpoints both in v1 and v2 that have a major impact on performance because the database has to be hit for a count of millions of records and then retrieve 50-100 records based on an offset.
This performance hit in a normal environment would be easy to fix by sharding, getting more hardware or optimizing the implementation of the database layer by using postgres specific functions like https://wiki.postgresql.org/wiki/Count_estimate which is not an option as we use Sequelize.
https://github.com/fix/ark-core/blob/master/app/api/public/versions/1/index.js#L11
https://github.com/fix/ark-core/blob/master/app/api/public/versions/2/index.js#L15
https://github.com/fix/ark-core/blob/master/app/api/public/versions/2/index.js#L39
https://github.com/fix/ark-core/blob/master/app/api/public/versions/2/index.js#L40
The only real solution without major changes or spec changes for people that want to run a node I can think of is that we load all blocks and transactions into memory on application start and push new blocks into memory after they are stored in the database.
This way we avoid hitting the database for millions of records as we could simply use filter
, sortBy
or length
to count records instead of having to do heavy database queries after the application is booted.
Currently the requests on the block endpoints can take anywhere from 10 to 20 seconds (up to 3 minutes on stat endpoints) and this request time will only increase over time as we are not optimizing around postgres or something like cassandra which is designed for larger datasets.
The reality is people run their nodes on the cheapest possible option so we sadly have to work around that.
Currently we already have a bunch of singletons and include files over and over again in all kind of places which can be solved by implementing a container like https://github.com/jeffijoe/awilix.
We would register all classes and globally used variables (like configs) on application start in the container and they would be auto injected and accessible from everywhere.
Also we could get rid of the hacky singletons as the container can maintain the singleton state for us by only instantiating a class once if specified and retrieving the initial instance on consecutive calls.
The issue with the new plugin system is that the configuration file is a plain javascript object that gets exported and not a JSON object like previously which makes it hard (maybe impossible without a hacky solution) to read the configuration and write it back into the file as things like path.resolve
or anyFunction()
are resolved when you require a file that contains module.exports
.
There are basically 2 solutions to this:
~/.ark/config
with the commander and require configuration to be done manually but offer "test" functionality in the commander to make sure the configuration is valid and workingThis would eventually lead to a tonne of almost redundant data being stored in Redis, due to the broadcast of transactions to/from other peers.
Implement http://pm2.keymetrics.io/docs/usage/pm2-api/#programmatic-api to start the relay and forger with custom configuration through the commander.
Move ark-js into ark-core as a folder and publishing only the directory on npm.. -
https://github.com/lerna/lerna
Reason: manage the models and different versions
Starting with ark-core v2
In order to optimise in memory wallets, empty wallets can be removed from wallet manager and be considered as cold wallet.
Needed rules :
when restart:
We could use https://github.com/sindresorhus/ow for 2 things.
I. Config Validation
We should make sure on application start that all important configuration like the network configuration is valid.
II. Argument Validation
We should make sure that arguments passed onto methods have the right type, length and format to avoid any unexpected behaviour that could cause harm or create corrupted data.
We basically have 2 options currently, one would require a change to the database and use more storage but grant much greater searching abilities.
Keep the database how it is with a hex vendor field and require people to enter vendor fields in hex format for searches. Advantage is less storage, Disadvantage is no proper search for the most important part of a transaction to the end-user.
Store the vendor field in plain text in the database, allows partial matching, regex pattern, full text search. Advantages are the mentioned ones, Disadvantages are more storage.
Implement transaction broadcast, upon receiving and verifying the transaction - broadcast it to XX peers.
{
"statusCode": 500,
"error": "Internal Server Error",
"message": "An internal server error occurred"
}
need to remove the senderId:
{
"transactions": []
}
This was pulled directly from the Desktop Wallet, where I added my devnet v2 node to.
Part of #182
If we want people to allow to type things like ark-core start:mainnet
we need to add a global bin executable that can handle all those commands we currently have inside the package.json as scripts.
"bin": {
"ark-core": "bin/index.js"
},
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.