-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
feature(node): ERC20 and ETH support #2325
feature(node): ERC20 and ETH support #2325
Conversation
e6e485b
to
5f5eae6
Compare
Can now sync ETH and get wallet history for ERC20 tokens
5f5eae6
to
d08ea9d
Compare
packages/bitcore-node/src/modules/ethereum/models/transaction.ts
Outdated
Show resolved
Hide resolved
ETH blocks were using the BTC transforms, fixed that
@@ -115,7 +115,7 @@ router.get('/:pubKey/addresses/missing', authenticate, async (req: Authenticated | |||
pubKey, | |||
stream: res | |||
}; | |||
return ChainStateProvider.streamMissingWalletAddresses(payload); | |||
return await ChainStateProvider.streamMissingWalletAddresses(payload); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if this is streaming why does it await?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
eRRoR
@@ -134,7 +134,7 @@ router.get('/:pubKey/addresses', authenticate, async (req: AuthenticatedRequest, | |||
req, | |||
res | |||
}; | |||
return ChainStateProvider.streamWalletAddresses(payload); | |||
return await ChainStateProvider.streamWalletAddresses(payload); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if this is streaming why does it await?
@@ -188,7 +188,7 @@ router.post('/:pubKey', authenticate, async (req: AuthenticatedRequest, res) => | |||
router.get('/:pubKey/transactions', authenticate, async (req: AuthenticatedRequest, res) => { | |||
let { chain, network } = req.params; | |||
try { | |||
return ChainStateProvider.streamWalletTransactions({ | |||
return await ChainStateProvider.streamWalletTransactions({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if this is streaming why does it await?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So interesting thing I learned. If there's a throw inside of an async method that streams, then you'll get an unhandled promise rejection if you don't await that method.
|
||
onConnect() { | ||
super.onConnect(); | ||
this.collection.createIndex({ chain: 1, network: 1, to: 1 }, { background: true }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sparse
002b129
to
e12cc24
Compare
e12cc24
to
a031a9b
Compare
if (!initialSyncComplete) { | ||
return; | ||
} | ||
let prunedTxs = {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix pruneTxs always empty object
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
2e33d95
to
e9bec10
Compare
3c73bb3
to
478ea8d
Compare
1002638
to
f8dac47
Compare
f8dac47
to
38081bf
Compare
Can now sync ETH and get wallet history for ERC20 tokens
Refactoring currency support into a module system. This allows the creation of 3rd party modules, and arbitrary currency support without forking.
ETH Syncing via
Testing
I've been testing with this local development node
alias parity-dev="/Users/micah/blockchains/eth/parity2.4.2 --config dev --base-path '/Users/micah/blockchains/eth/dev' --db-compaction ssd --cache-size 8192 --jsonrpc-cors=all --ws-origins=all --ws-apis=all"
and this private key
0x4d5db4107d237df6a3d58ee5f70ae63d73d7658d4026f2eefd2f204c81682cb7
imported into metamask