Skip to main content

Posts

Showing posts with the label Transaction in Ganache using golang

Transactions on Ganache using Golang

  Previous Topic:  Connect to Ganache using golang In the pervious topic, we showed how to connect with ganache and retrieving balance for the account using Golang. Now, we are going to transfer some ethers from one account to another account using Golang. Transfer Fund: Here we are going to transfer 5 ethers, From Address :  0x532205E897418D09F2C0253E5A31e666eE87cb1A To Address :  0x3fCf008C3d40C0af410CD122F00eFA77288A2E13 Each account has balance of 100 eth. First, we need to find the nonce of the From Address and generate the unsigned raw transaction and using the private key of the From Address sign the unsigned raw transaction.  To get the Private Key follow the steps: 1. Click the show keys. 2. We will able to see the private key details of the respective address. After Signing the transaction, we need to broadcast that signed transaction in the network. package main import ( "context" "fmt" "log" "math/big" "strings" ...