Created
July 8, 2020 09:12
-
-
Save MariusVanDerWijden/ebf1f036543f420feccb574e426bbef8 to your computer and use it in GitHub Desktop.
This file contains 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 characters
// Retrieve a block by number | |
ctx := context.Background() | |
block, err := cl.BlockByNumber(ctx, big.NewInt(123)) | |
// Get Balance of an account (nil means at newest block) | |
addr := common.HexToAddress("0xb02A2EdA1b317FBd16760...") | |
balance, err := cl.BalanceAt(ctx, addr, nil) | |
// Send transaction | |
tx := new(types.Transaction) | |
err = cl.SendTransaction(ctx, tx) | |
// Get sync progress of the node | |
progress, err := cl.SyncProgress(ctx) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment