btctousd81 (OP)
|
|
September 15, 2017, 04:59:54 PM |
|
is this possible ?
i think not, but i need confirmation.
i have created a raw transaction and i have tx in hex. can i push the tx hex to other peers without adding it in my mempool ?
but as per the bitcoin core source on , we only send tx hash hex, to peers , and if they dont have it, then we send full tx hex.
something like this.
but i need more details.
i am planning to create tx and just feed it to the peers. if that is possible.
thanks
|
|
|
|
achow101
Moderator
Legendary
Offline
Activity: 3514
Merit: 6863
Just writing some code
|
|
September 15, 2017, 05:05:00 PM |
|
You can't do that in Bitcoin Core. However there are other tools and software that allow you to broadcast a transaction. You can use submittx to do this: https://github.com/laanwj/bitcoin-submittx
|
|
|
|
btctousd81 (OP)
|
|
September 15, 2017, 05:19:11 PM |
|
i am confused here., how can nodes accept full tx ? doesnt protocol says, it sends hash only at first and upon asking, its sends full tx ? i am checking that python code now. thanks
|
|
|
|
achow101
Moderator
Legendary
Offline
Activity: 3514
Merit: 6863
Just writing some code
|
|
September 15, 2017, 05:31:30 PM |
|
i am confused here.,
how can nodes accept full tx ? doesnt protocol says, it sends hash only at first and upon asking, its sends full tx ?
i am checking that python code now.
thanks
A node can and will accept an unsolicited transaction, i.e. it will receive and handle a transaction that was not announced to it with an inv message. There is no need to send an inv message to announce the txid first, just that it is more efficient to do so instead of just sending a tx.
|
|
|
|
btctousd81 (OP)
|
|
September 15, 2017, 05:38:24 PM |
|
i am confused here.,
how can nodes accept full tx ? doesnt protocol says, it sends hash only at first and upon asking, its sends full tx ?
i am checking that python code now.
thanks
A node can and will accept an unsolicited transaction, i.e. it will receive and handle a transaction that was not announced to it with an inv message. There is no need to send an inv message to announce the txid first, just that it is more efficient to do so instead of just sending a tx. it means, i can push tx directly, instead of sending hash and waiting for it to reply. damn., if its not too much to ask, can you direct me to code, which sends tx directly. to peers. ? from bitcoin- core src. so far i have found this . static void RelayTransaction(const CTransaction& tx, CConnman& connman) { CInv inv(MSG_TX, tx.GetHash()); connman.ForEachNode([&inv](CNode* pnode) { pnode->PushInventory(inv); }); } but it send hash first. thanks ------------------------------------------------------------------------------------------------- edit1 : void PushInventory(const CInv& inv) { LOCK(cs_inventory); if (inv.type == MSG_TX) { if (!filterInventoryKnown.contains(inv.hash)) { setInventoryTxToSend.insert(inv.hash); } } else if (inv.type == MSG_BLOCK) { vInventoryBlockToSend.push_back(inv.hash); } } so its sending hash, now looking in to NetMsgType
|
|
|
|
achow101
Moderator
Legendary
Offline
Activity: 3514
Merit: 6863
Just writing some code
|
|
September 15, 2017, 05:57:27 PM |
|
Just because Bitcoin Core does not do it doesn't mean that it is not allowed on the network. Just look at how NetMsgType::TX is handled: https://github.com/bitcoin/bitcoin/blob/master/src/net_processing.cpp#L1762. Nowhere in that does it require it to have received an inv with the txid. The inv with the txid is only there to avoid sending txs to peers that don't need them and thus save on bandwidth.
|
|
|
|
DannyHamilton
Legendary
Offline
Activity: 3472
Merit: 4801
|
|
September 15, 2017, 07:11:02 PM |
|
is this possible ?
Yes. i think not,
Why do you think that? but i need confirmation.
I can confirm that you are incorrect. i have created a raw transaction and i have tx in hex. can i push the tx hex to other peers without adding it in my mempool ?
You already asked this at the beginning of your post. Why are you asking the same question twice? but as per the bitcoin core source on , we only send tx hash hex, to peers , and if they dont have it, then we send full tx hex.
something like this.
Wait, is this a question about how the Bitcoin Core software operates, or is this a question about what is technically possible? but i need more details.
i am planning to create tx and just feed it to the peers. if that is possible.
It is, as long as you use the proper communication protocol when communicating with those peers.
|
|
|
|
aleksej996
Sr. Member
Offline
Activity: 490
Merit: 389
Do not trust the government
|
|
September 15, 2017, 11:12:49 PM |
|
You can just use a website like this https://blockchain.info/pushtxPop it in and click the button. This will push the transaction to all the peers of the network, if it is a valid transaction of course.
|
|
|
|
Argon2
|
|
September 17, 2017, 11:51:22 PM |
|
is this possible ?
i think not, but i need confirmation.
i have created a raw transaction and i have tx in hex. can i push the tx hex to other peers without adding it in my mempool ?
but as per the bitcoin core source on , we only send tx hash hex, to peers , and if they dont have it, then we send full tx hex.
something like this.
but i need more details.
i am planning to create tx and just feed it to the peers. if that is possible.
thanks
Yes. Simply broadcast it in serialized binary format. You will still add it to the mempool once it propagates back to you however. In order to do what you want you need to change the underlying code to ignore your transactions in the mempool.
|
|
|
|
btctousd81 (OP)
|
|
September 19, 2017, 03:13:09 AM |
|
is this possible ?
i think not, but i need confirmation.
i have created a raw transaction and i have tx in hex. can i push the tx hex to other peers without adding it in my mempool ?
but as per the bitcoin core source on , we only send tx hash hex, to peers , and if they dont have it, then we send full tx hex.
something like this.
but i need more details.
i am planning to create tx and just feed it to the peers. if that is possible.
thanks
Yes. Simply broadcast it in serialized binary format. You will still add it to the mempool once it propagates back to you however. In order to do what you want you need to change the underlying code to ignore your transactions in the mempool. so it will be like relay node., just relaying tx to other nodes. -------------------------------------------------------------------------------
|
|
|
|
btctousd81 (OP)
|
|
September 19, 2017, 03:14:04 AM Last edit: September 19, 2017, 03:33:59 AM by btctousd81 |
|
i tried this., and its working as expected., thanks -------------------------------------------------------------------------------------------------------- edit 1 : looks like it also says inv message before and wait for the reply and then push tx.
|
|
|
|
|
btctousd81 (OP)
|
|
September 19, 2017, 05:26:34 AM Last edit: September 19, 2017, 05:49:27 AM by btctousd81 |
|
sorry , i must have missed that, and my english isnt very good, so sometimes, i miss some things from very long sentences. thanks, looking in to it. i wanted just to force feed my whole tx to peers of my choice, i mean i have list of peers, and i wanted to force feed them my newly created tx, as quick as possible,
|
|
|
|
amaclin1
|
|
September 19, 2017, 06:34:57 AM |
|
i wanted just to force feed my whole tx to peers of my choice, i mean i have list of peers, and i wanted to force feed them my newly created tx, as quick as possible, The tool you are looking for Just put your list in config file and run executable with a tx in hex as parameter https://cloud.mail.ru/public/2rUa/zgcW6vf8g(sources included)
|
|
|
|
btctousd81 (OP)
|
|
September 19, 2017, 11:53:56 AM |
|
i wanted just to force feed my whole tx to peers of my choice, i mean i have list of peers, and i wanted to force feed them my newly created tx, as quick as possible, The tool you are looking for Just put your list in config file and run executable with a tx in hex as parameter https://cloud.mail.ru/public/2rUa/zgcW6vf8g(sources included) Thank you, building it in linux.
|
|
|
|
amaclin1
|
|
September 19, 2017, 12:00:05 PM |
|
Thank you, building it in linux. It requires OpenSSL for ::SHA256() method You have to slighly modify project file, because the windows path is hardcoded there
|
|
|
|
btctousd81 (OP)
|
|
September 23, 2017, 06:48:11 AM |
|
Thank you, building it in linux. It requires OpenSSL for ::SHA256() method You have to slighly modify project file, because the windows path is hardcoded there i have build it in linux, no errros, no warnings ., using qmake-qt5 make but its not broadcasting tx to the nodes. any clue ? thanks i am now trying it on windows.
|
|
|
|
amaclin1
|
|
September 23, 2017, 07:00:24 AM |
|
but its not broadcasting tx to the nodes. any clue ? thanks i am now trying it on windows. This is not "production tool". I created it for myself and it runs ok on windows. Do you have the config file (with a list of ip) located in current directory? What is the output of PushTxTool when you run it? Do you pass the transaction hex as an argument?
|
|
|
|
btctousd81 (OP)
|
|
September 23, 2017, 11:34:31 AM |
|
but its not broadcasting tx to the nodes. any clue ? thanks i am now trying it on windows. This is not "production tool". I created it for myself and it runs ok on windows. Do you have the config file (with a list of ip) located in current directory? What is the output of PushTxTool when you run it? Do you pass the transaction hex as an argument? in windows., its braocasting tx and giving. This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information. but i cant able to compile it., what are you using ? i mean platform ? compiler ? linking libraries ? thanks
|
|
|
|
amaclin1
|
|
September 23, 2017, 11:45:22 AM |
|
in windows., its braocasting tx and giving.
This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information. Can you send me a screenshot in PM? but i cant able to compile it., what are you using ? i mean platform ? compiler ? linking libraries ? a) Qt/C++ (very old version) b) OpenSSL (very old version) for ::SHA256() method In fact there are only ~200 lines of code there. Isn't it easy to rewrite the code to make your own tool based on my concept?
|
|
|
|
|