Deploying dnetvlan node for Linux and MacOS

1.Download the dnet virtual networking code and compile

Recommended environment: Ubuntu 16.04, 18.04, 20.04:

autoreconf -sfi
# "--enable-testnet" : Declare running in a test environment
./configure --enable-testdnet
make
make install

Stable version download

  • Linux client download instructions

    Linux Quick install command:

    curl -fsSL http://d.network/assets/download/dnetvlan/linux/install.sh | bash

    Linux system supported version:

    NameVersion
    Ubuntu1604、1804、2004、2110
    Debian9、10
    CentOS7、8
    Fedora27、28、32、33
    Rocky8
    Rhel8
  • MacOS client download instructions

    Support MacOS 10.13 - 11.x version

    md5: 668d2c7cb8f46af80838de8c02852567

    link: dnetvlan-mac.zip

    Installation steps:

    1. unzip dnetvlan-mac.zip
    2. Execute the installation script
      sudo ./install.sh

2.dnet virtual networking client component

namedescript
dnetddnetvlan node daemon
dnetclidnetvlan node cli

3.Initialize the dnet virtual networking client node

# Initialize
#   "client"         : Declare role as client
#   "localhost:port" : Local ip and port (default port: 1213)
sudo dnetcli init client [localhost:port]

4.Request "dnet administrator" to add client nodes to the virtual group

Execute the "status" command to get the client node address:

# Returns the running status of the client node.
dnetcli status

# Return result description:
#   "role"      : client
#   "status"    : Client running status (running/stop)
#   "reachable" : Client virtual network status (online/offline)
#   "ip"        : virtual ip address
#   "name"      : Client node name
#   "address"   : Client node address (unique identifier)
#   "datadir"   : Client configuration file directory
#   "vlan"      : The virtual group where the client is located 
#                 (including connected and unconnected groups)

Provide address to the dnet administrator, who will manually add it to the specified dnet as a member node.

After the client node is added to the dnet, it may take a while to synchronize the data, depending on how fast the blockchain produces blocks.

5.Start the dnet virtual networking client node

Execute the start command to start the client:

# Start the client as a daemon
#   "loglevel" : Run log level (default 0)
sudo dnetcli start [loglevel]

Run "status" to view the current running status:

(For the return result, please refer to the previous "status" command return value description)

dnetcli status

When the client executes the status command, if the returned "status" attribute is "running", it means that the client is already running. At this time, if the "reachable" attribute is "offline", it means that the client is offline. You don't need to worry because the current client node is not connected to the dnet.

Next, it needs to wait for the client node to be confirmed in the added dnet. The speed of this confirmation process depends on the speed of the blockchain to generate blocks.

6.Verify the dnet where the client node is located

In the first two steps, we have started the client and provided the client address to the dnet administrator, then wait for the dnet administrator to add the client node to the specified dnet, and then the blockchain synchronizes this part data.

The average block generation time of the blockchain is 2-3 minutes. This does not guarantee that each block generation time is within the average time. You may wait longer, but the synchronization will be successful in the end.

In a short time, if you want to check the status of the client node's application to join the dnet, you can execute the getvlanlist command to find it.

# Get the virtual groups where the client node is located
# Contains information about the virtual group, the status of client nodes in the group, and the status of member client nodes within the group
dnetcli getvlanlist 

# Return result description:
#  "Name"         : DNet id 
#                   (dnet virtual group id)
#  "Alias"        : DNet alias 
#                   (dnet virtual group alias) 
#  "Status"       : The status of the client node in the virtual group 
#                   (1:connected \ 0:not connected)
#  "OnlineCount"  : The number of online client nodes in the virtual group
#  "OnlineNodes"  : Online client nodes in the virtual group
#                   (display client virtual IP)
#  "OfflineCount" : Offline client nodes in the virtual group 
#                   (display client virtual IP)

If after a long period of time, the getvlanlist command still cannot obtain the dnet that the client applies to join, you can execute the syncvlan command to force the synchronization from the blockchain once, and you can also ask "Group Administrator" Confirm that the client node has been joined.

# Force sync data
dnetcli syncvlan

After manually executing the synchronization command, you need to continue to execute the getvlanlist command to confirm the synchronization result of the group that the client applied to join.

7.Client connects or disconnects from dnet

When the client node successfully joins the dnet (confirmed by the miner), execute getvlanlist to obtain the list of group information of the client node. In the returned result, the "Name" attribute in the group list is the unique identifier of each dnet, which is called dnet_id here for the convenience of subsequent operations. Client nodes need to manually select the specified dnet_id to establish a connection with the dnet.

The first time a client node connects to a new dnet is not automatic, and requires manual execution of the command connect or disconnect group ID.

When the client finishes executing the connect or disconnect command, the client internally remembers this operation. The next time the client starts, the connect or disconnect command will be automatically executed to restore the state.

# The client establishes a connection with the specified virtual group
dnetcli connect [dnet_id]

# Client disconnects from specified virtual group
# dnetcli disconnect [dnet_id]

Tip: When the client connects or disconnects from the dnet, the network response may time out, please try again manually.

Next, you can execute the status command or the getvlanlist command to verify the running status of the client in the dnet:

  • Execute the status command to verify the client "connected group" and "unconnected group" information.

    "vlan":{
    # connected virtual group  
    "connected":[]# unconnected virtual group
    "disconnected":[]
    }
  • Execute the getvlanlist command. The "Status" property of each dnet is the status of the client within the group. When "Status" is equal to 1, it is connected, otherwise it is disconnected.

Edit this page on GitHub