连接太少,config.json?
-
-
配置文件是config.json,请更新问题以减少混乱.The config file is config.json, please update the question to reduce confusion.
- 0
- 2019-08-29
- Phlogi
-
5 个回答
- 投票数
-
- 2019-05-23
某些"刚开始的节点"有时会在这种情况下结束,并且已经在努力解决该问题. 情况如下:
- 引导对等方接受大量连接,因此连接到它们永远没有问题
- 然后,他们总是将相同的子集发送回去.和 这些同伴不接受数百个连接,因此最终成为所有人 饱和,因此没有答复.
- 该节点一直停留在此阶段,直到通过
admin-client connect address [...]
手动给出一个接受连接并给出一些其他非饱和节点,一切都很好.
我们正在通过建立饱和节点来进行工作,同时拒绝额外的连接以任何方式将其对等节点的一部分发回尝试...
Some "just started node" sometime ends up in a situation like that and work is done to get rid of the problem. The scenario is the following:
- The bootstrap peers accept a big number of connection so there is never any problem to connect to them
- Then, they send back always the same subset of their peers. And these peers do not accept hundred of connection so they end up being all saturate and therefore none reply.
- The node is stuck in this stage until being given by hand via
admin-client connect address [...]
the address of a non saturated node that accepts the connection and gives some addresses of some other non saturated nodes and everything is finally fine.
We are working on it by making saturated nodes while refusing an extra connection sending back anyway a subset of their peers to try...
-
- 2019-02-15
您的节点是否处于私有模式?当网络中有数百个对等方时,只有5个连接是很奇怪的.您是否尝试过重新启动节点?和/或生成新的身份?也许其他节点已将您的节点列入黑名单.
您可以使用命令行选项-peer ADDR:PORT 添加对等体,也可以将其添加到config.json文件中.通过配置文件,您可以例如按如下方式添加对等体:
{ "p2p": { "bootstrap-peers": ["127.0.0.1:9731"], }
Is your node in private mode ? It's bizarre to only have 5 connections while there are hundreds of peers in the networks. Have you tried to restart your node ? and/or to generate a new identity ? Maybe the other nodes have blacklisted yours.
You can either add peers with command line option --peer ADDR:PORT, or by adding them in the config.json file. Via the config file, you can for instance add the peers as follows:
{ "p2p": { "bootstrap-peers": ["127.0.0.1:9731"], }
-
没有私人模式.是的,我尝试过重启几次.为什么有人将我列入黑名单?No private mode. And yes i've tried to restart several times. Why should somebody blacklist me?
- 0
- 2019-02-15
- Blindripper
-
例如,如果某人认为您的行为不像"正常"节点,则您可能将其列入黑名单:(您的数据格式不正确,您尝试用相同的请求来填充另一个节点,..).您可以尝试打印更多调试跟踪(使用-vvv),并查看为什么拒绝/关闭连接.One may blacklist you if, for instance, it considers that you are not behaving like a "normal" node: (your data are not well formed, you try to flood the other node with the same request, ....). You can try to print more debug traces (with -vvv) and see why connections are refused/closed.
- 2
- 2019-02-15
- iguerNL
-
好吧,事实并非如此,我表现得"正常" :)Ok that can't be the case, i behave "normal" :)
- 0
- 2019-02-15
- Blindripper
-
- 2019-02-16
好吧,我尝试打开端口,生成一个新的标识,建议手动添加对等体(例如iguer),但没有任何帮助.
但是在Tezos Baking松弛中一个叫" Krixt"的人写了这个脚本:
#!/bin/bash # get foundation nodes for i in dubnodes franodes sinnodes nrtnodes pdxnodes; do for j in `dig $i.tzbeta.net +short`; do echo "Connecting foundation $j..." ~/tezos/tezos-admin-client connect address [$j]:9732 done done # public nodes for j in 0 1; do for i in `curl -s "http://api6.tzscan.io/v3/network?state=running&p=$j&number=50" \ | jq -r '.[] | .point_id' | xargs`; do # handle ipv4 or ipv6 numparts=$(echo $i | awk -F: '{print NF}') basenum=$((numparts-1)) port=$(echo $i | cut -d: -f$numparts) base=$(echo $i | cut -d: -f1-$basenum) formatted="[$base]:$port" echo "Connecting $formatted..." ~/tezos/tezos-admin-client connect address $formatted done done
来源: https://gist.github.com/utdrmac/2125a8514960e163837e86bc934f19b6
>此脚本是真正的连接助推器:) 我现在有100多个连接(以前是5个).
我希望这会帮助遇到相同
"too few connections"
问题的其他人;)Ok, i've tried to open ports, generated a new identity, added peers manually (like iguer) adviced, but nothing helped.
But a guy called "Krixt" in the Tezos Baking slack wrote this script:
#!/bin/bash # get foundation nodes for i in dubnodes franodes sinnodes nrtnodes pdxnodes; do for j in `dig $i.tzbeta.net +short`; do echo "Connecting foundation $j..." ~/tezos/tezos-admin-client connect address [$j]:9732 done done # public nodes for j in 0 1; do for i in `curl -s "http://api6.tzscan.io/v3/network?state=running&p=$j&number=50" \ | jq -r '.[] | .point_id' | xargs`; do # handle ipv4 or ipv6 numparts=$(echo $i | awk -F: '{print NF}') basenum=$((numparts-1)) port=$(echo $i | cut -d: -f$numparts) base=$(echo $i | cut -d: -f1-$basenum) formatted="[$base]:$port" echo "Connecting $formatted..." ~/tezos/tezos-admin-client connect address $formatted done done
Source: https://gist.github.com/utdrmac/2125a8514960e163837e86bc934f19b6
This script is a true connection booster :) I've now more than 100 connections (from 5 before).
I hope this will help others with the same
"too few connections"
problems ;)-
不错!尽管这不能解释为什么节点不自行发现网络.这可能是需要开发团队进行调查和调试的情况.Nice ! Although this does not explain why the node is not discovering the network by its own. This is maybe a case that needs investigation and debug by dev team.
- 1
- 2019-02-16
- iguerNL
-
是的,我从第7个周期开始运行,没有任何问题或更改(代码更新除外).好奇怪Yeah, i am running since cycle 7 without problems or changes (Except the code updates). Weired.
- 0
- 2019-02-16
- Blindripper
-
我很高兴为您服务.但同样,此脚本与他人建立了联系.问题肯定是其他人无法与您建立联系,您应该深入研究它,而不要使用创可贴.正常节点在其稳定状态下会自行获得约50多个连接,在最初的几分钟内会获得10多个连接.I'm glad something works for you. But again, this script makes connections to others. The problem is surely that others can't connect to you, you should dig more into it instead of using a bandaid. A normal node gets about 50+ connections on its own in its stable state, 10+ within the first few minutes.
- 0
- 2019-02-16
- Frank
-
创建新身份后,也会出现此问题.因此,我认为它与黑名单无关.如果所有其他节点都花了超过70个周期将我列入黑名单,那将是奇怪的.The problem also raised after i've created a new identity. So I think it can not have anything to do with blacklisting. And it would be strange, if all other nodes took more than 70 cycles to blacklist me.
- 0
- 2019-02-17
- Blindripper
-
tzscan不再可用.请检查https://github.com/Phlogi/tezos-snapshots/blob/master/scripts/addpeers_2.0.sh以获取替代方法.tzscan is not available anymore. Please check https://github.com/Phlogi/tezos-snapshots/blob/master/scripts/addpeers_2.0.sh for an alternative.
- 0
- 2020-01-23
- Phlogi
-
我在carthagenet上不工作,脚本输出为错误: 对等连接被拒绝:没有通用的网络协议. >连接基础34.246.245.155 ... 错误: 对等连接被拒绝:没有通用的网络协议. >连接基础52.30.97.85 ... 错误: 对等连接被拒绝:没有通用的网络协议.I doesn't work on carthagenet, script output is Error: Rejected peer connection: no common network protocol. > Connecting foundation 34.246.245.155... Error: Rejected peer connection: no common network protocol. > Connecting foundation 52.30.97.85... Error: Rejected peer connection: no common network protocol.
- 0
- 2020-04-02
- saiwaixiaowangzi
-
- 2019-02-15
正如iguer所指出的,私有模式将是导致这种情况的原因之一.但是,详细说来,这主要是因为私有模式节点对于对等节点的连接不太有利,因为私有节点基本上是网络的障碍.它不会尝试引导其他节点.专用节点通常只会监视以获取区块链并填充其内存池,仅偶尔偶尔共享诸如烘焙或交易之类的操作.
从根本上讲,专用节点不允许其他节点连接到该专用节点.出于同样的原因,如果您的公共节点不允许其他人连接到它,它将共享"连接太少"的症状.允许其他人连接不是节点的要求,因为节点本身可以尝试连接到已知的对等节点并以此方式引导链.但是我的理论是,不允许其他节点建立连接的节点也被认为是不利的,因此某些节点可能会丢弃或拒绝您的节点作为对等节点,因为这无助于扩展其网络覆盖范围.我当然会检查以确保您的端口
9732
可通过防火墙或路由器或其他设备进行连接. (官方文档说它是端口19732
,但根据我的经验,我认为这是错误的.)too few connections
的第三种原因很少见,但应该指出.如果您使用了错误的网络,分支/链或协议,则只能连接到兼容节点.您连接的所有节点也将使用相同的设置.需要注意的事情是确保使用mainnet
分支而不是master
编译二进制文件.另外,请记住运行正确的二进制文件(当前使用003
协议),并通过频繁地重新编译(或在Riot或Slack上进行通知)重新运行二进制文件.As iguer pointed out, private mode would be one reason to cause this. But to elaborate, this happens mostly because private mode nodes are less favorable for a peer node to connect to as the private node is basically a leech to the network. It will not try to bootstrap other nodes. Private nodes will mostly just monitor to get the blockchain and fill its mempool, only sometimes occasionally share an operation like baking or transaction.
Fundamentally, a private node does not allow others to connect to it. For the same reason, if your public node does not allow others to connect to it, it will share the "too few connections" symptoms. It's not a node requirement to allow others to connect because the node itself can try to connect to known peers and bootstrap the chain that way. But my theory is that nodes that does not allow connections from others are also considered less favorable, hence some nodes might drop or refuse your node as a peer because it doesn't help expand their reach to the network. I would certainly check to make sure your port
9732
is connectable through your firewall or router or whatever. (Official documentations says it's port19732
, but I believe that's wrong based on my experience.)Third reason why
too few connections
may happen is rare but should be pointed out. If you are on the wrong network or fork/chain or protocol, you will only connected to compatible nodes. All the nodes you are connected will be also on the same setup. Things to watch out for is to make sure to compile your binaries withmainnet
branch, notmaster
. Also, remember to run the correct binaries (currently at003
protocol) and keep your binaries up to date by recompiling every so often(or notified to do so on Riot or Slack).-
第三个对我有效:)我在docker/master而不是mainnet上运行,并且该节点无法连接到任何对等节点.谢谢!The third one was valid for me :) I was running on a docker/master instead of mainnet and the node could not connect to any peer. Thank you!
- 1
- 2019-02-20
- mitelone
-
- 2019-08-29
这是将对等体永久添加到tezos数据目录中的config.json文件的命令:
tezos节点配置更新--peer=13.251.160.63:9732 --peer=...
不幸的是,此命令不会检查现有条目.这样您就可以多次添加相同的对等体.
This is the command to add a peer permanently to the config.json file in the tezos data directory:
tezos-node config update --peer=13.251.160.63:9732 --peer=...
This command does unfortunately not check for already existing entries. So you can end up adding the same peers multiple times.
大约2天以来,我的连接数(5)太少(5). 我认为将对等体添加到我的" .tezos-node/config.json"文件中应该会有所帮助,但是我不确定它的外观.
我可以简单地将IP和端口添加到空白文件并将其放入./tezos-node文件夹吗?还是config.js必须具有特定的格式并包含特定的(更多)信息?