MCPcopy Index your code
hub / github.com/DOSNetwork/core

github.com/DOSNetwork/core @v1.1.4

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.1.4 ↗ · + Follow
2,528 symbols 6,485 edges 105 files 1,437 documented · 57%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

DOS Client and Core Libraries

Go Report Card Maintainability GoDoc

Prerequisites:

Cloud Server / VPS Recommendations
  • AWS Lightsail - $5 monthly plan (1 cpu, 1GB memory, 40GB ssd, 2TB bandwidth)
  • Vultr - Cloud Compute $5 monthly plan (1 cpu, 1GB memory, 25GB ssd, 1TB bandwidth)
  • Digital Ocean - Droplet $5 monthly plan (1 cpu, 25GB ssd, 1TB bandwidth)
  • Linode - $5 monthly plan (1 cpu, 1GB memory, 25GB ssd, 1TB bandwidth)
  • .
Verified and recommended installation environment
  • Ubuntu 18.04 x64 LTS or higher
  • An IPv4 address
  • Run $ dig +short myip.opendns.com @resolver1.opendns.com
  • Or get it from cloud server providers. Most vps / cloud server
  • With below ports open:
  • udp port 7946
  • tcp port 7946,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 18.04 and disable password logins.
Acquire testnet ether and testnet tokens
Register and setup Infura api key

Run binary from github releases

  • Install: sh $ wget https://github.com/DOSNetwork/core/releases/download/v1.0-beta.23/config.json $ wget https://github.com/DOSNetwork/core/releases/download/v1.0-beta.23/dos.sh $ sudo chmod +x dos.sh
  • Use a existing keystore (optional): sh $ mkdir vault $ cp oldKeyStore vault/
  • Start: sh $ ./dos.sh start
  • Check client status : sh $ ./dos.sh status
  • Stop client : sh $ ./dos.sh stop
  • Debuging an issue : sh $ ./dos.sh log

Building binary from source

  • Install Go and setup golang workingspace like below: sh $ sudo apt-get install golang $ sudo apt-get install go-dep $ sudo apt-get install build-essential

  • Open ~/.bashrc and set $GOPATH and $PATH environmental variables: sh $ vim ~/.bashrc export GOPATH=$HOME/go export PATH=$PATH:/usr/local/go/bin:$GOPATH/bin $ source ~/.bashrc

  • Download source code: sh $ mkdir -p $GOPATH/src/github.com/DOSNetwork $ cd $GOPATH/src/github.com/DOSNetwork && git clone https://github.com/DOSNetwork/core.git $ cd core $ git checkout v1.0-beta.20

  • Build:

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

  • Run: sh $ ./dos.sh start

  • 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.

Run with docker image

  • TODO

Status

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

Extension points exported contracts — how you extend this code

NAT (Interface)
NAT represents an interface for upnp and natpmp [2 implementers]
p2p/nat/nat.go
Membership (Interface)
Membership represents the p2p network [2 implementers]
p2p/discover/membership.go
Suite (Interface)
Suite represents the set of functionalities needed by the package schnorr. [2 implementers]
sign/schnorr/schnorr.go
Suite (Interface)
Suite is the sum of all suites mix-ins in Kyber. [2 implementers]
suites/suites.go
P2PInterface (Interface)
P2PInterface represents a p2p network [1 implementers]
p2p/p2p_interface.go
Logger (Interface)
* Example: import ( "errors" "time" log "github.com/DOSNetwork/core/log" ) func myfunc() error { return errors.New [1 …
log/logger.go
PDKGInterface (Interface)
PDKGInterface is a interface for DKG [1 implementers]
share/dkg/pedersen/pdkg.go
ProxyAdapter (Interface)
ProxyAdapter represents an unified adapter interface for different blockchain [1 implementers]
onchain/chain_adaptor.go

Core symbols most depended-on inside this repo

New
called by 223
log/logger.go
Error
called by 137
log/logger.go
feMul
called by 112
group/edwards25519/fe.go
load3
called by 109
group/edwards25519/fe.go
load4
called by 105
group/edwards25519/fe.go
feSquare
called by 104
group/edwards25519/fe.go
Equal
called by 69
share/poly.go
Point
called by 63
group/nist/curve.go

Shape

Method 1,793
Function 430
Struct 284
Interface 12
TypeAlias 6
FuncType 3

Languages

Go100%

Modules by API surface

onchain/dosproxy/DOSProxy.go445 symbols
onchain/dosstaking/Staking.go233 symbols
onchain/dospayment/DOSPayment.go157 symbols
onchain/dosbridge/DOSAddressBridge.go113 symbols
p2p/internal/package.pb.go97 symbols
share/vss/pedersen/vss.pb.go89 symbols
onchain/commitreveal/CommitReveal.go75 symbols
group/bn256/point.go70 symbols
share/dkg/pedersen/dkg.pb.go52 symbols
p2p/package.pb.go50 symbols
share/vss/pedersen/vss.go46 symbols
group/mod/int.go45 symbols

For agents

$ claude mcp add core \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact