Giter Club home page Giter Club logo

dna's Introduction

Build Status

English | 中文

DNA (Distributed Networks Architecture)

DNA is a decentralized distributed network protocol based on blockchain technology and is implemented in Golang. Through peer-to-peer network, DNA can be used to digitize assets and provide financial service, including asset registration, issuance, transfer, etc.

Highlight Features

  • Scalable Lightweight Universal Smart Contract
  • Crosschain Interactive Protocol
  • Quantum-Resistant Cryptography (optional module)
  • China National Crypto Standard (optional module)
  • High Optimization of TPS
  • P2P Link Layer Encryption
  • Node Access Control
  • Multiple Consensus Algorithm Support (DBFT/VBFT)
  • Configurable Block Generation Time
  • Configurable Digital Currency Incentive
  • Configable Sharding Consensus (in progress)

Building

The requirements to build DNA are:

  • Go version 1.12.5 or later
  • Properly configured Go environment

Clone the DNA repository into the appropriate $GOPATH/src/DNAProject directory.

$ git clone https://github.com/DNAProject/DNA.git

Build the source code with make.

$ make

After building the source code, you should see two executable programs:

  • dnaNode: the node program

Follow the procedures in Deployment section to give them a shot!

Deployment

To run DNA successfully, at least 4 nodes are required. The four nodes can be deployed in the following two way:

  • multi-hosts deployment
  • testmode deployment

Configurations for multi-hosts deployment

We can do a quick multi-host deployment by modifying the default configuration file config.json. Change the IP address in SeedList section to the seed node's IP address, and then copy the changed file to the hosts that you will run on. On each host, put the executable program dnaNode and the configuration file config.json into the same directory. Like :

$ ls
config.json dnaNode

Each node also needs a wallet.dat to run. The quickest way to generate wallets is to run ./dnaNode account add -d on each host.Then, change the peerPubkey and address field to the 4 nodes' wallet public keys, which you can get from the last command's echo. The public key sequence does not matter. Now all configurations are completed.

Here's an snippet for configuration, note that 10.0.1.100 and 10.0.1.101 are public seed node's addresses:

$ cat config.json
{
  "SeedList": [
    "10.0.1.100:20338",
    "10.0.1.101:20338",
    "10.0.1.102:20338",
    "10.0.1.103:20338"
  ],
  "ConsensusType":"vbft",
  "VBFT":{
    "n":40,
    "c":1,
    "k":4,
    "l":64,
    "block_msg_delay":10000,
    "hash_msg_delay":10000,
    "peer_handshake_timeout":10,
    "max_block_change_view":3000,
    "admin_ont_id":"did:dna:AMAx993nE6NEqZjwBssUfopxnnvTdob9ij",
    "min_init_stake":10000,
    "vrf_value":"1c9810aa9822e511d5804a9c4db9dd08497c31087b0daafa34d768a3253441fa20515e2f30f81741102af0ca3cefc4818fef16adb825fbaa8cad78647f3afb590e",
    "vrf_proof":"c57741f934042cb8d8b087b44b161db56fc3ffd4ffb675d36cd09f83935be853d8729f3f5298d12d6fd28d45dde515a4b9d7f67682d182ba5118abf451ff1988",
    "peers":[
      {
        "index":1,
        "peerPubkey":"0289ebcf708798cd4c2570385e1371ba10bdc91e4800fa5b98a9b276eab9300f10",
        "address":"ANT97HNwurK2LE2LEiU72MsSD684nPyJMX",
        "initPos":10000
      },
      {
        "index":2,
        "peerPubkey":"039dc5f67a4e1b3e4fc907ed430fd3958d8b6690f4f298b5e041697bd5be77f3e8",
        "address":"AMLU5evr9EeW8G1WaZT1n1HDBxaq5GczeC",
        "initPos":10000
      },
      {
        "index":3,
        "peerPubkey":"0369f4005b006166e988af436860b8a06c15f3eb272ccbabff175e067e6bba88d7",
        "address":"AbSAwqHQmNMoUT8ps8N16HciYtgprbNozF",
        "initPos":10000
      },
      {
        "index":4,
        "peerPubkey":"035998e70d829eea58998ec743113cf778f66932a063efc1a0a0496717c4a0d93d",
        "address":"AemhQtcPTGegSk1UAsiLnePVcut1MLXSPg",
        "initPos":10000
      }
    ]
  }
}

Configurations for testmode deployment

If you like to run in test mode, there's no configuration needed. With the following command, you can start DNA in test mode.

$ ./dnaNode --testmode
$ - input your wallet password

Getting Started

Start the seed node program first and then other nodes. Just run:

$ ./dnaNode
$ - input your wallet password

Run ./dnaNode --help for more details.

Contributing

Can I contribute patches to DNA project?

Yes! Please open a pull request with signed-off commits. We appreciate your help!

You can also send your patches as emails to the developer mailing list. Please join the DNA mailing list or forum and talk to us about it.

Either way, if you don't sign off your patches, we will not accept them. This means adding a line that says "Signed-off-by: Name " at the end of each commit, indicating that you wrote the code and have the right to pass it on as an open source patch.

Also, please write good git commit messages. A good commit message looks like this:

Header line: explain the commit in one line (use the imperative)

Body of commit message is a few lines of text, explaining things
in more detail, possibly giving some background about the issue
being fixed, etc etc.

The body of the commit message can be several paragraphs, and
please do proper word-wrap and keep columns shorter than about
74 characters or so. That way "git log" will show things
nicely even when it's indented.

Make sure you explain your solution and why you're doing what you're
doing, as opposed to describing what you're doing. Reviewers and your
future self can read the patch, but might not understand why a
particular solution was implemented.

Reported-by: whoever-reported-it
Signed-off-by: Your Name <[email protected]>

License

DNA blockchain is licensed under the LGPL License, Version 3.0. See LICENSE for the full license text.

dna's People

Contributors

alverlyu avatar arbio5zt avatar carltraveler avatar chenzhijie avatar d5c5ceb0 avatar dnaproject2 avatar dreamfly281 avatar dyassab avatar honglei-cong avatar jasonzhoupw avatar kunxian-xia avatar laizy avatar lightshine001 avatar liuhangyu avatar lucas7788 avatar nashmiao avatar qiluge avatar rongyi avatar sharpbear avatar siovanus avatar superjinqing avatar tanziwen avatar voodoo12345 avatar weixudonga avatar wyattmufson avatar xiemylogos avatar xizho10 avatar yihen-liu avatar zhengq1 avatar zhouziyan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dna's Issues

Implement Block Verfication

Brief Description:

Implement the block verficaiton. Under "Validation" package, implement func "VerfiyBlock", take "Block" and other releated inputs, do following verfication:

  • Block format checking

  • Block's Programs should be pass via VM

缺少client库

master分支
glide install报错

[INFO] --> Fetching DNA/client
[WARN] Unable to checkout DNA/client
[ERROR] Error looking for DNA/client:

why is the question error Native contract address?

[ERROR] GID 1, Ledger AddBlock BlockHeight:1 BlockHash:526ae662a1aad09ecf92457bff0666061b464b65b6e4f09ef456cee77e27df60 error:saveBlock error Native contract address 0000000000000000000000000000000000000004 haven't been registered.
panic: saveBlock error Native contract address 0000000000000000000000000000000000000004 haven't been registered.

Is this project production ready?

Hi, I have been looking at DNA website and I see there is no documentation but the README here describes deployment procedures..

I was wondering whether the project can be used to deploy new private/consortium blockchains

Any info is appreciated :) Thanks in advance!

Implement Transaction Verification

Implement transaction verfication functions

Berif Description:

Under "Validation" package, implement func "VerifyTransaction", take "Transaciton","Transaction Pool", "Blockchain State" as inputs. The func will do following validations:

  • Transcation Well format

  • No duplicated inputs

  • Asset Precision check

  • inputs/outputs balance

  • double spend

  • Transcation's programs should be passed via VM

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.