Skip to content

Instantly share code, notes, and snippets.

@alejoloaiza
Created December 9, 2018 23:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alejoloaiza/5eec95b8e3dcac1cff448e39134dfc60 to your computer and use it in GitHub Desktop.
Save alejoloaiza/5eec95b8e3dcac1cff448e39134dfc60 to your computer and use it in GitHub Desktop.
shows signature values from a given block
package main
import (
"context"
"fmt"
"math/big"
"github.com/ethereum/go-ethereum/ethclient"
)
func main() {
ConnectEth()
block, _ := EthClient.BlockByNumber(context.Background(), big.NewInt(6857439))
body := block.Body()
for _, tx := range body.Transactions {
v, r, s := tx.RawSignatureValues()
fmt.Printf("v: %d R: %d S: %d \n", v.Int64(), r.Int64(), s.Int64())
}
}
var EthClient *ethclient.Client
func ConnectEth() {
EthClient, _ = ethclient.Dial("https://mainnet.infura.io")
//EthClient, _ = ethclient.Dial("https://ropsten.infura.io/")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment