tango-crypto / cardano-wallet-js

cardano-wallet javascript/typescript client
80 stars 34 forks source link

How can i know the specific error when submitting signed tx #38

Open bajian opened 2 years ago

bajian commented 2 years ago
const {Seed, WalletServer} = require('cardano-wallet-js');

(async () => {

    //testnet:
    let txSignedHex = '84a400818258208561258e210352fba2ac0488afed67b3427a27ccf1d41ec030c98a8199bc22ec0001828258390079467c69a9ac66280174d09d62575ba955748b21dec3b483a9469a65cc339a35f9e0fe039cf510c761d4dd29040c48e9657fdac7e9c01d941a000f4240825820409493315cd92eb5d8c4304e67b7e16ae36d61d34502694657811a2c8e0102031a001bf74f021a00028d31031a000641a5a10081825820e9b5aa0c60fbc886ee6dfaa25d3b4e20d6d2c527d9cfa44ffad432e5de2505c55840924bcdbe5ef5bbaad9af7c55d866325d68c9f5f5b80ef573093dccf7ab1d140fb9dcd759659ee40fe8d993c0220c19072e30b5d3be7d2be9e5d052a47348da04f5f6';
    let walletServer = WalletServer.init('http://localhost:8090/v2');
    let txId = await walletServer.submitTx(txSignedHex);
    console.log(txId)

})()

Got error

(node:84541) UnhandledPromiseRejectionWarning: Error: Request failed with status code 500
    at createError (/data/ada_test/node_modules/axios/lib/core/createError.js:16:15)
    at settle (/data/ada_test/node_modules/axios/lib/core/settle.js:17:12)
    at IncomingMessage.handleStreamEnd (/data/ada_test/node_modules/axios/lib/adapters/http.js:269:11)
    at emitNone (events.js:111:20)
    at IncomingMessage.emit (events.js:208:7)
    at endReadableNT (_stream_readable.js:1064:12)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)
(node:84541) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:84541) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Such error tips are confusing Any idea to solve it ?

bajian commented 2 years ago

[cardano-wallet.wallet-engine:Info:120] [2022-02-18 10:05:50.86 UTC] Submitting external transaction 85c78710 to local node...
[cardano-wallet.wallet-engine:Error:120] [2022-02-18 10:05:50.90 UTC] Transaction 85c78710 failed: TxValidationEraMismatch (EraMismatch {ledgerEraName = "Mary", otherEraName = "Alonzo"})
[cardano-wallet.api-server:Error:120] [2022-02-18 10:05:50.90 UTC] [RequestId 5] POST /v2/proxy/transactions 500 Internal Server Error in 0.039752749s

I have found the error in the wallet server

bajian commented 2 years ago

Why not return the error messages to the api side? And where is the wallet server error log directory if i run the wallet server as deamon?