mirror of
https://github.com/ZeroTier/ZeroTierOne
synced 2025-08-21 13:54:15 -07:00
Renamed supernode to rootserver
This commit is contained in:
parent
845955dea5
commit
a425bbc673
30 changed files with 166 additions and 156 deletions
|
@ -2,9 +2,9 @@ This folder contains the source files to compile the signed network root topolog
|
|||
|
||||
Keys in the root topology dictionary are:
|
||||
|
||||
* **supernodes**: contains another Dictionary mapping supernode address to supernode definition
|
||||
* **##########**: supernode address, contains supernode definition
|
||||
* **id**: supernode identity (public) in string-serialized format
|
||||
* **rootservers**: contains another Dictionary mapping rootserver address to rootserver definition
|
||||
* **##########**: rootserver address, contains rootserver definition
|
||||
* **id**: rootserver identity (public) in string-serialized format
|
||||
* **udp**: comma-delimited list of ip/port UDP addresses of node
|
||||
* **tcp**: *DEPRECATED* comma-delimited list of ip/port TCP addresses of node
|
||||
* **desc**: human-readable description (optional)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
supernodes=7e19876aba\=id\\\=7e19876aba:0:2a6e2b2318930f60eb097f70d0f4b028b2cd6d3d0c63c014b9039ff35390e41181f216fb2e6fa8d95c1ee9667156411905c3dccfea78d8c6dfafba688170b3fa\\nudp\\\=198.199.97.220/9993\\ntcp\\\=198.199.97.220/443\\ndesc\\\=San Francisco, California, USA\\ndns\\\=nyarlathotep.zerotier.com\\n\n8841408a2e\=id\\\=8841408a2e:0:bb1d31f2c323e264e9e64172c1a74f77899555ed10751cd56e86405cde118d02dffe555d462ccf6a85b5631c12350c8d5dc409ba10b9025d0f445cf449d92b1c\\nudp\\\=107.191.46.210/9993\\ntcp\\\=107.191.46.210/443\\ndesc\\\=Paris, France\\ndns\\\=shoggoth.zerotier.com\\n\n8acf059fe3\=id\\\=8acf059fe3:0:482f6ee5dfe902319b419de5bdc765209c0ecda38c4d6e4fcf0d33658398b4527dcd22f93112fb9befd02fd78bf7261b333fc105d192a623ca9e50fc60b374a5\\nudp\\\=162.243.77.111/9993\\ntcp\\\=162.243.77.111/443\\ndesc\\\=New York, New York, USA\\ndns\\\=cthulhu.zerotier.com\\n\n9d219039f3\=id\\\=9d219039f3:0:01f0922a98e3b34ebcbff333269dc265d7a020aab69d72be4d4acc9c8c9294785771256cd1d942a90d1bd1d2dca3ea84ef7d85afe6611fb43ff0b74126d90a6e\\nudp\\\=128.199.197.217/9993\\ntcp\\\=128.199.197.217/443\\ndesc\\\=Singapore\\ndns\\\=mi-go.zerotier.com\\n\n
|
||||
rootservers=7e19876aba\=id\\\=7e19876aba:0:2a6e2b2318930f60eb097f70d0f4b028b2cd6d3d0c63c014b9039ff35390e41181f216fb2e6fa8d95c1ee9667156411905c3dccfea78d8c6dfafba688170b3fa\\nudp\\\=198.199.97.220/9993\\ntcp\\\=198.199.97.220/443\\ndesc\\\=San Francisco, California, USA\\ndns\\\=nyarlathotep.zerotier.com\\n\n8841408a2e\=id\\\=8841408a2e:0:bb1d31f2c323e264e9e64172c1a74f77899555ed10751cd56e86405cde118d02dffe555d462ccf6a85b5631c12350c8d5dc409ba10b9025d0f445cf449d92b1c\\nudp\\\=107.191.46.210/9993\\ntcp\\\=107.191.46.210/443\\ndesc\\\=Paris, France\\ndns\\\=shoggoth.zerotier.com\\n\n8acf059fe3\=id\\\=8acf059fe3:0:482f6ee5dfe902319b419de5bdc765209c0ecda38c4d6e4fcf0d33658398b4527dcd22f93112fb9befd02fd78bf7261b333fc105d192a623ca9e50fc60b374a5\\nudp\\\=162.243.77.111/9993\\ntcp\\\=162.243.77.111/443\\ndesc\\\=New York, New York, USA\\ndns\\\=cthulhu.zerotier.com\\n\n9d219039f3\=id\\\=9d219039f3:0:01f0922a98e3b34ebcbff333269dc265d7a020aab69d72be4d4acc9c8c9294785771256cd1d942a90d1bd1d2dca3ea84ef7d85afe6611fb43ff0b74126d90a6e\\nudp\\\=128.199.197.217/9993\\ntcp\\\=128.199.197.217/443\\ndesc\\\=Singapore\\ndns\\\=mi-go.zerotier.com\\n\n
|
||||
~!ed25519=b7493f5a4b79a1dcc423fd25d2d8aa8d6293c490a12ceb6395417dd5868c17bfbcee685de58019d21f92576a78a45235d342efa2a00a544ded34766dd32d6f0e11809197f9baeedf4c6a0e8d2d657d280a579f2f2478b2f7c7a08089a5016b55
|
||||
~!sigid=77792b1c02:0:b5c361e8e9c2154e82c3e902fdfc337468b092a7c4d8dc685c37eb10ee4f3c17cc0bb1d024167e8cb0824d12263428373582da3d0a9a14b36e4546c317e811e6
|
||||
~!sigts=14ae42d0314
|
||||
|
|
|
@ -30,21 +30,21 @@ int main(int argc,char **argv)
|
|||
if (OSUtils::readFile("template.dict",buf))
|
||||
topology.fromString(buf);
|
||||
|
||||
// Read all entries in supernodes/ that correspond to supernode entry dictionaries
|
||||
// and add them to topology under supernodes/ subkey.
|
||||
Dictionary supernodes;
|
||||
std::vector<std::string> supernodeDictionaries(OSUtils::listDirectory("supernodes"));
|
||||
for(std::vector<std::string>::const_iterator sn(supernodeDictionaries.begin());sn!=supernodeDictionaries.end();++sn) {
|
||||
// Read all entries in rootservers/ that correspond to rootserver entry dictionaries
|
||||
// and add them to topology under rootservers/ subkey.
|
||||
Dictionary rootservers;
|
||||
std::vector<std::string> rootserverDictionaries(OSUtils::listDirectory("rootservers"));
|
||||
for(std::vector<std::string>::const_iterator sn(rootserverDictionaries.begin());sn!=rootserverDictionaries.end();++sn) {
|
||||
if (sn->length() == 10) {
|
||||
buf.clear();
|
||||
if (!OSUtils::readFile((std::string("supernodes/")+(*sn)).c_str(),buf)) {
|
||||
std::cerr << "Cannot read supernodes/" << *sn << std::endl;
|
||||
if (!OSUtils::readFile((std::string("rootservers/")+(*sn)).c_str(),buf)) {
|
||||
std::cerr << "Cannot read rootservers/" << *sn << std::endl;
|
||||
return 1;
|
||||
}
|
||||
supernodes[*sn] = buf;
|
||||
rootservers[*sn] = buf;
|
||||
}
|
||||
}
|
||||
topology["supernodes"] = supernodes.toString();
|
||||
topology["rootservers"] = rootservers.toString();
|
||||
|
||||
if ((topologyAuthority)&&(topologyAuthority.hasPrivate())) {
|
||||
// Sign topology with root-topology-authority.secret
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
Test Root Topology Script
|
||||
======
|
||||
|
||||
This builds a test-root-topology from any number of running test-supernode-# Docker containers. This can then be used with the (undocumented) -T (override root topology) option to run test networks under Docker.
|
||||
This builds a test-root-topology from any number of running test-rootserver-# Docker containers. This can then be used with the (undocumented) -T (override root topology) option to run test networks under Docker.
|
||||
|
||||
Once you have a local Docker test network running you can use iptables rules to simulate a variety of network pathologies, or you can just use it to test any new changes to the protocol or node behavior at some limited scale.
|
||||
|
|
|
@ -5,18 +5,18 @@ if [ ! -e ../mktopology ]; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
echo 'Populating supernodes/* with all Docker test-supernode-* container IPs and identities...'
|
||||
echo 'Populating rootservers/* with all Docker test-rootserver-* container IPs and identities...'
|
||||
|
||||
rm -rf supernodes
|
||||
mkdir supernodes
|
||||
rm -rf rootservers
|
||||
mkdir rootservers
|
||||
|
||||
for cid in `docker ps -f 'name=test-supernode-*' -q`; do
|
||||
for cid in `docker ps -f 'name=test-rootserver-*' -q`; do
|
||||
id=`docker exec $cid cat /var/lib/zerotier-one/identity.secret | cut -d : -f 1-3`
|
||||
ztaddr=`echo $id | cut -d : -f 1`
|
||||
ip=`docker exec $cid ifconfig | sed -En 's/127.0.0.1//;s/.*inet (addr:)?(([0-9]*\.){3}[0-9]*).*/\2/p'`
|
||||
echo $cid $ztaddr $id $ip
|
||||
echo "id=$id" >supernodes/$ztaddr
|
||||
echo "udp=$ip/9993" >>supernodes/$ztaddr
|
||||
echo "id=$id" >rootservers/$ztaddr
|
||||
echo "udp=$ip/9993" >>rootservers/$ztaddr
|
||||
done
|
||||
|
||||
echo 'Creating test-root-topology...'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue