File tree 3 files changed +50
-0
lines changed
3 files changed +50
-0
lines changed Original file line number Diff line number Diff line change
1
+ package main
2
+
3
+ import (
4
+ "fmt"
5
+ "io"
6
+ "net/http"
7
+ "strings"
8
+ )
9
+
10
+ func main () {
11
+
12
+ // privateKey := "5e408d58b36aaaef69a91dacd444a4bfc285d0e61fdb147bcb501aed8d5f959d"
13
+ address := "TFdZsjFTqT5APEcWmGo4oeMJ84BGSZgJnH"
14
+
15
+ getAccountInfo (address )
16
+ }
17
+
18
+ func getAccountInfo (address string ) {
19
+
20
+ url := "https://api.shasta.trongrid.io/wallet/getaccount"
21
+
22
+ payload := strings .NewReader ("{\" address\" :\" TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g\" ,\" visible\" :true}" )
23
+
24
+ req , _ := http .NewRequest ("POST" , url , payload )
25
+
26
+ req .Header .Add ("accept" , "application/json" )
27
+ req .Header .Add ("content-type" , "application/json" )
28
+
29
+ res , _ := http .DefaultClient .Do (req )
30
+
31
+ defer res .Body .Close ()
32
+ body , _ := io .ReadAll (res .Body )
33
+
34
+ fmt .Println (string (body ))
35
+
36
+ }
Original file line number Diff line number Diff line change
1
+ module tron-contract
2
+
3
+ go 1.20
Original file line number Diff line number Diff line change
1
+ # Tron contract
2
+
3
+ ### How to run private TRON network
4
+
5
+ you can run ` docker run -it --rm -p 9090:9090 --name tron trontools/quickstart ` on your local system and you will have private TRON network
6
+
7
+ note that it will generate 10 wallets with 10000 TRX on each one
8
+
9
+ the wallets addresses and private keys will be printed in console when you bring up container
10
+
11
+ you can access http server exposed on port ` 9090 `
You can’t perform that action at this time.
0 commit comments