Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: initial daemon implementation (#1)
* feat: initial commit * feat: using generator to download blocks to be able to cancel it when state changes * chore: updated package.json, lock and tsconfig * chore: removed .env from git * feat: resetting blocks on syncing state entry and moving to idle when receiving NEW_BLOCK event' * feat: checking if our best block is still valid (not voided) before continuing) * refactor: handling errors better by yielding instead of throwing * refactor: using bi-directional callbacks on state machine instead of an activity * feat: using hathorLib Connection class to maintain a connection to the fullnode * feat: starting the state machine only on START event * feat: added type to generator and yields * feat: added tests for utils methods * refactor: moved state machine methods to a dedicated file * fix: typo when parsing outputs * feat: added tests for the state machine * chore: added baseUrl to prevent warnings * feat: transition to reorg when a reorg is detected * docs: added README * feat: getting NETWORK from env var * fix: handling lambda call failures * chore: removed size.yml github action (came from tsdx template) * docs: added comment explaining the block sync strategy on ws events * docs: added comment explaining state updates from ws conn * chore: removed unused and commented import on machine and commented unused sync event type * docs: added comment on the machine refering to the README * refactor: getting constant from hathor-lib and removed useless commented block code * feat: typed prepareTx * fix: returning success false if a failure has ocurred inside the tx loop * fix: added missing attributes to PreparedTx type * docs: added docstring to util methods * feat: using a LRU cache for transactions * refactor: removed misleading log * feat: loading wallet_service_local_url from env variables * docs: added a TODO to replace the getFullNodeBestBlock API * fix: added missing type to sendTx parameter * fix: added missing types and fixed lint on LRU cache * Added dockerfile to the project (#4) * chore: added dockerfile * chore: removed global tsdx from dockerfile * docs: added a simple explaination on how to run locally, build and run a production service * chore: updated state machine diagram URL to render automatically * docs: added missing hathor header * feat: added winston as a logger and refactored console.logs to use it * refactor: moved api methods to src/api * fix: winston import breaking production build * refactor: using wallet util method to get token index * refactor: changed reorg message * refactor: improved blocks download message * refactor: using a better algorithm to filter unique txs * docs: added comment explaining Map queue order * fix: typo * feat: typed yield result from generator * feat: added type and docstring to onReceive from syncHandler * refactor: using strict, refactor types to pass tslint * fix: token creation tx was not sending token_name and token_symbol * fix: breaking type on fullnode response * feat: logging full data instead of data.Response on lambda response * tests: removed isVoided from tx * tests: fix typo on tests, clearing all mocks before every test instead of 'beforeAll' * tests: fix test by using the hathorLib to define whether a tx is a block or not * feat: typed raw tx response from fullnode * refactor: typed rawTx and refactored types * chore: set build output to cjs as the project is node-only * chore: removed dom from lib * feat: added spent_by and token to RawOutput and RawInput to handle block_at_height response format * chore: ignoring some ts errors that can be handled by typing for now. * chore: using strict: true * feat: ignoring genesis transactions before sending them to the wallet-service (#5)
- Loading branch information