-
-
Notifications
You must be signed in to change notification settings - Fork 3
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] N2N TxSubmission #63
Conversation
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 @nemo83 for the PR.
Looks good to me. Few minor comments.
core/src/main/java/com/bloxbean/cardano/yaci/core/network/NodeClient.java
Show resolved
Hide resolved
map.put(new ByteString(HexUtil.decodeHexString(id)), new UnsignedInteger(size)); | ||
var pair = new Array(); | ||
var era = new Array(); | ||
era.add(new UnsignedInteger(5)); |
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.
Is this an era specific value or a constant value (always 5) ?
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.
oppssieee a daisy. It's an Era specific. Great catch, will look how it's handled elsewhere in the code and update accordingly, but happy to get pointers / suggestions if you have any on how to pass or where to get that info!
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.
Check Era enum in package com.bloxbean.cardano.yaci.core.protocol.localstate.api
. Probably you need this one. This one is used in local state query and local tx submission.
There is another Era enum, but it has different values and is used in block de-serialization if I am not wrong.
core/src/main/java/com/bloxbean/cardano/yaci/core/protocol/txsubmission/TxSubmissionAgent.java
Outdated
Show resolved
Hide resolved
Updated most comments, before closing I need to:
|
Thanks @nemo83 . Please check my era specific comment above. Is it possible to add an integration test for Tx submission? Something like |
helper/src/main/java/com/bloxbean/cardano/yaci/helper/TxSubmissionClient.java
Outdated
Show resolved
Hide resolved
@nemo83 I tried it and I was able to successfully submit and execute my transaction So, the callback methods in listener are only to notify if the transaction has been successfully pulled by the remote node. right? |
Feat N2N TxSubmission
This is the implementation of the Node-to-Node mini protocol TxSubmission.
Worth to mention that I've replaced the initial
HashMap
containing ids and bytes of the txs as I wanted to preserve order to addition (as it actually matters).I've streamed real node mempool via N2C to a local node via N2N TxSubmission and it has been running for a few hours w/o errors or disconnecting.