This quick start shows the steps to run a slightly-modified Tinc-VPN 1.0.36 to create a Virtual LAN on DNet testnet. A driver App has been developed to map the DNet block data with the Tinc-VPN configuration settings and also manage the life cycle of Tinc App, like init, start, update setting and stop.
By the end of this tutorial, a private overlay network in the form of Layer 3 Virtual LAN is created. A Cloud VPN is created over Internet. Nodes around the world with assigned virtual IP address can connect with peer nodes like in a LAN environment.
For admins, please refer to the 7 steps workflow diagram before continue.
Install ÐNet Admin tools & DNet OVC & APP
Environment: tested on Ubuntun 16.04, 18.04, 20.04
The default data folder is:
$HOME/.dnet/
Role: dnet-admin
Using DNet App to create your own VLAN network and invite others to join.
1. Making sure dnet is started.
dnet
supports background and gui mode startup. The data is installed in the ~/.dnet
directory by default. You can also specify a custom data directory with the following parameters:
# custom data directory paramters
-datadir='dnet_path'
# example:
# dnetd/dnet-qt -datadir='dnet_path' [other commands]
If you use dnet-cli
or http
to operate the wallet, you need to enable the jsonrpc service. By adding the following parameters:
-rpcuser='custom username'
-rpcpassword='custom password'
-rpcport='custom port <default 19332>'
Run in background mode, the command line is:
dnetd -testnet -server -rpcuser='custom_username' -rpcpassword='custom_password' -daemon
Or run in GUI mode (Linux desktop version), the command line is:
dnet-qt -testnet -server -rpcuser='custom_username' -rpcpassword='custom_password'
2. Use dnet-cli
to operate DNetDB.
dnet-cli
is used for RPC operation DNetDB. This command depends on the jsonrpc service
, dnetd/dnet-qt
needs to enable the rpc service.
If dnetd/dnet-qt
specifies the data directory (-datadir='dnetcoin_path'
), the dnet-cli
command also needs to bring the data directory (-datadir='dnetcoin_path'
), otherwise it will prompt that the directory does not exist.
# example:
# dnet-cli -datadir='dnetcoin_path' [other commands]
3. About the wallet
Creating your own vLAN network and inviting others to join needs dnetcoin
coins, therefore, the wallet must have balance
to operate. If the wallet
balance is 0
, you need to transfer currency from other accounts with balance
or get test tokens from testnet.
Creating a DNET application requires operating the wallet and consuming dnetcoin. It takes up to two minutes to confirm.
Create a DNET application to use as a VLAN group, and you can specify an alias
for its application. A dnet_id
is returned.
dnet-cli dnet_create 'hello_vlan'
Deprecated
command line:dnetcoin-cli dnet_create 'hello_vlan'
Role: ovc-admin
Creating an OVC application requires operating the wallet and consuming dnetcoin. It takes up to two minutes to confirm.
OVC application acts as the cloud backend for VLAN applications. Every VLAN application must include OVC. Create an OVC application, and you can specify an alias
for its application. An ovc_id
is returned.
dnet-cli ovc_create 'my_ovc'
Deprecated
command line:dnetcoin-cli dnet_create 'my_ovc'
ovc-app
client command line generation resources
The OVC application
is a container for OVC resources
. One or more OVC resources can be added to the OVC application. The OVC data directory is installed by default in ~/.dnet/vlan
.You can also specify a custom data directory with the following parameters:
-datadir='ovr_path'
# example:
# vlan-cli -datadir='ovr_path'
Create an OVC resource
and use the ovc-app
client command line to complete this operation.
Use the vlan-cli
command line in the ovc-app
client:
# Initialize the ovc resource and return the ovc c2pkh.
# Specify the role as ovc.
# 'ovc' is a fixed role name and cannot be modified
vlan-cli init ovc
# Use this command to obtain the ovc c2pkh
vlan-cli c2pkh
# Start ovc resource
# loglevel: 0 - 4
# If the log level is not filled in, no log will be output
vlan-cli start [loglevel]
Operating the DNET application requires operating the wallet and consuming dnetcoin. It takes up to two minutes to confirm.
OVC application
added OVC resource
. This operation is performed by the creator
of the OVC application
.
Use dnet-cli
to run the command line:
dnet-cli ovc_put_cloud 'ovc_id' 'ovc_c2pkh' 'ovc_pub_ip'
Multiple ovc resources can be added to the ovc_id.
Deprecated
command line:dnetcoin-cli dnet_put 'ovc_id' 'ovc_c2pkh' 'ovc_pub_ip'
Role: dnet-admin
Operating the DNET application requires operating the wallet and consuming dnetcoin. It takes up to two minutes to confirm.
Add OVC application
to VLAN application
. Each VLAN application needs to include an OVC application, which can be added through ovc_id
. This operation is performed by the creator
of VLAN application
.
Use dnet-cli
to run the command line:
dnet-cli dnet_put_ovc 'dnet_id' 'ovc_id'
Deprecated
command line:dnetcoin-cli dnet_put 'dnet_id' '_OVC_LIST_' 'ovc_id'
Role: ovc-admin
VLAN applications
require OVC applications
authorization
to use OVC resources, otherwise it will prevent VLAN application
nodes from connecting.
Use the vlan
command line in the ovc-app
client to authorize:
# # Authorize to VLAN
vlan-cli join 'dnet_id'
# Get the currently authorized vlan(dnet_id)
vlan-cli list
Role: end-user
The Client node data directory is installed by default in ~/.dnet/vlan
.You can also specify a custom data directory with the following parameters:
-datadir='client_path'
# example:
# vlan-cli -datadir='client_path'
vlan-app
initialization. Use the vlan
command line in the app-app
client:
# Initialize the ovc resource and return the ovc c2pkh
vlan-cli init
# Use this command to obtain the ovc c2pkh
vlan-cli c2pkh
Role: dnet-admin & end-user
Send the client c2pkh
information to the VLAN application creator
. The VLAN application creator
will add his own node to the VLAN application. The node c2pkh
information can be obtained through the vlan info
command of vlan-app
. This part of the operation may be delayed (it takes time to generate the block).
Role: dnet-admin
Operating the DNET application requires operating the wallet and consuming dnetcoin. It takes up to two minutes to confirm.
VLAN application creator
joins the node. A VLAN application consists of an OVC application
and multiple VLAN client nodes. Each client node needs to provide its own c2pkh
information to the VLAN application in order to join in, and the virtual IP of the client node is assigned by the VLAN application creator. This operation is performed by the creator
of VLAN application
.
Use dnet-cli
to run the command line: ( The node_ip
is assigned by the creator
)
dnet-cli dnet_put_node 'dnet_id' 'node_c2pkh' 'node_ip'
Deprecated
command line:dnetcoin-cli dnet_put 'dnet_id' 'node_c2pkh' 'node_ip'
Role: end-user
After the creator add the node to the VLAN, the client node needs to acknowledge joining VLAN.
Use the vlan
command line in the vlan-cli
program:
# Acknowledge joining a VLAN. You can specify an alias.
vlan-cli join 'dnet_id' ['dnet_alias']
# View the joined VLAN ID list
vlan-cli list
Role: end-user
Use the vlan
command line in the vlan-cli
client:
# Start the client
# loglevel: 0 - 4
# If the log level is not filled in, no log will be output
vlan-cli start [loglevel]
# Restart the client
# loglevel: 0 - 4
# vlan-cli restart [loglevel]
# Stop the client
# vlan-cli stop
The client connects to the OVC in the specified VLAN and goes online in the VLAN.
Use the vlan
command line in the vlan-cli
client:
# Connect to the specified group
vlan-cli connect 'dnet_id'
# Restart the client
# loglevel: 0 - 4
vlan-cli restart
Note:
When switching VLAN applications, the client configuration will be rewritten, and the client needs to be restarted
The vlan client starts and requests data from the dnetcoin distributed node. If there is a network problem during this process, you can manually add the dnetcoin node.
Use the vlan
command line in the vlan-cli
client:
# Add dnetcoin node to the client local.
# 'host' can be a domain name or ip+port.
vlan addnode 'host'
# Remove the added dnetcoin node from the local
# 'host' can be a domain name or ip+port.
vlan removenode 'host'
Role: end-user
Now, the private overlay network is setup!
# View the status
vlan-cli status
Know the status of all nodes in the current connection vlan:
vlan-cli nodelist
The next section uses Tinc-VPN as example to explain the details of the DNetwork concepts, configuration and how to run an existing application to DNet platform.