Skip to content
This repository has been archived by the owner on Jun 29, 2021. It is now read-only.

Invalid Tx Json from example #81

Closed
csajedi opened this issue May 13, 2019 · 2 comments
Closed

Invalid Tx Json from example #81

csajedi opened this issue May 13, 2019 · 2 comments

Comments

@csajedi
Copy link

csajedi commented May 13, 2019

I'm attempting to use the starter provided here and I keep getting invalid tx json. The error responses have not helped me troubleshoot the error on the kaya side:

[LOGIC] : Processing transaction...
Error: Msg is not well-formed
Possible fix: Did you specify the correct chain Id and msg version?
[LOGIC] : Payload well-formed? false
Error: Msg is not well-formed
Possible fix: Did you specify the correct chain Id and msg version?
[App.js] : Sending response back to client
[App.js] : Method specified GetBalance
[App.js] : Getting balance for 7bb3b0e8a59f3f61d9bff038f4aeb42cae2ecce8
[Wallet] : Getting balance for 7bb3b0e8a59f3f61d9bff038f4aeb42cae2ecce8
[App.js] : Sending response back to client
[App.js] : Method specified GetMinimumGasPrice
[App.js] : Sending response back to client
[App.js] : Method specified GetBalance
[App.js] : Getting balance for 7bb3b0e8a59f3f61d9bff038f4aeb42cae2ecce8
[Wallet] : Getting balance for 7bb3b0e8a59f3f61d9bff038f4aeb42cae2ecce8
[App.js] : Sending response back to client
[App.js] : Method specified CreateTransaction

I'm running with fixtures, and the only change I made to QuickStart.ts from the linked repo was adding a destination address that was provided by the fixtures file (QuickStart.ts/line40):

    const tx = await zilliqa.blockchain.createTransaction(
      zilliqa.transactions.new({
        version: VERSION,
        toAddr: "381f4008505e940ad7681ec3468a719060caf796",
        amount: new BN(units.toQa("888", units.Units.Zil)), // Sending an amount in Zil (888) and converting the amount to Qa
        gasPrice: myGasPrice, // Minimum gasPrice veries. Check the `GetMinimumGasPrice` on the blockchain
        gasLimit: Long.fromNumber(1)
      })
    );

➜ zilliqajs-starter git:(master) ✗ ts-node src/QuickStart.ts
Your account address is:
0x7bb3b0e8a59f3f61d9bff038f4aeb42cae2ecce8
Your account balance is:
{ balance: '1000000000000000000', nonce: 0 }
Current Minimum Gas Price: 1000000000
My Gas Price 1000000000
Sufficient Gas Price?
true
{ message: 'Invalid Tx Json' }

As a result I am not able to progress with development. Is there something I am missing? None of the examples I've seen have provided any clues. Can you confirm that this will provide a valid Kaya RPC version:

const CHAIN_ID = 2;
const MSG_VERSION = 1;
const VERSION = bytes.pack(CHAIN_ID, MSG_VERSION);
@snowsledge
Copy link

snowsledge commented May 15, 2019

The expected CHAIN_ID should be 111 looking at the config.js file

@csajedi
Copy link
Author

csajedi commented May 16, 2019

This resolved my issue. Thank you @evesnow91

@csajedi csajedi closed this as completed May 16, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants