It‘s actually all in the title: When using the “official” command line interface wallet (https://github.com/iotaledger/cli-app) and e.g. attaching an address, is PoW executed on the client or by the connected full node?
1 Answer
As this CLI wallet uses iota.lib.js and not also curl.lib.js, and attachToTangle is nowhere overwritten (monkey-patched), PoW will be executed on the full node you connect to. In case the node does not allow so, transactions/transfers will fail.
-
Thanks! But in theory, the wallet could do the PoW, never call attachToTangle and just use broadcastTransactions to send the transactions including the nonce (PoW) to the network. Is this correct? Asked differently: There is no need to call attachToTangle because all it does is outsourcing PoW, or? (I still think, that the name for the API method is somewhat misleading.)– ralfCommented Dec 27, 2017 at 12:01
-
Yes. the wallet could just depend on
curl.lib.js
and call itsoverrideAttachToTangle
function, which will redirect allattachToTangle
calls (by the wallet or somewhere hidden in the lib by e.g.sendTransfer
to local PoW.– mihi ♦Commented Dec 27, 2017 at 12:04 -
This makes it crystal clear for me. So attachToTangle actually doesn’t attach anything to the tangle. It is sendTransactions which does so. I was stuck with this for a while!– ralfCommented Dec 27, 2017 at 12:08
-
yes. It only builds consistent transactions that are part of the "virtual" tangle spanning over all nodes and wallets.
sendTransactions
(which will internally call store and broadcast) will actually send these transactions to the node and its neighbors.– mihi ♦Commented Dec 27, 2017 at 12:15 -
See also iota.stackexchange.com/a/989/134 (an answer to your other question)– mihi ♦Commented Dec 27, 2017 at 12:17