├── LICENSE └── README.md /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 DAppBoard 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # DAppBoard Documentation 2 | How to install, run and hack [DAppBoard](http://dappboard.com). 3 | 4 | Table of content: 5 | * [1. Introduction](#1-introduction) 6 | * [2. Installation](#2-installation) 7 | + [A. Prerequisite](#a-prerequisite) 8 | + [B. Setup](#b-setup) 9 | - [a. Common tools](#a-common-tools) 10 | - [b. ETL and Database](#b-etl-and-database) 11 | - [c. Web](#c-web) 12 | * [2. Running](#2-running) 13 | + [A. ETL](#a-etl) 14 | + [B. Web](#b-web) 15 | * [3. License and attribution](#3-license-and-attribution) 16 | 17 | ## 1. Introduction 18 | 19 | The DAppBoard project is a suite of open source tools used to capture and analyze Ethereum blockchain data. It is o into 4 repositories: 20 | * [ETL](https://github.com/DAppBoard/dappboard-etl): The tools that extract and transform the blockchain data and inject into our database. 21 | * [Web](https://github.com/DAppBoard/dappboard-web): A backend and frontend based on SailsJS. This is what you see when you visit [dappboard.com](http://dappboard.com). 22 | * [Environment](https://github.com/DAppBoard/dappboard-environment): Contains script and environment variable you will need to run DAppBoard [ETL](https://github.com/DAppBoard/dappboard-etl) and [Web](https://github.com/DAppBoard/dappboard-web). 23 | * [Documentation](https://github.com/DAppBoard/dappboard-documentation): How to set up and run your own DAppBoard. 24 | 25 | ## 2. Installation 26 | 27 | ### A. Prerequisite 28 | 29 | Running DAppBoard requires few resources 30 | 31 | * **Ubuntu 18.04 server**: any other distribution should work but this is what we use. 32 | * **PostgreSQL database**: or any compatible system like Amazon Aurora. 33 | 34 | We are currently hosting our pipeline at [DigitalOcean](http://digitalocean.com) and would like to thanks them for their support. 35 | 36 | 37 | ### B. Setup 38 | 39 | #### a. Common tools 40 | 41 | On a fresh Ubuntu server, clone the environment installation script and run it as an administrator. This will install all the tools needed to run the [ETL](https://github.com/DAppBoard/dappboard-etl) and [Web](https://github.com/DAppBoard/dappboard-web) interface. 42 | 43 | ``cd ~ && git clone https://github.com/DAppBoard/dappboard-environment.git && cd dappboard-environment && sudo ./install_server.sh`` 44 | 45 | You will then need to fill the environment file, the sample one is available here ```dappboard-environment/env_sample```: 46 | 47 | ``` 48 | # Database connection information 49 | export DAPPBOARD_PSQL_HOST="" 50 | export DAPPBOARD_PSQL_DB="" 51 | export DAPPBOARD_PSQL_USER="" 52 | export DAPPBOARD_PSQL_PASSWORD="" 53 | 54 | # The connection string for your RPC node or Infura 55 | export DAPPBOARD_NODE_URL="" 56 | 57 | # Only necessary for scripts that are fetching data from Etherscan (ABI/Sourcecode) 58 | export DAPPBOARD_ETHERSCAN_API="" 59 | ``` 60 | 61 | Once you have filled the information, source it and add it to your general environment. 62 | 63 | ```source env_sample && sudo cat env_sample >> /etc/environment``` 64 | 65 | #### b. ETL and Database 66 | 67 | For installing the [ETL](https://github.com/DAppBoard/dappboard-etl), we just need to clone the repo and install NPM dependencies. 68 | 69 | ``cd ~ && cd dappboard-etl/etl && npm install`` 70 | 71 | You will then need to create all the tables and indexes. For this, connect to your PostgreSQL database and run the SQL queries located in the ```dappboard-etl/schemas/tables/``` folder or [here](https://github.com/DAppBoard/dappboard-etl/tree/master/schemas/tables). 72 | 73 | #### c. Web 74 | 75 | Installing the [Web](https://github.com/DAppBoard/dappboard-web) part is optional as it's only valuable if you want to replicate DAppBoard. We publish it for learning and transparency purpose. 76 | 77 | ``cd ~ && cd dappboard-web/ && npm install`` 78 | 79 | ## 2. Running 80 | 81 | ### A. ETL 82 | 83 | We use [PM2](http://pm2.keymetrics.io/) in order to run and monitor node script: it was installed with the server environment. In the home folder run: 84 | 85 | ```pm2 start etl.ecosystem.config.js``` 86 | 87 | This will start all the ETL scripts: 88 | * **live** is responsible for getting new blocks and ingesting them. 89 | * **past** is responsible for going back in time for ingesting the blocks. 90 | * **scrape_tokens** is running every hour and get information about the tokens that emitted Transfer events. 91 | 92 | ### B. Web 93 | 94 | In the web folder, run: 95 | 96 | ```sails lift``` 97 | 98 | ## 3. License and attribution 99 | 100 | Everything you see (sources, documentation) is published under the MIT License. 101 | 102 | We invite you to use our work and contribute. If you use our tools or some of our data, feel free to tell it to the world! 103 | --------------------------------------------------------------------------------