Skip to content

Instantly share code, notes, and snippets.

@alejoloaiza alejoloaiza/signatures Secret
Created Dec 9, 2018

Embed
What would you like to do?
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
You can’t perform that action at this time.