diff --git a/docker-compose.yml b/docker-compose.yml index 0ea94e35de..e058bf9046 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -18,7 +18,7 @@ services: postgres: - image: postgres:12.0 + image: postgres:13-alpine container_name: postgres restart: always environment: @@ -27,8 +27,10 @@ services: - POSTGRES_DB=db - PGDATA=/postgresql/data volumes: - - db:/postgresql/data - network_mode: host + - ./pg_db:/postgresql/data + - ./tables.sql:/docker-entrypoint-initdb.d/tables.sql + ports: + - '5432:5432' prysm: image: gcr.io/prysmaticlabs/prysm/beacon-chain:latest diff --git a/exporter/eth1.go b/exporter/eth1.go index 6972ab560b..52d1f3acf0 100644 --- a/exporter/eth1.go +++ b/exporter/eth1.go @@ -191,6 +191,13 @@ func fetchEth1Deposits(fromBlock, toBlock uint64) (depositsToSave []*types.Eth1D cfg.ZeroHash[:], ) } + if utils.Config.Chain.Network == "stake" { + domain, err = helpers.ComputeDomain( + cfg.DomainDeposit, + []byte{0x00, 0x00, 0x64, 0x64}, + cfg.ZeroHash[:], + ) + } if err != nil { return nil, err } diff --git a/go.mod b/go.mod index d2f491c80b..65be5b9499 100644 --- a/go.mod +++ b/go.mod @@ -18,7 +18,6 @@ require ( github.com/go-sql-driver/mysql v1.5.0 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.2 - github.com/google/go-querystring v1.0.0 github.com/gorilla/context v1.1.1 github.com/gorilla/csrf v1.7.0 github.com/gorilla/mux v1.8.0 @@ -46,8 +45,8 @@ require ( github.com/protolambda/zssz v0.1.5 github.com/protolambda/ztyp v0.1.0 github.com/prysmaticlabs/eth2-types v0.0.0-20210303084904-c9735a06829d - github.com/prysmaticlabs/ethereumapis v0.0.0-20210818160529-ab1ec7a0bf07 github.com/prysmaticlabs/go-bitfield v0.0.0-20210809151128-385d8c5e3fb7 + github.com/prysmaticlabs/protoc-gen-go-cast v0.0.0-20210505221644-3b823fdaca7f // indirect github.com/prysmaticlabs/prysm v1.4.2-0.20210816195537-4db77ce69181 github.com/sirupsen/logrus v1.6.0 github.com/stripe/stripe-go/v72 v72.50.0 diff --git a/go.sum b/go.sum index 1d514df072..7134596dfe 100644 --- a/go.sum +++ b/go.sum @@ -298,7 +298,6 @@ github.com/facebookgo/subset v0.0.0-20150612182917-8dac2c3c4870/go.mod h1:5tD+ne github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= github.com/ferranbt/fastssz v0.0.0-20210120143747-11b9eff30ea9/go.mod h1:DyEu2iuLBnb/T51BlsiO3yLYdJC6UbGMrIkqK1KmQxM= -github.com/ferranbt/fastssz v0.0.0-20210526181520-7df50c8568f8/go.mod h1:DyEu2iuLBnb/T51BlsiO3yLYdJC6UbGMrIkqK1KmQxM= github.com/ferranbt/fastssz v0.0.0-20210719200358-90640294cb9c h1:R8HHtp9wrae6trZA2lgJtOhghKl16lWY4cG0l7hH8CM= github.com/ferranbt/fastssz v0.0.0-20210719200358-90640294cb9c/go.mod h1:DyEu2iuLBnb/T51BlsiO3yLYdJC6UbGMrIkqK1KmQxM= github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5 h1:FtmdgXiUlNeRsoNMFlKLDt+S+6hbjVMEW6RGQ7aUf7c= @@ -321,7 +320,6 @@ github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08 h1:f6D9Hr8xV8uYKlyuj8XIruxlh9WjVjdh1gIicAS7ays= github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-contrib/gzip v0.0.1/go.mod h1:fGBJBCdt6qCZuCAOwWuFhBB4OOq9EFqlo5dEaFhhu5w= github.com/gin-contrib/sse v0.0.0-20170109093832-22d885f9ecc7/go.mod h1:VJ0WA2NBN22VlZ2dKZQPAPnyWw5XTlK1KymzLKsr59s= @@ -471,7 +469,6 @@ github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ= -github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -745,7 +742,6 @@ github.com/klauspost/cpuid v0.0.0-20170728055534-ae7887de9fa5/go.mod h1:Pj4uuM52 github.com/klauspost/cpuid v1.2.3 h1:CCtW0xUnWGVINKvE/WWOYKdsPV6mawAtvQuSl8guwQs= github.com/klauspost/cpuid v1.2.3/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/klauspost/cpuid/v2 v2.0.4/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= -github.com/klauspost/cpuid/v2 v2.0.6/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/klauspost/cpuid/v2 v2.0.8/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/klauspost/cpuid/v2 v2.0.9 h1:lgaqFMSdTdQYdZ04uHyN2d/eKdOMyi2YLSvlQIBFYa4= github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= @@ -1241,10 +1237,7 @@ github.com/prysmaticlabs/bazel-go-ethereum v0.0.0-20210707101027-e8523651bf6f h1 github.com/prysmaticlabs/bazel-go-ethereum v0.0.0-20210707101027-e8523651bf6f/go.mod h1:gEAkxJY2/a1FO2DGrkeJOc9lMwlwt9T+Hyc5kNMVHJs= github.com/prysmaticlabs/eth2-types v0.0.0-20210303084904-c9735a06829d h1:1dN7YAqMN3oAJ0LceWcyv/U4jHLh+5urnSnr4br6zg4= github.com/prysmaticlabs/eth2-types v0.0.0-20210303084904-c9735a06829d/go.mod h1:kOmQ/zdobQf7HUohDTifDNFEZfNaSCIY5fkONPL+dWU= -github.com/prysmaticlabs/ethereumapis v0.0.0-20210818160529-ab1ec7a0bf07 h1:kBffA6gQdL2bmsJV0r9BFCSGdl5Pcn48wfWk5pSg+wA= -github.com/prysmaticlabs/ethereumapis v0.0.0-20210818160529-ab1ec7a0bf07/go.mod h1:eytkwONIpe6f1KoXet8NoBLLJbbO3mXOZq1xTBbgsZs= github.com/prysmaticlabs/go-bitfield v0.0.0-20210108222456-8e92c3709aa0/go.mod h1:hCwmef+4qXWjv0jLDbQdWnL0Ol7cS7/lCSS26WR+u6s= -github.com/prysmaticlabs/go-bitfield v0.0.0-20210515192923-def021850363/go.mod h1:hCwmef+4qXWjv0jLDbQdWnL0Ol7cS7/lCSS26WR+u6s= github.com/prysmaticlabs/go-bitfield v0.0.0-20210809151128-385d8c5e3fb7 h1:0tVE4tdWQK9ZpYygoV7+vS6QkDvQVySboMVEIxBJmXw= github.com/prysmaticlabs/go-bitfield v0.0.0-20210809151128-385d8c5e3fb7/go.mod h1:wmuf/mdK4VMD+jA9ThwcUKjg3a2XWM9cVfFYjDyY4j4= github.com/prysmaticlabs/grpc-gateway/v2 v2.3.1-0.20210702154020-550e1cd83ec1 h1:xcu59yYL6AWWTl6jtejBfE0y8uF35fArCBeZjRlvJss= diff --git a/tables.sql b/tables.sql index a4827746dd..889528c98a 100644 --- a/tables.sql +++ b/tables.sql @@ -610,9 +610,7 @@ CREATE TABLE stats_process ( sync_eth2_fallback_configured bool not null, sync_eth2_fallback_connected bool not null, - meta_id bigint not null, - - foreign key(meta_id) references stats_meta(id) + meta_id bigint not null ); create index idx_stats_process_metaid on stats_process (meta_id); @@ -677,11 +675,8 @@ CREATE TABLE stats_system ( misc_node_boot_ts_seconds bigint not null, misc_os character varying(6) not null, - - meta_id bigint not null, - - - foreign key(meta_id) references stats_meta(id) + + meta_id bigint not null ); create index idx_stats_system_meta_id on stats_system (meta_id); diff --git a/types/config.go b/types/config.go index 77e5aa59ca..2053fe4f1a 100644 --- a/types/config.go +++ b/types/config.go @@ -57,7 +57,7 @@ type Config struct { Frontend struct { Kong string `yaml:"kong" envconfig:"FRONTEND_KONG"` OnlyAPI bool `yaml:"onlyAPI" envconfig:"FRONTEND_ONLY_API"` - CsrfAuthKey string `yaml:"csrfAuthKey" envconfig:"FRONTEND_CSRF_AUTHKEY` + CsrfAuthKey string `yaml:"csrfAuthKey" envconfig:"FRONTEND_CSRF_AUTHKEY"` CsrfInsecure bool `yaml:"csrfInsecure" envconfig:"FRONTEND_CSRF_INSECURE"` DisableCharts bool `yaml:"disableCharts" envconfig:"disableCharts"` RecaptchaSiteKey string `yaml:"recaptchaSiteKey" envconfig:"FRONTEND_RECAPTCHA_SITEKEY"`