2

Problem

So basically what I am trying to do is to send Transactions that were signed by an account that was generated by ethereumjs-wallet so my node don't keep UTC file and therefore I don't have an issue if someone stealing accounts UTC file. But my contract doesn't execute if there is no UTC file, on a node, for an address that signed my transaction.

This is part of a code that I used for sending Tx.

utils.askForInput('Owner address: ')
  .then((ownerAddr) => {
    Tx.ownerAddr = ownerAddr;
    return utils.askForInput('New wallet address: ');
  }).then(async (newAddr) => {
    const data = await utils.prepareData('addWallet', newAddr);
    const nonce = await utils.getAccountNonce(Tx.ownerAddr);

    console.log('Data: ' + data);
    console.log('Nonce: ' + nonce);

    return utils.askForInput('Signed Transaction: ');
  }).then(async (signedTx) => {
    await utils.sendRawTransaction(signedTx);

    utils.closeReadLine();
  }).catch((err) => {
    console.log(err);

    utils.closeReadLine();
  });

Possible solution

I can just create UTC file and call contract and after I am done with everything I can just delete UTC file. But I think it is a hack. My Q is why this is the case and is it necessary to solve it like this.

Just to point out my code works, if UTC file is created for that account.

1 Answer 1

0

I found out that I need to have some ethers on the created address so that address can execute a transaction with gas price 0. So I need to fill the account with ethers before sending raw transaction.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.