Skip to content

Commit

Permalink
update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
6boris committed May 8, 2023
1 parent 396f484 commit 8bd9cce
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,24 @@ go get github.com/6boris/web3-go
package main

import (
"context"
"fmt"
"github.com/6boris/web3-go/client"
"context"
"fmt"
"github.com/6boris/web3-go/client"
"github.com/6boris/web3-go/pkg/otel"
)

func main() {
ec := client.NewPool(client.GetDefaultConfPool())
chainID := int64(1)
v, err := ec.GetClient(chainID).ClientVersion(context.Background())
if err != nil {
panic(err)
}
fmt.Println(fmt.Sprintf("ChainID:%d ClientVersion:%s", chainID, v))
func main() {
otel.InitProvider()
ec := client.NewPool(client.GetDefaultConfPool())
chainID := int64(1)
v, err := ec.GetClient(chainID).ClientVersion(context.Background())
if err != nil {
panic(err)
}
fmt.Println(fmt.Sprintf("ChainID:%d ClientVersion:%s", chainID, v))
}


/*
Output:
ChainID:1 ClientVersion:Geth/v1.11.5-omnibus-65be78cc/linux-amd64/go1.19.7
Expand Down

0 comments on commit 8bd9cce

Please sign in to comment.