forked from MystenLabs/sui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove workers from committee (MystenLabs/narwhal#670)
* Remove workers from committee * Fix local benchmark, client demo & tests * Fix remote benchmark * revert settings.json * Fix docker compose configurations * rebase * Use singleton cache & update reconfiguration * Update todo comments * Fix license check * Address review comments
- Loading branch information
1 parent
4cf926a
commit f7932a1
Showing
63 changed files
with
1,190 additions
and
598 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#!/usr/bin/env python3 | ||
"""Generate a workers.json file | ||
""" | ||
|
||
import sys | ||
import argparse | ||
import json | ||
|
||
|
||
def main(): | ||
"mainly main." | ||
parser = argparse.ArgumentParser( | ||
description="workers file generator") | ||
|
||
parser.add_argument("-np", default=4, type=int, | ||
help="number of primary instances") | ||
parser.add_argument("-nw", default=1, type=int, | ||
help="number of worker instances per primary") | ||
parser.add_argument("-f", default="workers.json", | ||
help="workers.json file name") | ||
parser.add_argument("-d", default=None, help="target directory") | ||
args = parser.parse_args() | ||
|
||
# load keys | ||
keys = [] | ||
for i in range(args.np): | ||
k = open("{}/validator-{:02d}/key.json".format(args.d, i)).read() | ||
keys.append(json.loads(k)) | ||
|
||
temp = {} | ||
starting_port = 4000 | ||
for i, k in enumerate(keys): | ||
workers = {} | ||
port = starting_port | ||
for i in range(args.nw): | ||
workers[i] = { | ||
"primary_to_worker": "/dns/worker_{:02d}/tcp/{}/http".format(i, port), | ||
"transactions": "/dns/worker_{:02d}/tcp/{}/http".format(i, port+1), | ||
"worker_to_worker": "/dns/worker_{:02d}/tcp/{}/http".format(i, port+2) | ||
} | ||
port += 3 | ||
temp[k['name']] = workers | ||
out = {"workers": temp, "epoch": 0} | ||
print(json.dumps(out, indent=4)) | ||
|
||
|
||
if __name__ == '__main__': | ||
sys.exit(main()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.