solana-go/rpc/examples/getEpochInfo/getEpochInfo.go

23 lines
328 B
Go
Raw Normal View History

2021-07-27 07:26:14 -07:00
package main
import (
"context"
"github.com/davecgh/go-spew/spew"
"github.com/gagliardetto/solana-go/rpc"
)
func main() {
2021-07-27 08:55:40 -07:00
endpoint := rpc.TestNet_RPC
2021-07-27 07:26:14 -07:00
client := rpc.New(endpoint)
out, err := client.GetEpochInfo(
context.TODO(),
rpc.CommitmentType("finalized"),
)
if err != nil {
panic(err)
}
spew.Dump(out)
}