5
0
mirror of https://github.com/cwinfo/yggdrasil-network.github.io.git synced 2024-09-19 16:09:36 +00:00

Update admin.md

This commit is contained in:
Neil Alexander 2021-07-13 09:28:17 +01:00 committed by GitHub
parent f346a846f3
commit 12f1a2c2cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

153
admin.md
View File

@ -14,10 +14,7 @@ The `yggdrasilctl` utility provides a human-friendly CLI interface to the Yggdra
Examples include: Examples include:
``` ```
yggdrasilctl getDHT yggdrasilctl getDHT
yggdrasilctl addPeer uri=tcp://a.b.c.d:e
yggdrasilctl getPeers yggdrasilctl getPeers
yggdrasilctl removePeer port=4
yggdrasilctl setTunTap name=auto mtu=65535 tap_mode=false
```` ````
To get a list of supported commands: To get a list of supported commands:
@ -33,12 +30,7 @@ yggdrasilctl -endpoint=unix:///var/run/yggdrasil.sock getDHT
To get the JSON response body instead of a "friendly" output, specify the `-json` parameter: To get the JSON response body instead of a "friendly" output, specify the `-json` parameter:
``` ```
yggdrasilctl -json getSwitchPeers yggdrasilctl -json getPeers
```
To draw a map of a node's view of the network, install Graphviz onto your system and use `dot`:
```
yggdrasilctl dot | dot -Tpng -o map.png
``` ```
## Admin Socket ## Admin Socket
@ -121,42 +113,6 @@ For each IPv6 address:
- `port` (`uint8`) contains the local switch port number for that peer - `port` (`uint8`) contains the local switch port number for that peer
- `uptime` (`float64`) contains the number of seconds since the peer connection was established - `uptime` (`float64`) contains the number of seconds since the peer connection was established
#### `addPeer`
Expects:
- `uri` (`string`) for the peer to added, in standard URI format as used in the configuration file, i.e. `tcp://a.b.c.d:e`
Adds a new peer.
Returns:
- Zero or more successful `string` peer URIs in the `"added"` section
- Zero or more failed `string` peer URIs in the `"not_added"` section
#### `removePeer`
Expects:
- `port` (`uint8`) for the port of the peer to remove, this can be looked up using `getPeers` or `getSwitchPorts`
Removes an existing peer.
Returns:
- Zero or more successful `string` ports in the `"removed"` section
- Zero or more failed `string` ports in the `"not_removed"` section
#### `getSwitchPeers`
Expects no additional request fields.
Returns zero or more records containing information about switch peers.
For each port number:
- `box_pub_key` (`string`) contains the `EncryptionPublicKey` of the remote node
- `bytes_sent` (`uint64`) contains the number of bytes sent to the remote node
- `bytes_recvd` (`uint64`) contains the number of bytes received from the remote node
- `coords` (`string`) contains the coordinates of the node on the spanning tree
- `endpoint` (`string`) contains the connected IPv4/IPv6 address and port of the peering
- `ip` (`string`) contains the IPv6 address of the remote node
#### `getSelf` #### `getSelf`
Expects no additional request fields. Expects no additional request fields.
@ -191,39 +147,8 @@ Expects no additional request fields.
Returns exactly one record containing information about the current node's TUN/TAP adapter. Returns exactly one record containing information about the current node's TUN/TAP adapter.
For each adapter: For each adapter:
- `tap_mode` (`bool`) shows whether or not the interface is in TAP mode (if `false` then TUN mode is implied)
- `mtu` (`uint8`) contains the MTU of the local TUN/TAP adapter - `mtu` (`uint8`) contains the MTU of the local TUN/TAP adapter
#### `getAllowedEncryptionPublicKeys`
Expects no additional request fields.
Returns zero or more strings containing the allowed box public keys.
If zero strings are returned then it is implied that all connections are permitted.
#### `addAllowedEncryptionPublicKey`
Expects:
- `box_pub_key=` `string` for the public key to add
Adds a new allowed box pub key.
Returns:
- Zero or more successful `string` box pub keys in the `"added"` section
- Zero or more failed `string` box pub keys in the `"not_added"` section
#### `removeAllowedEncryptionPublicKey`
Expects:
- `box_pub_key=` `string` for the public key to remove
Removes an existing box pub key.
Returns:
- Zero or more successful `string` box pub keys in the `"removed"` section
- Zero or more failed `string` box pub keys in the `"not_removed"` section
#### `getMulticastInterfaces` #### `getMulticastInterfaces`
Expects no additional request fields. Expects no additional request fields.
@ -232,84 +157,10 @@ Returns zero or more strings containing the enabled multicast peering interfaces
If zero strings are returned then it is implied that multicast peering is not allowed on any interface. If zero strings are returned then it is implied that multicast peering is not allowed on any interface.
#### `getRoutes`
Expects no additional request fields.
Returns zero or more records where the subnet (`string`) is mapped to the public key (`string`).
#### `addRoute`
Expects:
- `subnet=` `string` for the subnet to route
- `box_pub_key=` `string` for the public key to route to
Adds a new crypto-key route.
Returns:
- Zero or more successful `string` routes in the `"added"` section
- Zero or more failed `string` routes in the `"not_added"` section
#### `removeRoute`
Expects:
- `subnet=` `string` for the subnet to remove the route for
- `box_pub_key=` `string` for the public key that is routed to
Removes an existing crypto-key route.
Returns:
- Zero or more successful `string` routes in the `"removed"` section
- Zero or more failed `string` routes in the `"not_removed"` section
#### `getSourceSubnets`
Expects no additional request fields.
Returns zero or more records for allowed crypto-key routing source subnets (`string`).
#### `addSourceSubnet`
Expects:
- `subnet=` `string` for the subnet to allow traffic from
Adds a new crypto-key source subnet.
Returns:
- Zero or more successful `string` source subnets in the `"added"` section
- Zero or more failed `string` source subnets in the `"not_added"` section
#### `removeSourceSubnet`
Expects:
- `subnet=` `string` for the subnet to remove
Removes an existing crypto-key source subnet.
Returns:
- Zero or more successful `string` source subnets in the `"removed"` section
- Zero or more failed `string` source subnets in the `"not_removed"` section
#### `dhtPing`
Expects:
- `box_pub_key=` `string`, hex-encoded public key of the remote node to ping, in the same format as e.g. verbose output from a `getDHT` response
- `coords=` `string`, location of the remote node in the network, in the same format as e.g. a `getDHT` response
- `target=` `string`, hex-encoded 512-bit NodeID to ask about, affects what the response from the remote node will be, optional
Asks a remote node to respond with information from the DHT.
Returns a `nodes` section with information about each node included in the DHT lookup response, indexed by IPv6.
For each IPv6 address, this includes:
- `box_pub_key` (`string`) contains the `EncryptionPublicKey` of the remote node
- `coords` (`string`) contains the coordinates of the node on the spanning tree
#### `getNodeInfo` #### `getNodeInfo`
Expects: Expects:
- `box_pub_key=` `string`, hex-encoded public key of the remote node to ping, in the same format as e.g. verbose output from a `getDHT` response - `key=` `string`, hex-encoded public key of the remote node to ping, in the same format as e.g. verbose output from a `getDHT` response
- `coords=` `string`, location of the remote node in the network, in the same format as e.g. a `getDHT` response
Asks a remote node to respond with their nodeinfo. Asks a remote node to respond with their nodeinfo.