Skip to content

Commit

Permalink
Update go.mod (#401)
Browse files Browse the repository at this point in the history
* Update go.mod

Fixes go install

* chore: refactor deps
  • Loading branch information
vcastellm authored Oct 20, 2024
1 parent 6b4ba3c commit 971b28e
Show file tree
Hide file tree
Showing 52 changed files with 130 additions and 119 deletions.
13 changes: 12 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ env:
GO_VERSION: "1.21" # https://go.dev/dl/
STRINGER_VERSION: "0.23.0" # https://pkg.go.dev/golang.org/x/tools/cmd/stringer?tab=versions
# Protoc dependencies.
PROTOC_VERSION: "27.1" # https://github.com/protocolbuffers/protobuf/releases
PROTOC_VERSION: "27.3" # https://github.com/protocolbuffers/protobuf/releases
PROTOC_GEN_GO_VERSION: "1.31.0" # https://pkg.go.dev/google.golang.org/protobuf/cmd/protoc-gen-go?tab=versions
PROTOC_GEN_GO_GRPC_VERSION: "1.4.0" # https://pkg.go.dev/google.golang.org/grpc/cmd/protoc-gen-go-grpc?tab=versions
ARCH: "linux-x86_64"
Expand Down Expand Up @@ -134,3 +134,14 @@ jobs:
make ${{ matrix.tool }} &
sleep 5
make loadtest
install:
name: Install go package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- name: Install polycli using go
run: go install github.com/0xPolygon/polygon-cli@latest
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ ENTRYPOINT ["polycli"]
CMD ["--help"]

# How to test this image?
# https://github.com/maticnetwork/polygon-cli/pull/189#discussion_r1464486344
# https://github.com/0xPolygon/polygon-cli/pull/189#discussion_r1464486344
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ GIT_SHA := $(shell git rev-parse HEAD | cut -c 1-8)
GIT_TAG := $(shell git describe --tags)
DATE := $(shell date +%s)
VERSION_FLAGS=\
-X github.com/maticnetwork/polygon-cli/cmd/version.Version=$(GIT_TAG) \
-X github.com/maticnetwork/polygon-cli/cmd/version.Commit=$(GIT_SHA) \
-X github.com/maticnetwork/polygon-cli/cmd/version.Date=$(DATE) \
-X github.com/maticnetwork/polygon-cli/cmd/version.BuiltBy=makefile
-X github.com/0xPolygon/polygon-cli/cmd/version.Version=$(GIT_TAG) \
-X github.com/0xPolygon/polygon-cli/cmd/version.Commit=$(GIT_SHA) \
-X github.com/0xPolygon/polygon-cli/cmd/version.Date=$(DATE) \
-X github.com/0xPolygon/polygon-cli/cmd/version.BuiltBy=makefile

.PHONY: help
help: ## Display this help.
Expand Down
2 changes: 1 addition & 1 deletion bindings/tester/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
ethcommon "github.com/ethereum/go-ethereum/common"
ethtypes "github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/ethclient"
"github.com/maticnetwork/polygon-cli/util"
"github.com/0xPolygon/polygon-cli/util"
"github.com/rs/zerolog/log"
)

Expand Down
4 changes: 2 additions & 2 deletions cmd/abi/abi.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (

_ "embed"

"github.com/maticnetwork/polygon-cli/cmd/abi/decode"
"github.com/maticnetwork/polygon-cli/cmd/abi/encode"
"github.com/0xPolygon/polygon-cli/cmd/abi/decode"
"github.com/0xPolygon/polygon-cli/cmd/abi/encode"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion cmd/abi/encode/encode.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

"github.com/spf13/cobra"

"github.com/maticnetwork/polygon-cli/abi"
"github.com/0xPolygon/polygon-cli/abi"
)

var (
Expand Down
4 changes: 2 additions & 2 deletions cmd/dbbench/dbbench.go
Original file line number Diff line number Diff line change
Expand Up @@ -624,8 +624,8 @@ func init() {
readStrict = flagSet.Bool("read-strict", false, "if true the rand reads will be made in strict mode")
noWriteMerge = flagSet.Bool("no-merge-write", false, "allows disabling write merge")
syncWrites = flagSet.Bool("sync-writes", false, "sync each write")
// https://github.com/maticnetwork/bor/blob/eedeaed1fb17d73dd46d8999644d5035e176e22a/eth/backend.go#L141
// https://github.com/maticnetwork/bor/blob/eedeaed1fb17d73dd46d8999644d5035e176e22a/eth/ethconfig/config.go#L86C2-L86C15
// https://github.com/0xPolygon/bor/blob/eedeaed1fb17d73dd46d8999644d5035e176e22a/eth/backend.go#L141
// https://github.com/0xPolygon/bor/blob/eedeaed1fb17d73dd46d8999644d5035e176e22a/eth/ethconfig/config.go#L86C2-L86C15
cacheSize = flagSet.Int("cache-size", 512, "the number of megabytes to use as our internal cache size")
openFilesCacheCapacity = flagSet.Int("handles", 500, "defines the capacity of the open files caching. Use -1 for zero, this has same effect as specifying NoCacher to OpenFilesCacher.")
writeZero = flagSet.Bool("write-zero", false, "if true, we'll write 0s rather than random data")
Expand Down
6 changes: 3 additions & 3 deletions cmd/dumpblocks/dumpblocks.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import (
_ "embed"

ethrpc "github.com/ethereum/go-ethereum/rpc"
"github.com/maticnetwork/polygon-cli/proto/gen/pb"
"github.com/maticnetwork/polygon-cli/rpctypes"
"github.com/maticnetwork/polygon-cli/util"
"github.com/0xPolygon/polygon-cli/proto/gen/pb"
"github.com/0xPolygon/polygon-cli/rpctypes"
"github.com/0xPolygon/polygon-cli/util"
"github.com/rs/zerolog/log"
"github.com/spf13/cobra"
"golang.org/x/exp/slices"
Expand Down
2 changes: 1 addition & 1 deletion cmd/ecrecover/ecrecover.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/ethclient"
ethrpc "github.com/ethereum/go-ethereum/rpc"
"github.com/maticnetwork/polygon-cli/util"
"github.com/0xPolygon/polygon-cli/util"
"github.com/rs/zerolog/log"
"github.com/spf13/cobra"
)
Expand Down
2 changes: 1 addition & 1 deletion cmd/fund/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

_ "embed"

"github.com/maticnetwork/polygon-cli/util"
"github.com/0xPolygon/polygon-cli/util"
"github.com/spf13/cobra"
)

Expand Down
6 changes: 3 additions & 3 deletions cmd/fund/fund.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ import (
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/ethclient"
"github.com/ethereum/go-ethereum/rpc"
"github.com/maticnetwork/polygon-cli/bindings/funder"
"github.com/maticnetwork/polygon-cli/hdwallet"
"github.com/maticnetwork/polygon-cli/util"
"github.com/0xPolygon/polygon-cli/bindings/funder"
"github.com/0xPolygon/polygon-cli/hdwallet"
"github.com/0xPolygon/polygon-cli/util"
"github.com/rs/zerolog/log"
)

Expand Down
4 changes: 2 additions & 2 deletions cmd/loadtest/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
"time"

ethcommon "github.com/ethereum/go-ethereum/common"
"github.com/maticnetwork/polygon-cli/rpctypes"
"github.com/maticnetwork/polygon-cli/util"
"github.com/0xPolygon/polygon-cli/rpctypes"
"github.com/0xPolygon/polygon-cli/util"
"github.com/rs/zerolog"
"github.com/spf13/cobra"
"golang.org/x/time/rate"
Expand Down
14 changes: 7 additions & 7 deletions cmd/loadtest/loadtest.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ import (
"github.com/ethereum/go-ethereum/signer/core/apitypes"
"github.com/holiman/uint256"

"github.com/maticnetwork/polygon-cli/bindings/tester"
"github.com/maticnetwork/polygon-cli/bindings/tokens"
uniswapv3loadtest "github.com/maticnetwork/polygon-cli/cmd/loadtest/uniswapv3"
"github.com/0xPolygon/polygon-cli/bindings/tester"
"github.com/0xPolygon/polygon-cli/bindings/tokens"
uniswapv3loadtest "github.com/0xPolygon/polygon-cli/cmd/loadtest/uniswapv3"

"github.com/maticnetwork/polygon-cli/abi"
"github.com/maticnetwork/polygon-cli/rpctypes"
"github.com/maticnetwork/polygon-cli/util"
"github.com/0xPolygon/polygon-cli/abi"
"github.com/0xPolygon/polygon-cli/rpctypes"
"github.com/0xPolygon/polygon-cli/util"

ethereum "github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/accounts/abi/bind"
Expand All @@ -53,7 +53,7 @@ const (
// If you add a new constant, it fill fail to compile until you regenerate the strings.
// There are two steps needed:
// 1. Install stringer: `go install golang.org/x/tools/cmd/stringer`.
// 2. Generate the string: `go generate github.com/maticnetwork/polygon-cli/cmd/loadtest`.
// 2. Generate the string: `go generate github.com/0xPolygon/polygon-cli/cmd/loadtest`.
// You can also use `make gen-loadtest-modes`.
loadTestModeERC20 loadTestMode = iota
loadTestModeERC721
Expand Down
4 changes: 2 additions & 2 deletions cmd/loadtest/output.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import (

"golang.org/x/time/rate"

"github.com/maticnetwork/polygon-cli/rpctypes"
"github.com/maticnetwork/polygon-cli/util"
"github.com/0xPolygon/polygon-cli/rpctypes"
"github.com/0xPolygon/polygon-cli/util"
"golang.org/x/exp/constraints"
"golang.org/x/text/language"
"golang.org/x/text/message"
Expand Down
4 changes: 2 additions & 2 deletions cmd/loadtest/recall.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
ethtypes "github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/ethclient"
ethrpc "github.com/ethereum/go-ethereum/rpc"
"github.com/maticnetwork/polygon-cli/rpctypes"
"github.com/maticnetwork/polygon-cli/util"
"github.com/0xPolygon/polygon-cli/rpctypes"
"github.com/0xPolygon/polygon-cli/util"
"math/big"
"strings"
)
Expand Down
4 changes: 2 additions & 2 deletions cmd/loadtest/uniswapv3.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import (
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/ethclient"
"github.com/maticnetwork/polygon-cli/bindings/uniswapv3"
uniswapv3loadtest "github.com/maticnetwork/polygon-cli/cmd/loadtest/uniswapv3"
"github.com/0xPolygon/polygon-cli/bindings/uniswapv3"
uniswapv3loadtest "github.com/0xPolygon/polygon-cli/cmd/loadtest/uniswapv3"
"github.com/rs/zerolog/log"
)

Expand Down
4 changes: 2 additions & 2 deletions cmd/loadtest/uniswapv3/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/ethclient"
"github.com/maticnetwork/polygon-cli/bindings/uniswapv3"
"github.com/maticnetwork/polygon-cli/util"
"github.com/0xPolygon/polygon-cli/bindings/uniswapv3"
"github.com/0xPolygon/polygon-cli/util"
"github.com/rs/zerolog/log"
)

Expand Down
4 changes: 2 additions & 2 deletions cmd/loadtest/uniswapv3/pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/ethclient"
"github.com/maticnetwork/polygon-cli/bindings/uniswapv3"
"github.com/maticnetwork/polygon-cli/util"
"github.com/0xPolygon/polygon-cli/bindings/uniswapv3"
"github.com/0xPolygon/polygon-cli/util"
"github.com/rs/zerolog/log"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/loadtest/uniswapv3/swap.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (

"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/common"
"github.com/maticnetwork/polygon-cli/bindings/uniswapv3"
"github.com/0xPolygon/polygon-cli/bindings/uniswapv3"
"github.com/rs/zerolog/log"
)

Expand Down
4 changes: 2 additions & 2 deletions cmd/loadtest/uniswapv3/swapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/ethclient"
"github.com/maticnetwork/polygon-cli/bindings/uniswapv3"
"github.com/maticnetwork/polygon-cli/util"
"github.com/0xPolygon/polygon-cli/bindings/uniswapv3"
"github.com/0xPolygon/polygon-cli/util"
"github.com/rs/zerolog/log"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/metricsToDash/metricsToDash.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (

_ "embed"

"github.com/maticnetwork/polygon-cli/dashboard"
"github.com/0xPolygon/polygon-cli/dashboard"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/mnemonic/mnemonic.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package mnemonic
import (
"fmt"

"github.com/maticnetwork/polygon-cli/hdwallet"
"github.com/0xPolygon/polygon-cli/hdwallet"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/monitor/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"sync"
"time"

"github.com/maticnetwork/polygon-cli/util"
"github.com/0xPolygon/polygon-cli/util"
"github.com/spf13/cobra"
)

Expand Down
8 changes: 4 additions & 4 deletions cmd/monitor/monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"time"

lru "github.com/hashicorp/golang-lru"
"github.com/maticnetwork/polygon-cli/util"
"github.com/0xPolygon/polygon-cli/util"

_ "embed"

Expand All @@ -20,9 +20,9 @@ import (

"github.com/cenkalti/backoff/v4"
termui "github.com/gizak/termui/v3"
"github.com/maticnetwork/polygon-cli/cmd/monitor/ui"
"github.com/maticnetwork/polygon-cli/metrics"
"github.com/maticnetwork/polygon-cli/rpctypes"
"github.com/0xPolygon/polygon-cli/cmd/monitor/ui"
"github.com/0xPolygon/polygon-cli/metrics"
"github.com/0xPolygon/polygon-cli/rpctypes"
"github.com/rs/zerolog/log"
)

Expand Down
4 changes: 2 additions & 2 deletions cmd/monitor/ui/ui.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import (
ethrpc "github.com/ethereum/go-ethereum/rpc"
ui "github.com/gizak/termui/v3"
"github.com/gizak/termui/v3/widgets"
"github.com/maticnetwork/polygon-cli/metrics"
"github.com/maticnetwork/polygon-cli/rpctypes"
"github.com/0xPolygon/polygon-cli/metrics"
"github.com/0xPolygon/polygon-cli/rpctypes"
"github.com/rs/zerolog/log"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/p2p/crawl/crawl.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/rs/zerolog/log"
"github.com/spf13/cobra"

"github.com/maticnetwork/polygon-cli/p2p"
"github.com/0xPolygon/polygon-cli/p2p"
)

type (
Expand Down
2 changes: 1 addition & 1 deletion cmd/p2p/crawl/crawl_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/ethereum/go-ethereum/p2p/enode"
"github.com/rs/zerolog/log"

"github.com/maticnetwork/polygon-cli/p2p"
"github.com/0xPolygon/polygon-cli/p2p"
)

type crawler struct {
Expand Down
2 changes: 1 addition & 1 deletion cmd/p2p/nodelist/nodelist.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"encoding/json"
"os"

"github.com/maticnetwork/polygon-cli/p2p/database"
"github.com/0xPolygon/polygon-cli/p2p/database"
"github.com/spf13/cobra"
)

Expand Down
10 changes: 5 additions & 5 deletions cmd/p2p/p2p.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import (

_ "embed"

"github.com/maticnetwork/polygon-cli/cmd/p2p/crawl"
"github.com/maticnetwork/polygon-cli/cmd/p2p/nodelist"
"github.com/maticnetwork/polygon-cli/cmd/p2p/ping"
"github.com/maticnetwork/polygon-cli/cmd/p2p/query"
"github.com/maticnetwork/polygon-cli/cmd/p2p/sensor"
"github.com/0xPolygon/polygon-cli/cmd/p2p/crawl"
"github.com/0xPolygon/polygon-cli/cmd/p2p/nodelist"
"github.com/0xPolygon/polygon-cli/cmd/p2p/ping"
"github.com/0xPolygon/polygon-cli/cmd/p2p/query"
"github.com/0xPolygon/polygon-cli/cmd/p2p/sensor"
)

//go:embed usage.md
Expand Down
2 changes: 1 addition & 1 deletion cmd/p2p/ping/ping.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/rs/zerolog/log"
"github.com/spf13/cobra"

"github.com/maticnetwork/polygon-cli/p2p"
"github.com/0xPolygon/polygon-cli/p2p"
)

type (
Expand Down
2 changes: 1 addition & 1 deletion cmd/p2p/query/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/rs/zerolog/log"
"github.com/spf13/cobra"

"github.com/maticnetwork/polygon-cli/p2p"
"github.com/0xPolygon/polygon-cli/p2p"
)

type (
Expand Down
6 changes: 3 additions & 3 deletions cmd/p2p/sensor/sensor.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ import (
"github.com/rs/zerolog/log"
"github.com/spf13/cobra"

"github.com/maticnetwork/polygon-cli/p2p"
"github.com/maticnetwork/polygon-cli/p2p/database"
"github.com/maticnetwork/polygon-cli/rpctypes"
"github.com/0xPolygon/polygon-cli/p2p"
"github.com/0xPolygon/polygon-cli/p2p/database"
"github.com/0xPolygon/polygon-cli/rpctypes"
)

type (
Expand Down
4 changes: 2 additions & 2 deletions cmd/p2p/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,6 @@ polycli p2p crawl nodes.json \
--network-id 137
```

[mainnet-genesis]: https://github.com/maticnetwork/bor/blob/master/builder/files/genesis-mainnet-v1.json
[mumbai-genesis]: https://github.com/maticnetwork/bor/blob/master/builder/files/genesis-testnet-v4.json
[mainnet-genesis]: https://github.com/0xPolygon/bor/blob/master/builder/files/genesis-mainnet-v1.json
[mumbai-genesis]: https://github.com/0xPolygon/bor/blob/master/builder/files/genesis-testnet-v4.json
[bootnodes]: https://wiki.polygon.technology/docs/pos/operate/node/full-node-binaries/#configure-bor-seeds-mainnet
2 changes: 1 addition & 1 deletion cmd/parseethwallet/parseethwallet.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"encoding/hex"
"encoding/json"
"fmt"
"github.com/maticnetwork/polygon-cli/gethkeystore"
"github.com/0xPolygon/polygon-cli/gethkeystore"
"io"
"os"
"strings"
Expand Down
Loading

0 comments on commit 971b28e

Please sign in to comment.