Your Guide to Building and Deploying the DNA Blockchain

Feb 16, 2024 | Blockchain

Welcome to the world of DNA (Distributed Networks Architecture), a cutting-edge decentralized network protocol elegantly intertwined with blockchain technology, crafted in the robust Golang programming language. This guide will walk you through building and deploying DNA, making sure you harness its potential in digitizing assets and providing financial services.

Highlight Features of DNA

  • 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
  • Configurable Sharding Consensus (in progress)

Preparing to Build DNA

Before diving into building DNA, ensure you have the right tools:

  • Go version 1.12.5 or later
  • A properly configured Go environment

Steps to Build DNA

Follow these easy steps to get the DNA framework up and running:

  1. Clone the DNA repository into your $GOPATH/src/DNAProject directory:
  2. $ git clone https://github.com/DNAProject/DNA.git
  3. Build the source code using the make command:
  4. $ make
  5. Upon successful build, you should find two executable programs:
    • dnaNode: This is the main node program you will run.

Deployment of DNA

To run DNA successfully, you’ll need a minimum of four nodes. Deployment can be achieved in two ways:

  • Multi-hosts deployment
  • Test mode deployment

Configurations for Multi-hosts Deployment

For a swift multi-host deployment, you will need to modify the default configuration file config.json:

  1. Change the IP addresses in the SeedList section to the seed nodes’ addresses.
  2. Distribute the modified config.json file to each host where you will run DNA.
  3. Each node requires a wallet.dat. Generate one by running the following command on each host:
  4. $ .dnaNode account add -d
  5. Update the peer public keys and addresses in the config.json file with those of the generated wallets.

Example Configuration

Here’s a snippet for your config.json: (note that IP addresses are just examples)

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 Test Mode Deployment

If you prefer to run in test mode, simply follow this command without any configuration:

$ .dnaNode --testmode

Make sure to input your wallet password when prompted.

Getting Started

To kickstart your DNA experience, start by running the seed node program, followed by other nodes:

$ .dnaNode

For additional command options, you can run:

$ .dnaNode --help

Troubleshooting Your Deployment

Facing issues during deployment? Here are some helpful tips:

  • Node not starting: Ensure that all nodes have correct IP configurations and that the respective executables and configuration files reside in the same folder.
  • Wallet errors: If you’re receiving wallet-related errors, double-check that each node has a properly generated wallet.dat file.
  • Peer communication issues: Make sure that all public keys and addresses entered in the configuration match those generated by the wallet creation commands.
  • Insufficient consensus participants: Ensure you have at least four nodes running as required.

For more insights, updates, or to collaborate on AI development projects, stay connected with fxis.ai.

Join the DNA Community!

Contributions to the DNA project are welcome. Open a pull request with your patches or reach out via the developer mailing list. Just remember to sign off your patches to ensure smooth acceptance!

In Conclusion

At fxis.ai, we believe that such advancements are crucial for the future of AI, as they enable more comprehensive and effective solutions. Our team is continually exploring new methodologies to push the envelope in artificial intelligence, ensuring that our clients benefit from the latest technological innovations.

Stay Informed with the Newest F(x) Insights and Blogs

Tech News and Blog Highlights, Straight to Your Inbox