Ethereum wallet not able to make transaction

0 votes

I have this code in python for Ethereum transaction but the transaction is not happening. I have just kept waiting but the transaction does not happen.

class MyEtherApi():



    def __init__(self, addr=None, key=None):

        self.addr = addr

        self.key = key

        self.w3 = Web3(HTTPProvider('https://api.myetherapi.com/eth'))


    def get_eth_balance(self):

        return self.w3.eth.getBalance(self.addr)


    def send_eth(self, address, amt, gas):

        tx = Transaction(

            to=address,

            value=Web3.toWei(amt, 'ether'),

            nonce=int(time()),

            gasprice=self.w3.eth.gasPrice,

            startgas=int(gas),

            data=b'',

           )

        tx.sign(self.key)

        raw_tx = rlp.encode(tx)

        signed = self.w3.toHex(raw_tx)

        return self.w3.eth.sendRawTransaction(signed)
Aug 9, 2018 in Blockchain by digger
• 26,550 points
35 views

1 answer to this question.

0 votes
I can see that the nonce you have set is very high. When you set a nonce very high, it just means that the transaction cant be mined and maybe that’s why your transaction is not happening. The most used practiced is to start the nonce with 0 and keeps on increasing with every transaction. Setting a low nonce should solve your problem.
answered Aug 9, 2018 by slayer
• 29,050 points

Related Questions In Blockchain

0 votes
1 answer

Not able to invoke a contract in Ethereum Private chain using geth

Hope this helps: contract mortal { /* ...READ MORE

answered Oct 22, 2018 in Blockchain by Omkar
• 67,480 points
41 views
0 votes
1 answer

Not able to start testrpc for Ethereum truffle

Hey. It seems like you already have ...READ MORE

answered Nov 28, 2018 in Blockchain by Omkar
• 67,480 points
113 views
0 votes
1 answer

Not able to create new account in geth for private ethereum network

Looks like the account you are trying ...READ MORE

answered Dec 6, 2018 in Blockchain by Omkar
• 67,480 points
111 views
0 votes
1 answer

Not able to pull any events in ethereum

You need to catch the even emitted ...READ MORE

answered Dec 31, 2018 in Blockchain by Omkar
• 67,480 points
28 views
0 votes
1 answer

Truffle tests not running after truffle init

This was a bug. They've fixed it. ...READ MORE

answered Sep 11, 2018 in Blockchain by Christine
• 15,790 points
141 views
0 votes
1 answer
0 votes
1 answer

Protocols used in a distributed/dlt system for the nodes to establish communication

yes all are over TCP/IP connections secured by TLS encryption in hashgraph architecture-hashgraph, ...READ MORE

answered Aug 6, 2018 in Blockchain by ariaholic
• 7,340 points
76 views
0 votes
1 answer

Not able to send Ethereum transaction

Hey, Change this line: await crowdsale.sendTransaction({value, from: buyer, gas: ...READ MORE

answered Sep 24, 2018 in Blockchain by slayer
• 29,050 points
24 views
0 votes
1 answer