Giter Site home page Giter Site logo

wuxiaonai / core Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dosnetwork/core

0.0 0.0 0.0 47.38 MB

Core Protocols, Libraries and Off-chain Clients

Home Page: https://dos.network

License: MIT License

Dockerfile 0.18% Makefile 0.58% Go 96.56% C 0.46% Assembly 0.13% Shell 2.10%

core's Introduction

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

core's People

Contributors

ericnien avatar xinruiwu avatar dryruner avatar fmlwlher avatar owen05 avatar lakerswq7 avatar azurestare avatar readonly123 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.