polkascan / harvester

Polkascan Harvester
GNU General Public License v3.0
18 stars 11 forks source link

How to run Harvester on my Local? #5

Closed SWS-5007 closed 1 year ago

SWS-5007 commented 1 year ago

Hi, I am going to this Harvester on my Local. So I cloned this rep on my local and executed all steps step by step as your readme. But Now, I am getting this error when I run alembic upgrade head command.

... ... File "C:\Users\Home\AppData\Local\Programs\Python\Python310\lib\site-packages\pymysql\connections.py", line 692, in _read_packet packet_header = self._read_bytes(4) File "C:\Users\Home\AppData\Local\Programs\Python\Python310\lib\site-packages\pymysql\connections.py", line 748, in _read_bytes raise err.OperationalError( sqlalchemy.exc.OperationalError: (pymysql.err.OperationalError) (2013, 'Lost connection to MySQL server during query') (Background on this error at: https://sqlalche.me/e/14/e3q8)

And here is my docker-compose.yml file.

version: '3.2'

services:

  harvester:
    build: .
    image: polkascan/harvester
    restart: unless-stopped
    entrypoint: /usr/src/start.sh
    ports:
      - '9620:9616'
    environment:
      # - DB_CONNECTION=mysql+pymysql://root:root@mysql:3306/shearscan?charset=utf8mb4
      - DB_CONNECTION=mysql+pymysql://shearscan_root:6kkgyRfrdLy=@81.181.255.41:3306/shearscan_explorer?charset=utf8mb4
      - SUBSTRATE_RPC_URL=wss://sheartoken.com
#      - SUBSTRATE_RPC_URL=ws://host.docker.internal:9944
      - NODE_TYPE=archive
      - SUBSTRATE_SS58_FORMAT=42
    depends_on:
      - mysql
      - substrate-node

  substrate-node:
    image: arjanz/substrate-node-template:latest
    volumes:
      - 'substrate-node:/substrate'
    ports:
      - '9944:9944'
      - '9933:9933'
    command: --dev --ws-external --rpc-cors=all --rpc-external --rpc-methods=Unsafe --no-telemetry --no-prometheus --pruning=archive

  mysql:
    image: mysql:latest
    volumes:
      - 'mysql-data:/var/lib/mysql'
    ports:
      - '33061:3306'
    environment:
      - MYSQL_ROOT_PASSWORD=6kkgyRfrdLy=
      - MYSQL_DATABASE=shearscan_db

volumes:
  substrate-node:
  mysql-data:

My local system is Win_10. So Can't I run this Harvester on Win_10 local? How can I solve this issue? Please help me. Best.

arjanz commented 1 year ago

See: https://github.com/polkascan/explorer/discussions/21#discussioncomment-4696418