-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclient.go
More file actions
32 lines (26 loc) · 690 Bytes
/
client.go
File metadata and controls
32 lines (26 loc) · 690 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package main
import (
"fmt"
"log"
"math/big"
"github.com/ethereum/go-ethereum/ethclient"
)
var client *ethclient.Client
func main() {
var err error
client, err = ethclient.Dial("http://localhost:7545")
if err != nil {
log.Fatal(err)
}
fmt.Println("we have a connection")
generateWallet()
value := big.NewInt(2000000000000000000) // in wei (1 eth)
transferEth("5CD956063F3EB0F959DD961B04142314D78D3E400A504B644A29A96CC38852E6", value)
accountBalance(address)
monitorTransaction(transactionHash)
generateWallet()
value = big.NewInt(0000000000000100000) // in wei (1 eth)
transferEth(privateKey2, value)
accountBalance(address)
monitorTransaction(transactionHash)
}