GithubHelp home page GithubHelp logo

isabella232 / node-crawler Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ethereum/node-crawler

0.0 0.0 0.0 911 KB

Attempts to crawl the Ethereum network of valid Ethereum Nodes and visualizes them in a nice web dashboard.

Home Page: https://crawler.ethereum.org

License: MIT License

Shell 0.01% HTML 1.29% TypeScript 50.46% JavaScript 0.20% Batchfile 0.09% Go 46.97% Dockerfile 0.97%

node-crawler's Introduction

Ethereum Node Crawler

Crawls the network and visualizes collected data. This repository includes backend, API and frontend for Ethereum network crawler.

Backend is based on devp2p tool. It tries to connect to discovered nodes, fetches info about them and creates a database. API software reads raw node database, filters it, caches and serves as API. Frontend is a web application which reads data from the API and visualizes them as a dashboard.

Features:

  • Advanced filtering, allows you to add filters for a customized dashboard
  • Drilldown support, allows you to drill down the data to find interesting trends
  • Network upgrade readiness overview
  • Responsive mobile design

Contribute

Project is still in an early stage, contribution and testing is welcomed. You can run manually each part of the software for development purposes or deploy whole production ready stack with Docker.

Frontend

Development

For local development with debugging, remoting, etc:

  1. Copy .env into .env.local and replace the variables.
  2. And then npm install then npm start
  3. Run tests to make sure the data processing is working good. npm test

Production

To deploy this web app:

  1. Build the production bits by npm install then npm run build the contents will be located in build folder.
  2. Use your favorite web server, in this example we will be using nginx.
  3. The nginx config for that website could be which proxies the api to endpoint /v1:
server {
      server_name crawler.com;
      root /var/www/crawler.com;
      index index.html;

      location /v1 {
              proxy_pass http://localhost:10000;
              proxy_http_version 1.1;
              proxy_set_header Upgrade $http_upgrade;
              proxy_set_header Connection 'upgrade';
              proxy_set_header Host $host;
              proxy_cache_bypass $http_upgrade;
      }

      location / {
              try_files $uri $uri/ /index.html;
      }

      listen 80;
      listen [::]:80;
}

Backend API

Download latest golang.

Development

go run ./ .

Production

  1. Build the assembly into /usr/bin
go build ./ . -o /usr/bin/node-crawler-backend
  1. Make sure database is in /etc/node-crawler-backend/nodetable
  2. Create a systemd service in /etc/systemd/system/node-crawler-backend.service:
    [Unit]
    Description     = eth node crawler api
    Wants           = network-online.target
    After           = network-online.target
    
    [Service]
    User            = node-crawler
    ExecStart       = /usr/bin/node-crawler-backend --crawler-db-path /etc/node-crawler-backend/nodetable --api-db-path /etc/node-crawler-backend/nodes
    Restart         = on-failure
    RestartSec      = 3
    TimeoutSec      = 300
    
    [Install]
    WantedBy    = multi-user.target
    
  3. Then enable it and start it.
    systemctl enable node-crawler-backend
    systemctl start node-crawler-backend
    systemctl status node-crawler-backend
    

Crawler

Development

Backend for crawling the network also requires golang installed.

cd crawler
go run .

Run crawler using crawl command.

go run . crawl

Production

Build crawler and copy the binary to /usr/bin.

go build -o /usr/bin/

Create a systemd service similarly to above API example. In executed command, override default settings by pointing crawler database to chosen path and setting period to write crawled nodes.

crawler crawl --timeout 10m --table /path/to/database

Docker setup

Production build of preconfigured software stack can be easily deployed with Docker. To achieve this, clone this repository and access docker directory.

cd docker

Make sure you have Docker and docker-compose tools installed.

docker-compose up

node-crawler's People

Contributors

mariusvanderwijden avatar mohamedmansour avatar taxmeifyoucan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.