Created
April 26, 2022 09:29
Revisions
-
crazygit revised this gist
Apr 26, 2022 . 1 changed file with 0 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -25,6 +25,5 @@ func main() { fmt.Printf("Transaction Hash: %s\n", tx.Hash().Hex()) fmt.Printf("Transaction Value: %s\n", tx.Value()) fmt.Printf("Transaction Data: %s\n", tx.Data()) fmt.Printf("isPending: %t\n", isPending) } -
crazygit created this gist
Apr 26, 2022 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,30 @@ package main import ( "context" "fmt" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/ethclient" "log" ) const ropstenHttpsEndpoint = "https://ropsten.infura.io/v3/77a8f7b1379d440b8c06e82f37d05657" func main() { client, err := ethclient.Dial(ropstenHttpsEndpoint) if err != nil { log.Fatal(err) } txHash := common.HexToHash("0x389cf60f4936ee1fa81f255d0a133fd84fe6e8b69fd8a376f3ee028d134b4ff3") tx, isPending, err := client.TransactionByHash(context.Background(), txHash) if err != nil { log.Fatal(err) } fmt.Printf("Transaction Hash: %s\n", tx.Hash().Hex()) fmt.Printf("Transaction Value: %s\n", tx.Value()) fmt.Printf("Transaction Data: %s\n", tx.Data()) fmt.Printf("Transaction Hash: %s\n", tx.Hash().Hex()) fmt.Printf("isPending: %t\n", isPending) }