-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve validators guide #6337
base: master
Are you sure you want to change the base?
Improve validators guide #6337
Conversation
|
Hello @ajk-code , Thanks for your feedback.
ubuntu@ip-172-31-40-65:~$ cat /etc/hosts
127.0.0.1 localhost
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts This is the default Ubuntu hosts, still, the error happens anyway: ubuntu@ip-172-31-40-65:~$ curl -H "Content-Type: application/json" -d '{"id":1, "jsonrpc":"2.0", "method": "author_rotateKeys", "params":[]}' http://localhost:9944
Provided Host header is not whitelisted.
ubuntu@ip-172-31-40-65:~$ curl -H "Content-Type: application/json" -d '{"id":1, "jsonrpc":"2.0", "method": "author_rotateKeys", "params":[]}' http://127.0.0.1:9944
{"jsonrpc":"2.0","id":1,"result":"0x0000"} This is from Kusama Thousand Validators element channel, it seems lots of people get the same error with localhost and I believe everyone is using stock distro |
@leonardocustodio Did you try disabling IPv6? Just to test, to rule out any IPv6 shenanigans :) |
Disabling IPv6 with: sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1
sudo sysctl -w net.ipv6.conf.default.disable_ipv6=1
sudo sysctl -w net.ipv6.conf.lo.disable_ipv6=1 Indeed makes it work. ip -a (before) 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host noprefixroute
valid_lft forever preferred_lft forever
2: ens5: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9001 qdisc mq state UP group default qlen 1000
link/ether 0a:54:d4:7a:63:1d brd ff:ff:ff:ff:ff:ff
altname enp0s5
inet 172.31.40.65/20 metric 100 brd 172.31.47.255 scope global dynamic ens5
valid_lft 3261sec preferred_lft 3261sec
inet6 fe80::854:d4ff:fe7a:631d/64 scope link
valid_lft forever preferred_lft forever ip -a (after) 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
2: ens5: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9001 qdisc mq state UP group default qlen 1000
link/ether 0a:54:d4:7a:63:1d brd ff:ff:ff:ff:ff:ff
altname enp0s5
inet 172.31.40.65/20 metric 100 brd 172.31.47.255 scope global dynamic ens5
valid_lft 3067sec preferred_lft 3067sec Though again, this is a fresh install with default options and no IPv6 internet access, I suppose Ubuntu just enables the interface by default. What do you think would be better? Should we put a warning about IPv6 or just replace localhost with 127.0.0.1? My only concern is that people without knowing that will start the node with unsafe flags and might leave it running that way without knowing the proper solution, like the people on the element channel |
Yeah maybe a warning/disclaimer would be helpful, maybe you could check if the listener starts on IPv6 loopback (::1) as well and create a PR if it is not ? Regardless of that, I think that sort of issues is something a validator operator should be able to handle by him-/herself, there are so many factors and possibilities here (nss, netfilter, policies etc . on different OSI layers) we cannot nor should we cover all possible OS/sysadmin scenarios on the validator setup page imho. What do you think? |
Hello,
I made a minor tweak to improve the validator's guide.
Changed the order of generating the node key. The reason for that is that if the user starts to sync with the validator flag without the key, the node will not even begin, so I believe it is better if we tell the user to generate it before, even though we don't say to pass the validator flag on the next step, a lot of people could pass anyway.
When using
localhost
to rotate the keys, it will give an error about not being whitelisted; this makes some validators start the node with the unsafe flag, as some people have proposed in the community. But if you use127.0.0.1
, it will work as it is already whitelisted, preventing people from using the unsafe flag.