/core

Core Protocols, Libraries and Off-chain Clients

Primary LanguageGoMIT LicenseMIT

DOS Client and Core Libraries

Go Report Card Maintainability GoDoc

Prerequisites:

Cloud Server / VPS Recommendations
  • AWS Lightsail - $5 monthly plan (1CPU, 1GB Memory, 40GB SSD, 2TB Bandwidth)
  • Vultr - Cloud Compute $5 monthly plan (1CPU, 1GB Memory, 25GB SSD, 1TB Bandwidth)
  • Digital Ocean - Droplet $5 monthly plan (1CPU, 25GB SSD, 1TB Bandwidth)
  • Linode - $5 monthly plan (1CPU, 1GB Memory, 25GB SSD, 1TB Bandwidth)
  • .
Verified and recommended installation environment
  • Ubuntu 16.04 x64 LTS or higher
  • An IPv4 address
  • Run $ curl ipconfig.me
  • Or get it from cloud server providers. Most vps / cloud server
  • With below ports open:
    • udp port 7946,30303
    • tcp port 7946,30303,8545,8546,9501
  • It's recommended to generate ssh login key pairs and setup public key authentication instead of using password login for server security and funds safety:
  • Learn how to setup SSH public key authentication on Ubuntu 16.04 and disable password logins.
Acquire testnet ether and testnet tokens

Building from source

  • Install Go and setup golang workingspace like below:

    $ cd /usr/local
    $ wget https://dl.google.com/go/go1.12.6.linux-amd64.tar.gz
    $ tar -C /usr/local -xzf go1.12.6.linux-amd64.tar.gz
  • Open ~/.bashrc and set $GOPATH and $PATH environmental variables:

    $ vim ~/.bashrc
      export GOPATH=$HOME/go
      export PATH=$PATH:/usr/local/go/bin:$GOPATH/bin
    $ source ~/.bashrc
  • Install dep to manage package dependencies.

  • Download source code:

    $ mkdir -p $GOPATH/src/github.com/DOSNetwork
    $ cd $GOPATH/src/github.com/DOSNetwork && git clone https://github.com/DOSNetwork/core.git
    $ cd core
  • Install build-essential if not already done

    $ sudo apt-get install build-essential
  • Build:

    • $ make vendor - to prepare dependencies for building
    • $ make - to build release version client
  • Dev tips:

    • $ go fmt ./... to reformat go source code.
    • $ golint to fix style mistakes conflicting with effective go. (golint tool for vim users.)
    • $ make devClient to build develoment version client.
    • $ make updateSubmodule to fetch latest system contracts from repo, instead of making contract modifications locally.
    • $ make gen to generate binding files for system contracts.
    • $ make clean to remove built binaries or unnecessary generated files.

Building using Docker (TODO)

Prepare the environment (TODO)

  • Download github repo: $ git clone https://github.com/DOSNetwork/core.git
  • Config following fields in dos.setting file:
    • USER: Username of the remote server/vps.
    • IP: Public ip address of the remote server/vps.
    • SSHKEY: VPS ssh private key location
    • KEYSTORE: Path to the ethereum keystore file generated by user
    • GETHPOOL: Beta node runners may NOT need to modify this field. (User can add more infura endpoins and more geth full nodes here. (Infura endpoins are used to relay transactions and ws (web socket) of full nodes are only for event subscriptions.)
    • Example:
      DOSIMAGE=dosnetwork/dosnode:beta
      GETHPOOL="https://rinkeby.infura.io/v3/<apikey>;ws://<ip-to-ethereum-rinkeby-fullnode>:8546"
      USER=<ubuntu>
      IP=<remote-server-ip>
      SSHKEY=/home/<ubuntu>/.ssh/<local-private-key-to-login-remote-server>
      KEYSTORE=<path-to-local-ethereum-keystore-file-generated-by-user>
      

Install and run client node using Docker (TODO)

  • Install and setup docker environment:
    • $ ./vps_docker.sh install
  • Start client node:
    • $ ./vps_docker.sh run
  • Stop client node:
    • $ ./vps_docker.sh stop
  • Check node status:
    • $ ./vps_docker.sh clientInfo

Build from source and run standalone binary (TODO)

  • $ git checkout Beta1.1 to use source code of latest release and follow development-setup to build #beta1.0 client node from scratch.
  • You can also build from master branch which contains latest features/updates, but they might not be considered as release-ready.
  • Install and upload node executable binary file to remote server:
    • $ ./vps.sh install
  • Start client node:
    • $ ./vps.sh run
  • Stop client node:
    • $ ./vps.sh stop
  • Check node status:
    • $ ./vps.sh clientInfo

Status

  • Verifiable Secret Sharing
  • Distributed Key Generation (Pedersen's DKG approach)
  • Paring Library and Threshold BLS Signature
  • Distributed Randomness Generation
  • Gossip & DHT Implementation
  • P2P NAT Support
  • Json / Xml / Html Request Parser
  • Dockerization and Client Deployment Script
  • Integration with Ethereum On-chain System Contracts
  • P2P Network Performance Tuning
  • Test with geth lightnode mode and experiment with parity clients
  • Staking & Delegation Contracts with a User-friendly Dashboard
  • Network Status Scanner/Explorer