getamis/eth-indexer

dial tcp 127.0.0.1:8546: getsockopt: connection refused

faithgithub opened this issue · 2 comments

Hi:
when I run the docker,it give below wrong message,I need help;thank you!

ERROR[08-09|11:43:24|indexer/root.go:81] Failed to new a eth client err="dial tcp 127.0.0.1:8546: getsockopt: connection refused"

my config is:
version: "3"
services:

Customized geth image for indexer

geth:
image: quay.io/amis/geth:indexer_diff_tx_1.8.10
ports:
- "30303:30303"
- "8546:8546"
volumes:
- ${GETH_DATA_PATH}:/root/.ethereum
command: "--gcmode=archive --syncmode=full --wsapi "eth,debug" --ws --wsaddr 0.0.0.0 --wsport 8546 --wsorigins "*""
restart: always
depends_on:
- idx-database
idx-database:
image: mysql:5.7
ports:
- "3306:3306"
environment:
- MYSQL_ROOT_PASSWORD=qwe!@#123
- MYSQL_CHARSET=utf8
- MYSQL_DATABASE=ethdb
volumes:
- ${MYSQL_DATA_PATH}:/var/lib/mysql
idx-migration:
build:
context: ./migration
command: ["rake", "db:migrate"]
restart: on-failure
depends_on:
- idx-database
environment:
- RAILS_ENV=customized
- HOST=idx-database
- PORT=3306
- DATABASE=ethdb
- USERNAME=root
- PASSWORD=qwe!@#123
indexer:
build:
context: .
dockerfile: ./cmd/Dockerfile
command:
- indexer
restart: on-failure
depends_on:
- idx-database
- idx-migration
- geth
external_links:
- idx-database
- idx-migration
- geth
volumes:
- ./configs:/configs

the configs/config.yaml is:

protocol: ws
host: "127.0.0.1"
port: 8546
db:
driver: mysql
host: idx-database
port: 3306
name: ethdb
user: root
password: qwe!@#123
sync:
fromBlock: 0
pprof:
enable: false
port: 8000
address: "0.0.0.0"
functions:
erc20token: true
chain:
test: false

Hey @faithgithub
According to your config, indexer can't find geth because of wrong host ip.
Replace host from 127.0.0.1 to geth in configs/config.yaml and try again

yes I resolve this question but I got new problem.
ERROR[08-10|17:41:40|client/client.go:179] Failed to get total supply addr=0x86Fa049857E0209aa7D9e616F7eb3b3B78ECfdb0 err="no contract code at given address"
indexer_1 | ERROR[08-10|17:41:40|indexer/indexer.go:74] Failed to get ERC20 addr=0x86fa049857e0209aa7d9e616f7eb3b3b78ecfdb0 err="no contract code at given address"
indexer_1 | ERROR[08-10|17:41:40|indexer/root.go:115] Fail to subscribe ERC20Tokens and write to database err="no contract code at given address"
indexer_1 | Error: no contract code at given address
indexer_1 | CRIT [08-10|17:41:40|indexer/root.go:147] ServerCmd Execution failed err="no contract code at given address"