# Nelson user-guide
## Nelson
Automatic peer discovery for IOTA.
## Environment
* Nodejs (ubuntu 16.04)
* Upgrade to [Nodejs 8](https://nodejs.org/en/download/package-manager/)
## Installation
https://github.com/SemkoDev/nelson.cli
* Globally install Nelson
`$ sudo npm install -g nelson.cli`
* And run it
`$ nelson --gui --getNeighbors`
## Glossary
#### Nelson node info (GUI):
![](https://i.imgur.com/SacRDA8.png)
* weight: 只要有 peer 推薦該節點,此質變從 0 開始增長。
* epoch(時代): Personality 每 900 sec 變化的次數。
* 以上圖為例:
* epoch interval 為 15 分鐘
* 15 分鐘後 epoch 可達到 100%
* 之後,左邊的 Epoch 值累加 1
* cycle(循環): It is used to periodically check upon the connected peers and disconnect those that are not alive
#### Nelson node info (GLI):
curl http://localhost:18600
```
{
"ready": true,
"isIRIHealthy": true,
"totalPeers": 362,
"connectedPeers": [
{
"hostname": "xxx.212.xxx.212",
"ip": "xxx.212.xxx.212",
"port": "16600",
"TCPPort": "15600",
"UDPPort": "14600",
"seen": 1,
"connected": 3,
"tried": 0,
"weight": 0.14707582184280174,
"dateTried": "2017-12-19T17:53:29.384Z",
"dateLastConnected": "2017-12-19T17:53:30.057Z",
"dateCreated": "2017-12-19T11:36:45.094Z",
"isTrusted": false,
"_id": "mx5Wy2DpLF0wyNFQ",
"nelsonID": "75b14dab"
} (skip ...)
],
"config": {
"cycleInterval": 60,
"epochInterval": 900,
"beatInterval": 10,
"dataPath": "/home/ubuntu/data/neighbors.db",
"port": 16600,
"apiPort": 18600,
"IRIPort": 14265,
"TCPPort": 15600,
"UDPPort": 14600,
"isMaster": false,
"temporary": false
},
"heart": {
"lastCycle": "2017-12-19T18:28:50.443Z",
"lastEpoch": "2017-12-19T18:23:48.468Z",
"personality": {
"id": "f5a1de94c0b212807b8d89abb0225ca848ac86f1975819a4fa90701354beaf87230e2682981eac8bbe68cc1f666c1dc1",
"publicId": "f5a1de94",
"feature": "8"
},
"currentCycle": 65,
"currentEpoch": 5,
"startDate": "2017-12-19T17:23:25.206Z"
}
}
```
* ready
* isIRIHealthy
* totalPeers
* connectedPeers
* hostname
* ip
* port
* TCPPort
* UDPPort
* seen
* connected
* tried
* weight
* dateTried
* dateLastConnected
* dateCreated
* isTrusted
* _id
* nelsonID
* config
* cycleInterval
* epochInterval
* beatInterval
* dataPath
* port
* apiPort
* IRIPort
* TCPPort
* UDPPort
* isMaster
* temporary
* heart
* lastCycle
* lastEpoch
* personality
* id
* publicId
* feature
* currentCycle
* currentEpoch
* startDate
## Example (A testing Nelson Node deploy on Node1)
* Before
* URL: Node1
* latestSolidSubtangleMilestoneIndex:243000
* Run with Nelson
* 103 min
* Neighbor: 5
* latestSolidSubtangleMilestoneIndex: 287776
## Monitor tool
* https://github.com/SemkoDev/nelson.mon
* [Nelson Monitor](http://node1.puyuma.org:3000/)
## Question
* Tangled [14 hours ago]
Is it possible to make Nelson only add TCP neighbors?
* Roman Semko [14 hours ago]
:::info
No, there is an open bug in IRI. Running your iri in TCP and adding/removing neighbors will render it useless in a matter of half an hour.
:::
* https://github.com/iotaledger/iri/issues/345
* 此 issue 賞金 2Gi
* Can I watch my weight ?
* 推薦機制是否造成資安疑慮? (過度中心化)