diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..796b96d1 --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +/build diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..21f4b03a --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,7 @@ +version: 2 +updates: + - package-ecosystem: "gomod" + directory: "/" + schedule: + interval: "daily" + target-branch: "main" diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml new file mode 100644 index 00000000..7ee8afbf --- /dev/null +++ b/.github/workflows/lint.yaml @@ -0,0 +1,19 @@ +name: Lint +on: + push: + pull_request: + +jobs: + lint: + name: Lint + runs-on: ubuntu-latest + steps: + - name: Setup Go + uses: actions/setup-go@v3 + with: + go-version: "1.21" + - uses: actions/checkout@v3 + - name: GolangCI Lint + uses: golangci/golangci-lint-action@v3 + with: + version: v1.55.2 diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 00000000..2f18149a --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,18 @@ +name: Test +on: + push: + pull_request: + +jobs: + test: + name: Test + runs-on: self-hosted + steps: + - name: Setup Go + uses: actions/setup-go@v3 + with: + go-version: "1.21" + - name: Checkout + uses: actions/checkout@v3 + - name: Test + run: make test diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..bd469677 --- /dev/null +++ b/.gitignore @@ -0,0 +1,32 @@ +### Visual Studio Code +.vscode/* + + +### JetBrains +.idea/* + +!.idea/icon.svg + +### Linux + +### Go template +*.exe +*.exe~ +*.dll +*.so +*.dylib + +# Test binary, built with `go test -c` +*.test + +# Output of the go coverage tool, specifically when used with LiteIDE +*.out + +# Go workspace file +go.work + +### macOS +.DS_Store + +### Project +/build/* diff --git a/.golangci.yaml b/.golangci.yaml new file mode 100644 index 00000000..5fa8a592 --- /dev/null +++ b/.golangci.yaml @@ -0,0 +1,32 @@ +run: + timeout: 10m + +linters: + enable: + # Enabled by default + - errcheck + - gosimple + - govet + - ineffassign + - staticcheck + - unused + # Disabled by default + - asasalint + - asciicheck + - bodyclose + - errorlint + - gci + - gocyclo + - gosec + - makezero + - noctx + - paralleltest + - prealloc + - reassign + - revive + - whitespace + - wsl + +issues: + max-issues-per-linter: 0 # Unlimited + max-same-issues: 0 # Unlimited diff --git a/.idea/icon.svg b/.idea/icon.svg new file mode 100644 index 00000000..5a1195b7 --- /dev/null +++ b/.idea/icon.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..539fe821 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,14 @@ +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.5.0 + hooks: + - id: end-of-file-fixer + - id: trailing-whitespace + - repo: https://github.com/golangci/golangci-lint + rev: v1.55.2 + hooks: + - id: golangci-lint + - repo: https://github.com/commitizen-tools/commitizen + rev: v2.42.1 + hooks: + - id: commitizen diff --git a/.run/build.run.xml b/.run/build.run.xml new file mode 100644 index 00000000..3571f78c --- /dev/null +++ b/.run/build.run.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/.run/image.run.xml b/.run/image.run.xml new file mode 100644 index 00000000..02ab4ec4 --- /dev/null +++ b/.run/image.run.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/.run/lint.run.xml b/.run/lint.run.xml new file mode 100644 index 00000000..015237cf --- /dev/null +++ b/.run/lint.run.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/.run/run.run.xml b/.run/run.run.xml new file mode 100644 index 00000000..b15b7471 --- /dev/null +++ b/.run/run.run.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/.run/test.run.xml b/.run/test.run.xml new file mode 100644 index 00000000..abf84a4c --- /dev/null +++ b/.run/test.run.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/CODEOWNERS b/CODEOWNERS new file mode 100644 index 00000000..35f9326e --- /dev/null +++ b/CODEOWNERS @@ -0,0 +1 @@ +* @polebug @kallydev diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..037adfcb --- /dev/null +++ b/Dockerfile @@ -0,0 +1,19 @@ +FROM golang:1.21.3-alpine AS builder + +WORKDIR /root/rss3-node + +COPY . . + +RUN apk add --no-cache git make gcc libc-dev + +RUN CGO_ENABLED=1 make build + +FROM alpine:3.18.4 AS runner + +WORKDIR /root/rss3-node + +RUN apk add --no-cache ca-certificates tzdata + +COPY --from=builder /root/rss3-node/build/rss3-node . + +ENTRYPOINT ["./rss3-node"] diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..18e4f0f5 --- /dev/null +++ b/Makefile @@ -0,0 +1,31 @@ +VERSION=$(shell git describe --tags --abbrev=0) +COMMIT=$(shell git rev-parse --short HEAD) + +ifeq ($(VERSION),) + VERSION="0.0.0" +endif + +generate: + go generate ./... + +lint: generate + go mod tidy + go run github.com/golangci/golangci-lint/cmd/golangci-lint@v1.55.2 run + +test: + go test -cover -v ./... + +.PHONY: build +build: generate + mkdir -p ./build + go build \ + -ldflags "-X github.com/naturalselectionlabs/rss3-node/internal/constant.Version=$(VERSION) -X github.com/naturalselectionlabs/rss3-node/internal/constant.Commit=$(COMMIT)" \ + -o ./build/rss3-node ./cmd + +image: generate + docker build \ + --tag naturalselectionlabs/rss3-node:$(VERSION) \ + . + +run: generate + ENVIRONMENT=development go run ./cmd diff --git a/README.md b/README.md new file mode 100644 index 00000000..c103fe44 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +# RSS3 Node diff --git a/cmd/main.go b/cmd/main.go new file mode 100644 index 00000000..9e17569f --- /dev/null +++ b/cmd/main.go @@ -0,0 +1,57 @@ +package main + +import ( + "context" + "fmt" + + "github.com/naturalselectionlabs/rss3-node/internal/config" + "github.com/naturalselectionlabs/rss3-node/internal/config/flag" + "github.com/naturalselectionlabs/rss3-node/internal/constant" + "github.com/naturalselectionlabs/rss3-node/internal/node" + "github.com/spf13/cobra" + "github.com/spf13/viper" + "go.uber.org/zap" +) + +var command = cobra.Command{ + Use: constant.Name, + Version: constant.BuildVersion(), + SilenceUsage: true, + SilenceErrors: true, + PreRunE: func(cmd *cobra.Command, args []string) error { + return viper.BindPFlags(cmd.Flags()) + }, + RunE: func(cmd *cobra.Command, _ []string) error { + config, err := config.Setup(viper.GetString(flag.KeyConfig)) + if err != nil { + return fmt.Errorf("setup config file: %w", err) + } + + server, err := node.NewServer(config.Node) + if err != nil { + return fmt.Errorf("build node server: %w", err) + } + + return server.Run(cmd.Context()) + }, +} + +func initializeLogger() { + if viper.GetString(config.Environment) == config.EnvironmentDevelopment { + zap.ReplaceGlobals(zap.Must(zap.NewDevelopment())) + } else { + zap.ReplaceGlobals(zap.Must(zap.NewProduction())) + } +} + +func init() { + initializeLogger() + + command.PersistentFlags().String(flag.KeyConfig, "./deploy/config.development.yaml", "config file path") +} + +func main() { + if err := command.ExecuteContext(context.Background()); err != nil { + zap.L().Fatal("execute command", zap.Error(err)) + } +} diff --git a/deploy/config.development.yaml b/deploy/config.development.yaml new file mode 100644 index 00000000..6e5128aa --- /dev/null +++ b/deploy/config.development.yaml @@ -0,0 +1,5 @@ +environment: development +node: + network: arweave + chain: mainnet + endpoint: https://ethereum.blockpi.network/v1/rpc/public diff --git a/go.mod b/go.mod new file mode 100644 index 00000000..09b5d663 --- /dev/null +++ b/go.mod @@ -0,0 +1,62 @@ +module github.com/naturalselectionlabs/rss3-node + +go 1.21 + +require ( + github.com/ethereum/go-ethereum v1.13.5 + github.com/samber/lo v1.38.1 + github.com/shopspring/decimal v1.3.1 + github.com/sourcegraph/conc v0.3.0 + github.com/spf13/cobra v1.8.0 + github.com/spf13/viper v1.17.0 + github.com/stretchr/testify v1.8.4 + go.uber.org/zap v1.26.0 +) + +require ( + github.com/Microsoft/go-winio v0.6.1 // indirect + github.com/StackExchange/wmi v1.2.1 // indirect + github.com/bits-and-blooms/bitset v1.7.0 // indirect + github.com/btcsuite/btcd/btcec/v2 v2.2.0 // indirect + github.com/consensys/bavard v0.1.13 // indirect + github.com/consensys/gnark-crypto v0.12.1 // indirect + github.com/crate-crypto/go-kzg-4844 v0.7.0 // indirect + github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/deckarep/golang-set/v2 v2.1.0 // indirect + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect + github.com/ethereum/c-kzg-4844 v0.4.0 // indirect + github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/go-ole/go-ole v1.2.5 // indirect + github.com/go-stack/stack v1.8.1 // indirect + github.com/gorilla/websocket v1.4.2 // indirect + github.com/hashicorp/hcl v1.0.0 // indirect + github.com/holiman/uint256 v1.2.3 // indirect + github.com/inconshreveable/mousetrap v1.1.0 // indirect + github.com/magiconair/properties v1.8.7 // indirect + github.com/mattn/go-isatty v0.0.19 // indirect + github.com/mitchellh/mapstructure v1.5.0 // indirect + github.com/mmcloughlin/addchain v0.4.0 // indirect + github.com/pelletier/go-toml/v2 v2.1.0 // indirect + github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect + github.com/sagikazarmark/locafero v0.3.0 // indirect + github.com/sagikazarmark/slog-shim v0.1.0 // indirect + github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible // indirect + github.com/spf13/afero v1.10.0 // indirect + github.com/spf13/cast v1.5.1 // indirect + github.com/spf13/pflag v1.0.5 // indirect + github.com/subosito/gotenv v1.6.0 // indirect + github.com/supranational/blst v0.3.11 // indirect + github.com/tklauser/go-sysconf v0.3.12 // indirect + github.com/tklauser/numcpus v0.6.1 // indirect + go.uber.org/multierr v1.11.0 // indirect + golang.org/x/crypto v0.15.0 // indirect + golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa // indirect + golang.org/x/mod v0.14.0 // indirect + golang.org/x/sync v0.5.0 // indirect + golang.org/x/sys v0.14.0 // indirect + golang.org/x/text v0.14.0 // indirect + golang.org/x/tools v0.15.0 // indirect + gopkg.in/ini.v1 v1.67.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect + rsc.io/tmplfunc v0.0.3 // indirect +) diff --git a/go.sum b/go.sum new file mode 100644 index 00000000..0ed05b3c --- /dev/null +++ b/go.sum @@ -0,0 +1,666 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= +cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= +cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.44.3/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= +cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= +cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= +cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= +cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= +cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= +cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= +cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= +cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= +cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= +cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= +cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= +cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY= +cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= +cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= +cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= +cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= +cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= +cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= +cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= +cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= +cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= +cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= +cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= +cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= +cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= +cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= +cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= +cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= +cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= +cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/DataDog/zstd v1.4.5 h1:EndNeuB0l9syBZhut0wns3gV1hL8zX8LIu6ZiVHWLIQ= +github.com/DataDog/zstd v1.4.5/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo= +github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= +github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= +github.com/StackExchange/wmi v1.2.1 h1:VIkavFPXSjcnS+O8yTq7NI32k0R5Aj+v39y29VYDOSA= +github.com/StackExchange/wmi v1.2.1/go.mod h1:rcmrprowKIVzvc+NUiLncP2uuArMWLCbu9SBzvHz7e8= +github.com/VictoriaMetrics/fastcache v1.12.1 h1:i0mICQuojGDL3KblA7wUNlY5lOK6a4bwt3uRKnkZU40= +github.com/VictoriaMetrics/fastcache v1.12.1/go.mod h1:tX04vaqcNoQeGLD+ra5pU5sWkuxnzWhEzLwhP9w653o= +github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= +github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +github.com/bits-and-blooms/bitset v1.7.0 h1:YjAGVd3XmtK9ktAbX8Zg2g2PwLIMjGREZJHlV4j7NEo= +github.com/bits-and-blooms/bitset v1.7.0/go.mod h1:gIdJ4wp64HaoK2YrL1Q5/N7Y16edYb8uY+O0FJTyyDA= +github.com/btcsuite/btcd/btcec/v2 v2.2.0 h1:fzn1qaOt32TuLjFlkzYSsBC35Q3KUjT1SwPxiMSCF5k= +github.com/btcsuite/btcd/btcec/v2 v2.2.0/go.mod h1:U7MHm051Al6XmscBQ0BoNydpOTsFAn707034b5nY8zU= +github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U= +github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= +github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cockroachdb/errors v1.8.1 h1:A5+txlVZfOqFBDa4mGz2bUWSp0aHElvHX2bKkdbQu+Y= +github.com/cockroachdb/errors v1.8.1/go.mod h1:qGwQn6JmZ+oMjuLwjWzUNqblqk0xl4CVV3SQbGwK7Ac= +github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f h1:o/kfcElHqOiXqcou5a3rIlMc7oJbMQkeLk0VQJ7zgqY= +github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f/go.mod h1:i/u985jwjWRlyHXQbwatDASoW0RMlZ/3i9yJHE2xLkI= +github.com/cockroachdb/pebble v0.0.0-20230928194634-aa077af62593 h1:aPEJyR4rPBvDmeyi+l/FS/VtA00IWvjeFvjen1m1l1A= +github.com/cockroachdb/pebble v0.0.0-20230928194634-aa077af62593/go.mod h1:6hk1eMY/u5t+Cf18q5lFMUA1Rc+Sm5I6Ra1QuPyxXCo= +github.com/cockroachdb/redact v1.0.8 h1:8QG/764wK+vmEYoOlfobpe12EQcS81ukx/a4hdVMxNw= +github.com/cockroachdb/redact v1.0.8/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= +github.com/cockroachdb/sentry-go v0.6.1-cockroachdb.2 h1:IKgmqgMQlVJIZj19CdocBeSfSaiCbEBZGKODaixqtHM= +github.com/cockroachdb/sentry-go v0.6.1-cockroachdb.2/go.mod h1:8BT+cPK6xvFOcRlk0R8eg+OTkcqI6baNH4xAkpiYVvQ= +github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= +github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= +github.com/consensys/bavard v0.1.13 h1:oLhMLOFGTLdlda/kma4VOJazblc7IM5y5QPd2A/YjhQ= +github.com/consensys/bavard v0.1.13/go.mod h1:9ItSMtA/dXMAiL7BG6bqW2m3NdSEObYWoH223nGHukI= +github.com/consensys/gnark-crypto v0.12.1 h1:lHH39WuuFgVHONRl3J0LRBtuYdQTumFSDtJF7HpyG8M= +github.com/consensys/gnark-crypto v0.12.1/go.mod h1:v2Gy7L/4ZRosZ7Ivs+9SfUDr0f5UlG+EM5t7MPHiLuY= +github.com/cpuguy83/go-md2man/v2 v2.0.3 h1:qMCsGGgs+MAzDFyp9LpAe1Lqy/fY/qCovCm0qnXZOBM= +github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/crate-crypto/go-kzg-4844 v0.7.0 h1:C0vgZRk4q4EZ/JgPfzuSoxdCq3C3mOZMBShovmncxvA= +github.com/crate-crypto/go-kzg-4844 v0.7.0/go.mod h1:1kMhvPgI0Ky3yIa+9lFySEBUBXkYxeOi8ZF1sYioxhc= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/deckarep/golang-set/v2 v2.1.0 h1:g47V4Or+DUdzbs8FxCCmgb6VYd+ptPAngjM6dtGktsI= +github.com/deckarep/golang-set/v2 v2.1.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= +github.com/decred/dcrd/crypto/blake256 v1.0.0 h1:/8DMNYp9SGi5f0w7uCm6d6M4OU2rGFK09Y2A4Xv7EE0= +github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 h1:YLtO71vCjJRCBcrPMtQ9nqBsqpA1m5sE92cU+pd5Mcc= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1/go.mod h1:hyedUtir6IdtD/7lIxGeCxkaw7y45JueMRL4DIyJDKs= +github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= +github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/ethereum/c-kzg-4844 v0.4.0 h1:3MS1s4JtA868KpJxroZoepdV0ZKBp3u/O5HcZ7R3nlY= +github.com/ethereum/c-kzg-4844 v0.4.0/go.mod h1:VewdlzQmpT5QSrVhbBuGoCdFJkpaJlO1aQputP83wc0= +github.com/ethereum/go-ethereum v1.13.5 h1:U6TCRciCqZRe4FPXmy1sMGxTfuk8P7u2UoinF3VbaFk= +github.com/ethereum/go-ethereum v1.13.5/go.mod h1:yMTu38GSuyxaYzQMViqNmQ1s3cE84abZexQmTgenWk0= +github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5 h1:FtmdgXiUlNeRsoNMFlKLDt+S+6hbjVMEW6RGQ7aUf7c= +github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= +github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= +github.com/frankban/quicktest v1.14.4/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= +github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= +github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= +github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff h1:tY80oXqGNY4FhTFhk+o9oFHGINQ/+vhlm8HFzi6znCI= +github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= +github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-ole/go-ole v1.2.5 h1:t4MGB5xEDZvXI+0rMjjsfBsD7yAgp/s9ZDkL1JndXwY= +github.com/go-ole/go-ole v1.2.5/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= +github.com/go-stack/stack v1.8.1 h1:ntEHSVwIt7PNXNpgPmVfMrNhLtgjlmnZha2kOpuRiDw= +github.com/go-stack/stack v1.8.1/go.mod h1:dcoOX6HbPZSZptuspn9bctJ+N/CnF5gGygcUP3XYfe4= +github.com/gofrs/flock v0.8.1 h1:+gYjHKf32LDeiEEFhQaotPbLuUXjY5ZqxKgXy7n59aw= +github.com/gofrs/flock v0.8.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= +github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= +github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= +github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= +github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= +github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= +github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb h1:PBC98N2aIaM3XXiurYmW7fx4GZkL8feAMVq7nEjURHk= +github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/google/subcommands v1.2.0/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk= +github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= +github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= +github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= +github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= +github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc= +github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/hashicorp/go-bexpr v0.1.10 h1:9kuI5PFotCboP3dkDYFr/wi0gg0QVbSNz5oFRpxn4uE= +github.com/hashicorp/go-bexpr v0.1.10/go.mod h1:oxlubA2vC/gFVfX1A6JGp7ls7uCDlfJn732ehYYg+g0= +github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= +github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/holiman/billy v0.0.0-20230718173358-1c7e68d277a7 h1:3JQNjnMRil1yD0IfZKHF9GxxWKDJGj8I0IqOUol//sw= +github.com/holiman/billy v0.0.0-20230718173358-1c7e68d277a7/go.mod h1:5GuXa7vkL8u9FkFuWdVvfR5ix8hRB7DbOAaYULamFpc= +github.com/holiman/bloomfilter/v2 v2.0.3 h1:73e0e/V0tCydx14a0SCYS/EWCxgwLZ18CZcZKVu0fao= +github.com/holiman/bloomfilter/v2 v2.0.3/go.mod h1:zpoh+gs7qcpqrHr3dB55AMiJwo0iURXE7ZOP9L9hSkA= +github.com/holiman/uint256 v1.2.3 h1:K8UWO1HUJpRMXBxbmaY1Y8IAMZC/RsKB+ArEnnK4l5o= +github.com/holiman/uint256 v1.2.3/go.mod h1:SC8Ryt4n+UBbPbIBKaG9zbbDlp4jOru9xFZmPzLUTxw= +github.com/huin/goupnp v1.3.0 h1:UvLUlWDNpoUdYzb2TCn+MuTWtcjXKSza2n6CBdQ0xXc= +github.com/huin/goupnp v1.3.0/go.mod h1:gnGPsThkYa7bFi/KWmEysQRf48l2dvR5bxr2OFckNX8= +github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= +github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= +github.com/jackpal/go-nat-pmp v1.0.2 h1:KzKSgb7qkJvOUTqYl9/Hg/me3pWgBmERKrTGD7BdWus= +github.com/jackpal/go-nat-pmp v1.0.2/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= +github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/klauspost/compress v1.17.0 h1:Rnbp4K9EjcDuVuHtd0dgA4qNuv9yKDYKK1ulpJwgrqM= +github.com/klauspost/compress v1.17.0/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= +github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= +github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= +github.com/leanovate/gopter v0.2.9 h1:fQjYxZaynp97ozCzfOyOuAGOU4aU/z37zf/tOujFk7c= +github.com/leanovate/gopter v0.2.9/go.mod h1:U2L/78B+KVFIx2VmW6onHJQzXtFb+p5y3y2Sh+Jxxv8= +github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= +github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= +github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= +github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= +github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= +github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/mattn/go-runewidth v0.0.13 h1:lTGmDsbAYt5DmK6OnoV7EuIF1wEIFAcxld6ypU4OSgU= +github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= +github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 h1:I0XW9+e1XWDxdcEniV4rQAIOPUGDq67JSCiRCgGCZLI= +github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= +github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= +github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/pointerstructure v1.2.0 h1:O+i9nHnXS3l/9Wu7r4NrEdwA2VFTicjUEN1uBnDo34A= +github.com/mitchellh/pointerstructure v1.2.0/go.mod h1:BRAsLI5zgXmw97Lf6s25bs8ohIXc3tViBH44KcwB2g4= +github.com/mmcloughlin/addchain v0.4.0 h1:SobOdjm2xLj1KkXN5/n0xTIWyZA2+s99UCY1iPfkHRY= +github.com/mmcloughlin/addchain v0.4.0/go.mod h1:A86O+tHqZLMNO4w6ZZ4FlVQEadcoqkyU72HC5wJ4RlU= +github.com/mmcloughlin/profile v0.1.1/go.mod h1:IhHD7q1ooxgwTgjxQYkACGA77oFTDdFVejUS1/tS/qU= +github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= +github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= +github.com/pelletier/go-toml/v2 v2.1.0 h1:FnwAJ4oYMvbT/34k9zzHuZNrhlz48GB3/s6at6/MHO4= +github.com/pelletier/go-toml/v2 v2.1.0/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prometheus/client_golang v1.12.0 h1:C+UIj/QWtmqY13Arb8kwMt5j34/0Z2iKamrJ+ryC0Gg= +github.com/prometheus/client_golang v1.12.0/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.2.1-0.20210607210712-147c58e9608a h1:CmF68hwI0XsOQ5UwlBopMi2Ow4Pbg32akc4KIVCOm+Y= +github.com/prometheus/client_model v0.2.1-0.20210607210712-147c58e9608a/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= +github.com/prometheus/common v0.32.1 h1:hWIdL3N2HoUx3B8j3YN9mWor0qhY/NlEKZEaXxuIRh4= +github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= +github.com/prometheus/procfs v0.7.3 h1:4jVXhlkAyzOScmCkXBTOLRLTz8EeU+eyjrwB/EPq0VU= +github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= +github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= +github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= +github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= +github.com/rs/cors v1.7.0 h1:+88SsELBHx5r+hZ8TCkggzSstaWNbDvThkVK8H6f9ik= +github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= +github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= +github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/sagikazarmark/locafero v0.3.0 h1:zT7VEGWC2DTflmccN/5T1etyKvxSxpHsjb9cJvm4SvQ= +github.com/sagikazarmark/locafero v0.3.0/go.mod h1:w+v7UsPNFwzF1cHuOajOOzoq4U7v/ig1mpRjqV+Bu1U= +github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6gto+ugjYE= +github.com/sagikazarmark/slog-shim v0.1.0/go.mod h1:SrcSrq8aKtyuqEI1uvTDTK1arOWRIczQRv+GVI1AkeQ= +github.com/samber/lo v1.38.1 h1:j2XEAqXKb09Am4ebOg31SpvzUTTs6EN3VfgeLUhPdXM= +github.com/samber/lo v1.38.1/go.mod h1:+m/ZKRl6ClXCE2Lgf3MsQlWfh4bn1bz6CXEOxnEXnEA= +github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible h1:Bn1aCHHRnjv4Bl16T8rcaFjYSrGrIZvpiGO6P3Q4GpU= +github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= +github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8= +github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= +github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo= +github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0= +github.com/spf13/afero v1.10.0 h1:EaGW2JJh15aKOejeuJ+wpFSHnbd7GE6Wvp3TsNhb6LY= +github.com/spf13/afero v1.10.0/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ= +github.com/spf13/cast v1.5.1 h1:R+kOtfhWQE6TVQzY+4D7wJLBgkdVasCEFxSUBYBYIlA= +github.com/spf13/cast v1.5.1/go.mod h1:b9PdjNptOpzXr7Rq1q9gJML/2cdGQAo69NKzQ10KN48= +github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= +github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/viper v1.17.0 h1:I5txKw7MJasPL/BrfkbA0Jyo/oELqVmux4pR/UxOMfI= +github.com/spf13/viper v1.17.0/go.mod h1:BmMMMLQXSbcHK6KAOiFLz0l5JHrU89OdIRHvsk0+yVI= +github.com/status-im/keycard-go v0.2.0 h1:QDLFswOQu1r5jsycloeQh3bVU8n/NatHHaZobtDnDzA= +github.com/status-im/keycard-go v0.2.0/go.mod h1:wlp8ZLbsmrF6g6WjugPAx+IzoLrkdf9+mHxBEeo3Hbg= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= +github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= +github.com/supranational/blst v0.3.11 h1:LyU6FolezeWAhvQk0k6O/d49jqgO52MSDDfYgbeoEm4= +github.com/supranational/blst v0.3.11/go.mod h1:jZJtfjgudtNl4en1tzwPIV3KjUnQUvG3/j+w+fVonLw= +github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY= +github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= +github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU= +github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI= +github.com/tklauser/numcpus v0.6.1 h1:ng9scYS7az0Bk4OZLvrNXNSAO2Pxr1XXRAPyjhIx+Fk= +github.com/tklauser/numcpus v0.6.1/go.mod h1:1XfjsgE2zo8GVw7POkMbHENHzVg3GzmoZ9fESEdAacY= +github.com/tyler-smith/go-bip39 v1.1.0 h1:5eUemwrMargf3BSLRRCalXT93Ns6pQJIjYQN2nyfOP8= +github.com/tyler-smith/go-bip39 v1.1.0/go.mod h1:gUYDtqQw1JS3ZJ8UWVcGTGqqr6YIN3CWg+kkNaLt55U= +github.com/urfave/cli/v2 v2.25.7 h1:VAzn5oq403l5pHjc4OhD54+XGO9cdKVL/7lDjF+iKUs= +github.com/urfave/cli/v2 v2.25.7/go.mod h1:8qnjx1vcq5s2/wpsqoZFndg2CE5tNFyrTvS6SinrnYQ= +github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU= +github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8= +github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= +go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= +go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= +go.uber.org/goleak v1.2.0 h1:xqgm/S+aQvhWFTtR0XK3Jvg7z8kGV8P4X14IzwN3Eqk= +go.uber.org/goleak v1.2.0/go.mod h1:XJYK+MuIchqpmGmUSAzotztawfKvYLUIgg7guXrwVUo= +go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= +go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= +go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= +go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= +golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.15.0 h1:frVn1TEaCEaZcn3Tmd7Y2b5KKPaZ+I32Q2OA3kYp5TA= +golang.org/x/crypto v0.15.0/go.mod h1:4ChreQoLWfG3xLDer1WdlH5NdlQ3+mwnQq1YTKY+72g= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= +golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= +golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= +golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= +golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa h1:FRnLl4eNAQl8hwxVVC17teOw8kdjVDVAiFMtgUdTSRQ= +golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa/go.mod h1:zk2irFbV9DP96SEBUUAy67IdHUaZuSnrz1n472HUCLE= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= +golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= +golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= +golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0= +golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE= +golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.14.0 h1:Vz7Qs629MkJkGyHxUlRHizWJRG2j8fbQKjELVSNhy7Q= +golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= +golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= +golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= +golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= +golang.org/x/tools v0.15.0 h1:zdAyfUGbYmuVokhzVmghFl2ZJh5QhcfebBgmVPFYA+8= +golang.org/x/tools v0.15.0/go.mod h1:hpksKq4dtpQWS1uQ61JkdqWM3LscIS6Slf+VVkm+wQk= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= +google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= +google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= +google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= +google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= +google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= +google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= +google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= +google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= +google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= +google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= +google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= +google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= +google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= +google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= +google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= +gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/natefinch/lumberjack.v2 v2.0.0 h1:1Lc07Kr7qY4U2YPouBjpCLxpiyxIVoxqXgkXLknAOE8= +gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= +rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= +rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= +rsc.io/tmplfunc v0.0.3 h1:53XFQh69AfOa8Tw0Jm7t+GV7KZhOi6jzsCzTtKbMvzU= +rsc.io/tmplfunc v0.0.3/go.mod h1:AG3sTPzElb1Io3Yg4voV9AGZJuleGAwaVRxL9M49PhA= diff --git a/internal/config/config.go b/internal/config/config.go new file mode 100644 index 00000000..a674d27d --- /dev/null +++ b/internal/config/config.go @@ -0,0 +1,39 @@ +package config + +import ( + "fmt" + + "github.com/naturalselectionlabs/rss3-node/internal/engine" + "github.com/spf13/viper" +) + +const ( + Environment = "environment" + + EnvironmentDevelopment = "development" + EnvironmentProduction = "production" +) + +type File struct { + Environment string `mapstructure:"environment"` + Node *engine.Config `mapstructure:"node"` +} + +func Setup(configFilePath string) (*File, error) { + viper.SetConfigFile(configFilePath) + + if err := viper.ReadInConfig(); err != nil { + return nil, fmt.Errorf("read config file: %w", err) + } + + var configFile File + if err := viper.Unmarshal(&configFile); err != nil { + return nil, fmt.Errorf("unmarshal config file: %w", err) + } + + return &configFile, nil +} + +func init() { + viper.AutomaticEnv() +} diff --git a/internal/config/flag/config.go b/internal/config/flag/config.go new file mode 100644 index 00000000..0ca38e99 --- /dev/null +++ b/internal/config/flag/config.go @@ -0,0 +1,5 @@ +package flag + +var ( + KeyConfig = "config" +) diff --git a/internal/constant/version.go b/internal/constant/version.go new file mode 100644 index 00000000..fca8fc44 --- /dev/null +++ b/internal/constant/version.go @@ -0,0 +1,23 @@ +package constant + +import "fmt" + +const Name = "rss3-node" + +// The Go compiler will set these variables via ldflags. +var ( + Version string + Commit string +) + +func BuildVersion() string { + if Version == "" { + Version = "0.0.0" + } + + if Commit == "" { + Commit = "000000" + } + + return fmt.Sprintf("%s (%s)", Version, Commit) +} diff --git a/internal/engine/config.go b/internal/engine/config.go new file mode 100644 index 00000000..81a0747d --- /dev/null +++ b/internal/engine/config.go @@ -0,0 +1,7 @@ +package engine + +type Config struct { + Network string `mapstructure:"network"` + Chain string `mapstructure:"chain"` + Endpoint string `mapstructure:"endpoint"` +} diff --git a/internal/engine/source.go b/internal/engine/source.go new file mode 100644 index 00000000..216186c1 --- /dev/null +++ b/internal/engine/source.go @@ -0,0 +1,12 @@ +package engine + +import ( + "context" + + "github.com/naturalselectionlabs/rss3-node/schema/filter" +) + +type Source interface { + Chain() filter.Chain + Start(ctx context.Context, tasksChan chan<- []Task, errorChan chan<- error) +} diff --git a/internal/engine/source/ethereum/config.go b/internal/engine/source/ethereum/config.go new file mode 100644 index 00000000..88a1868a --- /dev/null +++ b/internal/engine/source/ethereum/config.go @@ -0,0 +1,10 @@ +package ethereum + +import ( + "math/big" +) + +type Config struct { // TODO Implement support for customizable configurations. + BlockNumberStart *big.Int + BlockNumberTarget *big.Int +} diff --git a/internal/engine/source/ethereum/source.go b/internal/engine/source/ethereum/source.go new file mode 100644 index 00000000..e7444343 --- /dev/null +++ b/internal/engine/source/ethereum/source.go @@ -0,0 +1,161 @@ +package ethereum + +import ( + "context" + "fmt" + "math/big" + "time" + + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/ethclient" + "github.com/ethereum/go-ethereum/rpc" + "github.com/naturalselectionlabs/rss3-node/internal/engine" + "github.com/naturalselectionlabs/rss3-node/provider/ethereum" + "github.com/naturalselectionlabs/rss3-node/schema/filter" + "github.com/samber/lo" + "go.uber.org/zap" +) + +const ( + // The block time in Ethereum mainnet is designed to be approximately 15 seconds. + defaultBlockTime = 15 * time.Second +) + +var _ engine.Source = (*source)(nil) + +type source struct { + config *engine.Config + ethereumClient *ethclient.Client + state *State +} + +func (s *source) Chain() filter.Chain { + return filter.ChainEthereumMainnet +} + +func (s *source) Start(ctx context.Context, tasksChan chan<- []engine.Task, errorChan chan<- error) { + if err := s.initialize(ctx); err != nil { + errorChan <- fmt.Errorf("initialize source: %w", err) + + return + } + + go func() { + errorChan <- s.pollBlocks(ctx, tasksChan) + }() +} + +func (s *source) initialize(ctx context.Context) (err error) { + // TODO Load state from checkpoint. + s.state = &State{ + ChainID: filter.ChainEthereumMainnet.ID(), + BlockHash: ethereum.HashGenesis, + BlockNumber: 0, + } + + if s.ethereumClient, err = ethclient.Dial(s.config.Endpoint); err != nil { + return fmt.Errorf("dial rpc endpoint: %w", err) + } + + if s.ethereumClient, err = ethclient.Dial(s.config.Endpoint); err != nil { + return fmt.Errorf("dial ethereum endpoint: %w", err) + } + + chainID, err := s.ethereumClient.ChainID(ctx) + if err != nil { + return fmt.Errorf("get chain id: %w", err) + } + + if s.Chain().ID() != chainID.Uint64() { + return fmt.Errorf("mismatch between local chain id %d and remote chain id %d", s.Chain().ID(), chainID.Uint64()) + } + + return nil +} + +func (s *source) pollBlocks(ctx context.Context, tasksChan chan<- []engine.Task) error { + var blockNumberLatestLocal uint64 + + // TODO End polling at completion if target block height is specified. + for { + // The local block number is equal than the remote block number. + if s.state.BlockNumber >= blockNumberLatestLocal || blockNumberLatestLocal == 0 { + // Refresh the remote block number. + blockNumberLatestRemote, err := s.ethereumClient.BlockNumber(ctx) + if err != nil { + return fmt.Errorf("get latest block number: %w", err) + } + + // RPC providers may incorrectly shunt the request to a lagging node. + if blockNumberLatestRemote <= blockNumberLatestLocal { + zap.L().Info("waiting new block", zap.Uint64("block.number.local", s.state.BlockNumber), zap.Uint64("block.number.remote", blockNumberLatestLocal), zap.Duration("block.time", defaultBlockTime)) + + time.Sleep(defaultBlockTime) + } else { + // TODO Need to handle block reorganization. + blockNumberLatestLocal = blockNumberLatestRemote + } + + continue + } + + block, err := s.ethereumClient.BlockByNumber(ctx, new(big.Int).SetUint64(s.state.BlockNumber)) + if err != nil { + return fmt.Errorf("get block by number %d: %w", s.state.BlockNumber, err) + } + + // Before being able to handle block reorganization, correctly handle canonical. + receipts, err := s.ethereumClient.BlockReceipts(ctx, rpc.BlockNumberOrHashWithHash(block.Hash(), true)) + if err != nil { + return fmt.Errorf("get receipts by block hash %s: %w", block.Hash(), err) + } + + tasks, err := s.buildTasks(block, receipts) + if err != nil { + return fmt.Errorf("build tasks for block hash: %s: %w", block.Hash(), err) + } + + // TODO It might be possible to use generics to avoid manual type assertions. + tasksChan <- lo.Map(tasks, func(task *Task, _ int) engine.Task { return task }) + + // Update local block number. + s.state.BlockNumber++ + } +} + +func (s *source) buildTasks(block *types.Block, receipts types.Receipts) ([]*Task, error) { + tasks := make([]*Task, len(block.Transactions())) + + for index, transaction := range block.Transactions() { + // There is no guarantee that the receipts provided by RPC will be in the same order as the transactions, + // so instead of using a transaction index, we can match the hash. + receipt, exists := lo.Find(receipts, func(receipt *types.Receipt) bool { + return receipt.TxHash == transaction.Hash() + }) + + // TODO Often this is also caused by a lagging RPC node failing to get the latest data, + // and it's best to fix this before the build task. + if !exists { + return nil, fmt.Errorf("no receipt matched to transaction hash %s", transaction.Hash()) + } + + task := Task{ + Chain: filter.ChainEthereum(s.state.ChainID), + Header: block.Header(), + Transaction: transaction, + Receipt: receipt, + } + + tasks[index] = &task + } + + return tasks, nil +} + +func NewSource(config *engine.Config) (engine.Source, error) { + instance := source{ + config: config, + } + + return &instance, nil +} diff --git a/internal/engine/source/ethereum/source_test.go b/internal/engine/source/ethereum/source_test.go new file mode 100644 index 00000000..be504903 --- /dev/null +++ b/internal/engine/source/ethereum/source_test.go @@ -0,0 +1,80 @@ +package ethereum_test + +import ( + "context" + "sync" + "testing" + + "github.com/naturalselectionlabs/rss3-node/internal/engine" + "github.com/naturalselectionlabs/rss3-node/internal/engine/source/ethereum" + "github.com/stretchr/testify/require" + "go.uber.org/zap" + "go.uber.org/zap/zaptest" +) + +var initializeOnce sync.Once + +func initialize(t *testing.T) { + initializeOnce.Do(func() { + zap.ReplaceGlobals(zaptest.NewLogger(t)) + }) +} + +func TestSource(t *testing.T) { + t.Parallel() + + initialize(t) + + type arguments struct { + config *engine.Config + } + + testcases := []struct { + name string + arguments arguments + want require.ValueAssertionFunc + wantError require.ErrorAssertionFunc + }{ + // TODO Implement a solution to configure custom block number ranges for source. + // { + // name: "From block number 15537393 to 15537398", + // want: func(t require.TestingT, actual interface{}, msgAndArgs ...interface{}) { + // tasks, ok := actual.([]engine.Task) + // require.True(t, ok, "invalid tasks type: %T", actual) + // + // require.Len(t, tasks, 5, "invalid tasks length") + // }, + // }, + } + + for _, testcase := range testcases { + testcase := testcase + + t.Run(testcase.name, func(t *testing.T) { + t.Parallel() + + instance, err := ethereum.NewSource(testcase.arguments.config) + require.NoError(t, err, "new ethereum source") + + var ( + tasksChan = make(chan []engine.Task, 1) + errorChan = make(chan error) + ) + + instance.Start(context.Background(), tasksChan, errorChan) + + for { + select { + case tasks := <-tasksChan: + for _, task := range tasks { + t.Logf("Task %s", task.ID()) + } + case err := <-errorChan: + require.NoError(t, err) + + return + } + } + }) + } +} diff --git a/internal/engine/source/ethereum/state.go b/internal/engine/source/ethereum/state.go new file mode 100644 index 00000000..8f7a093f --- /dev/null +++ b/internal/engine/source/ethereum/state.go @@ -0,0 +1,11 @@ +package ethereum + +import ( + "github.com/ethereum/go-ethereum/common" +) + +type State struct { + ChainID uint64 `json:"chain_id"` + BlockHash common.Hash `json:"block_hash"` + BlockNumber uint64 `json:"block_number"` +} diff --git a/internal/engine/source/ethereum/task.go b/internal/engine/source/ethereum/task.go new file mode 100644 index 00000000..dc36d4fe --- /dev/null +++ b/internal/engine/source/ethereum/task.go @@ -0,0 +1,99 @@ +package ethereum + +import ( + "fmt" + "math/big" + + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/naturalselectionlabs/rss3-node/internal/engine" + "github.com/naturalselectionlabs/rss3-node/provider/ethereum" + "github.com/naturalselectionlabs/rss3-node/schema" + "github.com/naturalselectionlabs/rss3-node/schema/filter" + "github.com/shopspring/decimal" +) + +const defaultFeeDecimal = 18 + +var _ engine.Task = (*Task)(nil) + +type Task struct { + Chain filter.ChainEthereum + Header *types.Header + Transaction *types.Transaction + TransactionIndex uint + Receipt *types.Receipt +} + +func (t Task) ID() string { + return fmt.Sprintf("%s.%s.%s", t.Chain.Network(), t.Chain, t.Transaction.Hash()) +} + +func (t Task) Network() filter.Network { + return t.Chain.Network() +} + +func (t Task) Timestamp() uint64 { + return t.Header.Time +} + +func (t Task) Validate() error { + // TODO Implement it. + return nil +} + +func (t Task) BuildFeed( /* TODO Implementing options. */ ) (*schema.Feed, error) { + var to common.Address + + if t.Transaction.To() == nil { + // The Nethermind node may be missing this field, + // Reference https://github.com/NethermindEth/nethermind/issues/5823. + if t.Receipt.ContractAddress == ethereum.AddressGenesis { + return nil, fmt.Errorf("invalid receipt %s", t.Transaction.Hash().String()) + } + + to = t.Receipt.ContractAddress + } else { + to = *t.Transaction.To() + } + + from, err := types.LatestSignerForChainID(t.Transaction.ChainId()).Sender(t.Transaction) + if err != nil { + return nil, fmt.Errorf("recovery transaction sender: %w", err) + } + + feeAmount, err := t.buildFee() + if err != nil { + return nil, fmt.Errorf("build fee: %w", err) + } + + feed := schema.Feed{ + ID: t.Transaction.Hash().String(), + Chain: t.Chain, + Index: t.TransactionIndex, + From: from.String(), + To: to.String(), + Type: filter.TypeUnknown, + Fee: schema.Fee{ + Amount: decimal.NewFromBigInt(feeAmount, 0), + Decimal: defaultFeeDecimal, + }, + Actions: make([]schema.Action, 0), + Status: t.Receipt.Status == types.ReceiptStatusSuccessful, + Timestamp: t.Header.Time, + } + + return &feed, nil +} + +func (t Task) buildFee() (*big.Int, error) { + switch t.Receipt.Type { + case types.LegacyTxType, types.AccessListTxType: + return new(big.Int).Mul(t.Transaction.GasPrice(), new(big.Int).SetUint64(t.Receipt.GasUsed)), nil + case types.DynamicFeeTxType: + // TODO Add support for EIP-1559 transaction. + return big.NewInt(0), nil + default: + return nil, fmt.Errorf("unsupported transaction type %d", t.Receipt.Type) + } +} diff --git a/internal/engine/source/factory.go b/internal/engine/source/factory.go new file mode 100644 index 00000000..2d45b11e --- /dev/null +++ b/internal/engine/source/factory.go @@ -0,0 +1,21 @@ +package source + +import ( + "fmt" + + "github.com/naturalselectionlabs/rss3-node/internal/engine" + "github.com/naturalselectionlabs/rss3-node/internal/engine/source/ethereum" +) + +const ( + NameEthereum = "ethereum" +) + +func New(name string, config *engine.Config) (engine.Source, error) { + switch name { + case NameEthereum: + return ethereum.NewSource(config) + default: + return nil, fmt.Errorf("unsupported source %s", name) + } +} diff --git a/internal/engine/task.go b/internal/engine/task.go new file mode 100644 index 00000000..98c24f38 --- /dev/null +++ b/internal/engine/task.go @@ -0,0 +1,14 @@ +package engine + +import ( + "github.com/naturalselectionlabs/rss3-node/schema" + "github.com/naturalselectionlabs/rss3-node/schema/filter" +) + +type Task interface { + ID() string + Network() filter.Network + Timestamp() uint64 + Validate() error + BuildFeed() (*schema.Feed, error) +} diff --git a/internal/engine/worker.go b/internal/engine/worker.go new file mode 100644 index 00000000..a2e760ad --- /dev/null +++ b/internal/engine/worker.go @@ -0,0 +1,12 @@ +package engine + +import ( + "context" + + "github.com/naturalselectionlabs/rss3-node/schema" +) + +type Worker interface { + Match(ctx context.Context, task Task) (bool, error) + Transform(ctx context.Context, task Task) (*schema.Feed, error) +} diff --git a/internal/engine/worker/factory.go b/internal/engine/worker/factory.go new file mode 100644 index 00000000..25026001 --- /dev/null +++ b/internal/engine/worker/factory.go @@ -0,0 +1,21 @@ +package worker + +import ( + "fmt" + + "github.com/naturalselectionlabs/rss3-node/internal/engine" + "github.com/naturalselectionlabs/rss3-node/internal/engine/worker/fallback/ethereum" +) + +const ( + NameFallbackEthereum = "fallback.ethereum" +) + +func New(name string, config *engine.Config) (engine.Worker, error) { + switch name { + case NameFallbackEthereum: + return ethereum.NewWorker(config) + default: + return nil, fmt.Errorf("unsupported source %s", name) + } +} diff --git a/internal/engine/worker/fallback/ethereum/config.go b/internal/engine/worker/fallback/ethereum/config.go new file mode 100644 index 00000000..1cebe48d --- /dev/null +++ b/internal/engine/worker/fallback/ethereum/config.go @@ -0,0 +1,5 @@ +package ethereum + +type Config struct { + // TODO Implement support for customizable configurations. +} diff --git a/internal/engine/worker/fallback/ethereum/worker.go b/internal/engine/worker/fallback/ethereum/worker.go new file mode 100644 index 00000000..40437207 --- /dev/null +++ b/internal/engine/worker/fallback/ethereum/worker.go @@ -0,0 +1,100 @@ +package ethereum + +import ( + "context" + "fmt" + "math/big" + + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/naturalselectionlabs/rss3-node/internal/engine" + "github.com/naturalselectionlabs/rss3-node/internal/engine/source/ethereum" + ethereumx "github.com/naturalselectionlabs/rss3-node/provider/ethereum" + "github.com/naturalselectionlabs/rss3-node/schema" + "github.com/naturalselectionlabs/rss3-node/schema/filter" + "github.com/naturalselectionlabs/rss3-node/schema/metadata" + "github.com/samber/lo" + "github.com/shopspring/decimal" +) + +var _ engine.Worker = (*worker)(nil) + +type worker struct { + config *engine.Config +} + +func (w *worker) Match(_ context.Context, task engine.Task) (bool, error) { + return task.Network() == filter.NetworkEthereum, nil +} + +func (w *worker) Transform(ctx context.Context, task engine.Task) (*schema.Feed, error) { + ethereumTask, ok := task.(*ethereum.Task) + if !ok { + return nil, fmt.Errorf("invalid task type: %T", task) + } + + feed, err := task.BuildFeed() + if err != nil { + return nil, fmt.Errorf("build feed: %w", err) + } + + if w.matchEthereumFailedTransaction(ethereumTask) { + return feed, nil + } + + if w.matchEthereumNativeTransferTransaction(ethereumTask) { + action, err := w.handleEthereumNativeTransferTransaction(ctx, ethereumTask) + if err != nil { + return nil, fmt.Errorf("handle native transfer transaction: %w", err) + } + + feed.Type = action.Type + feed.Actions = append(feed.Actions, *action) + } + + return feed, nil +} + +func (w *worker) matchEthereumFailedTransaction(task *ethereum.Task) bool { + return task.Receipt.Status == types.ReceiptStatusFailed +} + +func (w *worker) matchEthereumNativeTransferTransaction(task *ethereum.Task) bool { + return task.Transaction.Value().Cmp(big.NewInt(0)) == 1 && len(task.Transaction.Data()) == 0 +} + +func (w *worker) handleEthereumNativeTransferTransaction(ctx context.Context, task *ethereum.Task) (*schema.Action, error) { + transactionFrom, err := types.LatestSignerForChainID(task.Transaction.ChainId()).Sender(task.Transaction) + if err != nil { + return nil, fmt.Errorf("recover transaction signer: %w", err) + } + + var transactionTo = ethereumx.AddressGenesis + if task.Transaction.To() != nil { + transactionTo = *task.Transaction.To() + } + + return w.buildEthereumTransactionTransferAction(ctx, task, transactionFrom, transactionTo, nil, task.Transaction.Value()) +} + +func (w *worker) buildEthereumTransactionTransferAction(_ context.Context, _ *ethereum.Task, from, to common.Address, _ *common.Address, tokenValue *big.Int) (*schema.Action, error) { + // TODO Add support for ERC-20 and ERC-1577 token transfer transactions. + action := schema.Action{ + Type: filter.TypeTransactionTransfer, + From: from.String(), + To: to.String(), + Metadata: metadata.TransactionTransfer{ + Value: lo.ToPtr(decimal.NewFromBigInt(tokenValue, 0)), + }, + } + + return &action, nil +} + +func NewWorker(config *engine.Config) (engine.Worker, error) { + var instance = worker{ + config: config, + } + + return &instance, nil +} diff --git a/internal/engine/worker/fallback/ethereum/worker_test.go b/internal/engine/worker/fallback/ethereum/worker_test.go new file mode 100644 index 00000000..b96eb09b --- /dev/null +++ b/internal/engine/worker/fallback/ethereum/worker_test.go @@ -0,0 +1,121 @@ +package ethereum_test + +import ( + "context" + "testing" + + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/core/types" + "github.com/naturalselectionlabs/rss3-node/internal/engine" + "github.com/naturalselectionlabs/rss3-node/internal/engine/source/ethereum" + worker "github.com/naturalselectionlabs/rss3-node/internal/engine/worker/fallback/ethereum" + "github.com/naturalselectionlabs/rss3-node/schema" + "github.com/naturalselectionlabs/rss3-node/schema/filter" + "github.com/naturalselectionlabs/rss3-node/schema/metadata" + "github.com/samber/lo" + "github.com/shopspring/decimal" + "github.com/stretchr/testify/require" +) + +func TestWorker_Ethereum(t *testing.T) { + t.Parallel() + + type arguments struct { + task *ethereum.Task + config *engine.Config + } + + testcases := []struct { + name string + arguments arguments + want *schema.Feed + wantError require.ErrorAssertionFunc + }{ + { + name: "Ethereum native transfer", + arguments: arguments{ + task: ðereum.Task{ + Chain: filter.ChainEthereumMainnet, + Header: &types.Header{ + // TODO Provide all fields. + Time: 1647774927, + }, + Transaction: types.NewTx(&types.DynamicFeeTx{ + ChainID: lo.Must(hexutil.DecodeBig("0x1")), + Nonce: 0xa, + GasTipCap: lo.Must(hexutil.DecodeBig("0x59682f00")), + GasFeeCap: lo.Must(hexutil.DecodeBig("0x3b8c8f46b")), + Gas: 0x5208, + To: lo.ToPtr(common.HexToAddress("0xa1b2dcac834117f38fb0356b5176b5693e165c90")), + Value: lo.Must(hexutil.DecodeBig("0xd48ed9972b634")), + V: lo.Must(hexutil.DecodeBig("0x0")), + R: lo.Must(hexutil.DecodeBig("0x66f2c1c5fbde05362a8d944ee884ba05777150c5dbe5bd414834b567a73f7765")), + S: lo.Must(hexutil.DecodeBig("0x4b91fdf20d7d85572836d5c4849949d4d96b6cff36e6a53f2b1dce6a3144ef4")), + }), + TransactionIndex: 0xf4, + Receipt: &types.Receipt{ + Type: 0x2, + PostState: common.Hex2Bytes("0x1"), + Status: types.ReceiptStatusSuccessful, + CumulativeGasUsed: 0x18b21de, + TxHash: common.HexToHash("0x0c2f413efbc243f3bb8edac7e70bdc21936e01401a21b0d63e97732aa80f5d99"), + GasUsed: 0x5208, + EffectiveGasPrice: lo.Must(hexutil.DecodeBig("0x3b8c8f46b")), + BlockHash: common.HexToHash("0xea9d0ecd7a085aa998789e8e9c017a7d45f199873380ecb568218525171165b0"), + BlockNumber: lo.Must(hexutil.DecodeBig("0xdc1390")), + TransactionIndex: 0xf4, + }, + }, + }, + want: &schema.Feed{ + ID: "0x0c2f413efbc243f3bb8edac7e70bdc21936e01401a21b0d63e97732aa80f5d99", + Chain: filter.ChainEthereumMainnet, + Index: 244, + From: "0x000000A52a03835517E9d193B3c27626e1Bc96b1", + To: "0xA1b2DCAC834117F38FB0356b5176B5693E165c90", + Type: filter.TypeTransactionTransfer, + Fee: schema.Fee{ + Amount: decimal.NewFromInt(0), + Decimal: 18, + }, + Actions: []schema.Action{ + { + Type: filter.TypeTransactionTransfer, + From: "0x000000A52a03835517E9d193B3c27626e1Bc96b1", + To: "0xA1b2DCAC834117F38FB0356b5176B5693E165c90", + Metadata: metadata.TransactionTransfer{ + Value: lo.ToPtr(lo.Must(decimal.NewFromString("3739360016119348"))), + }, + }, + }, + Status: true, + Timestamp: 1647774927, + }, + wantError: require.NoError, + }, + } + + for _, testcase := range testcases { + testcase := testcase + + t.Run(testcase.name, func(t *testing.T) { + t.Parallel() + + ctx := context.Background() + + instance, err := worker.NewWorker(testcase.arguments.config) + require.NoError(t, err) + + matched, err := instance.Match(ctx, testcase.arguments.task) + testcase.wantError(t, err) + require.True(t, matched) + + feed, err := instance.Transform(ctx, testcase.arguments.task) + testcase.wantError(t, err) + require.Equal(t, testcase.want, feed) + + t.Log(feed) + }) + } +} diff --git a/internal/node/server.go b/internal/node/server.go new file mode 100644 index 00000000..8bd4025c --- /dev/null +++ b/internal/node/server.go @@ -0,0 +1,113 @@ +package node + +import ( + "context" + "fmt" + + "github.com/naturalselectionlabs/rss3-node/internal/constant" + "github.com/naturalselectionlabs/rss3-node/internal/engine" + "github.com/naturalselectionlabs/rss3-node/internal/engine/source" + "github.com/naturalselectionlabs/rss3-node/internal/engine/worker" + "github.com/naturalselectionlabs/rss3-node/schema" + "github.com/samber/lo" + "github.com/sourcegraph/conc/pool" + "go.uber.org/zap" +) + +type Server struct { + config *engine.Config + source engine.Source + worker engine.Worker +} + +func (s *Server) Run(ctx context.Context) error { + var ( + // TODO Develop a more effective solution to implement back pressure. + tasksChan = make(chan []engine.Task, 1) + errorChan = make(chan error) + ) + + zap.L().Info("start node", zap.String("version", constant.BuildVersion())) + + s.source.Start(ctx, tasksChan, errorChan) + + for { + select { + case tasks := <-tasksChan: + if err := s.handleTasks(ctx, tasks); err != nil { + return fmt.Errorf("handle tasks: %w", err) + } + case err := <-errorChan: + if err != nil { + return fmt.Errorf("an error occurred in the source: %w", err) + } + + return nil + } + } +} + +func (s *Server) handleTasks(ctx context.Context, tasks []engine.Task) error { + resultPool := pool.NewWithResults[*schema.Feed]() + + for _, task := range tasks { + task := task + + resultPool.Go(func() *schema.Feed { + zap.L().Debug("start match task", zap.String("task.id", task.ID())) + + matched, err := s.worker.Match(ctx, task) + if err != nil { + zap.L().Error("matched task", zap.String("task.id", task.ID())) + + return nil + } + + if !matched { + zap.L().Warn("unmatched task", zap.String("task.id", task.ID())) + + return nil + } + + zap.L().Debug("start transform task", zap.String("task.id", task.ID())) + + feed, err := s.worker.Transform(ctx, task) + if err != nil { + zap.L().Error("transform task", zap.String("task.id", task.ID())) + + return nil + } + + return feed + }) + } + + // Filter failed feeds. + feeds := lo.Filter(resultPool.Wait(), func(feed *schema.Feed, _ int) bool { + return feed != nil + }) + + // Save feeds to database. + for _, feed := range feeds { + zap.L().Debug("feed", zap.Any("feed", feed)) + } + + return nil +} + +func NewServer(config *engine.Config) (server *Server, err error) { + instance := Server{ + config: config, + } + + // TODO Implement support for sources and workers from non Ethereum networks. + if instance.source, err = source.New(source.NameEthereum, instance.config); err != nil { + return nil, fmt.Errorf("new source: %w", err) + } + + if instance.worker, err = worker.New(worker.NameFallbackEthereum, instance.config); err != nil { + return nil, fmt.Errorf("new worker: %w", err) + } + + return &instance, nil +} diff --git a/provider/ethereum/constant.go b/provider/ethereum/constant.go new file mode 100644 index 00000000..a13a078a --- /dev/null +++ b/provider/ethereum/constant.go @@ -0,0 +1,44 @@ +package ethereum + +import "github.com/ethereum/go-ethereum/common" + +var ( + AddressGenesis = common.HexToAddress("0x0000000000000000000000000000000000000000") + HashGenesis = common.HexToHash("0x0000000000000000000000000000000000000000000000000000000000000000") +) + +// IsBurnAddress will return whether the current address is a black hole address, +// most of which are provided by https://etherscan.io/accounts/label/burn. +func IsBurnAddress(address common.Address) bool { + switch address { + case + common.HexToAddress("0x000000000000000000000000000000000000dEaD"), + common.HexToAddress("0x0000000000000000000000000000000000000000"), + common.HexToAddress("0x0000000000000000000000000000000000000001"), + common.HexToAddress("0x0000000000000000000000000000000000000002"), + common.HexToAddress("0x0000000000000000000000000000000000000003"), + common.HexToAddress("0x0000000000000000000000000000000000000004"), + common.HexToAddress("0x0000000000000000000000000000000000000005"), + common.HexToAddress("0x0000000000000000000000000000000000000006"), + common.HexToAddress("0x0000000000000000000000000000000000000007"), + common.HexToAddress("0x0000000000000000000000000000000000000008"), + common.HexToAddress("0x0000000000000000000000000000000000000009"), + common.HexToAddress("0x00000000000000000000045261D4Ee77acdb3286"), + common.HexToAddress("0x0123456789012345678901234567890123456789"), + common.HexToAddress("0x1111111111111111111111111111111111111111"), + common.HexToAddress("0x1234567890123456789012345678901234567890"), + common.HexToAddress("0x2222222222222222222222222222222222222222"), + common.HexToAddress("0x3333333333333333333333333333333333333333"), + common.HexToAddress("0x4444444444444444444444444444444444444444"), + common.HexToAddress("0x6666666666666666666666666666666666666666"), + common.HexToAddress("0x8888888888888888888888888888888888888888"), + common.HexToAddress("0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB"), + common.HexToAddress("0xdEAD000000000000000042069420694206942069"), + common.HexToAddress("0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE"), + common.HexToAddress("0xFFfFfFffFFfffFFfFFfFFFFFffFFFffffFfFFFfF"), + common.HexToAddress("0xaAaAaAaaAaAaAaaAaAAAAAAAAaaaAaAaAaaAaaAa"): + return true + default: + return false + } +} diff --git a/provider/ethereum/endpoint/endpoint.go b/provider/ethereum/endpoint/endpoint.go new file mode 100644 index 00000000..03ed41f1 --- /dev/null +++ b/provider/ethereum/endpoint/endpoint.go @@ -0,0 +1,31 @@ +package endpoint + +import ( + "github.com/naturalselectionlabs/rss3-node/schema/filter" + "github.com/samber/lo" +) + +var endpointsMap = map[filter.ChainEthereum][]string{ + filter.ChainEthereumMainnet: { + "https://rpc.ankr.com/eth", + "https://ethereum.blockpi.network/v1/rpc/public", + "https://eth.llamarpc.com", + }, +} + +func Get(chain filter.ChainEthereum) ([]string, bool) { + endpoints, exists := endpointsMap[chain] + if exists && len(endpoints) == 0 { + return nil, !exists + } + + if !exists { + return nil, exists + } + + return endpoints, exists +} + +func MustGet(chain filter.ChainEthereum) string { + return lo.Must(Get(chain))[0] +} diff --git a/schema/feed.go b/schema/feed.go new file mode 100644 index 00000000..4f21155d --- /dev/null +++ b/schema/feed.go @@ -0,0 +1,19 @@ +package schema + +import "github.com/naturalselectionlabs/rss3-node/schema/filter" + +type Feed struct { + ID string `json:"id"` + Network filter.Network `json:"network"` + Chain filter.Chain `json:"chain"` + Index uint `json:"index"` + From string `json:"from"` + To string `json:"to"` + Tag filter.Tag `json:"tag"` + Type filter.Type `json:"type"` + Platform *filter.Platform `json:"platform,omitempty"` + Fee Fee `json:"fee"` + Actions []Action `json:"actions"` + Status bool `json:"status"` + Timestamp uint64 `json:"timestamp"` +} diff --git a/schema/feed_action.go b/schema/feed_action.go new file mode 100644 index 00000000..09c65271 --- /dev/null +++ b/schema/feed_action.go @@ -0,0 +1,12 @@ +package schema + +import "github.com/naturalselectionlabs/rss3-node/schema/filter" + +type Action struct { + Tag filter.Tag `json:"tag"` + Type filter.Type `json:"type"` + Platform string `json:"platform,omitempty"` + From string `json:"from"` + To string `json:"to"` + Metadata Metadata `json:"metadata"` +} diff --git a/schema/feed_action_metadata.go b/schema/feed_action_metadata.go new file mode 100644 index 00000000..26932d8d --- /dev/null +++ b/schema/feed_action_metadata.go @@ -0,0 +1,7 @@ +package schema + +import "github.com/naturalselectionlabs/rss3-node/schema/filter" + +type Metadata interface { + Type() filter.Type +} diff --git a/schema/feed_fee.go b/schema/feed_fee.go new file mode 100644 index 00000000..621a9224 --- /dev/null +++ b/schema/feed_fee.go @@ -0,0 +1,11 @@ +package schema + +import ( + "github.com/shopspring/decimal" +) + +type Fee struct { + Address *string `json:"address,omitempty"` + Amount decimal.Decimal `json:"amount"` + Decimal uint `json:"decimal"` +} diff --git a/schema/filter/chain.go b/schema/filter/chain.go new file mode 100644 index 00000000..7ee1a8ad --- /dev/null +++ b/schema/filter/chain.go @@ -0,0 +1,7 @@ +package filter + +type Chain interface { + Network() Network + String() string + ID() uint64 +} diff --git a/schema/filter/chain_ethereum.go b/schema/filter/chain_ethereum.go new file mode 100644 index 00000000..25f43133 --- /dev/null +++ b/schema/filter/chain_ethereum.go @@ -0,0 +1,20 @@ +package filter + +var _ Chain = (*ChainEthereum)(nil) + +//go:generate go run --mod=mod github.com/dmarkham/enumer@v1.5.9 --values --type=ChainEthereum --linecomment --output chain_ethereum_string.go --json --sql +type ChainEthereum uint64 + +//goland:noinspection GoMixedReceiverTypes +func (i ChainEthereum) Network() Network { + return NetworkEthereum +} + +//goland:noinspection GoMixedReceiverTypes +func (i ChainEthereum) ID() uint64 { + return uint64(i) +} + +const ( + ChainEthereumMainnet ChainEthereum = 1 // mainnet +) diff --git a/schema/filter/chain_ethereum_string.go b/schema/filter/chain_ethereum_string.go new file mode 100644 index 00000000..ce6157f3 --- /dev/null +++ b/schema/filter/chain_ethereum_string.go @@ -0,0 +1,128 @@ +// Code generated by "enumer --values --type=ChainEthereum --linecomment --output chain_ethereum_string.go --json --sql"; DO NOT EDIT. + +package filter + +import ( + "database/sql/driver" + "encoding/json" + "fmt" + "strings" +) + +const _ChainEthereumName = "mainnet" + +var _ChainEthereumIndex = [...]uint8{0, 7} + +const _ChainEthereumLowerName = "mainnet" + +func (i ChainEthereum) String() string { + i -= 1 + if i >= ChainEthereum(len(_ChainEthereumIndex)-1) { + return fmt.Sprintf("ChainEthereum(%d)", i+1) + } + return _ChainEthereumName[_ChainEthereumIndex[i]:_ChainEthereumIndex[i+1]] +} + +func (ChainEthereum) Values() []string { + return ChainEthereumStrings() +} + +// An "invalid array index" compiler error signifies that the constant values have changed. +// Re-run the stringer command to generate them again. +func _ChainEthereumNoOp() { + var x [1]struct{} + _ = x[ChainEthereumMainnet-(1)] +} + +var _ChainEthereumValues = []ChainEthereum{ChainEthereumMainnet} + +var _ChainEthereumNameToValueMap = map[string]ChainEthereum{ + _ChainEthereumName[0:7]: ChainEthereumMainnet, + _ChainEthereumLowerName[0:7]: ChainEthereumMainnet, +} + +var _ChainEthereumNames = []string{ + _ChainEthereumName[0:7], +} + +// ChainEthereumString retrieves an enum value from the enum constants string name. +// Throws an error if the param is not part of the enum. +func ChainEthereumString(s string) (ChainEthereum, error) { + if val, ok := _ChainEthereumNameToValueMap[s]; ok { + return val, nil + } + + if val, ok := _ChainEthereumNameToValueMap[strings.ToLower(s)]; ok { + return val, nil + } + return 0, fmt.Errorf("%s does not belong to ChainEthereum values", s) +} + +// ChainEthereumValues returns all values of the enum +func ChainEthereumValues() []ChainEthereum { + return _ChainEthereumValues +} + +// ChainEthereumStrings returns a slice of all String values of the enum +func ChainEthereumStrings() []string { + strs := make([]string, len(_ChainEthereumNames)) + copy(strs, _ChainEthereumNames) + return strs +} + +// IsAChainEthereum returns "true" if the value is listed in the enum definition. "false" otherwise +func (i ChainEthereum) IsAChainEthereum() bool { + for _, v := range _ChainEthereumValues { + if i == v { + return true + } + } + return false +} + +// MarshalJSON implements the json.Marshaler interface for ChainEthereum +func (i ChainEthereum) MarshalJSON() ([]byte, error) { + return json.Marshal(i.String()) +} + +// UnmarshalJSON implements the json.Unmarshaler interface for ChainEthereum +func (i *ChainEthereum) UnmarshalJSON(data []byte) error { + var s string + if err := json.Unmarshal(data, &s); err != nil { + return fmt.Errorf("ChainEthereum should be a string, got %s", data) + } + + var err error + *i, err = ChainEthereumString(s) + return err +} + +func (i ChainEthereum) Value() (driver.Value, error) { + return i.String(), nil +} + +func (i *ChainEthereum) Scan(value interface{}) error { + if value == nil { + return nil + } + + var str string + switch v := value.(type) { + case []byte: + str = string(v) + case string: + str = v + case fmt.Stringer: + str = v.String() + default: + return fmt.Errorf("invalid value of ChainEthereum: %[1]T(%[1]v)", value) + } + + val, err := ChainEthereumString(str) + if err != nil { + return err + } + + *i = val + return nil +} diff --git a/schema/filter/network.go b/schema/filter/network.go new file mode 100644 index 00000000..0ac21236 --- /dev/null +++ b/schema/filter/network.go @@ -0,0 +1,9 @@ +package filter + +//go:generate go run --mod=mod github.com/dmarkham/enumer@v1.5.9 --values --type=Network --linecomment --output network_string.go --json --sql +type Network uint64 + +const ( + NetworkUnknown Network = iota // unknown + NetworkEthereum // ethereum +) diff --git a/schema/filter/network_string.go b/schema/filter/network_string.go new file mode 100644 index 00000000..90a5b4f0 --- /dev/null +++ b/schema/filter/network_string.go @@ -0,0 +1,131 @@ +// Code generated by "enumer --values --type=Network --linecomment --output network_string.go --json --sql"; DO NOT EDIT. + +package filter + +import ( + "database/sql/driver" + "encoding/json" + "fmt" + "strings" +) + +const _NetworkName = "unknownethereum" + +var _NetworkIndex = [...]uint8{0, 7, 15} + +const _NetworkLowerName = "unknownethereum" + +func (i Network) String() string { + if i >= Network(len(_NetworkIndex)-1) { + return fmt.Sprintf("Network(%d)", i) + } + return _NetworkName[_NetworkIndex[i]:_NetworkIndex[i+1]] +} + +func (Network) Values() []string { + return NetworkStrings() +} + +// An "invalid array index" compiler error signifies that the constant values have changed. +// Re-run the stringer command to generate them again. +func _NetworkNoOp() { + var x [1]struct{} + _ = x[NetworkUnknown-(0)] + _ = x[NetworkEthereum-(1)] +} + +var _NetworkValues = []Network{NetworkUnknown, NetworkEthereum} + +var _NetworkNameToValueMap = map[string]Network{ + _NetworkName[0:7]: NetworkUnknown, + _NetworkLowerName[0:7]: NetworkUnknown, + _NetworkName[7:15]: NetworkEthereum, + _NetworkLowerName[7:15]: NetworkEthereum, +} + +var _NetworkNames = []string{ + _NetworkName[0:7], + _NetworkName[7:15], +} + +// NetworkString retrieves an enum value from the enum constants string name. +// Throws an error if the param is not part of the enum. +func NetworkString(s string) (Network, error) { + if val, ok := _NetworkNameToValueMap[s]; ok { + return val, nil + } + + if val, ok := _NetworkNameToValueMap[strings.ToLower(s)]; ok { + return val, nil + } + return 0, fmt.Errorf("%s does not belong to Network values", s) +} + +// NetworkValues returns all values of the enum +func NetworkValues() []Network { + return _NetworkValues +} + +// NetworkStrings returns a slice of all String values of the enum +func NetworkStrings() []string { + strs := make([]string, len(_NetworkNames)) + copy(strs, _NetworkNames) + return strs +} + +// IsANetwork returns "true" if the value is listed in the enum definition. "false" otherwise +func (i Network) IsANetwork() bool { + for _, v := range _NetworkValues { + if i == v { + return true + } + } + return false +} + +// MarshalJSON implements the json.Marshaler interface for Network +func (i Network) MarshalJSON() ([]byte, error) { + return json.Marshal(i.String()) +} + +// UnmarshalJSON implements the json.Unmarshaler interface for Network +func (i *Network) UnmarshalJSON(data []byte) error { + var s string + if err := json.Unmarshal(data, &s); err != nil { + return fmt.Errorf("Network should be a string, got %s", data) + } + + var err error + *i, err = NetworkString(s) + return err +} + +func (i Network) Value() (driver.Value, error) { + return i.String(), nil +} + +func (i *Network) Scan(value interface{}) error { + if value == nil { + return nil + } + + var str string + switch v := value.(type) { + case []byte: + str = string(v) + case string: + str = v + case fmt.Stringer: + str = v.String() + default: + return fmt.Errorf("invalid value of Network: %[1]T(%[1]v)", value) + } + + val, err := NetworkString(str) + if err != nil { + return err + } + + *i = val + return nil +} diff --git a/schema/filter/platform.go b/schema/filter/platform.go new file mode 100644 index 00000000..50cc0163 --- /dev/null +++ b/schema/filter/platform.go @@ -0,0 +1,14 @@ +package filter + +import "strings" + +//go:generate go run --mod=mod github.com/dmarkham/enumer@v1.5.9 --values --type=Platform --linecomment --output platform_string.go --json --sql +type Platform int + +func (p Platform) ID() string { + return strings.ReplaceAll(strings.ToLower(p.String()), "\x20", "_") +} + +const ( + PlatformRSS3 Platform = iota + 1 +) diff --git a/schema/filter/platform_string.go b/schema/filter/platform_string.go new file mode 100644 index 00000000..fc7980ea --- /dev/null +++ b/schema/filter/platform_string.go @@ -0,0 +1,128 @@ +// Code generated by "enumer --values --type=Platform --linecomment --output platform_string.go --json --sql"; DO NOT EDIT. + +package filter + +import ( + "database/sql/driver" + "encoding/json" + "fmt" + "strings" +) + +const _PlatformName = "PlatformRSS3" + +var _PlatformIndex = [...]uint8{0, 12} + +const _PlatformLowerName = "platformrss3" + +func (i Platform) String() string { + i -= 1 + if i < 0 || i >= Platform(len(_PlatformIndex)-1) { + return fmt.Sprintf("Platform(%d)", i+1) + } + return _PlatformName[_PlatformIndex[i]:_PlatformIndex[i+1]] +} + +func (Platform) Values() []string { + return PlatformStrings() +} + +// An "invalid array index" compiler error signifies that the constant values have changed. +// Re-run the stringer command to generate them again. +func _PlatformNoOp() { + var x [1]struct{} + _ = x[PlatformRSS3-(1)] +} + +var _PlatformValues = []Platform{PlatformRSS3} + +var _PlatformNameToValueMap = map[string]Platform{ + _PlatformName[0:12]: PlatformRSS3, + _PlatformLowerName[0:12]: PlatformRSS3, +} + +var _PlatformNames = []string{ + _PlatformName[0:12], +} + +// PlatformString retrieves an enum value from the enum constants string name. +// Throws an error if the param is not part of the enum. +func PlatformString(s string) (Platform, error) { + if val, ok := _PlatformNameToValueMap[s]; ok { + return val, nil + } + + if val, ok := _PlatformNameToValueMap[strings.ToLower(s)]; ok { + return val, nil + } + return 0, fmt.Errorf("%s does not belong to Platform values", s) +} + +// PlatformValues returns all values of the enum +func PlatformValues() []Platform { + return _PlatformValues +} + +// PlatformStrings returns a slice of all String values of the enum +func PlatformStrings() []string { + strs := make([]string, len(_PlatformNames)) + copy(strs, _PlatformNames) + return strs +} + +// IsAPlatform returns "true" if the value is listed in the enum definition. "false" otherwise +func (i Platform) IsAPlatform() bool { + for _, v := range _PlatformValues { + if i == v { + return true + } + } + return false +} + +// MarshalJSON implements the json.Marshaler interface for Platform +func (i Platform) MarshalJSON() ([]byte, error) { + return json.Marshal(i.String()) +} + +// UnmarshalJSON implements the json.Unmarshaler interface for Platform +func (i *Platform) UnmarshalJSON(data []byte) error { + var s string + if err := json.Unmarshal(data, &s); err != nil { + return fmt.Errorf("Platform should be a string, got %s", data) + } + + var err error + *i, err = PlatformString(s) + return err +} + +func (i Platform) Value() (driver.Value, error) { + return i.String(), nil +} + +func (i *Platform) Scan(value interface{}) error { + if value == nil { + return nil + } + + var str string + switch v := value.(type) { + case []byte: + str = string(v) + case string: + str = v + case fmt.Stringer: + str = v.String() + default: + return fmt.Errorf("invalid value of Platform: %[1]T(%[1]v)", value) + } + + val, err := PlatformString(str) + if err != nil { + return err + } + + *i = val + return nil +} diff --git a/schema/filter/tag.go b/schema/filter/tag.go new file mode 100644 index 00000000..04e9a8eb --- /dev/null +++ b/schema/filter/tag.go @@ -0,0 +1,9 @@ +package filter + +//go:generate go run --mod=mod github.com/dmarkham/enumer@v1.5.9 --values --type=Tag --transform=snake --trimprefix=Tag --output tag_string.go --json --sql +type Tag uint64 + +const ( + TagUnknown Tag = iota + TagTransaction +) diff --git a/schema/filter/tag_string.go b/schema/filter/tag_string.go new file mode 100644 index 00000000..3c2f673a --- /dev/null +++ b/schema/filter/tag_string.go @@ -0,0 +1,131 @@ +// Code generated by "enumer --values --type=Tag --transform=snake --trimprefix=Tag --output tag_string.go --json --sql"; DO NOT EDIT. + +package filter + +import ( + "database/sql/driver" + "encoding/json" + "fmt" + "strings" +) + +const _TagName = "unknowntransaction" + +var _TagIndex = [...]uint8{0, 7, 18} + +const _TagLowerName = "unknowntransaction" + +func (i Tag) String() string { + if i >= Tag(len(_TagIndex)-1) { + return fmt.Sprintf("Tag(%d)", i) + } + return _TagName[_TagIndex[i]:_TagIndex[i+1]] +} + +func (Tag) Values() []string { + return TagStrings() +} + +// An "invalid array index" compiler error signifies that the constant values have changed. +// Re-run the stringer command to generate them again. +func _TagNoOp() { + var x [1]struct{} + _ = x[TagUnknown-(0)] + _ = x[TagTransaction-(1)] +} + +var _TagValues = []Tag{TagUnknown, TagTransaction} + +var _TagNameToValueMap = map[string]Tag{ + _TagName[0:7]: TagUnknown, + _TagLowerName[0:7]: TagUnknown, + _TagName[7:18]: TagTransaction, + _TagLowerName[7:18]: TagTransaction, +} + +var _TagNames = []string{ + _TagName[0:7], + _TagName[7:18], +} + +// TagString retrieves an enum value from the enum constants string name. +// Throws an error if the param is not part of the enum. +func TagString(s string) (Tag, error) { + if val, ok := _TagNameToValueMap[s]; ok { + return val, nil + } + + if val, ok := _TagNameToValueMap[strings.ToLower(s)]; ok { + return val, nil + } + return 0, fmt.Errorf("%s does not belong to Tag values", s) +} + +// TagValues returns all values of the enum +func TagValues() []Tag { + return _TagValues +} + +// TagStrings returns a slice of all String values of the enum +func TagStrings() []string { + strs := make([]string, len(_TagNames)) + copy(strs, _TagNames) + return strs +} + +// IsATag returns "true" if the value is listed in the enum definition. "false" otherwise +func (i Tag) IsATag() bool { + for _, v := range _TagValues { + if i == v { + return true + } + } + return false +} + +// MarshalJSON implements the json.Marshaler interface for Tag +func (i Tag) MarshalJSON() ([]byte, error) { + return json.Marshal(i.String()) +} + +// UnmarshalJSON implements the json.Unmarshaler interface for Tag +func (i *Tag) UnmarshalJSON(data []byte) error { + var s string + if err := json.Unmarshal(data, &s); err != nil { + return fmt.Errorf("Tag should be a string, got %s", data) + } + + var err error + *i, err = TagString(s) + return err +} + +func (i Tag) Value() (driver.Value, error) { + return i.String(), nil +} + +func (i *Tag) Scan(value interface{}) error { + if value == nil { + return nil + } + + var str string + switch v := value.(type) { + case []byte: + str = string(v) + case string: + str = v + case fmt.Stringer: + str = v.String() + default: + return fmt.Errorf("invalid value of Tag: %[1]T(%[1]v)", value) + } + + val, err := TagString(str) + if err != nil { + return err + } + + *i = val + return nil +} diff --git a/schema/filter/tag_type.go b/schema/filter/tag_type.go new file mode 100644 index 00000000..ab49594f --- /dev/null +++ b/schema/filter/tag_type.go @@ -0,0 +1,6 @@ +package filter + +type Type interface { + Name() string + Tag() Tag +} diff --git a/schema/filter/type_transaction.go b/schema/filter/type_transaction.go new file mode 100644 index 00000000..73f107a5 --- /dev/null +++ b/schema/filter/type_transaction.go @@ -0,0 +1,18 @@ +package filter + +//go:generate go run --mod=mod github.com/dmarkham/enumer@v1.5.9 --values --type=TransactionType --transform=snake --trimprefix=TypeTransaction --output type_transaction_string.go --json --sql +type TransactionType uint64 + +//goland:noinspection GoMixedReceiverTypes +func (i TransactionType) Name() string { + return i.String() +} + +//goland:noinspection GoMixedReceiverTypes +func (i TransactionType) Tag() Tag { + return TagTransaction +} + +const ( + TypeTransactionTransfer TransactionType = iota + 1 +) diff --git a/schema/filter/type_transaction_string.go b/schema/filter/type_transaction_string.go new file mode 100644 index 00000000..078f04e1 --- /dev/null +++ b/schema/filter/type_transaction_string.go @@ -0,0 +1,128 @@ +// Code generated by "enumer --values --type=TransactionType --transform=snake --trimprefix=TypeTransaction --output type_transaction_string.go --json --sql"; DO NOT EDIT. + +package filter + +import ( + "database/sql/driver" + "encoding/json" + "fmt" + "strings" +) + +const _TransactionTypeName = "transfer" + +var _TransactionTypeIndex = [...]uint8{0, 8} + +const _TransactionTypeLowerName = "transfer" + +func (i TransactionType) String() string { + i -= 1 + if i >= TransactionType(len(_TransactionTypeIndex)-1) { + return fmt.Sprintf("TransactionType(%d)", i+1) + } + return _TransactionTypeName[_TransactionTypeIndex[i]:_TransactionTypeIndex[i+1]] +} + +func (TransactionType) Values() []string { + return TransactionTypeStrings() +} + +// An "invalid array index" compiler error signifies that the constant values have changed. +// Re-run the stringer command to generate them again. +func _TransactionTypeNoOp() { + var x [1]struct{} + _ = x[TypeTransactionTransfer-(1)] +} + +var _TransactionTypeValues = []TransactionType{TypeTransactionTransfer} + +var _TransactionTypeNameToValueMap = map[string]TransactionType{ + _TransactionTypeName[0:8]: TypeTransactionTransfer, + _TransactionTypeLowerName[0:8]: TypeTransactionTransfer, +} + +var _TransactionTypeNames = []string{ + _TransactionTypeName[0:8], +} + +// TransactionTypeString retrieves an enum value from the enum constants string name. +// Throws an error if the param is not part of the enum. +func TransactionTypeString(s string) (TransactionType, error) { + if val, ok := _TransactionTypeNameToValueMap[s]; ok { + return val, nil + } + + if val, ok := _TransactionTypeNameToValueMap[strings.ToLower(s)]; ok { + return val, nil + } + return 0, fmt.Errorf("%s does not belong to TransactionType values", s) +} + +// TransactionTypeValues returns all values of the enum +func TransactionTypeValues() []TransactionType { + return _TransactionTypeValues +} + +// TransactionTypeStrings returns a slice of all String values of the enum +func TransactionTypeStrings() []string { + strs := make([]string, len(_TransactionTypeNames)) + copy(strs, _TransactionTypeNames) + return strs +} + +// IsATransactionType returns "true" if the value is listed in the enum definition. "false" otherwise +func (i TransactionType) IsATransactionType() bool { + for _, v := range _TransactionTypeValues { + if i == v { + return true + } + } + return false +} + +// MarshalJSON implements the json.Marshaler interface for TransactionType +func (i TransactionType) MarshalJSON() ([]byte, error) { + return json.Marshal(i.String()) +} + +// UnmarshalJSON implements the json.Unmarshaler interface for TransactionType +func (i *TransactionType) UnmarshalJSON(data []byte) error { + var s string + if err := json.Unmarshal(data, &s); err != nil { + return fmt.Errorf("TransactionType should be a string, got %s", data) + } + + var err error + *i, err = TransactionTypeString(s) + return err +} + +func (i TransactionType) Value() (driver.Value, error) { + return i.String(), nil +} + +func (i *TransactionType) Scan(value interface{}) error { + if value == nil { + return nil + } + + var str string + switch v := value.(type) { + case []byte: + str = string(v) + case string: + str = v + case fmt.Stringer: + str = v.String() + default: + return fmt.Errorf("invalid value of TransactionType: %[1]T(%[1]v)", value) + } + + val, err := TransactionTypeString(str) + if err != nil { + return err + } + + *i = val + return nil +} diff --git a/schema/filter/type_unknown.go b/schema/filter/type_unknown.go new file mode 100644 index 00000000..5a5ce39d --- /dev/null +++ b/schema/filter/type_unknown.go @@ -0,0 +1,18 @@ +package filter + +//go:generate go run --mod=mod github.com/dmarkham/enumer@v1.5.9 --values --type=UnknownType --transform=snake --trimprefix=Type --output type_unknown_string.go --json --sql +type UnknownType uint64 + +//goland:noinspection GoMixedReceiverTypes +func (i UnknownType) Name() string { + return i.String() +} + +//goland:noinspection GoMixedReceiverTypes +func (i UnknownType) Tag() Tag { + return TagUnknown +} + +const ( + TypeUnknown UnknownType = iota +) diff --git a/schema/filter/type_unknown_string.go b/schema/filter/type_unknown_string.go new file mode 100644 index 00000000..e4a06c7f --- /dev/null +++ b/schema/filter/type_unknown_string.go @@ -0,0 +1,127 @@ +// Code generated by "enumer --values --type=UnknownType --transform=snake --trimprefix=Type --output type_unknown_string.go --json --sql"; DO NOT EDIT. + +package filter + +import ( + "database/sql/driver" + "encoding/json" + "fmt" + "strings" +) + +const _UnknownTypeName = "unknown" + +var _UnknownTypeIndex = [...]uint8{0, 7} + +const _UnknownTypeLowerName = "unknown" + +func (i UnknownType) String() string { + if i >= UnknownType(len(_UnknownTypeIndex)-1) { + return fmt.Sprintf("UnknownType(%d)", i) + } + return _UnknownTypeName[_UnknownTypeIndex[i]:_UnknownTypeIndex[i+1]] +} + +func (UnknownType) Values() []string { + return UnknownTypeStrings() +} + +// An "invalid array index" compiler error signifies that the constant values have changed. +// Re-run the stringer command to generate them again. +func _UnknownTypeNoOp() { + var x [1]struct{} + _ = x[TypeUnknown-(0)] +} + +var _UnknownTypeValues = []UnknownType{TypeUnknown} + +var _UnknownTypeNameToValueMap = map[string]UnknownType{ + _UnknownTypeName[0:7]: TypeUnknown, + _UnknownTypeLowerName[0:7]: TypeUnknown, +} + +var _UnknownTypeNames = []string{ + _UnknownTypeName[0:7], +} + +// UnknownTypeString retrieves an enum value from the enum constants string name. +// Throws an error if the param is not part of the enum. +func UnknownTypeString(s string) (UnknownType, error) { + if val, ok := _UnknownTypeNameToValueMap[s]; ok { + return val, nil + } + + if val, ok := _UnknownTypeNameToValueMap[strings.ToLower(s)]; ok { + return val, nil + } + return 0, fmt.Errorf("%s does not belong to UnknownType values", s) +} + +// UnknownTypeValues returns all values of the enum +func UnknownTypeValues() []UnknownType { + return _UnknownTypeValues +} + +// UnknownTypeStrings returns a slice of all String values of the enum +func UnknownTypeStrings() []string { + strs := make([]string, len(_UnknownTypeNames)) + copy(strs, _UnknownTypeNames) + return strs +} + +// IsAUnknownType returns "true" if the value is listed in the enum definition. "false" otherwise +func (i UnknownType) IsAUnknownType() bool { + for _, v := range _UnknownTypeValues { + if i == v { + return true + } + } + return false +} + +// MarshalJSON implements the json.Marshaler interface for UnknownType +func (i UnknownType) MarshalJSON() ([]byte, error) { + return json.Marshal(i.String()) +} + +// UnmarshalJSON implements the json.Unmarshaler interface for UnknownType +func (i *UnknownType) UnmarshalJSON(data []byte) error { + var s string + if err := json.Unmarshal(data, &s); err != nil { + return fmt.Errorf("UnknownType should be a string, got %s", data) + } + + var err error + *i, err = UnknownTypeString(s) + return err +} + +func (i UnknownType) Value() (driver.Value, error) { + return i.String(), nil +} + +func (i *UnknownType) Scan(value interface{}) error { + if value == nil { + return nil + } + + var str string + switch v := value.(type) { + case []byte: + str = string(v) + case string: + str = v + case fmt.Stringer: + str = v.String() + default: + return fmt.Errorf("invalid value of UnknownType: %[1]T(%[1]v)", value) + } + + val, err := UnknownTypeString(str) + if err != nil { + return err + } + + *i = val + return nil +} diff --git a/schema/metadata/transaction.go b/schema/metadata/transaction.go new file mode 100644 index 00000000..7706d22b --- /dev/null +++ b/schema/metadata/transaction.go @@ -0,0 +1,19 @@ +package metadata + +import ( + "github.com/naturalselectionlabs/rss3-node/schema" + "github.com/naturalselectionlabs/rss3-node/schema/filter" + "github.com/shopspring/decimal" +) + +var _ schema.Metadata = (*TransactionTransfer)(nil) + +type TransactionTransfer struct { + Address *string `json:"address,omitempty"` + ID *decimal.Decimal `json:"id,omitempty"` + Value *decimal.Decimal `json:"value,omitempty"` +} + +func (t TransactionTransfer) Type() filter.Type { + return filter.TypeTransactionTransfer +}