symbol / symbol-docs

Open-source documentation of Symbol
https://docs.symbol.dev
Apache License 2.0
57 stars 91 forks source link

packet 9 was pushed to the network via /transaction #406

Closed enricozanardo closed 4 years ago

enricozanardo commented 4 years ago

Describe the error Using the symbol-sdk:0.18.0 I'm trying to perform some mosaics transactions but they are not written into the blockchian even if the following response is provided: 'packet 9 was pushed to the network via /transaction'.

To Reproduce const NETWORK_TYPE = NetworkType.TEST_NET; const nodeUrl = 'http://api-01.us-west-1.symboldev.network:3000'; const networkGenerationHash = '44D2225B8932C9A96DCB13508CBCDFFA9A9663BFBA2354FEEC8FCFCB7E19846C'; const MOSAIC_NAME = 'unicalcoin'; const MOSAIC_ID_UNICALCOIN = '6CAA8A74284FC608'; const unicalcoin_divisibility = 0;

function createTransaction( rawRecipientAddress: string, amount: number, text: string ): TransferTransaction { const recipientAddress = Address.createFromRawAddress(rawRecipientAddress); const currency = new MosaicId(MOSAIC_ID_UNICALCOIN);

const transferTransaction = TransferTransaction.create( Deadline.create(), recipientAddress, [ new Mosaic( currency, UInt64.fromUint(10 * Math.pow(10, unicalcoin_divisibility)) ), ], PlainMessage.create(text), NETWORK_TYPE, UInt64.fromUint(amount) );

console.log(Deadline.create());

return transferTransaction; }

function signTransaction( account: Account, tx: TransferTransaction ): SignedTransaction { return account.sign(tx, networkGenerationHash); }

async function doTransaction(signedTx: SignedTransaction): Promise { transactionHttp.announce(signedTx).subscribe( (tx) => { console.log(\nTransaction info: ${tx.message}\n); }, (err: Error) => { console.log(\nIt was not possible to do the transfer. Error: ${err}\n); } ); return true; }

Expected behavior The destination wallet receive the amout of tokes defined into the function

Additional context A similar problem was already presented but this time I do not think that this time is related to the localtime of the DeadLine

Deadline { value: LocalDateTime { _date: LocalDate { _year: 2020, _month: 5, _day: 6 }, _time: LocalTime { _hour: 18, _minute: 52, _second: 12, _nano: 355000000 } } }

Example of tx: signedTx: 3A93F55CE67C6005C889CFF3D764D458AD5F28C19A86FC6C59D18A1BA1BEEBB6

or:

http://api-01.us-west-1.symboldev.network:3000/transaction/C3DB863C16021F65411992EBEB6EAD38D1859F5C87AB154472A21E509F078C6E/status

dgarcia360 commented 4 years ago

Hi@onezerobinary, thanks for opening an issue!

Receiving "packet 9 was pushed to the network via /transaction" response does not mean the transaction is valid or included in a block. To know about the transaction status (confirmed/unconfirmed/rejected), you could use WebSockets, or poll this endpoint after announcing the transaction.

The most common cause of why transfer transactions fail is not having enough mosaic units. In this case, you will get the error Failure_Core_Insufficient_Balance. If your transaction reaches the unconfirmed status but does not get confirmed, the fee set might be too low. In this case, you won't get an error, but the transaction will be rejected when the transaction deadline is reached.

Please, let me know if you manage to solve it to close the issue.