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,740 points
514 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,350 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
• 69,230 points
780 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
• 69,230 points
716 views
+1 vote
2 answers

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
• 69,230 points
3,706 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
• 69,230 points
394 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
1,769 views
0 votes
1 answer

Hyperledger Sawtooth vs Quorum in concurrency and speed Ask

Summary: Both should provide similar reliability of ...READ MORE

answered Sep 26, 2018 in IoT (Internet of Things) by Upasana
• 8,620 points
1,291 views
+1 vote
1 answer

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

yes all are over TCP/IP connections secured ...READ MORE

answered Aug 6, 2018 in Blockchain by aryya
• 7,450 points
1,204 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,350 points
536 views
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP