CityOfZion / neo-scan

Blockchain explorer for NEO
https://neoscan.io
MIT License
70 stars 65 forks source link

Neo-scan cannot sync with Neo-Go node #443

Open aprasolova opened 4 years ago

aprasolova commented 4 years ago

I have a neo-go node of version 0.74.1-pre-47-g396c78c and I'm trying to connect neo-scan to this node.

I run neo-scan with docker-compose. The compose file is:

version: '2.4'

services:
  neo-scan:
    container_name: neo-scan
    depends_on:
      - postgres
    environment:
      DB_DATABASE: neoscan_prodv
      DB_HOSTNAME: localhost
      DB_PASSWORD: postgres
      DB_USERNAME: postgres
      NEO_SEEDS: >-
        http://127.0.0.1:30333
      PORT: 4000
      REPLACE_OS_VARS: 'true'
    healthcheck:
      interval: 30s
      retries: 3
      start_period: 20s
      test:
        - CMD
        - bash
        - '-c'
        - exec 6<>/dev/tcp/127.0.0.1/4000
      timeout: 10s
    image: 'cityofzion/neoscan:latest'
    network_mode: host
    restart: always

  postgres:
    container_name: postgres
    environment:
      POSTGRES_DB: neoscan_prodv
      POSTGRES_PASSWORD: postgres
      POSTGRES_USER: postgres
    image: 'library/postgres:12-alpine'
    network_mode: host
    restart: always

Neo-Go's config file, protocol.privnet.yml, looks so:

ProtocolConfiguration:
  Magic: 56753
  AddressVersion: 23
  SecondsPerBlock: 15
  MemPoolSize: 50000
  LowPriorityThreshold: 0.001
  StandbyValidators:
  - 02b3622bf4017bdfe317c58aed5f4c753f206b7db896046fa7d774bbc4bf7f8dc2
  SeedList:
  - 127.0.0.1:20334
  SystemFee:
    EnrollmentTransaction: 1000
    IssueTransaction: 500
    PublishTransaction: 500
    RegisterTransaction: 10000
  VerifyBlocks: true
  VerifyTransactions: false
  FreeGasLimit: 10.0
  MaxTransactionsPerBlock: 500
  MaxFreeTransactionsPerBlock: 20
  MaxFreeTransactionSize: 1024
  FeePerExtraByte: 0.00001

ApplicationConfiguration:
  DBConfiguration:
    Type: "boltdb"
    BoltDBOptions:
      FilePath: "/var/lib/neo-go/privnet.bolt"
  Address: 0.0.0.0
  NodePort: 20334
  Relay: true
  DialTimeout: 3
  ProtoTickInterval: 2
  PingInterval: 30
  PingTimeout: 90
  MaxPeers: 100
  MinPeers: 0
  AttemptConnPeers: 20
  RPC:
    Enabled: true
    EnableCORSWorkaround: true
    Port: 30333
    MaxGasInvoke: 20
  Prometheus:
    Enabled: True
    Port: 2112
  Pprof:
    Enabled: False
    Port: 2113
  UnlockWallet:
    Path: "/etc/neo-go/wallet.json"
    Password: "one"

The error that neo-scan writes to log:

2020-04-06 09:16:34.656 [error] [neoscan_full@127.0.0.1] error while downloading block {2454, :exit, {:timeout, {Task.Supervised, :stream, [60000]}}}
2020-04-06 09:16:34.656 [error] [neoscan_full@127.0.0.1] [{Task.Supervised, :stream_reduce, 7, [file: 'lib/task/supervised.ex', line: 280]}, {Enum, :map, 2, [file: 'lib/enum.ex', line: 2979]}, {NeoscanNode, :get_block_with_transfers, 1, [file: 'lib/neoscan_node.ex', line: 16]}, {NeoscanSync.Syncer, :download_block, 1, [file: 'lib/neoscan_sync/syncer.ex', line: 50]}, {NeoscanSync.Syncer, :"-sync_indexes/1-fun-1-", 1, [file: 'lib/neoscan_sync/syncer.ex', line: 104]}, {Task.Supervised, :do_apply, 2, [file: 'lib/task/supervised.ex', line: 89]}, {Task.Supervised, :reply, 5, [file: 'lib/task/supervised.ex', line: 38]}, {:proc_lib, :init_p_do_apply, 3, [file: 'proc_lib.erl', line: 249]}]
2020-04-06 09:16:34.792 [error] [neoscan_full@127.0.0.1] error while downloading block {2487, :exit, {:timeout, {Task.Supervised, :stream, [60000]}}}
2020-04-06 09:16:34.793 [error] [neoscan_full@127.0.0.1] [{Task.Supervised, :stream_reduce, 7, [file: 'lib/task/supervised.ex', line: 280]}, {Enum, :map, 2, [file: 'lib/enum.ex', line: 2979]}, {NeoscanNode, :get_block_with_transfers, 1, [file: 'lib/neoscan_node.ex', line: 16]}, {NeoscanSync.Syncer, :download_block, 1, [file: 'lib/neoscan_sync/syncer.ex', line: 50]}, {NeoscanSync.Syncer, :"-sync_indexes/1-fun-1-", 1, [file: 'lib/neoscan_sync/syncer.ex', line: 104]}, {Task.Supervised, :do_apply, 2, [file: 'lib/task/supervised.ex', line: 89]}, {Task.Supervised, :reply, 5, [file: 'lib/task/supervised.ex', line: 38]}, {:proc_lib, :init_p_do_apply, 3, [file: 'proc_lib.erl', line: 249]}]

and so on and so forth for every block.

Looking into neo-go logs, I see that neo-scan sends a getapplicationlog RPC request, but there is no transaction ID in it, but '00' instead.

Neo-Go privnet consensus node runs at 85.143.219.93:30333 and accepts RPC requests from internet, since it might be useful for debug.

lllwvlvwlll commented 4 years ago

@adrienmo do you have any ideas?