App Command line

1. Command line description

1.1. initialization

Initialization needs to specify the role, the default is the client.

vlan-cli init [ ovc | client ]

Return result:

{
  code: 0,
  data: {
    datadir: 'vlan_data_path',
    pubkey:  'pubkey',
    role:    'ovc | client'
  },
  msg: ''
}

1.2. Get public key

vlan-cli pubkey

Return result:

{
  code: 0,
  data: {
    name:   'my_node_name',
    pubkey: 'pubkey'
  },
  msg: ''
}

1.3. Join and favorite vlan

Need to specify the dnet_id. You can also customize the dnet_alias

vlan-cli join 'dnet_id' ['dnet_alias']

Return result:

{
  code: 0,
  data: {
     dnet_id:    'xxxx',
     dnet_alias: 'xxxx'
  },
  msg: ''
}

1.4. Remove a favorite vlan

Need to specify the dnet_id.

vlan-cli remove 'dnet_id'

Return result:

{
  code: 0,
  data: {
     dnet_id:    'xxxx',
     dnet_alias: 'xxxx'
  },
  msg: ''
}

1.5. Get all the favorite vlans

vlan-cli list

Return result:

{
  code: 0,
  data: [{
     dnet_id:    'xxxx',
     dnet_alias: 'xxxx'
  }],
  msg: ''
}

1.6. Start the VLAN APP

vlan-cli start

Return result:

{
  code: 0,
  data: {
     datadir: 'xxxx',
     pid:     '1234'
  },
  msg: ''
}

1.7. Connect to the specified vlan

Need to specify the dnet_id.

vlan-cli connect 'dnet_id'

Return result:

{
  code: 0,
  data: [{
     dnet_id:    'xxxx',
     dnet_alias: 'xxxx'
  }],
  msg: ''
}

1.8. Get vlan members

vlan-cli nodelist

Return result:

{
  code: 0,
  data: [
    {
      ip:        '10.1.0.1',
      name:      'node_name',
      role:      'client',
      ostype:    'windows',
      version:   'xx',
      reachable:  1,
      rtt:        2300,
      udpconfirm: 1
    }
  ],
  msg: ''
}

1.9. Stop the VLAN APP

vlan-cli stop

Return result:

{
  code: 0,
  data: {
     datadir: 'xxxx',
  },
  msg: ''
}

1.10. Rstart the VLAN APP

# loglevel: 0 - 4
vlan-cli restart [loglevel]

Return result:

{
  code: 0,
  data: {
     datadir: 'xxxx',
     pid:     '1234'
  },
  msg: ''
}

1.11. VLAN status

vlan-cli status
# Role is client
{
  code: 0,
  data: {
     role:       'client | ovc',
     status:     'running | stop',
     reachable:  'online  | offline | -'
     ip:         '10.x.x.x | -',
     name:       'node name',
     c2pkh:      'c2pkh',
     pubkey:     'pubkey',
     vlan:       'id | alias | -',
     datadir:    'vlan_data_path'
  },
  msg: ''
}

# Role is ovc
{
  code: 0,
  data: {
     role:       'client | ovc',
     status:     'running | stop',
     ip:         '10.x.x.x | -',
     name:       'node name',
     c2pkh:     'c2pkh',
     pubkey:     'pubkey',
     datadir:    'vlan_data_path'
  },
  msg: ''
}

2. Status code description

Status codeDescription
0success
-10000vlan not started
-10001vlan not init
-10002other error
-10003parameter error

Edit this page on GitHub