forked from cerc-io/ipld-eth-server
Compare commits
21
Commits
v4.1.2-alpha
...
v4
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2c03c8cbd0 | ||
|
|
4d99ecdee3 | ||
|
|
fc0d7a6dd6 | ||
|
|
3201ed60f0 | ||
|
|
d24be29ef0 | ||
|
|
0e91e42128 | ||
|
|
4e9f4bbad6 | ||
|
|
e40e8a7335 | ||
|
|
ddc7485c08 | ||
|
|
cc35b06ddf | ||
|
|
1a24075da7 | ||
|
|
c9e6055cfd | ||
|
|
9eb7b22f47 | ||
|
|
4cf523b626 | ||
|
|
451d71a528 | ||
|
|
ec21e95182 | ||
|
|
0d1da46d6d | ||
|
|
45502e7117 | ||
|
|
74a7748483 | ||
|
|
415e426946 | ||
|
|
ba01123f54 |
@@ -29,8 +29,8 @@ jobs:
|
|||||||
BUILD_KEY: ${{ secrets.BUILD_KEY }}
|
BUILD_KEY: ${{ secrets.BUILD_KEY }}
|
||||||
with:
|
with:
|
||||||
STACK_ORCHESTRATOR_REF: "f2fd766f5400fcb9eb47b50675d2e3b1f2753702"
|
STACK_ORCHESTRATOR_REF: "f2fd766f5400fcb9eb47b50675d2e3b1f2753702"
|
||||||
GO_ETHEREUM_REF: "7b4ef34de2b9469c3f82972b60e38b34c99c5382"
|
GO_ETHEREUM_REF: "0c1e451c9865d8d47797b35526c4875f0d224772"
|
||||||
IPLD_ETH_DB_REF: "b59505eab252670c622b42ce60621e9747fb64f9"
|
IPLD_ETH_DB_REF: "be345e0733d2c025e4082c5154e441317ae94cf7"
|
||||||
build:
|
build:
|
||||||
name: Run docker build
|
name: Run docker build
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -47,11 +47,11 @@ jobs:
|
|||||||
- name: Run docker build
|
- name: Run docker build
|
||||||
run: make docker-build
|
run: make docker-build
|
||||||
- name: Tag docker image
|
- name: Tag docker image
|
||||||
run: docker tag vulcanize/ipld-eth-server docker.pkg.github.com/vulcanize/ipld-eth-server/ipld-eth-server:${{steps.vars.outputs.sha}}
|
run: docker tag cerc-io/ipld-eth-server git.vdb.to/cerc-io/ipld-eth-server/ipld-eth-server:${{steps.vars.outputs.sha}}
|
||||||
- name: Docker Login
|
- name: Docker Login
|
||||||
run: echo ${{ secrets.GITHUB_TOKEN }} | docker login https://docker.pkg.github.com -u vulcanize --password-stdin
|
run: echo ${{ secrets.GITHUB_TOKEN }} | docker login https://git.vdb.to -u cerccicd --password-stdin
|
||||||
- name: Docker Push
|
- name: Docker Push
|
||||||
run: docker push docker.pkg.github.com/vulcanize/ipld-eth-server/ipld-eth-server:${{steps.vars.outputs.sha}}
|
run: docker push git.vdb.to/cerc-io/ipld-eth-server/ipld-eth-server:${{steps.vars.outputs.sha}}
|
||||||
|
|
||||||
push_to_registries:
|
push_to_registries:
|
||||||
name: Push Docker image to Docker Hub
|
name: Push Docker image to Docker Hub
|
||||||
@@ -68,12 +68,12 @@ jobs:
|
|||||||
echo ::set-output name=sha::$(echo ${GITHUB_SHA:0:7})
|
echo ::set-output name=sha::$(echo ${GITHUB_SHA:0:7})
|
||||||
echo ::set-output name=tag::$(echo ${GITHUB_REF#refs/tags/})
|
echo ::set-output name=tag::$(echo ${GITHUB_REF#refs/tags/})
|
||||||
- name: Docker Login to Github Registry
|
- name: Docker Login to Github Registry
|
||||||
run: echo ${{ secrets.GITHUB_TOKEN }} | docker login https://docker.pkg.github.com -u vulcanize --password-stdin
|
run: echo ${{ secrets.GITHUB_TOKEN }} | docker login https://git.vdb.to -u cerccicd --password-stdin
|
||||||
- name: Docker Pull
|
- name: Docker Pull
|
||||||
run: docker pull docker.pkg.github.com/vulcanize/ipld-eth-server/ipld-eth-server:${{steps.vars.outputs.sha}}
|
run: docker pull git.vdb.to/cerc-io/ipld-eth-server/ipld-eth-server:${{steps.vars.outputs.sha}}
|
||||||
- name: Docker Login to Docker Registry
|
- name: Docker Login to Docker Registry
|
||||||
run: echo ${{ secrets.VULCANIZEJENKINS_PAT }} | docker login -u vulcanizejenkins --password-stdin
|
run: echo ${{ secrets.VULCANIZEJENKINS_PAT }} | docker login -u vulcanizejenkins --password-stdin
|
||||||
- name: Tag docker image
|
- name: Tag docker image
|
||||||
run: docker tag docker.pkg.github.com/vulcanize/ipld-eth-server/ipld-eth-server:${{steps.vars.outputs.sha}} vulcanize/ipld-eth-server:${{steps.vars.outputs.tag}}
|
run: docker tag git.vdb.to/cerc-io/ipld-eth-server/ipld-eth-server:${{steps.vars.outputs.sha}} cerc-io/ipld-eth-server:${{steps.vars.outputs.tag}}
|
||||||
- name: Docker Push to Docker Hub
|
- name: Docker Push to Docker Hub
|
||||||
run: docker push vulcanize/ipld-eth-server:${{steps.vars.outputs.tag}}
|
run: docker push cerc-io/ipld-eth-server:${{steps.vars.outputs.tag}}
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ cd ipld-eth-server
|
|||||||
rm -f /tmp/git_head_ref /tmp/git_repository
|
rm -f /tmp/git_head_ref /tmp/git_repository
|
||||||
|
|
||||||
# Spin up DB and run migrations
|
# Spin up DB and run migrations
|
||||||
|
echo 'docker-compose up -d migrations ipld-eth-db'
|
||||||
docker-compose up -d migrations ipld-eth-db
|
docker-compose up -d migrations ipld-eth-db
|
||||||
trap "docker-compose down -v --remove-orphans; cd $start_dir ; rm -r $temp_dir" SIGINT SIGTERM ERR
|
trap "docker-compose down -v --remove-orphans; cd $start_dir ; rm -r $temp_dir" SIGINT SIGTERM ERR
|
||||||
sleep 30
|
sleep 30
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ jobs:
|
|||||||
BUILD_KEY: ${{ secrets.BUILD_KEY }}
|
BUILD_KEY: ${{ secrets.BUILD_KEY }}
|
||||||
#strategy:
|
#strategy:
|
||||||
# matrix:
|
# matrix:
|
||||||
# go-version: [1.16.x, 1.17.x]
|
# go-version: [1.16.x, 1.17.x, 1.18.x]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
@@ -89,7 +89,7 @@ jobs:
|
|||||||
run: mkdir -p /tmp/go
|
run: mkdir -p /tmp/go
|
||||||
- uses: actions/setup-go@v3
|
- uses: actions/setup-go@v3
|
||||||
with:
|
with:
|
||||||
go-version: ">=1.18.0"
|
go-version: "1.18.x"
|
||||||
check-latest: true
|
check-latest: true
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
@@ -102,12 +102,12 @@ jobs:
|
|||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
ref: ${{ inputs.GO_ETHEREUM_REF }}
|
ref: ${{ inputs.GO_ETHEREUM_REF }}
|
||||||
repository: vulcanize/go-ethereum
|
repository: cerc-io/go-ethereum
|
||||||
path: "./go-ethereum/"
|
path: "./go-ethereum/"
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
ref: ${{ inputs.IPLD_ETH_DB_REF }}
|
ref: ${{ inputs.IPLD_ETH_DB_REF }}
|
||||||
repository: vulcanize/ipld-eth-db
|
repository: cerc-io/ipld-eth-db
|
||||||
path: "./ipld-eth-db/"
|
path: "./ipld-eth-db/"
|
||||||
- name: Create config file
|
- name: Create config file
|
||||||
run: |
|
run: |
|
||||||
@@ -157,7 +157,7 @@ jobs:
|
|||||||
run: mkdir -p /tmp/go
|
run: mkdir -p /tmp/go
|
||||||
- uses: actions/setup-go@v3
|
- uses: actions/setup-go@v3
|
||||||
with:
|
with:
|
||||||
go-version: ">=1.18.0"
|
go-version: "1.18.x"
|
||||||
check-latest: true
|
check-latest: true
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
@@ -170,12 +170,12 @@ jobs:
|
|||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
ref: ${{ inputs.GO_ETHEREUM_REF }}
|
ref: ${{ inputs.GO_ETHEREUM_REF }}
|
||||||
repository: vulcanize/go-ethereum
|
repository: cerc-io/go-ethereum
|
||||||
path: "./go-ethereum/"
|
path: "./go-ethereum/"
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
ref: ${{ inputs.IPLD_ETH_DB_REF }}
|
ref: ${{ inputs.IPLD_ETH_DB_REF }}
|
||||||
repository: vulcanize/ipld-eth-db
|
repository: cerc-io/ipld-eth-db
|
||||||
path: "./ipld-eth-db/"
|
path: "./ipld-eth-db/"
|
||||||
- name: Create config file
|
- name: Create config file
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
+5
-5
@@ -5,7 +5,7 @@ RUN apk --update --no-cache add make git g++ linux-headers
|
|||||||
RUN apk add busybox-extras
|
RUN apk add busybox-extras
|
||||||
|
|
||||||
# Build ipld-eth-server
|
# Build ipld-eth-server
|
||||||
WORKDIR /go/src/github.com/vulcanize/ipld-eth-server
|
WORKDIR /go/src/github.com/cerc-io/ipld-eth-server
|
||||||
|
|
||||||
# Cache the modules
|
# Cache the modules
|
||||||
ENV GO111MODULE=on
|
ENV GO111MODULE=on
|
||||||
@@ -37,13 +37,13 @@ USER $USER
|
|||||||
|
|
||||||
# chown first so dir is writable
|
# chown first so dir is writable
|
||||||
# note: using $USER is merged, but not in the stable release yet
|
# note: using $USER is merged, but not in the stable release yet
|
||||||
COPY --chown=5000:5000 --from=builder /go/src/github.com/vulcanize/ipld-eth-server/$CONFIG_FILE config.toml
|
COPY --chown=5000:5000 --from=builder /go/src/github.com/cerc-io/ipld-eth-server/$CONFIG_FILE config.toml
|
||||||
COPY --chown=5000:5000 --from=builder /go/src/github.com/vulcanize/ipld-eth-server/entrypoint.sh .
|
COPY --chown=5000:5000 --from=builder /go/src/github.com/cerc-io/ipld-eth-server/entrypoint.sh .
|
||||||
|
|
||||||
|
|
||||||
# keep binaries immutable
|
# keep binaries immutable
|
||||||
COPY --from=builder /go/src/github.com/vulcanize/ipld-eth-server/ipld-eth-server ipld-eth-server
|
COPY --from=builder /go/src/github.com/cerc-io/ipld-eth-server/ipld-eth-server ipld-eth-server
|
||||||
COPY --from=builder /goose goose
|
COPY --from=builder /goose goose
|
||||||
COPY --from=builder /go/src/github.com/vulcanize/ipld-eth-server/environments environments
|
COPY --from=builder /go/src/github.com/cerc-io/ipld-eth-server/environments environments
|
||||||
|
|
||||||
ENTRYPOINT ["/app/entrypoint.sh"]
|
ENTRYPOINT ["/app/entrypoint.sh"]
|
||||||
|
|||||||
@@ -51,19 +51,19 @@ TEST_CONNECT_STRING = postgresql://$(DATABASE_USER):$(DATABASE_PASSWORD)@$(DATAB
|
|||||||
TEST_CONNECT_STRING_LOCAL = postgresql://$(USER)@$(HOST_NAME):$(PORT)/$(TEST_DB)?sslmode=disable
|
TEST_CONNECT_STRING_LOCAL = postgresql://$(USER)@$(HOST_NAME):$(PORT)/$(TEST_DB)?sslmode=disable
|
||||||
|
|
||||||
.PHONY: test
|
.PHONY: test
|
||||||
test: | $(GOOSE)
|
test:
|
||||||
go vet ./...
|
go vet ./...
|
||||||
go fmt ./...
|
go fmt ./...
|
||||||
go run github.com/onsi/ginkgo/ginkgo -r --skipPackage=test
|
go run github.com/onsi/ginkgo/ginkgo -r --skipPackage=test
|
||||||
|
|
||||||
.PHONY: integrationtest
|
.PHONY: integrationtest
|
||||||
integrationtest: | $(GOOSE)
|
integrationtest:
|
||||||
go vet ./...
|
go vet ./...
|
||||||
go fmt ./...
|
go fmt ./...
|
||||||
go run github.com/onsi/ginkgo/ginkgo -r test/ -v
|
go run github.com/onsi/ginkgo/ginkgo -r test/ -v
|
||||||
|
|
||||||
.PHONY: test_local
|
.PHONY: test_local
|
||||||
test_local: | $(GOOSE)
|
test_local:
|
||||||
go vet ./...
|
go vet ./...
|
||||||
go fmt ./...
|
go fmt ./...
|
||||||
./scripts/run_unit_test.sh
|
./scripts/run_unit_test.sh
|
||||||
@@ -135,4 +135,4 @@ import:
|
|||||||
## Build docker image
|
## Build docker image
|
||||||
.PHONY: docker-build
|
.PHONY: docker-build
|
||||||
docker-build:
|
docker-build:
|
||||||
docker build -t vulcanize/ipld-eth-server .
|
docker build -t cerc-io/ipld-eth-server .
|
||||||
|
|||||||
@@ -28,14 +28,14 @@ Minimal build dependencies
|
|||||||
* This repository
|
* This repository
|
||||||
|
|
||||||
External dependency
|
External dependency
|
||||||
* Postgres database populated by [ipld-eth-db](https://github.com/vulcanize/ipld-eth-db)
|
* Postgres database populated by [ipld-eth-db](https://github.com/cerc-io/ipld-eth-db)
|
||||||
|
|
||||||
## Install
|
## Install
|
||||||
Start by downloading ipld-eth-server and moving into the repo:
|
Start by downloading ipld-eth-server and moving into the repo:
|
||||||
|
|
||||||
`GO111MODULE=off go get -d github.com/vulcanize/ipld-eth-server/v4`
|
`GO111MODULE=off go get -d github.com/cerc-io/ipld-eth-server/v4`
|
||||||
|
|
||||||
`cd $GOPATH/src/github.com/vulcanize/ipld-eth-server/v4@v4.x.x`
|
`cd $GOPATH/src/github.com/cerc-io/ipld-eth-server/v4@v4.x.x`
|
||||||
|
|
||||||
Then, build the binary:
|
Then, build the binary:
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -27,7 +27,7 @@ import (
|
|||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"github.com/spf13/viper"
|
"github.com/spf13/viper"
|
||||||
|
|
||||||
"github.com/vulcanize/ipld-eth-server/v4/pkg/prom"
|
"github.com/cerc-io/ipld-eth-server/v4/pkg/prom"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|||||||
+8
-8
@@ -17,6 +17,7 @@ package cmd
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
|
"github.com/mailgun/groupcache/v2"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
"os"
|
"os"
|
||||||
@@ -26,17 +27,16 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/ethereum/go-ethereum/rpc"
|
"github.com/ethereum/go-ethereum/rpc"
|
||||||
"github.com/mailgun/groupcache/v2"
|
|
||||||
log "github.com/sirupsen/logrus"
|
log "github.com/sirupsen/logrus"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"github.com/spf13/viper"
|
"github.com/spf13/viper"
|
||||||
"github.com/vulcanize/gap-filler/pkg/mux"
|
"github.com/vulcanize/gap-filler/pkg/mux"
|
||||||
|
|
||||||
"github.com/vulcanize/ipld-eth-server/v4/pkg/eth"
|
"github.com/cerc-io/ipld-eth-server/v4/pkg/eth"
|
||||||
"github.com/vulcanize/ipld-eth-server/v4/pkg/graphql"
|
"github.com/cerc-io/ipld-eth-server/v4/pkg/graphql"
|
||||||
srpc "github.com/vulcanize/ipld-eth-server/v4/pkg/rpc"
|
srpc "github.com/cerc-io/ipld-eth-server/v4/pkg/rpc"
|
||||||
s "github.com/vulcanize/ipld-eth-server/v4/pkg/serve"
|
s "github.com/cerc-io/ipld-eth-server/v4/pkg/serve"
|
||||||
v "github.com/vulcanize/ipld-eth-server/v4/version"
|
v "github.com/cerc-io/ipld-eth-server/v4/version"
|
||||||
)
|
)
|
||||||
|
|
||||||
var ErrNoRpcEndpoints = errors.New("no rpc endpoints is available")
|
var ErrNoRpcEndpoints = errors.New("no rpc endpoints is available")
|
||||||
@@ -123,7 +123,7 @@ func startServers(server s.Server, settings *s.Config) error {
|
|||||||
|
|
||||||
if settings.WSEnabled {
|
if settings.WSEnabled {
|
||||||
logWithCommand.Info("starting up WS server")
|
logWithCommand.Info("starting up WS server")
|
||||||
_, _, err := srpc.StartWSEndpoint(settings.WSEndpoint, server.APIs(), []string{"vdb", "net"}, nil, true)
|
_, _, err := srpc.StartWSEndpoint(settings.WSEndpoint, server.APIs(), []string{"vdb", "net"}, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@@ -133,7 +133,7 @@ func startServers(server s.Server, settings *s.Config) error {
|
|||||||
|
|
||||||
if settings.HTTPEnabled {
|
if settings.HTTPEnabled {
|
||||||
logWithCommand.Info("starting up HTTP server")
|
logWithCommand.Info("starting up HTTP server")
|
||||||
_, err := srpc.StartHTTPEndpoint(settings.HTTPEndpoint, server.APIs(), []string{"vdb", "eth", "net"}, nil, []string{"*"}, rpc.HTTPTimeouts{})
|
_, err := srpc.StartHTTPEndpoint(settings.HTTPEndpoint, server.APIs(), []string{"vdb", "eth", "debug", "net"}, nil, []string{"*"}, rpc.HTTPTimeouts{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -27,9 +27,9 @@ import (
|
|||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"github.com/spf13/viper"
|
"github.com/spf13/viper"
|
||||||
|
|
||||||
"github.com/vulcanize/ipld-eth-server/v4/pkg/client"
|
"github.com/cerc-io/ipld-eth-server/v4/pkg/client"
|
||||||
"github.com/vulcanize/ipld-eth-server/v4/pkg/eth"
|
"github.com/cerc-io/ipld-eth-server/v4/pkg/eth"
|
||||||
w "github.com/vulcanize/ipld-eth-server/v4/pkg/serve"
|
w "github.com/cerc-io/ipld-eth-server/v4/pkg/serve"
|
||||||
)
|
)
|
||||||
|
|
||||||
// subscribeCmd represents the subscribe command
|
// subscribeCmd represents the subscribe command
|
||||||
|
|||||||
+3
-3
@@ -18,14 +18,14 @@ package cmd
|
|||||||
import (
|
import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
validator "github.com/cerc-io/eth-ipfs-state-validator/v4/pkg"
|
||||||
|
ipfsethdb "github.com/cerc-io/ipfs-ethdb/v4/postgres"
|
||||||
"github.com/ethereum/go-ethereum/common"
|
"github.com/ethereum/go-ethereum/common"
|
||||||
log "github.com/sirupsen/logrus"
|
log "github.com/sirupsen/logrus"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"github.com/spf13/viper"
|
"github.com/spf13/viper"
|
||||||
validator "github.com/vulcanize/eth-ipfs-state-validator/v4/pkg"
|
|
||||||
ipfsethdb "github.com/vulcanize/ipfs-ethdb/v4/postgres"
|
|
||||||
|
|
||||||
s "github.com/vulcanize/ipld-eth-server/v4/pkg/serve"
|
s "github.com/cerc-io/ipld-eth-server/v4/pkg/serve"
|
||||||
)
|
)
|
||||||
|
|
||||||
const GroupName = "statedb-validate"
|
const GroupName = "statedb-validate"
|
||||||
|
|||||||
+1
-1
@@ -19,7 +19,7 @@ import (
|
|||||||
log "github.com/sirupsen/logrus"
|
log "github.com/sirupsen/logrus"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
|
|
||||||
v "github.com/vulcanize/ipld-eth-server/v4/version"
|
v "github.com/cerc-io/ipld-eth-server/v4/version"
|
||||||
)
|
)
|
||||||
|
|
||||||
// versionCmd represents the version command
|
// versionCmd represents the version command
|
||||||
|
|||||||
+1
-1
@@ -5,7 +5,7 @@ services:
|
|||||||
restart: on-failure
|
restart: on-failure
|
||||||
depends_on:
|
depends_on:
|
||||||
- ipld-eth-db
|
- ipld-eth-db
|
||||||
image: vulcanize/ipld-eth-db:v4.2.0-alpha
|
image: git.vdb.to/cerc-io/ipld-eth-db/ipld-eth-db:v4.2.1-alpha-unstable
|
||||||
environment:
|
environment:
|
||||||
DATABASE_USER: "vdbm"
|
DATABASE_USER: "vdbm"
|
||||||
DATABASE_NAME: "vulcanize_testing"
|
DATABASE_NAME: "vulcanize_testing"
|
||||||
|
|||||||
@@ -40,9 +40,9 @@ An example of how to subscribe to a real-time Ethereum data feed from ipld-eth-s
|
|||||||
"github.com/ethereum/go-ethereum/rpc"
|
"github.com/ethereum/go-ethereum/rpc"
|
||||||
"github.com/spf13/viper"
|
"github.com/spf13/viper"
|
||||||
|
|
||||||
"github.com/vulcanize/ipld-eth-server/v4/pkg/client"
|
"github.com/cerc-io/ipld-eth-server/v4/pkg/client"
|
||||||
"github.com/vulcanize/ipld-eth-server/v4/pkg/eth"
|
"github.com/cerc-io/ipld-eth-server/v4/pkg/eth"
|
||||||
"github.com/vulcanize/ipld-eth-server/v4/pkg/watch"
|
"github.com/cerc-io/ipld-eth-server/v4/pkg/watch"
|
||||||
)
|
)
|
||||||
|
|
||||||
config, _ := eth.NewEthSubscriptionConfig()
|
config, _ := eth.NewEthSubscriptionConfig()
|
||||||
|
|||||||
@@ -1,47 +1,52 @@
|
|||||||
module github.com/vulcanize/ipld-eth-server/v4
|
module github.com/cerc-io/ipld-eth-server/v4
|
||||||
|
|
||||||
go 1.18
|
go 1.18
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/ethereum/go-ethereum v1.10.19
|
github.com/cerc-io/eth-ipfs-state-validator/v4 v4.0.8-alpha
|
||||||
|
github.com/cerc-io/ipfs-ethdb/v4 v4.0.8-alpha
|
||||||
|
github.com/ethereum/go-ethereum v1.10.23
|
||||||
github.com/graph-gophers/graphql-go v1.3.0
|
github.com/graph-gophers/graphql-go v1.3.0
|
||||||
github.com/ipfs/go-block-format v0.0.3
|
github.com/ipfs/go-block-format v0.0.3
|
||||||
github.com/ipfs/go-cid v0.0.7
|
github.com/ipfs/go-cid v0.2.0
|
||||||
github.com/ipfs/go-ipfs-blockstore v1.0.1
|
github.com/ipfs/go-ipfs-blockstore v1.2.0
|
||||||
github.com/ipfs/go-ipfs-ds-help v1.0.0
|
github.com/ipfs/go-ipfs-ds-help v1.1.0
|
||||||
github.com/jmoiron/sqlx v1.3.5
|
github.com/jmoiron/sqlx v1.3.5
|
||||||
github.com/joho/godotenv v1.4.0
|
github.com/joho/godotenv v1.4.0
|
||||||
github.com/lib/pq v1.10.6
|
github.com/lib/pq v1.10.6
|
||||||
github.com/machinebox/graphql v0.2.2
|
github.com/machinebox/graphql v0.2.2
|
||||||
github.com/mailgun/groupcache/v2 v2.3.0
|
github.com/mailgun/groupcache/v2 v2.3.0
|
||||||
github.com/multiformats/go-multihash v0.1.0
|
github.com/multiformats/go-multihash v0.2.0
|
||||||
github.com/onsi/ginkgo v1.16.5
|
github.com/onsi/ginkgo v1.16.5
|
||||||
github.com/onsi/gomega v1.19.0
|
github.com/onsi/gomega v1.19.0
|
||||||
github.com/prometheus/client_golang v1.11.0
|
github.com/prometheus/client_golang v1.12.1
|
||||||
github.com/sirupsen/logrus v1.8.1
|
github.com/sirupsen/logrus v1.9.0
|
||||||
github.com/spf13/cobra v1.4.0
|
github.com/spf13/cobra v1.4.0
|
||||||
github.com/spf13/viper v1.11.0
|
github.com/spf13/viper v1.11.0
|
||||||
github.com/vulcanize/eth-ipfs-state-validator/v4 v4.0.3-alpha
|
|
||||||
github.com/vulcanize/gap-filler v0.4.0
|
github.com/vulcanize/gap-filler v0.4.0
|
||||||
github.com/vulcanize/ipfs-ethdb/v4 v4.0.2-alpha
|
|
||||||
gorm.io/driver/postgres v1.3.7
|
gorm.io/driver/postgres v1.3.7
|
||||||
gorm.io/gorm v1.23.5
|
gorm.io/gorm v1.23.5
|
||||||
)
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
bazil.org/fuse v0.0.0-20200117225306-7b5117fecadc // indirect
|
bazil.org/fuse v0.0.0-20200117225306-7b5117fecadc // indirect
|
||||||
github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6 // indirect
|
|
||||||
github.com/Stebalien/go-bitfield v0.0.1 // indirect
|
github.com/Stebalien/go-bitfield v0.0.1 // indirect
|
||||||
github.com/VictoriaMetrics/fastcache v1.6.0 // indirect
|
github.com/VictoriaMetrics/fastcache v1.6.0 // indirect
|
||||||
github.com/benbjohnson/clock v1.1.0 // indirect
|
github.com/alecthomas/units v0.0.0-20210927113745-59d0afb8317a // indirect
|
||||||
|
github.com/benbjohnson/clock v1.3.0 // indirect
|
||||||
github.com/beorn7/perks v1.0.1 // indirect
|
github.com/beorn7/perks v1.0.1 // indirect
|
||||||
github.com/blang/semver/v4 v4.0.0 // indirect
|
github.com/blang/semver/v4 v4.0.0 // indirect
|
||||||
github.com/btcsuite/btcd v0.22.1 // indirect
|
github.com/btcsuite/btcd v0.22.1 // indirect
|
||||||
github.com/btcsuite/btcd/btcec/v2 v2.2.0 // indirect
|
github.com/btcsuite/btcd/btcec/v2 v2.2.0 // indirect
|
||||||
|
github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 // indirect
|
||||||
github.com/cenkalti/backoff v2.2.1+incompatible // indirect
|
github.com/cenkalti/backoff v2.2.1+incompatible // indirect
|
||||||
github.com/cenkalti/backoff/v4 v4.1.1 // indirect
|
github.com/cenkalti/backoff/v4 v4.1.3 // indirect
|
||||||
github.com/cespare/xxhash/v2 v2.1.1 // indirect
|
github.com/cerc-io/go-eth-state-node-iterator v1.1.7 // indirect
|
||||||
|
github.com/cespare/xxhash/v2 v2.1.2 // indirect
|
||||||
github.com/cheekybits/genny v1.0.0 // indirect
|
github.com/cheekybits/genny v1.0.0 // indirect
|
||||||
|
github.com/containerd/cgroups v1.0.3 // indirect
|
||||||
|
github.com/coreos/go-systemd/v22 v22.3.2 // indirect
|
||||||
|
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
|
||||||
github.com/crackcomm/go-gitignore v0.0.0-20170627025303-887ab5e44cc3 // indirect
|
github.com/crackcomm/go-gitignore v0.0.0-20170627025303-887ab5e44cc3 // indirect
|
||||||
github.com/cskr/pubsub v1.0.2 // indirect
|
github.com/cskr/pubsub v1.0.2 // indirect
|
||||||
github.com/davecgh/go-spew v1.1.1 // indirect
|
github.com/davecgh/go-spew v1.1.1 // indirect
|
||||||
@@ -49,28 +54,35 @@ require (
|
|||||||
github.com/deckarep/golang-set v1.8.0 // indirect
|
github.com/deckarep/golang-set v1.8.0 // indirect
|
||||||
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect
|
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect
|
||||||
github.com/deepmap/oapi-codegen v1.8.2 // indirect
|
github.com/deepmap/oapi-codegen v1.8.2 // indirect
|
||||||
|
github.com/docker/go-units v0.4.0 // indirect
|
||||||
|
github.com/dustin/go-humanize v1.0.0 // indirect
|
||||||
github.com/edsrzf/mmap-go v1.0.0 // indirect
|
github.com/edsrzf/mmap-go v1.0.0 // indirect
|
||||||
|
github.com/elastic/gosigar v0.14.2 // indirect
|
||||||
github.com/facebookgo/atomicfile v0.0.0-20151019160806-2de1f203e7d5 // indirect
|
github.com/facebookgo/atomicfile v0.0.0-20151019160806-2de1f203e7d5 // indirect
|
||||||
github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5 // indirect
|
github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5 // indirect
|
||||||
github.com/flynn/noise v1.0.0 // indirect
|
github.com/flynn/noise v1.0.0 // indirect
|
||||||
github.com/francoispqt/gojay v1.2.13 // indirect
|
github.com/francoispqt/gojay v1.2.13 // indirect
|
||||||
github.com/friendsofgo/graphiql v0.2.2 // indirect
|
github.com/friendsofgo/graphiql v0.2.2 // indirect
|
||||||
github.com/fsnotify/fsnotify v1.5.1 // indirect
|
github.com/fsnotify/fsnotify v1.5.4 // indirect
|
||||||
github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff // indirect
|
github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff // indirect
|
||||||
github.com/georgysavva/scany v0.2.9 // indirect
|
github.com/georgysavva/scany v0.2.9 // indirect
|
||||||
github.com/go-ole/go-ole v1.2.1 // indirect
|
github.com/go-logr/logr v1.2.3 // indirect
|
||||||
|
github.com/go-logr/stdr v1.2.2 // indirect
|
||||||
|
github.com/go-ole/go-ole v1.2.6 // indirect
|
||||||
github.com/go-stack/stack v1.8.0 // indirect
|
github.com/go-stack/stack v1.8.0 // indirect
|
||||||
github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 // indirect
|
github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 // indirect
|
||||||
|
github.com/godbus/dbus/v5 v5.1.0 // indirect
|
||||||
github.com/gogo/protobuf v1.3.2 // indirect
|
github.com/gogo/protobuf v1.3.2 // indirect
|
||||||
github.com/golang-jwt/jwt/v4 v4.3.0 // indirect
|
github.com/golang-jwt/jwt/v4 v4.3.0 // indirect
|
||||||
github.com/golang/protobuf v1.5.2 // indirect
|
github.com/golang/protobuf v1.5.2 // indirect
|
||||||
github.com/golang/snappy v0.0.4 // indirect
|
github.com/golang/snappy v0.0.4 // indirect
|
||||||
github.com/google/gopacket v1.1.19 // indirect
|
github.com/google/gopacket v1.1.19 // indirect
|
||||||
github.com/google/uuid v1.3.0 // indirect
|
github.com/google/uuid v1.3.0 // indirect
|
||||||
github.com/gorilla/websocket v1.4.2 // indirect
|
github.com/gopherjs/gopherjs v0.0.0-20190812055157-5d271430af9f // indirect
|
||||||
|
github.com/gorilla/websocket v1.5.0 // indirect
|
||||||
github.com/graphql-go/graphql v0.7.9 // indirect
|
github.com/graphql-go/graphql v0.7.9 // indirect
|
||||||
github.com/hannahhoward/go-pubsub v0.0.0-20200423002714-8d62886cc36e // indirect
|
github.com/hannahhoward/go-pubsub v0.0.0-20200423002714-8d62886cc36e // indirect
|
||||||
github.com/hashicorp/errwrap v1.0.0 // indirect
|
github.com/hashicorp/errwrap v1.1.0 // indirect
|
||||||
github.com/hashicorp/go-bexpr v0.1.10 // indirect
|
github.com/hashicorp/go-bexpr v0.1.10 // indirect
|
||||||
github.com/hashicorp/go-multierror v1.1.1 // indirect
|
github.com/hashicorp/go-multierror v1.1.1 // indirect
|
||||||
github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect
|
github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect
|
||||||
@@ -83,47 +95,49 @@ require (
|
|||||||
github.com/influxdata/influxdb-client-go/v2 v2.4.0 // indirect
|
github.com/influxdata/influxdb-client-go/v2 v2.4.0 // indirect
|
||||||
github.com/influxdata/line-protocol v0.0.0-20210311194329-9aa0e372d097 // indirect
|
github.com/influxdata/line-protocol v0.0.0-20210311194329-9aa0e372d097 // indirect
|
||||||
github.com/ipfs/bbloom v0.0.4 // indirect
|
github.com/ipfs/bbloom v0.0.4 // indirect
|
||||||
github.com/ipfs/go-bitswap v0.4.0 // indirect
|
github.com/ipfs/go-bitfield v1.0.0 // indirect
|
||||||
github.com/ipfs/go-blockservice v0.1.7 // indirect
|
github.com/ipfs/go-bitswap v0.8.0 // indirect
|
||||||
github.com/ipfs/go-cidutil v0.0.2 // indirect
|
github.com/ipfs/go-blockservice v0.4.0 // indirect
|
||||||
github.com/ipfs/go-datastore v0.4.6 // indirect
|
github.com/ipfs/go-cidutil v0.1.0 // indirect
|
||||||
github.com/ipfs/go-ds-measure v0.1.0 // indirect
|
github.com/ipfs/go-datastore v0.5.1 // indirect
|
||||||
github.com/ipfs/go-fetcher v1.5.0 // indirect
|
github.com/ipfs/go-delegated-routing v0.3.0 // indirect
|
||||||
github.com/ipfs/go-filestore v1.0.0 // indirect
|
github.com/ipfs/go-ds-measure v0.2.0 // indirect
|
||||||
|
github.com/ipfs/go-fetcher v1.6.1 // indirect
|
||||||
|
github.com/ipfs/go-filestore v1.2.0 // indirect
|
||||||
github.com/ipfs/go-fs-lock v0.0.7 // indirect
|
github.com/ipfs/go-fs-lock v0.0.7 // indirect
|
||||||
github.com/ipfs/go-graphsync v0.8.0 // indirect
|
github.com/ipfs/go-graphsync v0.13.1 // indirect
|
||||||
github.com/ipfs/go-ipfs v0.10.0 // indirect
|
|
||||||
github.com/ipfs/go-ipfs-chunker v0.0.5 // indirect
|
github.com/ipfs/go-ipfs-chunker v0.0.5 // indirect
|
||||||
github.com/ipfs/go-ipfs-config v0.16.0 // indirect
|
|
||||||
github.com/ipfs/go-ipfs-delay v0.0.1 // indirect
|
github.com/ipfs/go-ipfs-delay v0.0.1 // indirect
|
||||||
github.com/ipfs/go-ipfs-exchange-interface v0.0.1 // indirect
|
github.com/ipfs/go-ipfs-exchange-interface v0.2.0 // indirect
|
||||||
github.com/ipfs/go-ipfs-exchange-offline v0.0.1 // indirect
|
github.com/ipfs/go-ipfs-exchange-offline v0.3.0 // indirect
|
||||||
github.com/ipfs/go-ipfs-files v0.0.8 // indirect
|
github.com/ipfs/go-ipfs-files v0.1.1 // indirect
|
||||||
github.com/ipfs/go-ipfs-keystore v0.0.2 // indirect
|
github.com/ipfs/go-ipfs-keystore v0.0.2 // indirect
|
||||||
github.com/ipfs/go-ipfs-pinner v0.1.2 // indirect
|
github.com/ipfs/go-ipfs-pinner v0.2.1 // indirect
|
||||||
github.com/ipfs/go-ipfs-posinfo v0.0.1 // indirect
|
github.com/ipfs/go-ipfs-posinfo v0.0.1 // indirect
|
||||||
github.com/ipfs/go-ipfs-pq v0.0.2 // indirect
|
github.com/ipfs/go-ipfs-pq v0.0.2 // indirect
|
||||||
github.com/ipfs/go-ipfs-provider v0.6.1 // indirect
|
github.com/ipfs/go-ipfs-provider v0.7.1 // indirect
|
||||||
github.com/ipfs/go-ipfs-routing v0.1.0 // indirect
|
github.com/ipfs/go-ipfs-routing v0.2.1 // indirect
|
||||||
github.com/ipfs/go-ipfs-util v0.0.2 // indirect
|
github.com/ipfs/go-ipfs-util v0.0.2 // indirect
|
||||||
github.com/ipfs/go-ipld-cbor v0.0.5 // indirect
|
github.com/ipfs/go-ipld-cbor v0.0.5 // indirect
|
||||||
github.com/ipfs/go-ipld-format v0.2.0 // indirect
|
github.com/ipfs/go-ipld-format v0.4.0 // indirect
|
||||||
github.com/ipfs/go-ipld-legacy v0.1.0 // indirect
|
github.com/ipfs/go-ipld-legacy v0.1.1 // indirect
|
||||||
github.com/ipfs/go-ipns v0.1.2 // indirect
|
github.com/ipfs/go-ipns v0.1.2 // indirect
|
||||||
github.com/ipfs/go-log v1.0.5 // indirect
|
github.com/ipfs/go-log v1.0.5 // indirect
|
||||||
github.com/ipfs/go-log/v2 v2.3.0 // indirect
|
github.com/ipfs/go-log/v2 v2.5.1 // indirect
|
||||||
github.com/ipfs/go-merkledag v0.4.0 // indirect
|
github.com/ipfs/go-merkledag v0.6.0 // indirect
|
||||||
github.com/ipfs/go-metrics-interface v0.0.1 // indirect
|
github.com/ipfs/go-metrics-interface v0.0.1 // indirect
|
||||||
github.com/ipfs/go-mfs v0.1.2 // indirect
|
github.com/ipfs/go-mfs v0.2.1 // indirect
|
||||||
github.com/ipfs/go-namesys v0.3.1 // indirect
|
github.com/ipfs/go-namesys v0.5.0 // indirect
|
||||||
github.com/ipfs/go-path v0.1.2 // indirect
|
github.com/ipfs/go-path v0.3.0 // indirect
|
||||||
github.com/ipfs/go-peertaskqueue v0.4.0 // indirect
|
github.com/ipfs/go-peertaskqueue v0.7.1 // indirect
|
||||||
github.com/ipfs/go-unixfs v0.2.5 // indirect
|
github.com/ipfs/go-unixfs v0.4.0 // indirect
|
||||||
github.com/ipfs/go-unixfsnode v1.1.3 // indirect
|
github.com/ipfs/go-unixfsnode v1.4.0 // indirect
|
||||||
github.com/ipfs/go-verifcid v0.0.1 // indirect
|
github.com/ipfs/go-verifcid v0.0.1 // indirect
|
||||||
github.com/ipfs/interface-go-ipfs-core v0.5.1 // indirect
|
github.com/ipfs/interface-go-ipfs-core v0.7.0 // indirect
|
||||||
github.com/ipld/go-codec-dagpb v1.3.0 // indirect
|
github.com/ipfs/kubo v0.14.0 // indirect
|
||||||
github.com/ipld/go-ipld-prime v0.12.2 // indirect
|
github.com/ipld/edelweiss v0.1.4 // indirect
|
||||||
|
github.com/ipld/go-codec-dagpb v1.4.0 // indirect
|
||||||
|
github.com/ipld/go-ipld-prime v0.17.0 // indirect
|
||||||
github.com/jackc/chunkreader/v2 v2.0.1 // indirect
|
github.com/jackc/chunkreader/v2 v2.0.1 // indirect
|
||||||
github.com/jackc/pgconn v1.12.1 // indirect
|
github.com/jackc/pgconn v1.12.1 // indirect
|
||||||
github.com/jackc/pgio v1.0.0 // indirect
|
github.com/jackc/pgio v1.0.0 // indirect
|
||||||
@@ -139,57 +153,38 @@ require (
|
|||||||
github.com/jinzhu/copier v0.2.4 // indirect
|
github.com/jinzhu/copier v0.2.4 // indirect
|
||||||
github.com/jinzhu/inflection v1.0.0 // indirect
|
github.com/jinzhu/inflection v1.0.0 // indirect
|
||||||
github.com/jinzhu/now v1.1.4 // indirect
|
github.com/jinzhu/now v1.1.4 // indirect
|
||||||
github.com/klauspost/compress v1.11.7 // indirect
|
github.com/klauspost/compress v1.15.1 // indirect
|
||||||
github.com/klauspost/cpuid/v2 v2.0.9 // indirect
|
github.com/klauspost/cpuid/v2 v2.0.12 // indirect
|
||||||
github.com/koron/go-ssdp v0.0.2 // indirect
|
github.com/koron/go-ssdp v0.0.2 // indirect
|
||||||
github.com/libp2p/go-addr-util v0.1.0 // indirect
|
|
||||||
github.com/libp2p/go-buffer-pool v0.0.2 // indirect
|
github.com/libp2p/go-buffer-pool v0.0.2 // indirect
|
||||||
github.com/libp2p/go-cidranger v1.1.0 // indirect
|
github.com/libp2p/go-cidranger v1.1.0 // indirect
|
||||||
github.com/libp2p/go-conn-security-multistream v0.2.1 // indirect
|
github.com/libp2p/go-doh-resolver v0.4.0 // indirect
|
||||||
github.com/libp2p/go-doh-resolver v0.3.1 // indirect
|
|
||||||
github.com/libp2p/go-eventbus v0.2.1 // indirect
|
github.com/libp2p/go-eventbus v0.2.1 // indirect
|
||||||
github.com/libp2p/go-flow-metrics v0.0.3 // indirect
|
github.com/libp2p/go-flow-metrics v0.0.3 // indirect
|
||||||
github.com/libp2p/go-libp2p v0.15.0 // indirect
|
github.com/libp2p/go-libp2p v0.20.3 // indirect
|
||||||
github.com/libp2p/go-libp2p-asn-util v0.0.0-20200825225859-85005c6cf052 // indirect
|
github.com/libp2p/go-libp2p-asn-util v0.2.0 // indirect
|
||||||
github.com/libp2p/go-libp2p-autonat v0.4.2 // indirect
|
github.com/libp2p/go-libp2p-core v0.16.1 // indirect
|
||||||
github.com/libp2p/go-libp2p-blankhost v0.2.0 // indirect
|
github.com/libp2p/go-libp2p-discovery v0.7.0 // indirect
|
||||||
github.com/libp2p/go-libp2p-circuit v0.4.0 // indirect
|
github.com/libp2p/go-libp2p-kad-dht v0.16.0 // indirect
|
||||||
github.com/libp2p/go-libp2p-connmgr v0.2.4 // indirect
|
|
||||||
github.com/libp2p/go-libp2p-core v0.9.0 // indirect
|
|
||||||
github.com/libp2p/go-libp2p-discovery v0.5.1 // indirect
|
|
||||||
github.com/libp2p/go-libp2p-kad-dht v0.13.1 // indirect
|
|
||||||
github.com/libp2p/go-libp2p-kbucket v0.4.7 // indirect
|
github.com/libp2p/go-libp2p-kbucket v0.4.7 // indirect
|
||||||
github.com/libp2p/go-libp2p-loggables v0.1.0 // indirect
|
github.com/libp2p/go-libp2p-loggables v0.1.0 // indirect
|
||||||
github.com/libp2p/go-libp2p-mplex v0.4.1 // indirect
|
github.com/libp2p/go-libp2p-peerstore v0.6.0 // indirect
|
||||||
github.com/libp2p/go-libp2p-nat v0.0.6 // indirect
|
github.com/libp2p/go-libp2p-pubsub v0.6.1 // indirect
|
||||||
github.com/libp2p/go-libp2p-noise v0.2.2 // indirect
|
github.com/libp2p/go-libp2p-pubsub-router v0.5.0 // indirect
|
||||||
github.com/libp2p/go-libp2p-peerstore v0.2.8 // indirect
|
|
||||||
github.com/libp2p/go-libp2p-pnet v0.2.0 // indirect
|
|
||||||
github.com/libp2p/go-libp2p-pubsub v0.5.4 // indirect
|
|
||||||
github.com/libp2p/go-libp2p-pubsub-router v0.4.0 // indirect
|
|
||||||
github.com/libp2p/go-libp2p-quic-transport v0.12.0 // indirect
|
|
||||||
github.com/libp2p/go-libp2p-record v0.1.3 // indirect
|
github.com/libp2p/go-libp2p-record v0.1.3 // indirect
|
||||||
|
github.com/libp2p/go-libp2p-resource-manager v0.3.0 // indirect
|
||||||
github.com/libp2p/go-libp2p-routing-helpers v0.2.3 // indirect
|
github.com/libp2p/go-libp2p-routing-helpers v0.2.3 // indirect
|
||||||
github.com/libp2p/go-libp2p-swarm v0.5.3 // indirect
|
github.com/libp2p/go-libp2p-swarm v0.11.0 // indirect
|
||||||
github.com/libp2p/go-libp2p-tls v0.2.0 // indirect
|
github.com/libp2p/go-libp2p-xor v0.1.0 // indirect
|
||||||
github.com/libp2p/go-libp2p-transport-upgrader v0.4.6 // indirect
|
github.com/libp2p/go-mplex v0.7.0 // indirect
|
||||||
github.com/libp2p/go-libp2p-xor v0.0.0-20210714161855-5c005aca55db // indirect
|
github.com/libp2p/go-msgio v0.2.0 // indirect
|
||||||
github.com/libp2p/go-libp2p-yamux v0.5.4 // indirect
|
github.com/libp2p/go-nat v0.1.0 // indirect
|
||||||
github.com/libp2p/go-maddr-filter v0.1.0 // indirect
|
github.com/libp2p/go-netroute v0.2.0 // indirect
|
||||||
github.com/libp2p/go-mplex v0.3.0 // indirect
|
|
||||||
github.com/libp2p/go-msgio v0.0.6 // indirect
|
|
||||||
github.com/libp2p/go-nat v0.0.5 // indirect
|
|
||||||
github.com/libp2p/go-netroute v0.1.6 // indirect
|
|
||||||
github.com/libp2p/go-openssl v0.0.7 // indirect
|
github.com/libp2p/go-openssl v0.0.7 // indirect
|
||||||
github.com/libp2p/go-reuseport v0.0.2 // indirect
|
github.com/libp2p/go-reuseport v0.2.0 // indirect
|
||||||
github.com/libp2p/go-reuseport-transport v0.0.5 // indirect
|
github.com/libp2p/go-yamux/v3 v3.1.2 // indirect
|
||||||
github.com/libp2p/go-sockaddr v0.1.1 // indirect
|
github.com/libp2p/zeroconf/v2 v2.1.1 // indirect
|
||||||
github.com/libp2p/go-stream-muxer-multistream v0.3.0 // indirect
|
github.com/lucas-clemente/quic-go v0.27.1 // indirect
|
||||||
github.com/libp2p/go-tcp-transport v0.2.8 // indirect
|
|
||||||
github.com/libp2p/go-ws-transport v0.5.0 // indirect
|
|
||||||
github.com/libp2p/go-yamux/v2 v2.2.0 // indirect
|
|
||||||
github.com/libp2p/zeroconf/v2 v2.0.0 // indirect
|
|
||||||
github.com/lucas-clemente/quic-go v0.26.0 // indirect
|
|
||||||
github.com/magiconair/properties v1.8.6 // indirect
|
github.com/magiconair/properties v1.8.6 // indirect
|
||||||
github.com/marten-seemann/qtls-go1-16 v0.1.5 // indirect
|
github.com/marten-seemann/qtls-go1-16 v0.1.5 // indirect
|
||||||
github.com/marten-seemann/qtls-go1-17 v0.1.1 // indirect
|
github.com/marten-seemann/qtls-go1-17 v0.1.1 // indirect
|
||||||
@@ -201,27 +196,28 @@ require (
|
|||||||
github.com/mattn/go-runewidth v0.0.9 // indirect
|
github.com/mattn/go-runewidth v0.0.9 // indirect
|
||||||
github.com/mattn/go-sqlite3 v2.0.3+incompatible // indirect
|
github.com/mattn/go-sqlite3 v2.0.3+incompatible // indirect
|
||||||
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
|
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
|
||||||
github.com/miekg/dns v1.1.43 // indirect
|
github.com/miekg/dns v1.1.48 // indirect
|
||||||
github.com/mikioh/tcpinfo v0.0.0-20190314235526-30a79bb1804b // indirect
|
github.com/mikioh/tcpinfo v0.0.0-20190314235526-30a79bb1804b // indirect
|
||||||
github.com/mikioh/tcpopt v0.0.0-20190314235656-172688c1accc // indirect
|
github.com/mikioh/tcpopt v0.0.0-20190314235656-172688c1accc // indirect
|
||||||
github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1 // indirect
|
|
||||||
github.com/minio/sha256-simd v1.0.0 // indirect
|
github.com/minio/sha256-simd v1.0.0 // indirect
|
||||||
github.com/mitchellh/go-homedir v1.1.0 // indirect
|
github.com/mitchellh/go-homedir v1.1.0 // indirect
|
||||||
github.com/mitchellh/mapstructure v1.4.3 // indirect
|
github.com/mitchellh/mapstructure v1.4.3 // indirect
|
||||||
github.com/mitchellh/pointerstructure v1.2.0 // indirect
|
github.com/mitchellh/pointerstructure v1.2.0 // indirect
|
||||||
github.com/mr-tron/base58 v1.2.0 // indirect
|
github.com/mr-tron/base58 v1.2.0 // indirect
|
||||||
github.com/multiformats/go-base32 v0.0.3 // indirect
|
github.com/multiformats/go-base32 v0.0.4 // indirect
|
||||||
github.com/multiformats/go-base36 v0.1.0 // indirect
|
github.com/multiformats/go-base36 v0.1.0 // indirect
|
||||||
github.com/multiformats/go-multiaddr v0.4.0 // indirect
|
github.com/multiformats/go-multiaddr v0.5.0 // indirect
|
||||||
github.com/multiformats/go-multiaddr-dns v0.3.1 // indirect
|
github.com/multiformats/go-multiaddr-dns v0.3.1 // indirect
|
||||||
github.com/multiformats/go-multiaddr-fmt v0.1.0 // indirect
|
github.com/multiformats/go-multiaddr-fmt v0.1.0 // indirect
|
||||||
github.com/multiformats/go-multibase v0.0.3 // indirect
|
github.com/multiformats/go-multibase v0.1.0 // indirect
|
||||||
github.com/multiformats/go-multicodec v0.3.0 // indirect
|
github.com/multiformats/go-multicodec v0.5.0 // indirect
|
||||||
github.com/multiformats/go-multistream v0.2.2 // indirect
|
github.com/multiformats/go-multistream v0.3.3 // indirect
|
||||||
github.com/multiformats/go-varint v0.0.6 // indirect
|
github.com/multiformats/go-varint v0.0.6 // indirect
|
||||||
github.com/nxadm/tail v1.4.8 // indirect
|
github.com/nxadm/tail v1.4.8 // indirect
|
||||||
github.com/olekukonko/tablewriter v0.0.5 // indirect
|
github.com/olekukonko/tablewriter v0.0.5 // indirect
|
||||||
|
github.com/opencontainers/runtime-spec v1.0.2 // indirect
|
||||||
github.com/opentracing/opentracing-go v1.2.0 // indirect
|
github.com/opentracing/opentracing-go v1.2.0 // indirect
|
||||||
|
github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 // indirect
|
||||||
github.com/pelletier/go-toml v1.9.4 // indirect
|
github.com/pelletier/go-toml v1.9.4 // indirect
|
||||||
github.com/pelletier/go-toml/v2 v2.0.0-beta.8 // indirect
|
github.com/pelletier/go-toml/v2 v2.0.0-beta.8 // indirect
|
||||||
github.com/peterh/liner v1.1.1-0.20190123174540-a2c9a5303de7 // indirect
|
github.com/peterh/liner v1.1.1-0.20190123174540-a2c9a5303de7 // indirect
|
||||||
@@ -230,13 +226,17 @@ require (
|
|||||||
github.com/pmezard/go-difflib v1.0.0 // indirect
|
github.com/pmezard/go-difflib v1.0.0 // indirect
|
||||||
github.com/polydawn/refmt v0.0.0-20201211092308-30ac6d18308e // indirect
|
github.com/polydawn/refmt v0.0.0-20201211092308-30ac6d18308e // indirect
|
||||||
github.com/prometheus/client_model v0.2.0 // indirect
|
github.com/prometheus/client_model v0.2.0 // indirect
|
||||||
github.com/prometheus/common v0.30.0 // indirect
|
github.com/prometheus/common v0.33.0 // indirect
|
||||||
github.com/prometheus/procfs v0.7.3 // indirect
|
github.com/prometheus/procfs v0.7.3 // indirect
|
||||||
github.com/prometheus/tsdb v0.7.1 // indirect
|
github.com/prometheus/tsdb v0.10.0 // indirect
|
||||||
|
github.com/raulk/clock v1.1.0 // indirect
|
||||||
|
github.com/raulk/go-watchdog v1.2.0 // indirect
|
||||||
github.com/rjeczalik/notify v0.9.1 // indirect
|
github.com/rjeczalik/notify v0.9.1 // indirect
|
||||||
github.com/rs/cors v1.7.0 // indirect
|
github.com/rs/cors v1.7.0 // indirect
|
||||||
|
github.com/russross/blackfriday/v2 v2.1.0 // indirect
|
||||||
github.com/segmentio/fasthash v1.0.3 // indirect
|
github.com/segmentio/fasthash v1.0.3 // indirect
|
||||||
github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible // indirect
|
github.com/shirou/gopsutil v3.21.11+incompatible // indirect
|
||||||
|
github.com/smartystreets/assertions v1.0.1 // indirect
|
||||||
github.com/spacemonkeygo/spacelog v0.0.0-20180420211403-2296661a0572 // indirect
|
github.com/spacemonkeygo/spacelog v0.0.0-20180420211403-2296661a0572 // indirect
|
||||||
github.com/spaolacci/murmur3 v1.1.0 // indirect
|
github.com/spaolacci/murmur3 v1.1.0 // indirect
|
||||||
github.com/spf13/afero v1.8.2 // indirect
|
github.com/spf13/afero v1.8.2 // indirect
|
||||||
@@ -245,48 +245,52 @@ require (
|
|||||||
github.com/spf13/pflag v1.0.5 // indirect
|
github.com/spf13/pflag v1.0.5 // indirect
|
||||||
github.com/status-im/keycard-go v0.0.0-20190316090335-8537d3370df4 // indirect
|
github.com/status-im/keycard-go v0.0.0-20190316090335-8537d3370df4 // indirect
|
||||||
github.com/stretchr/objx v0.2.0 // indirect
|
github.com/stretchr/objx v0.2.0 // indirect
|
||||||
github.com/stretchr/testify v1.7.1 // indirect
|
github.com/stretchr/testify v1.7.2 // indirect
|
||||||
github.com/subosito/gotenv v1.2.0 // indirect
|
github.com/subosito/gotenv v1.2.0 // indirect
|
||||||
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // indirect
|
github.com/syndtr/goleveldb v1.0.1-0.20220614013038-64ee5596c38a // indirect
|
||||||
github.com/thoas/go-funk v0.9.2 // indirect
|
github.com/thoas/go-funk v0.9.2 // indirect
|
||||||
|
github.com/tidwall/gjson v1.14.0 // indirect
|
||||||
|
github.com/tidwall/match v1.1.1 // indirect
|
||||||
|
github.com/tidwall/pretty v1.2.0 // indirect
|
||||||
github.com/tklauser/go-sysconf v0.3.5 // indirect
|
github.com/tklauser/go-sysconf v0.3.5 // indirect
|
||||||
github.com/tklauser/numcpus v0.2.2 // indirect
|
github.com/tklauser/numcpus v0.2.2 // indirect
|
||||||
github.com/tyler-smith/go-bip39 v1.0.1-0.20181017060643-dbb3b84ba2ef // indirect
|
github.com/tyler-smith/go-bip39 v1.0.1-0.20181017060643-dbb3b84ba2ef // indirect
|
||||||
|
github.com/urfave/cli/v2 v2.10.2 // indirect
|
||||||
github.com/valyala/fastjson v1.6.3 // indirect
|
github.com/valyala/fastjson v1.6.3 // indirect
|
||||||
|
github.com/wI2L/jsondiff v0.2.0 // indirect
|
||||||
github.com/whyrusleeping/base32 v0.0.0-20170828182744-c30ac30633cc // indirect
|
github.com/whyrusleeping/base32 v0.0.0-20170828182744-c30ac30633cc // indirect
|
||||||
github.com/whyrusleeping/cbor-gen v0.0.0-20210219115102-f37d292932f2 // indirect
|
github.com/whyrusleeping/cbor-gen v0.0.0-20210219115102-f37d292932f2 // indirect
|
||||||
github.com/whyrusleeping/chunker v0.0.0-20181014151217-fe64bd25879f // indirect
|
github.com/whyrusleeping/chunker v0.0.0-20181014151217-fe64bd25879f // indirect
|
||||||
github.com/whyrusleeping/go-keyspace v0.0.0-20160322163242-5b898ac5add1 // indirect
|
github.com/whyrusleeping/go-keyspace v0.0.0-20160322163242-5b898ac5add1 // indirect
|
||||||
github.com/whyrusleeping/mdns v0.0.0-20190826153040-b9b60ed33aa9 // indirect
|
|
||||||
github.com/whyrusleeping/multiaddr-filter v0.0.0-20160516205228-e903e4adabd7 // indirect
|
github.com/whyrusleeping/multiaddr-filter v0.0.0-20160516205228-e903e4adabd7 // indirect
|
||||||
github.com/whyrusleeping/timecache v0.0.0-20160911033111-cfcb2f1abfee // indirect
|
github.com/whyrusleeping/timecache v0.0.0-20160911033111-cfcb2f1abfee // indirect
|
||||||
|
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect
|
||||||
|
github.com/yusufpapurcu/wmi v1.2.2 // indirect
|
||||||
go.opencensus.io v0.23.0 // indirect
|
go.opencensus.io v0.23.0 // indirect
|
||||||
go.opentelemetry.io/otel v0.20.0 // indirect
|
go.opentelemetry.io/otel v1.7.0 // indirect
|
||||||
go.opentelemetry.io/otel/metric v0.20.0 // indirect
|
go.opentelemetry.io/otel/trace v1.7.0 // indirect
|
||||||
go.opentelemetry.io/otel/trace v0.20.0 // indirect
|
|
||||||
go.uber.org/atomic v1.9.0 // indirect
|
go.uber.org/atomic v1.9.0 // indirect
|
||||||
go.uber.org/dig v1.10.0 // indirect
|
go.uber.org/dig v1.14.0 // indirect
|
||||||
go.uber.org/fx v1.13.1 // indirect
|
go.uber.org/fx v1.16.0 // indirect
|
||||||
go.uber.org/multierr v1.7.0 // indirect
|
go.uber.org/multierr v1.8.0 // indirect
|
||||||
go.uber.org/zap v1.19.0 // indirect
|
go.uber.org/zap v1.21.0 // indirect
|
||||||
go4.org v0.0.0-20200411211856-f5505b9728dd // indirect
|
go4.org v0.0.0-20200411211856-f5505b9728dd // indirect
|
||||||
golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e // indirect
|
golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90 // indirect
|
||||||
golang.org/x/mod v0.6.0-dev.0.20211013180041-c96bc1413d57 // indirect
|
golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3 // indirect
|
||||||
golang.org/x/net v0.0.0-20220412020605-290c469a71a5 // indirect
|
golang.org/x/net v0.0.0-20220607020251-c690dde0001d // indirect
|
||||||
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect
|
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect
|
||||||
golang.org/x/sys v0.0.0-20220412211240-33da011f77ad // indirect
|
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8 // indirect
|
||||||
golang.org/x/text v0.3.7 // indirect
|
golang.org/x/text v0.3.7 // indirect
|
||||||
golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba // indirect
|
golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba // indirect
|
||||||
golang.org/x/tools v0.1.8-0.20211029000441-d6a9af8af023 // indirect
|
golang.org/x/tools v0.1.10 // indirect
|
||||||
golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f // indirect
|
golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df // indirect
|
||||||
google.golang.org/protobuf v1.28.0 // indirect
|
google.golang.org/protobuf v1.28.0 // indirect
|
||||||
gopkg.in/ini.v1 v1.66.4 // indirect
|
gopkg.in/ini.v1 v1.66.4 // indirect
|
||||||
gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect
|
gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect
|
||||||
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
|
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
|
||||||
gopkg.in/urfave/cli.v1 v1.20.0 // indirect
|
|
||||||
gopkg.in/yaml.v2 v2.4.0 // indirect
|
gopkg.in/yaml.v2 v2.4.0 // indirect
|
||||||
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
|
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||||
lukechampine.com/blake3 v1.1.6 // indirect
|
lukechampine.com/blake3 v1.1.7 // indirect
|
||||||
)
|
)
|
||||||
|
|
||||||
replace github.com/ethereum/go-ethereum v1.10.19 => github.com/vulcanize/go-ethereum v1.10.19-statediff-4.1.0-alpha
|
replace github.com/ethereum/go-ethereum v1.10.23 => github.com/cerc-io/go-ethereum v1.10.23-statediff-4.2.0-alpha
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ package main
|
|||||||
import (
|
import (
|
||||||
"github.com/sirupsen/logrus"
|
"github.com/sirupsen/logrus"
|
||||||
|
|
||||||
"github.com/vulcanize/ipld-eth-server/v4/cmd"
|
"github.com/cerc-io/ipld-eth-server/v4/cmd"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|||||||
@@ -22,8 +22,8 @@ import (
|
|||||||
|
|
||||||
"github.com/ethereum/go-ethereum/rpc"
|
"github.com/ethereum/go-ethereum/rpc"
|
||||||
|
|
||||||
"github.com/vulcanize/ipld-eth-server/v4/pkg/eth"
|
"github.com/cerc-io/ipld-eth-server/v4/pkg/eth"
|
||||||
"github.com/vulcanize/ipld-eth-server/v4/pkg/serve"
|
"github.com/cerc-io/ipld-eth-server/v4/pkg/serve"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Client is used to subscribe to the ipld-eth-server ipld data stream
|
// Client is used to subscribe to the ipld-eth-server ipld data stream
|
||||||
|
|||||||
@@ -0,0 +1,54 @@
|
|||||||
|
// VulcanizeDB
|
||||||
|
// Copyright © 2022 Vulcanize
|
||||||
|
|
||||||
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU Affero General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU Affero General Public License for more details.
|
||||||
|
|
||||||
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
package debug
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"errors"
|
||||||
|
|
||||||
|
"github.com/ethereum/go-ethereum/core"
|
||||||
|
"github.com/ethereum/go-ethereum/core/state"
|
||||||
|
"github.com/ethereum/go-ethereum/core/types"
|
||||||
|
"github.com/ethereum/go-ethereum/core/vm"
|
||||||
|
"github.com/ethereum/go-ethereum/eth/tracers"
|
||||||
|
"github.com/ethereum/go-ethereum/rpc"
|
||||||
|
|
||||||
|
"github.com/cerc-io/ipld-eth-server/v4/pkg/eth"
|
||||||
|
)
|
||||||
|
|
||||||
|
var _ tracers.Backend = &Backend{}
|
||||||
|
|
||||||
|
var (
|
||||||
|
errMethodNotSupported = errors.New("backend method not supported")
|
||||||
|
)
|
||||||
|
|
||||||
|
// Backend implements tracers.Backend interface
|
||||||
|
type Backend struct {
|
||||||
|
eth.Backend
|
||||||
|
}
|
||||||
|
|
||||||
|
// StateAtBlock retrieves the state database associated with a certain block
|
||||||
|
func (b *Backend) StateAtBlock(ctx context.Context, block *types.Block, reexec uint64, base *state.StateDB, checkLive, preferDisk bool) (*state.StateDB, error) {
|
||||||
|
rpcBlockNumber := rpc.BlockNumber(block.NumberU64())
|
||||||
|
statedb, _, err := b.StateAndHeaderByNumberOrHash(ctx, rpc.BlockNumberOrHashWithNumber(rpcBlockNumber))
|
||||||
|
return statedb, err
|
||||||
|
}
|
||||||
|
|
||||||
|
// StateAtTransaction returns the execution environment of a certain transaction
|
||||||
|
func (b *Backend) StateAtTransaction(ctx context.Context, block *types.Block, txIndex int, reexec uint64) (core.Message, vm.BlockContext, *state.StateDB, error) {
|
||||||
|
return nil, vm.BlockContext{}, nil, errMethodNotSupported
|
||||||
|
}
|
||||||
+29
-20
@@ -42,7 +42,12 @@ import (
|
|||||||
"github.com/ethereum/go-ethereum/statediff"
|
"github.com/ethereum/go-ethereum/statediff"
|
||||||
"github.com/sirupsen/logrus"
|
"github.com/sirupsen/logrus"
|
||||||
|
|
||||||
"github.com/vulcanize/ipld-eth-server/v4/pkg/shared"
|
"github.com/cerc-io/ipld-eth-server/v4/pkg/shared"
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
defaultEVMTimeout = 30 * time.Second
|
||||||
|
defaultStateDiffTimeout = 240 * time.Second
|
||||||
)
|
)
|
||||||
|
|
||||||
// APIName is the namespace for the watcher's eth api
|
// APIName is the namespace for the watcher's eth api
|
||||||
@@ -66,6 +71,9 @@ type PublicEthAPI struct {
|
|||||||
|
|
||||||
// NewPublicEthAPI creates a new PublicEthAPI with the provided underlying Backend
|
// NewPublicEthAPI creates a new PublicEthAPI with the provided underlying Backend
|
||||||
func NewPublicEthAPI(b *Backend, client *rpc.Client, supportsStateDiff, forwardEthCalls, proxyOnError bool) (*PublicEthAPI, error) {
|
func NewPublicEthAPI(b *Backend, client *rpc.Client, supportsStateDiff, forwardEthCalls, proxyOnError bool) (*PublicEthAPI, error) {
|
||||||
|
if b == nil {
|
||||||
|
return nil, errors.New("ipld-eth-server must be configured with an ethereum backend")
|
||||||
|
}
|
||||||
if forwardEthCalls && client == nil {
|
if forwardEthCalls && client == nil {
|
||||||
return nil, errors.New("ipld-eth-server is configured to forward eth_calls to proxy node but no proxy node is configured")
|
return nil, errors.New("ipld-eth-server is configured to forward eth_calls to proxy node but no proxy node is configured")
|
||||||
}
|
}
|
||||||
@@ -120,11 +128,10 @@ func (pea *PublicEthAPI) GetHeaderByHash(ctx context.Context, hash common.Hash)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if pea.proxyOnError {
|
if pea.proxyOnError {
|
||||||
if header, err := pea.ethClient.HeaderByHash(ctx, hash); header != nil && err == nil {
|
var result map[string]interface{}
|
||||||
|
if err := pea.rpc.CallContext(ctx, &result, "eth_getHeaderByHash", hash); result != nil && err == nil {
|
||||||
go pea.writeStateDiffFor(hash)
|
go pea.writeStateDiffFor(hash)
|
||||||
if res, err := pea.rpcMarshalHeader(header); err != nil {
|
return result
|
||||||
return res
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -175,6 +182,7 @@ func (pea *PublicEthAPI) GetBlockByNumber(ctx context.Context, number rpc.BlockN
|
|||||||
// GetBlockByHash returns the requested block. When fullTx is true all transactions in the block are returned in full
|
// GetBlockByHash returns the requested block. When fullTx is true all transactions in the block are returned in full
|
||||||
// detail, otherwise only the transaction hash is returned.
|
// detail, otherwise only the transaction hash is returned.
|
||||||
func (pea *PublicEthAPI) GetBlockByHash(ctx context.Context, hash common.Hash, fullTx bool) (map[string]interface{}, error) {
|
func (pea *PublicEthAPI) GetBlockByHash(ctx context.Context, hash common.Hash, fullTx bool) (map[string]interface{}, error) {
|
||||||
|
logrus.Debug("Received getBlockByHash request for hash ", hash.Hex())
|
||||||
block, err := pea.B.BlockByHash(ctx, hash)
|
block, err := pea.B.BlockByHash(ctx, hash)
|
||||||
if block != nil && err == nil {
|
if block != nil && err == nil {
|
||||||
return pea.rpcMarshalBlock(block, true, fullTx)
|
return pea.rpcMarshalBlock(block, true, fullTx)
|
||||||
@@ -191,21 +199,17 @@ func (pea *PublicEthAPI) GetBlockByHash(ctx context.Context, hash common.Hash, f
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ChainId is the EIP-155 replay-protection chain id for the current ethereum chain config.
|
// ChainId is the EIP-155 replay-protection chain id for the current ethereum chain config.
|
||||||
func (pea *PublicEthAPI) ChainId() (*hexutil.Big, error) {
|
func (pea *PublicEthAPI) ChainId() *hexutil.Big {
|
||||||
block, err := pea.B.CurrentBlock()
|
if pea.B.Config.ChainConfig.ChainID == nil || pea.B.Config.ChainConfig.ChainID.Cmp(big.NewInt(0)) <= 0 {
|
||||||
if err != nil {
|
|
||||||
if pea.proxyOnError {
|
if pea.proxyOnError {
|
||||||
if id, err := pea.ethClient.ChainID(context.Background()); err == nil {
|
if id, err := pea.ethClient.ChainID(context.Background()); err == nil {
|
||||||
return (*hexutil.Big)(id), nil
|
return (*hexutil.Big)(id)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return nil, err
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
if config := pea.B.Config.ChainConfig; config.IsEIP155(block.Number()) {
|
return (*hexutil.Big)(pea.B.Config.ChainConfig.ChainID)
|
||||||
return (*hexutil.Big)(config.ChainID), nil
|
|
||||||
}
|
|
||||||
return nil, fmt.Errorf("chain not synced beyond EIP-155 replay-protection fork block")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -928,7 +932,7 @@ func (pea *PublicEthAPI) Call(ctx context.Context, args CallArgs, blockNrOrHash
|
|||||||
return hex, err
|
return hex, err
|
||||||
}
|
}
|
||||||
|
|
||||||
result, err := DoCall(ctx, pea.B, args, blockNrOrHash, overrides, 5*time.Second, pea.B.Config.RPCGasCap.Uint64())
|
result, err := DoCall(ctx, pea.B, args, blockNrOrHash, overrides, defaultEVMTimeout, pea.B.Config.RPCGasCap.Uint64())
|
||||||
|
|
||||||
// If the result contains a revert reason, try to unpack and return it.
|
// If the result contains a revert reason, try to unpack and return it.
|
||||||
if err == nil {
|
if err == nil {
|
||||||
@@ -946,7 +950,12 @@ func (pea *PublicEthAPI) Call(ctx context.Context, args CallArgs, blockNrOrHash
|
|||||||
return hex, nil
|
return hex, nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result.Return(), err
|
|
||||||
|
if result != nil {
|
||||||
|
return result.Return(), err
|
||||||
|
} else {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func DoCall(ctx context.Context, b *Backend, args CallArgs, blockNrOrHash rpc.BlockNumberOrHash, overrides *StateOverride, timeout time.Duration, globalGasCap uint64) (*core.ExecutionResult, error) {
|
func DoCall(ctx context.Context, b *Backend, args CallArgs, blockNrOrHash rpc.BlockNumberOrHash, overrides *StateOverride, timeout time.Duration, globalGasCap uint64) (*core.ExecutionResult, error) {
|
||||||
@@ -1055,7 +1064,7 @@ func (pea *PublicEthAPI) writeStateDiffAt(height int64) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
// we use a separate context than the one provided by the client
|
// we use a separate context than the one provided by the client
|
||||||
ctx, cancel := context.WithTimeout(context.Background(), 240*time.Second)
|
ctx, cancel := context.WithTimeout(context.Background(), defaultStateDiffTimeout)
|
||||||
defer cancel()
|
defer cancel()
|
||||||
var data json.RawMessage
|
var data json.RawMessage
|
||||||
params := statediff.Params{
|
params := statediff.Params{
|
||||||
@@ -1077,7 +1086,7 @@ func (pea *PublicEthAPI) writeStateDiffFor(blockHash common.Hash) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
// we use a separate context than the one provided by the client
|
// we use a separate context than the one provided by the client
|
||||||
ctx, cancel := context.WithTimeout(context.Background(), 240*time.Second)
|
ctx, cancel := context.WithTimeout(context.Background(), defaultStateDiffTimeout)
|
||||||
defer cancel()
|
defer cancel()
|
||||||
var data json.RawMessage
|
var data json.RawMessage
|
||||||
params := statediff.Params{
|
params := statediff.Params{
|
||||||
@@ -1097,13 +1106,13 @@ func (pea *PublicEthAPI) writeStateDiffFor(blockHash common.Hash) {
|
|||||||
func (pea *PublicEthAPI) rpcMarshalBlock(b *types.Block, inclTx bool, fullTx bool) (map[string]interface{}, error) {
|
func (pea *PublicEthAPI) rpcMarshalBlock(b *types.Block, inclTx bool, fullTx bool) (map[string]interface{}, error) {
|
||||||
fields, err := RPCMarshalBlock(b, inclTx, fullTx)
|
fields, err := RPCMarshalBlock(b, inclTx, fullTx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logrus.Error("error RPC marshalling block with hash", b.Hash().String(), err)
|
logrus.Errorf("error RPC marshalling block with hash %s: %s", b.Hash().String(), err)
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
if inclTx {
|
if inclTx {
|
||||||
td, err := pea.B.GetTd(b.Hash())
|
td, err := pea.B.GetTd(b.Hash())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logrus.Error("error getting td for block with hash and number", b.Hash().String(), b.Number().String(), err)
|
logrus.Errorf("error getting td for block with hash and number %s, %s: %s", b.Hash().String(), b.Number().String(), err)
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
fields["totalDifficulty"] = (*hexutil.Big)(td)
|
fields["totalDifficulty"] = (*hexutil.Big)(td)
|
||||||
|
|||||||
+28
-5
@@ -21,6 +21,10 @@ import (
|
|||||||
"math/big"
|
"math/big"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
|
"github.com/cerc-io/ipld-eth-server/v4/pkg/eth"
|
||||||
|
"github.com/cerc-io/ipld-eth-server/v4/pkg/eth/test_helpers"
|
||||||
|
"github.com/cerc-io/ipld-eth-server/v4/pkg/shared"
|
||||||
|
ethServerShared "github.com/cerc-io/ipld-eth-server/v4/pkg/shared"
|
||||||
"github.com/ethereum/go-ethereum/common"
|
"github.com/ethereum/go-ethereum/common"
|
||||||
"github.com/ethereum/go-ethereum/common/hexutil"
|
"github.com/ethereum/go-ethereum/common/hexutil"
|
||||||
"github.com/ethereum/go-ethereum/core/types"
|
"github.com/ethereum/go-ethereum/core/types"
|
||||||
@@ -35,11 +39,6 @@ import (
|
|||||||
"github.com/jmoiron/sqlx"
|
"github.com/jmoiron/sqlx"
|
||||||
. "github.com/onsi/ginkgo"
|
. "github.com/onsi/ginkgo"
|
||||||
. "github.com/onsi/gomega"
|
. "github.com/onsi/gomega"
|
||||||
|
|
||||||
"github.com/vulcanize/ipld-eth-server/v4/pkg/eth"
|
|
||||||
"github.com/vulcanize/ipld-eth-server/v4/pkg/eth/test_helpers"
|
|
||||||
"github.com/vulcanize/ipld-eth-server/v4/pkg/shared"
|
|
||||||
ethServerShared "github.com/vulcanize/ipld-eth-server/v4/pkg/shared"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@@ -334,6 +333,18 @@ var _ = Describe("API", func() {
|
|||||||
Expect(err).ToNot(HaveOccurred())
|
Expect(err).ToNot(HaveOccurred())
|
||||||
Expect(block["baseFee"].(*big.Int)).To(Equal(baseFee))
|
Expect(block["baseFee"].(*big.Int)).To(Equal(baseFee))
|
||||||
})
|
})
|
||||||
|
It("Retrieves a block by number with uncles in correct order", func() {
|
||||||
|
block, err := api.GetBlockByNumber(ctx, londonBlockNum, false)
|
||||||
|
Expect(err).ToNot(HaveOccurred())
|
||||||
|
|
||||||
|
expectedUncles := []common.Hash{
|
||||||
|
test_helpers.MockLondonUncles[0].Hash(),
|
||||||
|
test_helpers.MockLondonUncles[1].Hash(),
|
||||||
|
}
|
||||||
|
Expect(block["uncles"]).To(Equal(expectedUncles))
|
||||||
|
Expect(block["sha3Uncles"]).To(Equal(test_helpers.MockLondonBlock.UncleHash()))
|
||||||
|
Expect(block["hash"]).To(Equal(test_helpers.MockLondonBlock.Hash()))
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
Describe("eth_getBlockByHash", func() {
|
Describe("eth_getBlockByHash", func() {
|
||||||
@@ -375,6 +386,18 @@ var _ = Describe("API", func() {
|
|||||||
Expect(err).ToNot(HaveOccurred())
|
Expect(err).ToNot(HaveOccurred())
|
||||||
Expect(block["baseFee"].(*big.Int)).To(Equal(baseFee))
|
Expect(block["baseFee"].(*big.Int)).To(Equal(baseFee))
|
||||||
})
|
})
|
||||||
|
It("Retrieves a block by hash with uncles in correct order", func() {
|
||||||
|
block, err := api.GetBlockByHash(ctx, test_helpers.MockLondonBlock.Hash(), false)
|
||||||
|
Expect(err).ToNot(HaveOccurred())
|
||||||
|
|
||||||
|
expectedUncles := []common.Hash{
|
||||||
|
test_helpers.MockLondonUncles[0].Hash(),
|
||||||
|
test_helpers.MockLondonUncles[1].Hash(),
|
||||||
|
}
|
||||||
|
Expect(block["uncles"]).To(Equal(expectedUncles))
|
||||||
|
Expect(block["sha3Uncles"]).To(Equal(test_helpers.MockLondonBlock.UncleHash()))
|
||||||
|
Expect(block["hash"]).To(Equal(test_helpers.MockLondonBlock.Hash()))
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
+167
-179
@@ -24,6 +24,8 @@ import (
|
|||||||
"math/big"
|
"math/big"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
validator "github.com/cerc-io/eth-ipfs-state-validator/v4/pkg"
|
||||||
|
ipfsethdb "github.com/cerc-io/ipfs-ethdb/v4/postgres"
|
||||||
"github.com/ethereum/go-ethereum/common"
|
"github.com/ethereum/go-ethereum/common"
|
||||||
"github.com/ethereum/go-ethereum/common/hexutil"
|
"github.com/ethereum/go-ethereum/common/hexutil"
|
||||||
"github.com/ethereum/go-ethereum/consensus"
|
"github.com/ethereum/go-ethereum/consensus"
|
||||||
@@ -39,16 +41,13 @@ import (
|
|||||||
"github.com/ethereum/go-ethereum/params"
|
"github.com/ethereum/go-ethereum/params"
|
||||||
"github.com/ethereum/go-ethereum/rlp"
|
"github.com/ethereum/go-ethereum/rlp"
|
||||||
"github.com/ethereum/go-ethereum/rpc"
|
"github.com/ethereum/go-ethereum/rpc"
|
||||||
"github.com/ethereum/go-ethereum/statediff/indexer/models"
|
|
||||||
"github.com/ethereum/go-ethereum/trie"
|
"github.com/ethereum/go-ethereum/trie"
|
||||||
"github.com/jmoiron/sqlx"
|
"github.com/jmoiron/sqlx"
|
||||||
log "github.com/sirupsen/logrus"
|
log "github.com/sirupsen/logrus"
|
||||||
validator "github.com/vulcanize/eth-ipfs-state-validator/v4/pkg"
|
|
||||||
ipfsethdb "github.com/vulcanize/ipfs-ethdb/v4/postgres"
|
|
||||||
|
|
||||||
ethServerShared "github.com/ethereum/go-ethereum/statediff/indexer/shared"
|
ethServerShared "github.com/ethereum/go-ethereum/statediff/indexer/shared"
|
||||||
|
|
||||||
"github.com/vulcanize/ipld-eth-server/v4/pkg/shared"
|
"github.com/cerc-io/ipld-eth-server/v4/pkg/shared"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@@ -192,7 +191,23 @@ func (b *Backend) HeaderByNumber(ctx context.Context, blockNumber rpc.BlockNumbe
|
|||||||
|
|
||||||
// HeaderByHash gets the header for the provided block hash
|
// HeaderByHash gets the header for the provided block hash
|
||||||
func (b *Backend) HeaderByHash(ctx context.Context, hash common.Hash) (*types.Header, error) {
|
func (b *Backend) HeaderByHash(ctx context.Context, hash common.Hash) (*types.Header, error) {
|
||||||
_, headerRLP, err := b.IPLDRetriever.RetrieveHeaderByHash(hash)
|
// Begin tx
|
||||||
|
tx, err := b.DB.Beginx()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
defer func() {
|
||||||
|
if p := recover(); p != nil {
|
||||||
|
shared.Rollback(tx)
|
||||||
|
panic(p)
|
||||||
|
} else if err != nil {
|
||||||
|
shared.Rollback(tx)
|
||||||
|
} else {
|
||||||
|
err = tx.Commit()
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
|
||||||
|
_, headerRLP, err := b.IPLDRetriever.RetrieveHeaderByHash(tx, hash)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -243,6 +258,11 @@ func (b *Backend) GetTd(blockHash common.Hash) (*big.Int, error) {
|
|||||||
return td, nil
|
return td, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ChainConfig returns the active chain configuration.
|
||||||
|
func (b *Backend) ChainConfig() *params.ChainConfig {
|
||||||
|
return b.Config.ChainConfig
|
||||||
|
}
|
||||||
|
|
||||||
// CurrentBlock returns the current block
|
// CurrentBlock returns the current block
|
||||||
func (b *Backend) CurrentBlock() (*types.Block, error) {
|
func (b *Backend) CurrentBlock() (*types.Block, error) {
|
||||||
block, err := b.BlockByNumber(context.Background(), rpc.LatestBlockNumber)
|
block, err := b.BlockByNumber(context.Background(), rpc.LatestBlockNumber)
|
||||||
@@ -281,7 +301,7 @@ func (b *Backend) BlockByNumberOrHash(ctx context.Context, blockNrOrHash rpc.Blo
|
|||||||
return nil, errors.New("invalid arguments; neither block nor hash specified")
|
return nil, errors.New("invalid arguments; neither block nor hash specified")
|
||||||
}
|
}
|
||||||
|
|
||||||
// BlockByNumber returns the requested canonical block.
|
// BlockByNumber returns the requested canonical block
|
||||||
func (b *Backend) BlockByNumber(ctx context.Context, blockNumber rpc.BlockNumber) (*types.Block, error) {
|
func (b *Backend) BlockByNumber(ctx context.Context, blockNumber rpc.BlockNumber) (*types.Block, error) {
|
||||||
var err error
|
var err error
|
||||||
number := blockNumber.Int64()
|
number := blockNumber.Int64()
|
||||||
@@ -303,6 +323,7 @@ func (b *Backend) BlockByNumber(ctx context.Context, blockNumber rpc.BlockNumber
|
|||||||
if number < 0 {
|
if number < 0 {
|
||||||
return nil, errNegativeBlockNumber
|
return nil, errNegativeBlockNumber
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the canonical hash
|
// Get the canonical hash
|
||||||
canonicalHash, err := b.GetCanonicalHash(uint64(number))
|
canonicalHash, err := b.GetCanonicalHash(uint64(number))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -311,118 +332,12 @@ func (b *Backend) BlockByNumber(ctx context.Context, blockNumber rpc.BlockNumber
|
|||||||
}
|
}
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
// Retrieve all the CIDs for the block
|
|
||||||
// TODO: optimize this by retrieving iplds directly rather than the cids first (this is remanent from when we fetched iplds through ipfs blockservice interface)
|
|
||||||
headerCID, uncleCIDs, txCIDs, rctCIDs, err := b.Retriever.RetrieveBlockByHash(canonicalHash)
|
|
||||||
if err != nil {
|
|
||||||
if err == sql.ErrNoRows {
|
|
||||||
return nil, nil
|
|
||||||
}
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
// Begin tx
|
return b.BlockByHash(ctx, canonicalHash)
|
||||||
tx, err := b.DB.Beginx()
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
defer func() {
|
|
||||||
if p := recover(); p != nil {
|
|
||||||
shared.Rollback(tx)
|
|
||||||
panic(p)
|
|
||||||
} else if err != nil {
|
|
||||||
shared.Rollback(tx)
|
|
||||||
} else {
|
|
||||||
err = tx.Commit()
|
|
||||||
}
|
|
||||||
}()
|
|
||||||
|
|
||||||
// Fetch and decode the header IPLD
|
|
||||||
var headerIPLD models.IPLDModel
|
|
||||||
headerIPLD, err = b.Fetcher.FetchHeader(tx, headerCID)
|
|
||||||
if err != nil {
|
|
||||||
log.Error("error fetching header ipld", err)
|
|
||||||
if err == sql.ErrNoRows {
|
|
||||||
return nil, nil
|
|
||||||
}
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
var header types.Header
|
|
||||||
err = rlp.DecodeBytes(headerIPLD.Data, &header)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
// Fetch and decode the uncle IPLDs
|
|
||||||
var uncleIPLDs []models.IPLDModel
|
|
||||||
uncleIPLDs, err = b.Fetcher.FetchUncles(tx, uncleCIDs)
|
|
||||||
if err != nil {
|
|
||||||
log.Error("error fetching uncle iplds", err)
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
var uncles []*types.Header
|
|
||||||
for _, uncleIPLD := range uncleIPLDs {
|
|
||||||
var uncle types.Header
|
|
||||||
err = rlp.DecodeBytes(uncleIPLD.Data, &uncle)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
uncles = append(uncles, &uncle)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Fetch and decode the transaction IPLDs
|
|
||||||
var txIPLDs []models.IPLDModel
|
|
||||||
txIPLDs, err = b.Fetcher.FetchTrxs(tx, txCIDs)
|
|
||||||
if err != nil {
|
|
||||||
log.Error("error fetching tx iplds", err)
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
var transactions []*types.Transaction
|
|
||||||
for _, txIPLD := range txIPLDs {
|
|
||||||
var transaction types.Transaction
|
|
||||||
err = transaction.UnmarshalBinary(txIPLD.Data)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
transactions = append(transactions, &transaction)
|
|
||||||
}
|
|
||||||
// Fetch and decode the receipt IPLDs
|
|
||||||
var rctIPLDs []models.IPLDModel
|
|
||||||
rctIPLDs, err = b.Fetcher.FetchRcts(tx, rctCIDs)
|
|
||||||
if err != nil {
|
|
||||||
log.Error("error fetching rct iplds", err)
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
var receipts []*types.Receipt
|
|
||||||
for _, rctIPLD := range rctIPLDs {
|
|
||||||
var receipt types.Receipt
|
|
||||||
nodeVal, err := DecodeLeafNode(rctIPLD.Data)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
err = receipt.UnmarshalBinary(nodeVal)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
receipts = append(receipts, &receipt)
|
|
||||||
}
|
|
||||||
// Compose everything together into a complete block
|
|
||||||
return types.NewBlock(&header, transactions, uncles, receipts, new(trie.Trie)), err
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// BlockByHash returns the requested block. When fullTx is true all transactions in the block are returned in full
|
// BlockByHash returns the requested block
|
||||||
// detail, otherwise only the transaction hash is returned.
|
|
||||||
func (b *Backend) BlockByHash(ctx context.Context, hash common.Hash) (*types.Block, error) {
|
func (b *Backend) BlockByHash(ctx context.Context, hash common.Hash) (*types.Block, error) {
|
||||||
// Retrieve all the CIDs for the block
|
|
||||||
headerCID, uncleCIDs, txCIDs, rctCIDs, err := b.Retriever.RetrieveBlockByHash(hash)
|
|
||||||
if err != nil {
|
|
||||||
if err == sql.ErrNoRows {
|
|
||||||
return nil, nil
|
|
||||||
}
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
// Begin tx
|
// Begin tx
|
||||||
tx, err := b.DB.Beginx()
|
tx, err := b.DB.Beginx()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -439,85 +354,126 @@ func (b *Backend) BlockByHash(ctx context.Context, hash common.Hash) (*types.Blo
|
|||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
// Fetch and decode the header IPLD
|
// Fetch header
|
||||||
var headerIPLD models.IPLDModel
|
header, err := b.GetHeaderByBlockHash(tx, hash)
|
||||||
headerIPLD, err = b.Fetcher.FetchHeader(tx, headerCID)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error("error fetching header ipld", err)
|
log.Error("error fetching header: ", err)
|
||||||
if err == sql.ErrNoRows {
|
if err == sql.ErrNoRows {
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
var header types.Header
|
|
||||||
err = rlp.DecodeBytes(headerIPLD.Data, &header)
|
// Fetch uncles
|
||||||
if err != nil {
|
uncles, err := b.GetUnclesByBlockHash(tx, hash)
|
||||||
|
if err != nil && err != sql.ErrNoRows {
|
||||||
|
log.Error("error fetching uncles: ", err)
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
// Fetch and decode the uncle IPLDs
|
|
||||||
var uncleIPLDs []models.IPLDModel
|
// When num. of uncles = 2,
|
||||||
uncleIPLDs, err = b.Fetcher.FetchUncles(tx, uncleCIDs)
|
// Check if calculated uncle hash matches the one in header
|
||||||
if err != nil {
|
// If not, re-order the two uncles
|
||||||
log.Error("error fetching uncle iplds", err)
|
// Assumption: Max num. of uncles in mainnet = 2
|
||||||
if err == sql.ErrNoRows {
|
if len(uncles) == 2 {
|
||||||
return nil, nil
|
uncleHash := types.CalcUncleHash(uncles)
|
||||||
|
if uncleHash != header.UncleHash {
|
||||||
|
uncles[0], uncles[1] = uncles[1], uncles[0]
|
||||||
|
|
||||||
|
uncleHash = types.CalcUncleHash(uncles)
|
||||||
|
// Check if uncle hash matches after re-ordering
|
||||||
|
if uncleHash != header.UncleHash {
|
||||||
|
log.Error("uncle hash mismatch for block hash: ", hash.Hex())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Fetch transactions
|
||||||
|
transactions, err := b.GetTransactionsByBlockHash(tx, hash)
|
||||||
|
if err != nil && err != sql.ErrNoRows {
|
||||||
|
log.Error("error fetching transactions: ", err)
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
var uncles []*types.Header
|
|
||||||
for _, uncleIPLD := range uncleIPLDs {
|
// Fetch receipts
|
||||||
|
receipts, err := b.GetReceiptsByBlockHash(tx, hash)
|
||||||
|
if err != nil && err != sql.ErrNoRows {
|
||||||
|
log.Error("error fetching receipts: ", err)
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
// Compose everything together into a complete block
|
||||||
|
return types.NewBlock(header, transactions, uncles, receipts, new(trie.Trie)), err
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetHeaderByBlockHash retrieves header for a provided block hash
|
||||||
|
func (b *Backend) GetHeaderByBlockHash(tx *sqlx.Tx, hash common.Hash) (*types.Header, error) {
|
||||||
|
_, headerRLP, err := b.IPLDRetriever.RetrieveHeaderByHash(tx, hash)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
header := new(types.Header)
|
||||||
|
return header, rlp.DecodeBytes(headerRLP, header)
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetUnclesByBlockHash retrieves uncles for a provided block hash
|
||||||
|
func (b *Backend) GetUnclesByBlockHash(tx *sqlx.Tx, hash common.Hash) ([]*types.Header, error) {
|
||||||
|
_, uncleBytes, err := b.IPLDRetriever.RetrieveUnclesByBlockHash(tx, hash)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
uncles := make([]*types.Header, len(uncleBytes))
|
||||||
|
for i, bytes := range uncleBytes {
|
||||||
var uncle types.Header
|
var uncle types.Header
|
||||||
err = rlp.DecodeBytes(uncleIPLD.Data, &uncle)
|
err = rlp.DecodeBytes(bytes, &uncle)
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
uncles = append(uncles, &uncle)
|
|
||||||
}
|
|
||||||
// Fetch and decode the transaction IPLDs
|
|
||||||
var txIPLDs []models.IPLDModel
|
|
||||||
txIPLDs, err = b.Fetcher.FetchTrxs(tx, txCIDs)
|
|
||||||
if err != nil {
|
|
||||||
log.Error("error fetching tx iplds", err)
|
|
||||||
if err == sql.ErrNoRows {
|
|
||||||
return nil, nil
|
|
||||||
}
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
var transactions []*types.Transaction
|
|
||||||
for _, txIPLD := range txIPLDs {
|
|
||||||
var transaction types.Transaction
|
|
||||||
err = transaction.UnmarshalBinary(txIPLD.Data)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
transactions = append(transactions, &transaction)
|
|
||||||
}
|
|
||||||
// Fetch and decode the receipt IPLDs
|
|
||||||
var rctIPLDs []models.IPLDModel
|
|
||||||
rctIPLDs, err = b.Fetcher.FetchRcts(tx, rctCIDs)
|
|
||||||
if err != nil {
|
|
||||||
log.Error("error fetching rct iplds", err)
|
|
||||||
if err == sql.ErrNoRows {
|
|
||||||
return nil, nil
|
|
||||||
}
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
var receipts []*types.Receipt
|
|
||||||
for _, rctIPLD := range rctIPLDs {
|
|
||||||
var receipt types.Receipt
|
|
||||||
nodeVal, err := DecodeLeafNode(rctIPLD.Data)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
err = receipt.UnmarshalBinary(nodeVal)
|
uncles[i] = &uncle
|
||||||
if err != nil {
|
}
|
||||||
|
|
||||||
|
return uncles, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetTransactionsByBlockHash retrieves transactions for a provided block hash
|
||||||
|
func (b *Backend) GetTransactionsByBlockHash(tx *sqlx.Tx, hash common.Hash) (types.Transactions, error) {
|
||||||
|
_, transactionBytes, err := b.IPLDRetriever.RetrieveTransactionsByBlockHash(tx, hash)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
txs := make(types.Transactions, len(transactionBytes))
|
||||||
|
for i, txBytes := range transactionBytes {
|
||||||
|
var tx types.Transaction
|
||||||
|
if err := tx.UnmarshalBinary(txBytes); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
receipts = append(receipts, &receipt)
|
|
||||||
|
txs[i] = &tx
|
||||||
}
|
}
|
||||||
// Compose everything together into a complete block
|
|
||||||
return types.NewBlock(&header, transactions, uncles, receipts, new(trie.Trie)), err
|
return txs, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetReceiptsByBlockHash retrieves receipts for a provided block hash
|
||||||
|
func (b *Backend) GetReceiptsByBlockHash(tx *sqlx.Tx, hash common.Hash) (types.Receipts, error) {
|
||||||
|
_, receiptBytes, txs, err := b.IPLDRetriever.RetrieveReceiptsByBlockHash(tx, hash)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
rcts := make(types.Receipts, len(receiptBytes))
|
||||||
|
for i, rctBytes := range receiptBytes {
|
||||||
|
rct := new(types.Receipt)
|
||||||
|
if err := rct.UnmarshalBinary(rctBytes); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
rct.TxHash = txs[i]
|
||||||
|
rcts[i] = rct
|
||||||
|
}
|
||||||
|
return rcts, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetTransaction retrieves a tx by hash
|
// GetTransaction retrieves a tx by hash
|
||||||
@@ -551,7 +507,23 @@ func (b *Backend) GetTransaction(ctx context.Context, txHash common.Hash) (*type
|
|||||||
|
|
||||||
// GetReceipts retrieves receipts for provided block hash
|
// GetReceipts retrieves receipts for provided block hash
|
||||||
func (b *Backend) GetReceipts(ctx context.Context, hash common.Hash) (types.Receipts, error) {
|
func (b *Backend) GetReceipts(ctx context.Context, hash common.Hash) (types.Receipts, error) {
|
||||||
_, receiptBytes, txs, err := b.IPLDRetriever.RetrieveReceiptsByBlockHash(hash)
|
// Begin tx
|
||||||
|
tx, err := b.DB.Beginx()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
defer func() {
|
||||||
|
if p := recover(); p != nil {
|
||||||
|
shared.Rollback(tx)
|
||||||
|
panic(p)
|
||||||
|
} else if err != nil {
|
||||||
|
shared.Rollback(tx)
|
||||||
|
} else {
|
||||||
|
err = tx.Commit()
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
|
||||||
|
_, receiptBytes, txs, err := b.IPLDRetriever.RetrieveReceiptsByBlockHash(tx, hash)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -568,8 +540,24 @@ func (b *Backend) GetReceipts(ctx context.Context, hash common.Hash) (types.Rece
|
|||||||
}
|
}
|
||||||
|
|
||||||
// GetLogs returns all the logs for the given block hash
|
// GetLogs returns all the logs for the given block hash
|
||||||
func (b *Backend) GetLogs(ctx context.Context, hash common.Hash) ([][]*types.Log, error) {
|
func (b *Backend) GetLogs(ctx context.Context, hash common.Hash, number uint64) ([][]*types.Log, error) {
|
||||||
_, receiptBytes, txs, err := b.IPLDRetriever.RetrieveReceiptsByBlockHash(hash)
|
// Begin tx
|
||||||
|
tx, err := b.DB.Beginx()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
defer func() {
|
||||||
|
if p := recover(); p != nil {
|
||||||
|
shared.Rollback(tx)
|
||||||
|
panic(p)
|
||||||
|
} else if err != nil {
|
||||||
|
shared.Rollback(tx)
|
||||||
|
} else {
|
||||||
|
err = tx.Commit()
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
|
||||||
|
_, receiptBytes, txs, err := b.IPLDRetriever.RetrieveReceiptsByBlockHash(tx, hash)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -866,8 +854,8 @@ func (b *Backend) ValidateTrie(stateRoot common.Hash) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// RPCGasCap returns the configured gas cap for the rpc server
|
// RPCGasCap returns the configured gas cap for the rpc server
|
||||||
func (b *Backend) RPCGasCap() *big.Int {
|
func (b *Backend) RPCGasCap() uint64 {
|
||||||
return b.Config.RPCGasCap
|
return b.Config.RPCGasCap.Uint64()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *Backend) SubscribeNewTxsEvent(chan<- core.NewTxsEvent) event.Subscription {
|
func (b *Backend) SubscribeNewTxsEvent(chan<- core.NewTxsEvent) event.Subscription {
|
||||||
|
|||||||
@@ -166,6 +166,11 @@ func NewRPCTransaction(tx *types.Transaction, blockHash common.Hash, blockNumber
|
|||||||
result.TransactionIndex = (*hexutil.Uint64)(&index)
|
result.TransactionIndex = (*hexutil.Uint64)(&index)
|
||||||
}
|
}
|
||||||
switch tx.Type() {
|
switch tx.Type() {
|
||||||
|
case types.LegacyTxType:
|
||||||
|
// if a legacy transaction has an EIP-155 chain id, include it explicitly
|
||||||
|
if id := tx.ChainId(); id.Sign() != 0 {
|
||||||
|
result.ChainID = (*hexutil.Big)(id)
|
||||||
|
}
|
||||||
case types.AccessListTxType:
|
case types.AccessListTxType:
|
||||||
al := tx.AccessList()
|
al := tx.AccessList()
|
||||||
result.Accesses = &al
|
result.Accesses = &al
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ import (
|
|||||||
"gorm.io/driver/postgres"
|
"gorm.io/driver/postgres"
|
||||||
"gorm.io/gorm"
|
"gorm.io/gorm"
|
||||||
|
|
||||||
"github.com/vulcanize/ipld-eth-server/v4/pkg/shared"
|
"github.com/cerc-io/ipld-eth-server/v4/pkg/shared"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Retriever interface for substituting mocks in tests
|
// Retriever interface for substituting mocks in tests
|
||||||
|
|||||||
@@ -19,6 +19,9 @@ package eth_test
|
|||||||
import (
|
import (
|
||||||
"math/big"
|
"math/big"
|
||||||
|
|
||||||
|
"github.com/cerc-io/ipld-eth-server/v4/pkg/eth"
|
||||||
|
"github.com/cerc-io/ipld-eth-server/v4/pkg/eth/test_helpers"
|
||||||
|
"github.com/cerc-io/ipld-eth-server/v4/pkg/shared"
|
||||||
"github.com/ethereum/go-ethereum/common"
|
"github.com/ethereum/go-ethereum/common"
|
||||||
"github.com/ethereum/go-ethereum/core/types"
|
"github.com/ethereum/go-ethereum/core/types"
|
||||||
"github.com/ethereum/go-ethereum/params"
|
"github.com/ethereum/go-ethereum/params"
|
||||||
@@ -28,10 +31,6 @@ import (
|
|||||||
"github.com/jmoiron/sqlx"
|
"github.com/jmoiron/sqlx"
|
||||||
. "github.com/onsi/ginkgo"
|
. "github.com/onsi/ginkgo"
|
||||||
. "github.com/onsi/gomega"
|
. "github.com/onsi/gomega"
|
||||||
|
|
||||||
"github.com/vulcanize/ipld-eth-server/v4/pkg/eth"
|
|
||||||
"github.com/vulcanize/ipld-eth-server/v4/pkg/eth/test_helpers"
|
|
||||||
"github.com/vulcanize/ipld-eth-server/v4/pkg/shared"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|||||||
@@ -23,6 +23,10 @@ import (
|
|||||||
"math/big"
|
"math/big"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/cerc-io/ipld-eth-server/v4/pkg/eth"
|
||||||
|
"github.com/cerc-io/ipld-eth-server/v4/pkg/eth/test_helpers"
|
||||||
|
"github.com/cerc-io/ipld-eth-server/v4/pkg/shared"
|
||||||
|
ethServerShared "github.com/cerc-io/ipld-eth-server/v4/pkg/shared"
|
||||||
"github.com/ethereum/go-ethereum/accounts/abi"
|
"github.com/ethereum/go-ethereum/accounts/abi"
|
||||||
"github.com/ethereum/go-ethereum/common"
|
"github.com/ethereum/go-ethereum/common"
|
||||||
"github.com/ethereum/go-ethereum/common/hexutil"
|
"github.com/ethereum/go-ethereum/common/hexutil"
|
||||||
@@ -36,11 +40,6 @@ import (
|
|||||||
"github.com/jmoiron/sqlx"
|
"github.com/jmoiron/sqlx"
|
||||||
. "github.com/onsi/ginkgo"
|
. "github.com/onsi/ginkgo"
|
||||||
. "github.com/onsi/gomega"
|
. "github.com/onsi/gomega"
|
||||||
|
|
||||||
"github.com/vulcanize/ipld-eth-server/v4/pkg/eth"
|
|
||||||
"github.com/vulcanize/ipld-eth-server/v4/pkg/eth/test_helpers"
|
|
||||||
"github.com/vulcanize/ipld-eth-server/v4/pkg/shared"
|
|
||||||
ethServerShared "github.com/vulcanize/ipld-eth-server/v4/pkg/shared"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|||||||
@@ -25,9 +25,9 @@ import (
|
|||||||
. "github.com/onsi/ginkgo"
|
. "github.com/onsi/ginkgo"
|
||||||
. "github.com/onsi/gomega"
|
. "github.com/onsi/gomega"
|
||||||
|
|
||||||
"github.com/vulcanize/ipld-eth-server/v4/pkg/eth"
|
"github.com/cerc-io/ipld-eth-server/v4/pkg/eth"
|
||||||
"github.com/vulcanize/ipld-eth-server/v4/pkg/eth/test_helpers"
|
"github.com/cerc-io/ipld-eth-server/v4/pkg/eth/test_helpers"
|
||||||
"github.com/vulcanize/ipld-eth-server/v4/pkg/shared"
|
"github.com/cerc-io/ipld-eth-server/v4/pkg/shared"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|||||||
@@ -22,11 +22,11 @@ import (
|
|||||||
"math/big"
|
"math/big"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
|
"github.com/cerc-io/ipld-eth-server/v4/pkg/shared"
|
||||||
"github.com/ethereum/go-ethereum/common"
|
"github.com/ethereum/go-ethereum/common"
|
||||||
"github.com/ethereum/go-ethereum/statediff/indexer/models"
|
"github.com/ethereum/go-ethereum/statediff/indexer/models"
|
||||||
"github.com/jmoiron/sqlx"
|
"github.com/jmoiron/sqlx"
|
||||||
log "github.com/sirupsen/logrus"
|
log "github.com/sirupsen/logrus"
|
||||||
"github.com/vulcanize/ipld-eth-server/v4/pkg/shared"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Fetcher interface for substituting mocks in tests
|
// Fetcher interface for substituting mocks in tests
|
||||||
|
|||||||
@@ -23,9 +23,9 @@ import (
|
|||||||
. "github.com/onsi/ginkgo"
|
. "github.com/onsi/ginkgo"
|
||||||
. "github.com/onsi/gomega"
|
. "github.com/onsi/gomega"
|
||||||
|
|
||||||
"github.com/vulcanize/ipld-eth-server/v4/pkg/eth"
|
"github.com/cerc-io/ipld-eth-server/v4/pkg/eth"
|
||||||
"github.com/vulcanize/ipld-eth-server/v4/pkg/eth/test_helpers"
|
"github.com/cerc-io/ipld-eth-server/v4/pkg/eth/test_helpers"
|
||||||
"github.com/vulcanize/ipld-eth-server/v4/pkg/shared"
|
"github.com/cerc-io/ipld-eth-server/v4/pkg/shared"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ = Describe("IPLDFetcher", func() {
|
var _ = Describe("IPLDFetcher", func() {
|
||||||
|
|||||||
+12
-11
@@ -20,10 +20,10 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
|
"github.com/cerc-io/ipld-eth-server/v4/pkg/shared"
|
||||||
"github.com/ethereum/go-ethereum/statediff/trie_helpers"
|
"github.com/ethereum/go-ethereum/statediff/trie_helpers"
|
||||||
sdtypes "github.com/ethereum/go-ethereum/statediff/types"
|
sdtypes "github.com/ethereum/go-ethereum/statediff/types"
|
||||||
"github.com/jmoiron/sqlx"
|
"github.com/jmoiron/sqlx"
|
||||||
"github.com/vulcanize/ipld-eth-server/v4/pkg/shared"
|
|
||||||
|
|
||||||
"github.com/ethereum/go-ethereum/common"
|
"github.com/ethereum/go-ethereum/common"
|
||||||
"github.com/ethereum/go-ethereum/crypto"
|
"github.com/ethereum/go-ethereum/crypto"
|
||||||
@@ -33,7 +33,7 @@ import (
|
|||||||
|
|
||||||
const (
|
const (
|
||||||
// node type removed value.
|
// node type removed value.
|
||||||
// https://github.com/vulcanize/go-ethereum/blob/271f4d01e7e2767ffd8e0cd469bf545be96f2a84/statediff/indexer/helpers.go#L34
|
// https://github.com/cerc-io/go-ethereum/blob/271f4d01e7e2767ffd8e0cd469bf545be96f2a84/statediff/indexer/helpers.go#L34
|
||||||
removedNode = 3
|
removedNode = 3
|
||||||
|
|
||||||
RetrieveHeadersByHashesPgStr = `SELECT cid, data
|
RetrieveHeadersByHashesPgStr = `SELECT cid, data
|
||||||
@@ -74,7 +74,8 @@ const (
|
|||||||
uncle_cids.mh_key = blocks.key
|
uncle_cids.mh_key = blocks.key
|
||||||
AND uncle_cids.block_number = blocks.block_number
|
AND uncle_cids.block_number = blocks.block_number
|
||||||
)
|
)
|
||||||
WHERE header_cids.block_hash = $1`
|
WHERE header_cids.block_hash = $1
|
||||||
|
ORDER BY uncle_cids.parent_hash`
|
||||||
RetrieveUnclesByBlockNumberPgStr = `SELECT uncle_cids.cid, data
|
RetrieveUnclesByBlockNumberPgStr = `SELECT uncle_cids.cid, data
|
||||||
FROM eth.uncle_cids
|
FROM eth.uncle_cids
|
||||||
INNER JOIN eth.header_cids ON (
|
INNER JOIN eth.header_cids ON (
|
||||||
@@ -313,9 +314,9 @@ func (r *IPLDRetriever) RetrieveHeadersByBlockNumber(number uint64) ([]string, [
|
|||||||
}
|
}
|
||||||
|
|
||||||
// RetrieveHeaderByHash returns the cid and rlp bytes for the header corresponding to the provided block hash
|
// RetrieveHeaderByHash returns the cid and rlp bytes for the header corresponding to the provided block hash
|
||||||
func (r *IPLDRetriever) RetrieveHeaderByHash(hash common.Hash) (string, []byte, error) {
|
func (r *IPLDRetriever) RetrieveHeaderByHash(tx *sqlx.Tx, hash common.Hash) (string, []byte, error) {
|
||||||
headerResult := new(ipldResult)
|
headerResult := new(ipldResult)
|
||||||
return headerResult.CID, headerResult.Data, r.db.Get(headerResult, RetrieveHeaderByHashPgStr, hash.Hex())
|
return headerResult.CID, headerResult.Data, tx.Get(headerResult, RetrieveHeaderByHashPgStr, hash.Hex())
|
||||||
}
|
}
|
||||||
|
|
||||||
// RetrieveUnclesByHashes returns the cids and rlp bytes for the uncles corresponding to the provided uncle hashes
|
// RetrieveUnclesByHashes returns the cids and rlp bytes for the uncles corresponding to the provided uncle hashes
|
||||||
@@ -338,9 +339,9 @@ func (r *IPLDRetriever) RetrieveUnclesByHashes(hashes []common.Hash) ([]string,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// RetrieveUnclesByBlockHash returns the cids and rlp bytes for the uncles corresponding to the provided block hash (of non-omner root block)
|
// RetrieveUnclesByBlockHash returns the cids and rlp bytes for the uncles corresponding to the provided block hash (of non-omner root block)
|
||||||
func (r *IPLDRetriever) RetrieveUnclesByBlockHash(hash common.Hash) ([]string, [][]byte, error) {
|
func (r *IPLDRetriever) RetrieveUnclesByBlockHash(tx *sqlx.Tx, hash common.Hash) ([]string, [][]byte, error) {
|
||||||
uncleResults := make([]ipldResult, 0)
|
uncleResults := make([]ipldResult, 0)
|
||||||
if err := r.db.Select(&uncleResults, RetrieveUnclesByBlockHashPgStr, hash.Hex()); err != nil {
|
if err := tx.Select(&uncleResults, RetrieveUnclesByBlockHashPgStr, hash.Hex()); err != nil {
|
||||||
return nil, nil, err
|
return nil, nil, err
|
||||||
}
|
}
|
||||||
cids := make([]string, len(uncleResults))
|
cids := make([]string, len(uncleResults))
|
||||||
@@ -393,9 +394,9 @@ func (r *IPLDRetriever) RetrieveTransactionsByHashes(hashes []common.Hash) ([]st
|
|||||||
}
|
}
|
||||||
|
|
||||||
// RetrieveTransactionsByBlockHash returns the cids and rlp bytes for the transactions corresponding to the provided block hash
|
// RetrieveTransactionsByBlockHash returns the cids and rlp bytes for the transactions corresponding to the provided block hash
|
||||||
func (r *IPLDRetriever) RetrieveTransactionsByBlockHash(hash common.Hash) ([]string, [][]byte, error) {
|
func (r *IPLDRetriever) RetrieveTransactionsByBlockHash(tx *sqlx.Tx, hash common.Hash) ([]string, [][]byte, error) {
|
||||||
txResults := make([]ipldResult, 0)
|
txResults := make([]ipldResult, 0)
|
||||||
if err := r.db.Select(&txResults, RetrieveTransactionsByBlockHashPgStr, hash.Hex()); err != nil {
|
if err := tx.Select(&txResults, RetrieveTransactionsByBlockHashPgStr, hash.Hex()); err != nil {
|
||||||
return nil, nil, err
|
return nil, nil, err
|
||||||
}
|
}
|
||||||
cids := make([]string, len(txResults))
|
cids := make([]string, len(txResults))
|
||||||
@@ -470,9 +471,9 @@ func (r *IPLDRetriever) RetrieveReceiptsByTxHashes(hashes []common.Hash) ([]stri
|
|||||||
|
|
||||||
// RetrieveReceiptsByBlockHash returns the cids and rlp bytes for the receipts corresponding to the provided block hash.
|
// RetrieveReceiptsByBlockHash returns the cids and rlp bytes for the receipts corresponding to the provided block hash.
|
||||||
// cid returned corresponds to the leaf node data which contains the receipt.
|
// cid returned corresponds to the leaf node data which contains the receipt.
|
||||||
func (r *IPLDRetriever) RetrieveReceiptsByBlockHash(hash common.Hash) ([]string, [][]byte, []common.Hash, error) {
|
func (r *IPLDRetriever) RetrieveReceiptsByBlockHash(tx *sqlx.Tx, hash common.Hash) ([]string, [][]byte, []common.Hash, error) {
|
||||||
rctResults := make([]rctIpldResult, 0)
|
rctResults := make([]rctIpldResult, 0)
|
||||||
if err := r.db.Select(&rctResults, RetrieveReceiptsByBlockHashPgStr, hash.Hex()); err != nil {
|
if err := tx.Select(&rctResults, RetrieveReceiptsByBlockHashPgStr, hash.Hex()); err != nil {
|
||||||
return nil, nil, nil, err
|
return nil, nil, nil, err
|
||||||
}
|
}
|
||||||
cids := make([]string, len(rctResults))
|
cids := make([]string, len(rctResults))
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ import (
|
|||||||
"github.com/ethereum/go-ethereum/core/vm"
|
"github.com/ethereum/go-ethereum/core/vm"
|
||||||
"github.com/ethereum/go-ethereum/crypto"
|
"github.com/ethereum/go-ethereum/crypto"
|
||||||
"github.com/ethereum/go-ethereum/params"
|
"github.com/ethereum/go-ethereum/params"
|
||||||
|
"github.com/ethereum/go-ethereum/statediff/test_helpers"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Test variables
|
// Test variables
|
||||||
@@ -35,7 +36,7 @@ var (
|
|||||||
TestBankKey, _ = crypto.HexToECDSA("b71c71a67e1177ad4e901695e1b4b9ee17ae16c6668d313eac2f96dbcda3f291")
|
TestBankKey, _ = crypto.HexToECDSA("b71c71a67e1177ad4e901695e1b4b9ee17ae16c6668d313eac2f96dbcda3f291")
|
||||||
TestBankAddress = crypto.PubkeyToAddress(TestBankKey.PublicKey) //0x71562b71999873DB5b286dF957af199Ec94617F7
|
TestBankAddress = crypto.PubkeyToAddress(TestBankKey.PublicKey) //0x71562b71999873DB5b286dF957af199Ec94617F7
|
||||||
TestBankFunds = big.NewInt(100000000)
|
TestBankFunds = big.NewInt(100000000)
|
||||||
Genesis = core.GenesisBlockForTesting(Testdb, TestBankAddress, TestBankFunds)
|
Genesis = test_helpers.GenesisBlockForTesting(Testdb, TestBankAddress, TestBankFunds)
|
||||||
|
|
||||||
Account1Key, _ = crypto.HexToECDSA("8a1f9a8f95be41cd7ccb6168179afb4504aefe388d1e14474d32c45c72ce7b7a")
|
Account1Key, _ = crypto.HexToECDSA("8a1f9a8f95be41cd7ccb6168179afb4504aefe388d1e14474d32c45c72ce7b7a")
|
||||||
Account2Key, _ = crypto.HexToECDSA("49a7b37aa6f6645917e7b807e9d1c00d4fa71f18343b0d4122a4d2df64dd6fee")
|
Account2Key, _ = crypto.HexToECDSA("49a7b37aa6f6645917e7b807e9d1c00d4fa71f18343b0d4122a4d2df64dd6fee")
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ import (
|
|||||||
"github.com/multiformats/go-multihash"
|
"github.com/multiformats/go-multihash"
|
||||||
log "github.com/sirupsen/logrus"
|
log "github.com/sirupsen/logrus"
|
||||||
|
|
||||||
"github.com/vulcanize/ipld-eth-server/v4/pkg/eth"
|
"github.com/cerc-io/ipld-eth-server/v4/pkg/eth"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Test variables
|
// Test variables
|
||||||
@@ -594,7 +594,29 @@ var (
|
|||||||
}
|
}
|
||||||
|
|
||||||
MockLondonTransactions, MockLondonReceipts, _ = createDynamicTransactionsAndReceipts(LondonBlockNum)
|
MockLondonTransactions, MockLondonReceipts, _ = createDynamicTransactionsAndReceipts(LondonBlockNum)
|
||||||
MockLondonBlock = createNewBlock(&MockLondonHeader, MockLondonTransactions, nil, MockLondonReceipts, new(trie.Trie))
|
MockLondonUncles = []*types.Header{
|
||||||
|
{
|
||||||
|
Time: 1,
|
||||||
|
Number: new(big.Int).Add(BlockNumber, big.NewInt(1)),
|
||||||
|
ParentHash: common.HexToHash("0x2"),
|
||||||
|
Root: common.HexToHash("0x1"),
|
||||||
|
TxHash: common.HexToHash("0x1"),
|
||||||
|
ReceiptHash: common.HexToHash("0x1"),
|
||||||
|
Difficulty: big.NewInt(500001),
|
||||||
|
Extra: []byte{},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
Time: 2,
|
||||||
|
Number: new(big.Int).Add(BlockNumber, big.NewInt(1)),
|
||||||
|
ParentHash: common.HexToHash("0x1"),
|
||||||
|
Root: common.HexToHash("0x2"),
|
||||||
|
TxHash: common.HexToHash("0x2"),
|
||||||
|
ReceiptHash: common.HexToHash("0x2"),
|
||||||
|
Difficulty: big.NewInt(500002),
|
||||||
|
Extra: []byte{},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
MockLondonBlock = createNewBlock(&MockLondonHeader, MockLondonTransactions, MockLondonUncles, MockLondonReceipts, new(trie.Trie))
|
||||||
)
|
)
|
||||||
|
|
||||||
func createNewBlock(header *types.Header, txs []*types.Transaction, uncles []*types.Header, receipts []*types.Receipt, hasher types.TrieHasher) *types.Block {
|
func createNewBlock(header *types.Header, txs []*types.Transaction, uncles []*types.Header, receipts []*types.Receipt, hasher types.TrieHasher) *types.Block {
|
||||||
|
|||||||
@@ -35,8 +35,8 @@ import (
|
|||||||
"github.com/ethereum/go-ethereum/rlp"
|
"github.com/ethereum/go-ethereum/rlp"
|
||||||
"github.com/ethereum/go-ethereum/rpc"
|
"github.com/ethereum/go-ethereum/rpc"
|
||||||
|
|
||||||
"github.com/vulcanize/ipld-eth-server/v4/pkg/eth"
|
"github.com/cerc-io/ipld-eth-server/v4/pkg/eth"
|
||||||
"github.com/vulcanize/ipld-eth-server/v4/pkg/shared"
|
"github.com/cerc-io/ipld-eth-server/v4/pkg/shared"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@@ -777,8 +777,8 @@ func (b *Block) Logs(ctx context.Context, args struct{ Filter BlockFilterCriteri
|
|||||||
hash = header.Hash()
|
hash = header.Hash()
|
||||||
}
|
}
|
||||||
// Construct the range filter
|
// Construct the range filter
|
||||||
filter := filters.NewBlockFilter(b.backend, hash, addresses, topics)
|
filterSys := filters.NewFilterSystem(b.backend, filters.Config{})
|
||||||
|
filter := filterSys.NewBlockFilter(hash, addresses, topics)
|
||||||
// Run the filter and return all the logs
|
// Run the filter and return all the logs
|
||||||
return runFilter(ctx, b.backend, filter)
|
return runFilter(ctx, b.backend, filter)
|
||||||
}
|
}
|
||||||
@@ -838,7 +838,7 @@ func (b *Block) Call(ctx context.Context, args struct {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
result, err := eth.DoCall(ctx, b.backend, args.Data, *b.numberOrHash, nil, 5*time.Second, b.backend.RPCGasCap().Uint64())
|
result, err := eth.DoCall(ctx, b.backend, args.Data, *b.numberOrHash, nil, 5*time.Second, b.backend.RPCGasCap())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -980,7 +980,8 @@ func (r *Resolver) Logs(ctx context.Context, args struct{ Filter FilterCriteria
|
|||||||
topics = *args.Filter.Topics
|
topics = *args.Filter.Topics
|
||||||
}
|
}
|
||||||
// Construct the range filter
|
// Construct the range filter
|
||||||
filter := filters.NewRangeFilter(filters.Backend(r.backend), begin, end, addresses, topics)
|
filterSys := filters.NewFilterSystem(r.backend, filters.Config{})
|
||||||
|
filter := filterSys.NewRangeFilter(begin, end, addresses, topics)
|
||||||
return runFilter(ctx, r.backend, filter)
|
return runFilter(ctx, r.backend, filter)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -36,11 +36,11 @@ import (
|
|||||||
. "github.com/onsi/ginkgo"
|
. "github.com/onsi/ginkgo"
|
||||||
. "github.com/onsi/gomega"
|
. "github.com/onsi/gomega"
|
||||||
|
|
||||||
"github.com/vulcanize/ipld-eth-server/v4/pkg/eth"
|
"github.com/cerc-io/ipld-eth-server/v4/pkg/eth"
|
||||||
"github.com/vulcanize/ipld-eth-server/v4/pkg/eth/test_helpers"
|
"github.com/cerc-io/ipld-eth-server/v4/pkg/eth/test_helpers"
|
||||||
"github.com/vulcanize/ipld-eth-server/v4/pkg/graphql"
|
"github.com/cerc-io/ipld-eth-server/v4/pkg/graphql"
|
||||||
"github.com/vulcanize/ipld-eth-server/v4/pkg/shared"
|
"github.com/cerc-io/ipld-eth-server/v4/pkg/shared"
|
||||||
ethServerShared "github.com/vulcanize/ipld-eth-server/v4/pkg/shared"
|
ethServerShared "github.com/cerc-io/ipld-eth-server/v4/pkg/shared"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ = Describe("GraphQL", func() {
|
var _ = Describe("GraphQL", func() {
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ import (
|
|||||||
"github.com/graph-gophers/graphql-go/relay"
|
"github.com/graph-gophers/graphql-go/relay"
|
||||||
"github.com/sirupsen/logrus"
|
"github.com/sirupsen/logrus"
|
||||||
|
|
||||||
"github.com/vulcanize/ipld-eth-server/v4/pkg/eth"
|
"github.com/cerc-io/ipld-eth-server/v4/pkg/eth"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Service encapsulates a GraphQL service.
|
// Service encapsulates a GraphQL service.
|
||||||
|
|||||||
+1
-1
@@ -20,7 +20,7 @@ import (
|
|||||||
. "github.com/onsi/ginkgo"
|
. "github.com/onsi/ginkgo"
|
||||||
. "github.com/onsi/gomega"
|
. "github.com/onsi/gomega"
|
||||||
|
|
||||||
"github.com/vulcanize/ipld-eth-server/v4/pkg/net"
|
"github.com/cerc-io/ipld-eth-server/v4/pkg/net"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ = Describe("API", func() {
|
var _ = Describe("API", func() {
|
||||||
|
|||||||
+1
-1
@@ -29,7 +29,7 @@ import (
|
|||||||
func StartHTTPEndpoint(endpoint string, apis []rpc.API, modules []string, cors []string, vhosts []string, timeouts rpc.HTTPTimeouts) (*rpc.Server, error) {
|
func StartHTTPEndpoint(endpoint string, apis []rpc.API, modules []string, cors []string, vhosts []string, timeouts rpc.HTTPTimeouts) (*rpc.Server, error) {
|
||||||
|
|
||||||
srv := rpc.NewServer()
|
srv := rpc.NewServer()
|
||||||
err := node.RegisterApis(apis, modules, srv, false)
|
err := node.RegisterApis(apis, modules, srv)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
utils.Fatalf("Could not register HTTP API: %w", err)
|
utils.Fatalf("Could not register HTTP API: %w", err)
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-1
@@ -25,7 +25,8 @@ import (
|
|||||||
"github.com/ethereum/go-ethereum/p2p/netutil"
|
"github.com/ethereum/go-ethereum/p2p/netutil"
|
||||||
"github.com/ethereum/go-ethereum/rpc"
|
"github.com/ethereum/go-ethereum/rpc"
|
||||||
log "github.com/sirupsen/logrus"
|
log "github.com/sirupsen/logrus"
|
||||||
"github.com/vulcanize/ipld-eth-server/v4/pkg/prom"
|
|
||||||
|
"github.com/cerc-io/ipld-eth-server/v4/pkg/prom"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|||||||
+3
-3
@@ -24,11 +24,11 @@ import (
|
|||||||
"github.com/ethereum/go-ethereum/node"
|
"github.com/ethereum/go-ethereum/node"
|
||||||
"github.com/ethereum/go-ethereum/rpc"
|
"github.com/ethereum/go-ethereum/rpc"
|
||||||
|
|
||||||
"github.com/vulcanize/ipld-eth-server/v4/pkg/prom"
|
"github.com/cerc-io/ipld-eth-server/v4/pkg/prom"
|
||||||
)
|
)
|
||||||
|
|
||||||
// StartWSEndpoint starts a websocket endpoint.
|
// StartWSEndpoint starts a websocket endpoint.
|
||||||
func StartWSEndpoint(endpoint string, apis []rpc.API, modules []string, wsOrigins []string, exposeAll bool) (net.Listener, *rpc.Server, error) {
|
func StartWSEndpoint(endpoint string, apis []rpc.API, modules []string, wsOrigins []string) (net.Listener, *rpc.Server, error) {
|
||||||
// All APIs registered, start the HTTP listener
|
// All APIs registered, start the HTTP listener
|
||||||
var (
|
var (
|
||||||
listener net.Listener
|
listener net.Listener
|
||||||
@@ -37,7 +37,7 @@ func StartWSEndpoint(endpoint string, apis []rpc.API, modules []string, wsOrigin
|
|||||||
|
|
||||||
// Register all the APIs exposed by the services
|
// Register all the APIs exposed by the services
|
||||||
handler := rpc.NewServer()
|
handler := rpc.NewServer()
|
||||||
err = node.RegisterApis(apis, modules, handler, exposeAll)
|
err = node.RegisterApis(apis, modules, handler)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
utils.Fatalf("Could not register WS API: %w", err)
|
utils.Fatalf("Could not register WS API: %w", err)
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -23,7 +23,7 @@ import (
|
|||||||
"github.com/ethereum/go-ethereum/statediff/types"
|
"github.com/ethereum/go-ethereum/statediff/types"
|
||||||
log "github.com/sirupsen/logrus"
|
log "github.com/sirupsen/logrus"
|
||||||
|
|
||||||
"github.com/vulcanize/ipld-eth-server/v4/pkg/eth"
|
"github.com/cerc-io/ipld-eth-server/v4/pkg/eth"
|
||||||
)
|
)
|
||||||
|
|
||||||
// APIName is the namespace used for the state diffing service API
|
// APIName is the namespace used for the state diffing service API
|
||||||
|
|||||||
+4
-2
@@ -32,8 +32,8 @@ import (
|
|||||||
"github.com/jmoiron/sqlx"
|
"github.com/jmoiron/sqlx"
|
||||||
"github.com/spf13/viper"
|
"github.com/spf13/viper"
|
||||||
|
|
||||||
"github.com/vulcanize/ipld-eth-server/v4/pkg/prom"
|
"github.com/cerc-io/ipld-eth-server/v4/pkg/prom"
|
||||||
ethServerShared "github.com/vulcanize/ipld-eth-server/v4/pkg/shared"
|
ethServerShared "github.com/cerc-io/ipld-eth-server/v4/pkg/shared"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Env variables
|
// Env variables
|
||||||
@@ -219,6 +219,8 @@ func NewConfig() (*Config, error) {
|
|||||||
if rpcGasCap, ok := new(big.Int).SetString(rpcGasCapStr, 10); ok {
|
if rpcGasCap, ok := new(big.Int).SetString(rpcGasCapStr, 10); ok {
|
||||||
c.RPCGasCap = rpcGasCap
|
c.RPCGasCap = rpcGasCap
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
c.RPCGasCap = big.NewInt(0)
|
||||||
}
|
}
|
||||||
chainConfigPath := viper.GetString("ethereum.chainConfig")
|
chainConfigPath := viper.GetString("ethereum.chainConfig")
|
||||||
if chainConfigPath != "" {
|
if chainConfigPath != "" {
|
||||||
|
|||||||
+17
-8
@@ -24,6 +24,7 @@ import (
|
|||||||
"github.com/ethereum/go-ethereum/common"
|
"github.com/ethereum/go-ethereum/common"
|
||||||
"github.com/ethereum/go-ethereum/core/vm"
|
"github.com/ethereum/go-ethereum/core/vm"
|
||||||
"github.com/ethereum/go-ethereum/crypto"
|
"github.com/ethereum/go-ethereum/crypto"
|
||||||
|
"github.com/ethereum/go-ethereum/eth/tracers"
|
||||||
ethnode "github.com/ethereum/go-ethereum/node"
|
ethnode "github.com/ethereum/go-ethereum/node"
|
||||||
"github.com/ethereum/go-ethereum/p2p"
|
"github.com/ethereum/go-ethereum/p2p"
|
||||||
"github.com/ethereum/go-ethereum/rlp"
|
"github.com/ethereum/go-ethereum/rlp"
|
||||||
@@ -31,8 +32,9 @@ import (
|
|||||||
"github.com/jmoiron/sqlx"
|
"github.com/jmoiron/sqlx"
|
||||||
log "github.com/sirupsen/logrus"
|
log "github.com/sirupsen/logrus"
|
||||||
|
|
||||||
"github.com/vulcanize/ipld-eth-server/v4/pkg/eth"
|
"github.com/cerc-io/ipld-eth-server/v4/pkg/debug"
|
||||||
"github.com/vulcanize/ipld-eth-server/v4/pkg/net"
|
"github.com/cerc-io/ipld-eth-server/v4/pkg/eth"
|
||||||
|
"github.com/cerc-io/ipld-eth-server/v4/pkg/net"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@@ -139,16 +141,23 @@ func (sap *Service) APIs() []rpc.API {
|
|||||||
Public: true,
|
Public: true,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
ethAPI, err := eth.NewPublicEthAPI(sap.backend, sap.client, sap.supportsStateDiffing, sap.forwardEthCalls, sap.proxyOnError)
|
ethAPI, err := eth.NewPublicEthAPI(sap.backend, sap.client, sap.supportsStateDiffing, sap.forwardEthCalls, sap.proxyOnError)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalf("unable to create public eth api: %v", err)
|
log.Fatalf("unable to create public eth api: %v", err)
|
||||||
}
|
}
|
||||||
return append(apis, rpc.API{
|
|
||||||
Namespace: eth.APIName,
|
debugTracerAPI := tracers.APIs(&debug.Backend{Backend: *sap.backend})[0]
|
||||||
Version: eth.APIVersion,
|
|
||||||
Service: ethAPI,
|
return append(apis,
|
||||||
Public: true,
|
rpc.API{
|
||||||
})
|
Namespace: eth.APIName,
|
||||||
|
Version: eth.APIVersion,
|
||||||
|
Service: ethAPI,
|
||||||
|
Public: true,
|
||||||
|
},
|
||||||
|
debugTracerAPI,
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Serve listens for incoming converter data off the screenAndServePayload from the Sync process
|
// Serve listens for incoming converter data off the screenAndServePayload from the Sync process
|
||||||
|
|||||||
+4
-4
@@ -4,16 +4,16 @@
|
|||||||
|
|
||||||
- Clone [stack-orchestrator](https://github.com/vulcanize/stack-orchestrator), [ipld-eth-db](https://github.com/vulcanize/ipld-eth-db) [go-ethereum](https://github.com/vulcanize/go-ethereum) repositories.
|
- Clone [stack-orchestrator](https://github.com/vulcanize/stack-orchestrator), [ipld-eth-db](https://github.com/vulcanize/ipld-eth-db) [go-ethereum](https://github.com/vulcanize/go-ethereum) repositories.
|
||||||
|
|
||||||
- Checkout [v4 release](https://github.com/vulcanize/ipld-eth-db/releases/tag/v4.2.0-alpha) in ipld-eth-db repo.
|
- Checkout [v4 release](https://github.com/vulcanize/ipld-eth-db/releases/tag/v4.2.1-alpha) in ipld-eth-db repo.
|
||||||
```bash
|
```bash
|
||||||
# In ipld-eth-db repo.
|
# In ipld-eth-db repo.
|
||||||
git checkout v4.2.0-alpha
|
git checkout v4.2.1-alpha
|
||||||
```
|
```
|
||||||
|
|
||||||
- Checkout [v4 release](https://github.com/vulcanize/go-ethereum/releases/tag/v1.10.19-statediff-4.1.0-alpha) in go-ethereum repo.
|
- Checkout [v4 release](https://github.com/vulcanize/go-ethereum/releases/tag/v1.10.23-statediff-4.2.0-alpha) in go-ethereum repo.
|
||||||
```bash
|
```bash
|
||||||
# In go-ethereum repo.
|
# In go-ethereum repo.
|
||||||
git checkout v1.10.19-statediff-4.1.0-alpha
|
git checkout v1.10.23-statediff-4.2.0-alpha
|
||||||
```
|
```
|
||||||
|
|
||||||
- Checkout working commit in stack-orchestrator repo.
|
- Checkout working commit in stack-orchestrator repo.
|
||||||
|
|||||||
@@ -13,8 +13,8 @@ import (
|
|||||||
. "github.com/onsi/ginkgo"
|
. "github.com/onsi/ginkgo"
|
||||||
. "github.com/onsi/gomega"
|
. "github.com/onsi/gomega"
|
||||||
|
|
||||||
"github.com/vulcanize/ipld-eth-server/v4/pkg/eth"
|
"github.com/cerc-io/ipld-eth-server/v4/pkg/eth"
|
||||||
integration "github.com/vulcanize/ipld-eth-server/v4/test"
|
integration "github.com/cerc-io/ipld-eth-server/v4/test"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ = Describe("Integration test", func() {
|
var _ = Describe("Integration test", func() {
|
||||||
@@ -431,7 +431,7 @@ var _ = Describe("Integration test", func() {
|
|||||||
Expect(err).ToNot(HaveOccurred())
|
Expect(err).ToNot(HaveOccurred())
|
||||||
|
|
||||||
_, err = ipldClient.ChainID(ctx)
|
_, err = ipldClient.ChainID(ctx)
|
||||||
Expect(err).To(HaveOccurred())
|
Expect(err).ToNot(HaveOccurred())
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -16,8 +16,8 @@ import (
|
|||||||
. "github.com/onsi/ginkgo"
|
. "github.com/onsi/ginkgo"
|
||||||
. "github.com/onsi/gomega"
|
. "github.com/onsi/gomega"
|
||||||
|
|
||||||
"github.com/vulcanize/ipld-eth-server/v4/pkg/eth"
|
"github.com/cerc-io/ipld-eth-server/v4/pkg/eth"
|
||||||
integration "github.com/vulcanize/ipld-eth-server/v4/test"
|
integration "github.com/cerc-io/ipld-eth-server/v4/test"
|
||||||
)
|
)
|
||||||
|
|
||||||
const nonExistingBlockHash = "0x111111111111111111111111111111111111111111111111111111111111111"
|
const nonExistingBlockHash = "0x111111111111111111111111111111111111111111111111111111111111111"
|
||||||
|
|||||||
@@ -13,7 +13,8 @@ import (
|
|||||||
sdtypes "github.com/ethereum/go-ethereum/statediff/types"
|
sdtypes "github.com/ethereum/go-ethereum/statediff/types"
|
||||||
. "github.com/onsi/ginkgo"
|
. "github.com/onsi/ginkgo"
|
||||||
. "github.com/onsi/gomega"
|
. "github.com/onsi/gomega"
|
||||||
integration "github.com/vulcanize/ipld-eth-server/v4/test"
|
|
||||||
|
integration "github.com/cerc-io/ipld-eth-server/v4/test"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ func init() {
|
|||||||
func setTestConfig() {
|
func setTestConfig() {
|
||||||
vip := viper.New()
|
vip := viper.New()
|
||||||
vip.SetConfigName("testing")
|
vip.SetConfigName("testing")
|
||||||
vip.AddConfigPath("$GOPATH/src/github.com/vulcanize/ipld-eth-server/environments/")
|
vip.AddConfigPath("$GOPATH/src/github.com/cerc-io/ipld-eth-server/environments/")
|
||||||
if err := vip.ReadInConfig(); err != nil {
|
if err := vip.ReadInConfig(); err != nil {
|
||||||
logrus.Fatal(err)
|
logrus.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-4
@@ -19,10 +19,10 @@ package version
|
|||||||
import "fmt"
|
import "fmt"
|
||||||
|
|
||||||
const (
|
const (
|
||||||
Major = 2 // Major version component of the current release
|
Major = 4 // Major version component of the current release
|
||||||
Minor = 0 // Minor version component of the current release
|
Minor = 1 // Minor version component of the current release
|
||||||
Patch = 0 // Patch version component of the current release
|
Patch = 9 // Patch version component of the current release
|
||||||
Meta = "" // Version metadata to append to the version string
|
Meta = "alpha" // Version metadata to append to the version string
|
||||||
)
|
)
|
||||||
|
|
||||||
// Version holds the textual version string.
|
// Version holds the textual version string.
|
||||||
|
|||||||
Reference in New Issue
Block a user