summaryrefslogtreecommitdiff
path: root/tools/compileconfig.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/compileconfig.py')
-rwxr-xr-xtools/compileconfig.py25
1 files changed, 17 insertions, 8 deletions
diff --git a/tools/compileconfig.py b/tools/compileconfig.py
index abe59a3..a5f013a 100755
--- a/tools/compileconfig.py
+++ b/tools/compileconfig.py
@@ -186,7 +186,7 @@ def allowed_servers_frontend(signingnodenames, storagenodenames):
("/plop/v1/signing/sct", signingnodenames),
]
-def allowed_servers_primarymerge(frontendnodenames, secondarymergenames):
+def allowed_servers_primarymerge(frontendnodenames, secondarymergenames, signingnodenames):
return [
("/plop/v1/frontend/verify-entries", frontendnodenames),
("/plop/v1/frontend/sendlog", frontendnodenames),
@@ -197,6 +197,7 @@ def allowed_servers_primarymerge(frontendnodenames, secondarymergenames):
("/plop/v1/merge/setverifiedsize", secondarymergenames),
("/plop/v1/merge/sendlog", secondarymergenames),
("/plop/v1/merge/sendentry", secondarymergenames),
+ ("/plop/v1/signing/sth", signingnodenames),
]
def parse_ratelimit_expression(expression):
@@ -327,7 +328,7 @@ def gen_config(nodename, config, localconfig):
(Symbol("entry_root_path"), paths["mergedb"] + "/chains"),
]
- signingnodes = config["signingnodes"]
+ signingnodenames = [node["name"] for node in config["signingnodes"]]
signingnodeaddresses = ["https://%s/plop/v1/signing/" % node["address"] for node in config["signingnodes"]]
mergenodenames = [node["name"] for node in config["mergenodes"]]
primarymergenodename = config["primarymergenode"]
@@ -346,7 +347,7 @@ def gen_config(nodename, config, localconfig):
services.add(Symbol("ht"))
allowed_clients += allowed_clients_frontend(mergenodenames, primarymergenodename)
allowed_clients += allowed_clients_public()
- allowed_servers += allowed_servers_frontend([node["name"] for node in signingnodes], storagenodenames)
+ allowed_servers += allowed_servers_frontend(signingnodenames, storagenodenames)
if "storagenodes" in nodetype:
allowed_clients += allowed_clients_storage(frontendnodenames, mergenodenames)
if "signingnodes" in nodetype:
@@ -373,7 +374,9 @@ def gen_config(nodename, config, localconfig):
plopconfig.append((Symbol("sth_path"), paths["mergedb"] + "/sth"))
plopconfig.append((Symbol("fetched_path"), paths["mergedb"] + "/fetched"))
plopconfig.append((Symbol("verified_path"), paths["mergedb"] + "/verified"))
- allowed_servers += allowed_servers_primarymerge(frontendnodenames, mergesecondarynames)
+ reloadableplopconfig.append((Symbol("signing_nodes"), signingnodeaddresses))
+ reloadableplopconfig.append((Symbol("backup_quorum"), config["backup-quorum-size"]))
+ allowed_servers += allowed_servers_primarymerge(frontendnodenames, mergesecondarynames, signingnodenames)
else:
allowed_clients += allowed_clients_mergesecondary(primarymergenodename)
@@ -429,19 +432,25 @@ def gen_testmakefile(config, testmakefile, machines, shellvars=False):
storagenodenames = set([node["name"] for node in config["storagenodes"]])
signingnodenames = set([node["name"] for node in config["signingnodes"]])
mergenodenames = set([node["name"] for node in config["mergenodes"]])
- erlangnodenames_and_apps = ['%s:%s' % (nn, 'catlfish' if nn != config["primarymergenode"] else "merge") for nn in frontendnodenames | storagenodenames | signingnodenames | mergenodenames]
+ mergesecondarynodenames = set([node["name"] for node in config["mergenodes"] if node["name"] != config["primarymergenode"]])
frontendnodeaddresses = [node["publicaddress"] for node in config["frontendnodes"]]
storagenodeaddresses = [node["address"] for node in config["storagenodes"]]
signingnodeaddresses = [node["address"] for node in config["signingnodes"]]
- mergenodeaddresses = [node["address"] for node in config["mergenodes"] if node["name"] != config["primarymergenode"]]
+ mergesecondarynodeaddresses = [node["address"] for node in config["mergenodes"] if node["name"] != config["primarymergenode"]]
delimiter = '"' if shellvars else ''
print >>configfile, "NODES=" + delimiter + " ".join(frontendnodenames|storagenodenames|signingnodenames|mergenodenames) + delimiter
- print >>configfile, "ERLANGNODES=" + delimiter + " ".join(erlangnodenames_and_apps) + delimiter
+
+ print >>configfile, "FRONTENDNODES=" + delimiter + " ".join(['%s:%s' % (name, 'catlfish') for name in frontendnodenames]) + delimiter
+ print >>configfile, "STORAGENODES=" + delimiter + " ".join(['%s:%s' % (name, 'catlfish') for name in storagenodenames if name not in frontendnodenames]) + delimiter
+ print >>configfile, "SIGNINGNODES=" + delimiter + " ".join(['%s:%s' % (name, 'catlfish') for name in signingnodenames]) + delimiter
+ print >>configfile, "MERGESECONDARYNODES=" + delimiter + " ".join(['%s:%s' % (name, 'catlfish') for name in mergesecondarynodenames]) + delimiter
+ print >>configfile, "MERGEPRIMARYNODE=" '%s:%s' % (config["primarymergenode"], 'merge')
+
print >>configfile, "MACHINES=" + delimiter + " ".join([str(e) for e in range(1, machines+1)]) + delimiter
- print >>configfile, "TESTURLS=" + delimiter + " ".join(frontendnodeaddresses+storagenodeaddresses+signingnodeaddresses+mergenodeaddresses) + delimiter
+ print >>configfile, "TESTURLS=" + delimiter + " ".join(frontendnodeaddresses+storagenodeaddresses+signingnodeaddresses+mergesecondarynodeaddresses) + delimiter
print >>configfile, "BASEURL=" + delimiter + config["baseurl"] + delimiter
configfile.close()