-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathconfig.py
More file actions
35 lines (32 loc) · 2.64 KB
/
Copy pathconfig.py
File metadata and controls
35 lines (32 loc) · 2.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# Copyright (c) 2019, Substratum LLC (https://substratum.net) and/or its affiliates. All rights reserved.
from command import SelectCommand, SetCommand
import finish, info, init, nfo, update, kill, start, help, daisy, cluster, binaries_command
COMMANDS = {
init.name(): init.command(), # setup
info.name(): info.command(), # always "all"
update.name(): update.command(),
start.name(): start.command(),
'tail': SelectCommand('tail', lambda instance: instance.tail(), "opens terminal(s) to tail -f MASQNode logs on"),
'subvert': SelectCommand('subvert', lambda instance: instance.subvert(), "subverts"),
'curl': SelectCommand('curl', lambda instance: instance.curl(), "prompts for URL and curl count, and executes on"),
'wget': SelectCommand('wget', lambda instance: instance.wget(), "wgets traffic on"),
'verify': SelectCommand('verify', lambda instance: instance.verify(), "checks whether traffic was routed for"),
'revert': SelectCommand('revert', lambda instance: instance.revert(), "reverts and cleans up traffic generation on"),
'inspect': SelectCommand('inspect', lambda instance: instance.inspect(), "finds all the DB update logs, prompts for which to display, and displays a graph representing the neighborhood of"),
'inbound': SelectCommand('inbound', lambda instance: instance.inbound(), "finds all the received Gossip, prompts for which to display, and displays a graph representing the Gossip sent to"),
'outbound': SelectCommand('outbound', lambda instance: instance.outbound(), "finds all the sent Gossip, prompts for which to display, and displays a graph representing the Gossip sent from"),
'stop': SelectCommand('stop', lambda instance: instance.stop_node(), "reverts and stops MASQNode on"),
finish.name(): finish.command(), # always "all"
'shell': SelectCommand('shell', lambda instance: instance.shell(), "opens shell(s) on node instance in terminal window"),
kill.name(): kill.command(),
nfo.name(): nfo.command(),
help.name(): help.command(),
daisy.name(): daisy.command(),
cluster.name(): cluster.command(),
'set': SetCommand(),
'binaries': binaries_command.BinariesCommand(),
# TODO status command (finds out which instances are running (checks all platforms), for running instances, determines if node is running on them, if they are subverted, etc)
# it should not load this state into INSTANCES automatically (multiple pairs could be using different cloud instances, so this should enable coordination)
# status could prompt for which ones we want to claim for this run of TNT, and load only those into INSTANCES.
# TODO help command with more detailed command info
}