-
Notifications
You must be signed in to change notification settings - Fork 0
/
poaMenu.py
147 lines (131 loc) · 3.58 KB
/
poaMenu.py
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
#!/usr/bin/env python
def showMainMenu():
ans=True
while ans:
print ("""
1. Setup new node
2. Update node
3. Option 3
4.Exit/Quit
""")
ans=raw_input("What would you like to do? \n")
if ans=="1":
print("\n OK, let's setup new node")
## show menu for node setup
showSetupNodeMenu()
elif ans=="2":
print("\n OK, let's update a node")
## show menu for node update
showUpdateNodeMenu()
elif ans=="3":
print("\n Option 3")
## show menu for option 3
elif ans=="4":
print("\n Goodbye")
exit()
elif ans !="":
print("\n Not a valid choice. Try again")
def showSetupNodeMenu():
ans=True
while ans:
print ("""
1. Core
2. Sokol
3.Exit/Quit
""")
ans=raw_input("Which network?")
if ans=="1":
print("\n OK, let's setup new node on Core")
networkType = "core"
## show submenu
showSetupNodeMenu_1()
elif ans=="2":
print("\n OK, let's setup new node on Sokol")
networkType = "sokol"
## show submenu
showSetupNodeMenu_1()
elif ans=="3":
print("\n Goodbye")
exit()
elif ans !="":
print("\n Not a valid choice. Try again")
def showSetupNodeMenu_1():
ans=True
while ans:
print ("""
1. bootnode
2. validator
3. Master of Ceremony (MoC)
4. Go back to the main menu
5. Exit/Quit
""")
ans=raw_input("...?")
if ans=="1":
print("\n OK, let's setup bootnode")
## show menu for node setup
nodeType = 'bootnode'
collectBootnodeInfo()
elif ans=="2":
print("\n OK, let's setup validator node")
## show menu for node update
nodeType = 'validator'
collectValidatorInfo()
elif ans=="3":
print("\n OK, let's setup Master of Ceremony node")
nodeType = 'moc'
elif ans=="4":
showMainMenu()
elif ans=="5":
print("\n Goodbye")
exit()
elif ans !="":
print("\n What type of node? \n")
def showUpdateNodeMenu():
ans=True
while ans:
print ("""
1. Update bootnode
2. Update validator node
3. Update moc node
4. Go back to the main menu
5.Exit/Quit
""")
ans=raw_input("...?")
if ans=="1":
print("\n 1")
## show menu for node setup
elif ans=="2":
print("\n 2")
## show menu for node update
elif ans=="3":
print("\n This option is not ready")
showUpdateNodeMenu()
## show menu for option 3
elif ans=="4":
showMainMenu()
elif ans=="5":
print("\n Goodbye")
exit()
elif ans !="":
print("\n Not a valid choice. Try again \n")
def collectAWSInfo():
print ("Enter AWS access_key:")
access_key = input( "> " )
print ("Enter AWS secret access_key:")
access_key = input( "> " )
print ("Enter MINING_KEYFILE - this should be a secret code provided to you by the Master of Ceremony")
MINING_KEYFILE = input( "> " )
def collectBootnodeInfo():
print ("Enter bootnode name. Should start with Bootnode. Example: 'Bootnode Atlanta' \n This would be visible to other members of the network")
NODE_FULLNAME = input( "> " )
print ("Enter your email. \n This would be visible to other members of the network")
NODE_ADMIN_EMAIL = input( "> " )
print ("Enter NETSTATS_SERVER - this should be a url provided to you by the Master of Ceremony")
NETSTATS_SERVER = input( "> " )
print ("Enter NETSTATS_SECRET - this should be a secret code provided to you by the Master of Ceremony")
NETSTATS_SECRET = input( "> " )
def collectValidatorInfo():
print ("Enter your FULL NAME. \n This would be visible to other members of the network")
NODE_FULLNAME = input( "> " )
#def collectMocInfo():
showMainMenu()