Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: initial daemon implementation #1

Merged
merged 66 commits into from
May 24, 2021
Merged
Changes from 1 commit
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
07b1b3e
feat: initial commit
andreabadesso Apr 1, 2021
f47eff9
feat: using generator to download blocks to be able to cancel it when…
andreabadesso Apr 2, 2021
e0d6fa4
chore: updated package.json, lock and tsconfig
andreabadesso Apr 2, 2021
7a7b6ab
chore: removed .env from git
andreabadesso Apr 2, 2021
f112121
feat: resetting blocks on syncing state entry and moving to idle when…
andreabadesso Apr 2, 2021
a1059d5
feat: checking if our best block is still valid (not voided) before c…
andreabadesso Apr 6, 2021
514e50f
refactor: handling errors better by yielding instead of throwing
andreabadesso Apr 6, 2021
501dcc3
refactor: using bi-directional callbacks on state machine instead of …
andreabadesso Apr 6, 2021
2d5831c
feat: using hathorLib Connection class to maintain a connection to th…
andreabadesso Apr 6, 2021
7a431d9
feat: starting the state machine only on START event
andreabadesso Apr 6, 2021
2473f7a
feat: added type to generator and yields
andreabadesso Apr 6, 2021
15b359f
feat: added tests for utils methods
andreabadesso Apr 8, 2021
95018d8
refactor: moved state machine methods to a dedicated file
andreabadesso Apr 8, 2021
8d8b42a
fix: typo when parsing outputs
andreabadesso Apr 8, 2021
92a5d50
feat: added tests for the state machine
andreabadesso Apr 8, 2021
a7e9039
chore: added baseUrl to prevent warnings
andreabadesso Apr 8, 2021
ace3568
feat: transition to reorg when a reorg is detected
andreabadesso Apr 8, 2021
c28cbcb
docs: added README
andreabadesso Apr 8, 2021
4c152de
feat: getting NETWORK from env var
andreabadesso Apr 8, 2021
942a174
fix: handling lambda call failures
andreabadesso Apr 12, 2021
1d2b1f5
chore: removed size.yml github action (came from tsdx template)
andreabadesso Apr 12, 2021
211417e
docs: added comment explaining the block sync strategy on ws events
andreabadesso Apr 13, 2021
e8daa1c
docs: added comment explaining state updates from ws conn
andreabadesso Apr 13, 2021
3d3cbed
chore: removed unused and commented import on machine and commented u…
andreabadesso Apr 13, 2021
749d968
docs: added comment on the machine refering to the README
andreabadesso Apr 13, 2021
5184025
refactor: getting constant from hathor-lib and removed useless commen…
andreabadesso Apr 13, 2021
cc6b152
feat: typed prepareTx
andreabadesso Apr 14, 2021
cf3a623
fix: returning success false if a failure has ocurred inside the tx loop
andreabadesso Apr 14, 2021
0b10072
fix: added missing attributes to PreparedTx type
andreabadesso Apr 14, 2021
f054877
docs: added docstring to util methods
andreabadesso Apr 14, 2021
a168187
feat: using a LRU cache for transactions
andreabadesso Apr 14, 2021
5d393bc
refactor: removed misleading log
andreabadesso Apr 14, 2021
9354570
feat: loading wallet_service_local_url from env variables
andreabadesso Apr 20, 2021
fd11312
docs: added a TODO to replace the getFullNodeBestBlock API
andreabadesso Apr 20, 2021
8bc8790
fix: added missing type to sendTx parameter
andreabadesso Apr 20, 2021
4e30d3f
fix: added missing types and fixed lint on LRU cache
andreabadesso Apr 20, 2021
742f777
Added dockerfile to the project (#4)
andreabadesso May 4, 2021
bff6a3f
docs: added a simple explaination on how to run locally, build and ru…
andreabadesso May 4, 2021
cb1a5b3
chore: updated state machine diagram URL to render automatically
andreabadesso May 4, 2021
6b27d88
docs: added missing hathor header
andreabadesso May 4, 2021
d130090
feat: added winston as a logger and refactored console.logs to use it
andreabadesso May 4, 2021
c5e1e4b
refactor: moved api methods to src/api
andreabadesso May 4, 2021
36578e0
fix: winston import breaking production build
andreabadesso May 5, 2021
c0ce52c
refactor: using wallet util method to get token index
andreabadesso May 5, 2021
e3ae097
refactor: changed reorg message
andreabadesso May 5, 2021
e210f76
refactor: improved blocks download message
andreabadesso May 5, 2021
f654dbe
refactor: using a better algorithm to filter unique txs
andreabadesso May 5, 2021
1b3435e
docs: added comment explaining Map queue order
andreabadesso May 5, 2021
fd840b2
fix: typo
andreabadesso May 6, 2021
908acaf
feat: typed yield result from generator
andreabadesso May 6, 2021
6d80493
feat: added type and docstring to onReceive from syncHandler
andreabadesso May 6, 2021
07b9c1e
refactor: using strict, refactor types to pass tslint
andreabadesso May 6, 2021
65f3774
fix: token creation tx was not sending token_name and token_symbol
andreabadesso May 6, 2021
09ce983
fix: breaking type on fullnode response
andreabadesso May 17, 2021
07c4624
feat: logging full data instead of data.Response on lambda response
andreabadesso May 17, 2021
1e78060
tests: removed isVoided from tx
andreabadesso May 17, 2021
83d2070
tests: fix typo on tests, clearing all mocks before every test instea…
andreabadesso May 17, 2021
9b01f07
tests: fix test by using the hathorLib to define whether a tx is a bl…
andreabadesso May 17, 2021
9eb23a9
feat: typed raw tx response from fullnode
andreabadesso May 17, 2021
9a37b7f
refactor: typed rawTx and refactored types
andreabadesso May 17, 2021
3ff7143
chore: set build output to cjs as the project is node-only
andreabadesso May 17, 2021
d8b3f67
chore: removed dom from lib
andreabadesso May 17, 2021
b4c2e15
feat: added spent_by and token to RawOutput and RawInput to handle bl…
andreabadesso May 17, 2021
135191c
chore: ignoring some ts errors that can be handled by typing for now.
andreabadesso May 17, 2021
3b7f2ea
chore: using strict: true
andreabadesso May 17, 2021
7bcdcf7
feat: ignoring genesis transactions before sending them to the wallet…
andreabadesso May 23, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
refactor: improved blocks download message
andreabadesso committed May 5, 2021
commit e210f765d9f09c4c081f2f9dbad06e085b018211
2 changes: 1 addition & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
@@ -254,7 +254,7 @@ export async function* syncToLatestBlock(): AsyncGenerator<StatusEvent> {
return;
}

logger.debug('Best block is valid.');
logger.debug(`Downloading ${meta.height - outBestBlock.height} blocks...`);
let success = true;

blockLoop: