diff --git a/.github/workflows/gotest.yaml b/.github/workflows/gotest.yaml index 6153245..07c0a95 100644 --- a/.github/workflows/gotest.yaml +++ b/.github/workflows/gotest.yaml @@ -28,7 +28,7 @@ jobs: # -------------- Test utilities - name: Test util - run: go test -v github.com/Blockpour/Blockpour-Geth-Indexer/util -v -cover -coverpkg=github.com/Blockpour/Blockpour-Geth-Indexer/util -coverprofile=profile.cov + run: go test -v github.com/supragya/EtherScope/util -v -cover -coverpkg=github.com/supragya/EtherScope/util -coverprofile=profile.cov - name: Coverage report for util run: go tool cover -func profile.cov @@ -37,7 +37,7 @@ jobs: # -------------- Test masterslave pool - name: Test mspool - run: go test -v github.com/Blockpour/Blockpour-Geth-Indexer/mspool -v -cover -coverpkg=github.com/Blockpour/Blockpour-Geth-Indexer/mspool -coverprofile=profile.cov + run: go test -v github.com/supragya/EtherScope/mspool -v -cover -coverpkg=github.com/supragya/EtherScope/mspool -coverprofile=profile.cov - name: Coverage report for mspool run: go tool cover -func profile.cov @@ -46,7 +46,7 @@ jobs: # -------------- Test gograph - name: Test indexer - run: go test -v github.com/Blockpour/Blockpour-Geth-Indexer/gograph -v -cover -coverpkg=github.com/Blockpour/Blockpour-Geth-Indexer/gograph -coverprofile=profile.cov + run: go test -v github.com/supragya/EtherScope/gograph -v -cover -coverpkg=github.com/supragya/EtherScope/gograph -coverprofile=profile.cov - name: Coverage report for gograph run: go tool cover -func profile.cov @@ -54,7 +54,7 @@ jobs: # -------------- Test realtime indexer - name: Test indexer - run: go test -v github.com/Blockpour/Blockpour-Geth-Indexer/indexer -v -cover -coverpkg=github.com/Blockpour/Blockpour-Geth-Indexer/indexer -coverprofile=profile.cov + run: go test -v github.com/supragya/EtherScope/indexer -v -cover -coverpkg=github.com/supragya/EtherScope/indexer -coverprofile=profile.cov - name: Coverage report for indexer run: go tool cover -func profile.cov @@ -63,4 +63,4 @@ jobs: # run: find . -name go.mod -execdir go test ./... -v -cover -coverpkg=./... -coverprofile=profile.cov ./... \; # - name: Coverage for all modules - # run: find . -name go.mod -execdir go tool cover -func profile.cov \; \ No newline at end of file + # run: find . -name go.mod -execdir go tool cover -func profile.cov \; diff --git a/Dockerfile b/Dockerfile index c141902..4407922 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,20 +21,20 @@ COPY ./version version COPY ./algorand algorand RUN go build -ldflags="\ - -X 'github.com/Blockpour/Blockpour-Geth-Indexer/version.buildCommit=$buildCommit' \ - -X 'github.com/Blockpour/Blockpour-Geth-Indexer/version.gittag=$gittag' \ - -X 'github.com/Blockpour/Blockpour-Geth-Indexer/version.buildTime=$buildtime' \ - -X 'github.com/Blockpour/Blockpour-Geth-Indexer/version.builder=$builder' \ - -X 'github.com/Blockpour/Blockpour-Geth-Indexer/version.gover=$gover'" \ - -o build/bgidx + -X 'github.com/supragya/EtherScope/version.buildCommit=$buildCommit' \ + -X 'github.com/supragya/EtherScope/version.gittag=$gittag' \ + -X 'github.com/supragya/EtherScope/version.buildTime=$buildtime' \ + -X 'github.com/supragya/EtherScope/version.builder=$builder' \ + -X 'github.com/supragya/EtherScope/version.gover=$gover'" \ + -o build/escope # App did not start correctly in Alpine, but perhaps a solution for this could be found FROM golang:1.19.3 WORKDIR /geth-indexer -COPY --from=build /geth-indexer/build/bgidx /geth-indexer/bgidx +COPY --from=build /geth-indexer/build/escope /geth-indexer/escope RUN "printf \"%s\" \"$CONFIG\" > ./config.yaml" -CMD ["./bgidx", "realtime", "-c", "config.yaml"] +CMD ["./escope", "realtime", "-c", "config.yaml"] diff --git a/Dockerfile.multiarch b/Dockerfile.multiarch index 9e36dea..6c007b0 100644 --- a/Dockerfile.multiarch +++ b/Dockerfile.multiarch @@ -25,21 +25,21 @@ COPY ./version version COPY ./algorand algorand RUN env GOOS=$TARGETOS GOARCH=$TARGETARCH go build -ldflags="\ - -X 'github.com/Blockpour/Blockpour-Geth-Indexer/version.buildCommit=$buildCommit' \ - -X 'github.com/Blockpour/Blockpour-Geth-Indexer/version.gittag=$gittag' \ - -X 'github.com/Blockpour/Blockpour-Geth-Indexer/version.buildTime=$buildtime' \ - -X 'github.com/Blockpour/Blockpour-Geth-Indexer/version.builder=$builder' \ - -X 'github.com/Blockpour/Blockpour-Geth-Indexer/version.gover=$gover'" \ - -o build/bgidx + -X 'github.com/supragya/EtherScope/version.buildCommit=$buildCommit' \ + -X 'github.com/supragya/EtherScope/version.gittag=$gittag' \ + -X 'github.com/supragya/EtherScope/version.buildTime=$buildtime' \ + -X 'github.com/supragya/EtherScope/version.builder=$builder' \ + -X 'github.com/supragya/EtherScope/version.gover=$gover'" \ + -o build/escope FROM --platform=$TARGETPLATFORM golang:1.19.3 WORKDIR /geth-indexer -COPY --from=build /geth-indexer/build/bgidx /geth-indexer/bgidx +COPY --from=build /geth-indexer/build/escope /geth-indexer/escope COPY --from=build /geth-indexer/libs libs ENTRYPOINT \ -mkdir -p /.blockpour/bgidx && \ +mkdir -p /.supragya/escope && \ printf "%s" "$CONFIG" > ./config.yaml && \ -./bgidx realtime -c ./config.yaml +./escope realtime -c ./config.yaml diff --git a/Makefile b/Makefile index 85f2dae..4392687 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ GO=go GOVER=$(shell go version) GOBUILD=$(GO) build BINDIR=build -BINCLI=bgidx +BINCLI=escope INSTALLLOC=/usr/local/bin/$(BINCLI) RELEASE=$(shell git describe --tags --abbrev=0) BUILDCOMMIT=$(shell git rev-parse HEAD | cut -c 1-7) @@ -13,11 +13,11 @@ BUILDER=$(shell uname -n) build: $(GOBUILD) -ldflags="\ - -X 'github.com/Blockpour/Blockpour-Geth-Indexer/version.buildCommit=$(BUILDLINE)@$(BUILDCOMMIT)' \ - -X 'github.com/Blockpour/Blockpour-Geth-Indexer/version.gittag=$(CURRENTTAG)' \ - -X 'github.com/Blockpour/Blockpour-Geth-Indexer/version.buildTime=$(CURRENTTIME)' \ - -X 'github.com/Blockpour/Blockpour-Geth-Indexer/version.builder=$(BUILDER)' \ - -X 'github.com/Blockpour/Blockpour-Geth-Indexer/version.gover=$(GOVER)' \ + -X 'github.com/supragya/EtherScope/version.buildCommit=$(BUILDLINE)@$(BUILDCOMMIT)' \ + -X 'github.com/supragya/EtherScope/version.gittag=$(CURRENTTAG)' \ + -X 'github.com/supragya/EtherScope/version.buildTime=$(CURRENTTIME)' \ + -X 'github.com/supragya/EtherScope/version.builder=$(BUILDER)' \ + -X 'github.com/supragya/EtherScope/version.gover=$(GOVER)' \ -linkmode=external" \ -o $(BINDIR)/$(BINCLI) clean: @@ -48,4 +48,4 @@ dockerbuildx: --build-arg 'buildTime=$(CURRENTTIME)' \ --build-arg 'builder=$(BUILDER)' \ --build-arg 'gover=$(GOVER)' \ - -f ./Dockerfile.multiarch . \ No newline at end of file + -f ./Dockerfile.multiarch . diff --git a/README.md b/README.md index 44a90cf..f809ccc 100644 --- a/README.md +++ b/README.md @@ -1,27 +1,27 @@ -# Blockpour Geth Indexer -`bgidx` program aims to index an EVM like chain using go-ethereum clients via RPCs. +# supragya Geth Indexer +`escope` program aims to index an EVM like chain using go-ethereum clients via RPCs. -![Test run status](https://github.com/Blockpour/Blockpour-Geth-Indexer/actions/workflows/gotest.yaml/badge.svg?branch=feat/v0.3.0) +![Test run status](https://github.com/supragya/EtherScope/actions/workflows/gotest.yaml/badge.svg?branch=feat/v0.3.0) ## Building Build the application using: - Setup golang abi modules via abigen using `./scripts/setup_abi.sh`. -- `make build` or `make build -B` (force) to build `build/bgidx` -- `make install` to install the built `bgidx` into `/usr/local/bin/bgidx` bringing it into $PATH. -- `make uninstall` removes `/usr/local/bin/bgidx` +- `make build` or `make build -B` (force) to build `build/escope` +- `make install` to install the built `escope` into `/usr/local/bin/escope` bringing it into $PATH. +- `make uninstall` removes `/usr/local/bin/escope` ## Asserting version of a built artifact -`bgidx` while building is stamped with build information such as git commit, CI process, time of build etc. so as to allow identification while in production. +`escope` while building is stamped with build information such as git commit, CI process, time of build etc. so as to allow identification while in production. ``` -$ bgidx --version -bgidx version v0.0.1 build main@5c6c6c5 +$ escope --version +escope version v0.0.1 build main@5c6c6c5 compiled at 23-05-2022 04:29:22 by travisci using go version go1.17.8 linux/amd64 ``` ## Indexer modes -`bgidx` runs in two different modes: -- **Realtime**: Aims to stay on head of the concerned blockchain and update the backend database in realtime. Can be run using `bgidx realtime -c ` -- **Backfill**: Aims to backfill a range of blocks in the past and update the backend database, rewriting the entries for concerned blocks. Can be run using `bgidx backfill -c ` +`escope` runs in two different modes: +- **Realtime**: Aims to stay on head of the concerned blockchain and update the backend database in realtime. Can be run using `escope realtime -c ` +- **Backfill**: Aims to backfill a range of blocks in the past and update the backend database, rewriting the entries for concerned blocks. Can be run using `escope backfill -c ` Example config file(s) is available at `test/configs/testcfg.yaml` diff --git a/algorand/Makefile b/algorand/Makefile index 11d5282..406ab99 100644 --- a/algorand/Makefile +++ b/algorand/Makefile @@ -12,10 +12,10 @@ BUILDER=$(shell uname -n) build: $(GOBUILD) -ldflags="\ - -X 'github.com/Blockpour/Blockpour-Geth-Indexer/algorand/version.buildCommit=$(BUILDLINE)@$(BUILDCOMMIT)' \ - -X 'github.com/Blockpour/Blockpour-Geth-Indexer/algorand/version.buildTime=$(CURRENTTIME)' \ - -X 'github.com/Blockpour/Blockpour-Geth-Indexer/algorand/version.builder=$(BUILDER)' \ - -X 'github.com/Blockpour/Blockpour-Geth-Indexer/algorand/version.gover=$(GOVER)' \ + -X 'github.com/supragya/EtherScope/algorand/version.buildCommit=$(BUILDLINE)@$(BUILDCOMMIT)' \ + -X 'github.com/supragya/EtherScope/algorand/version.buildTime=$(CURRENTTIME)' \ + -X 'github.com/supragya/EtherScope/algorand/version.builder=$(BUILDER)' \ + -X 'github.com/supragya/EtherScope/algorand/version.gover=$(GOVER)' \ -linkmode=external" \ -o $(BINDIR)/$(BINCLI) clean: @@ -25,4 +25,4 @@ install: cp $(BINDIR)/$(BINCLI) $(INSTALLLOC) uninstall: - rm $(INSTALLLOC) \ No newline at end of file + rm $(INSTALLLOC) diff --git a/algorand/README.md b/algorand/README.md index a8be81c..a98e51b 100644 --- a/algorand/README.md +++ b/algorand/README.md @@ -33,8 +33,8 @@ Be sure to restart the node after modifying the configuration. ## Indexer Config If using self hosted node: -algodUrl: "http://algorand.blockpour.local:8080" -indexerUrl: "http://algorand.blockpour.local:8980" +algodUrl: "http://algorand.supragya.local:8080" +indexerUrl: "http://algorand.supragya.local:8980" If using the quicknode, the algodUrl and indexerUrl should be in this format (including token and suffix) algodUrl: "https://.algorand-mainnet.discover.quiknode.pro//algod" @@ -43,4 +43,4 @@ indexerUrl: "https://.algorand-mainnet.discover.quiknode.pro/