|
27 | 27 | Direction, |
28 | 28 | ) |
29 | 29 |
|
| 30 | +LOCALHOST = "127.0.0.1" |
| 31 | + |
30 | 32 |
|
31 | 33 | def validate_slips_data(message_data: str) -> (str, int): |
32 | 34 | """ |
@@ -197,30 +199,23 @@ def _configure(self): |
197 | 199 | f"Did you include it in PATH?. Exiting process." |
198 | 200 | ) |
199 | 201 | return |
200 | | - executable = [self.pigeon_binary] |
201 | | - port_param = ["-port", str(self.port)] |
202 | | - # if '-ip' in sys.argv: |
203 | | - # ip_to_listen_on = sys.argv[sys.argv.index('-ip')+1] |
204 | | - # host_param = ["-host", ip_to_listen_on ] |
205 | | - # print(f"P2P modules is listening on ip {ip_to_listen_on} port: {self.port}, using '-ip' parameter") |
206 | | - # else: |
207 | | - host_param = ["-host", self.host] |
| 202 | + |
| 203 | + params = { |
| 204 | + "-port": str(self.port), |
| 205 | + "-host": self.host, |
| 206 | + "-key-file": self.pigeon_key_file, |
| 207 | + "--redis-db": f"localhost:{self.redis_port}", |
| 208 | + "-redis-channel-pygo": self.pygo_channel_raw, |
| 209 | + "-redis-channel-gopy": self.gopy_channel_raw, |
| 210 | + } |
208 | 211 | self.print( |
209 | | - f"P2p is listening on {self.host} port {self.port} determined " |
210 | | - f"by p2p module" |
| 212 | + f"P2P is listening on {self.host} port {self.port} " |
| 213 | + f"(determined by p2p module)" |
211 | 214 | ) |
| 215 | + executable = [self.pigeon_binary] + [ |
| 216 | + item for pair in params.items() for item in pair |
| 217 | + ] |
212 | 218 |
|
213 | | - keyfile_param = ["-key-file", self.pigeon_key_file] |
214 | | - # rename_with_port_param = ["-rename-with-port", |
215 | | - # str(self.rename_with_port).lower()] |
216 | | - pygo_channel_param = ["-redis-channel-pygo", self.pygo_channel_raw] |
217 | | - gopy_channel_param = ["-redis-channel-gopy", self.gopy_channel_raw] |
218 | | - executable.extend(port_param) |
219 | | - executable.extend(host_param) |
220 | | - executable.extend(keyfile_param) |
221 | | - # executable.extend(rename_with_port_param) |
222 | | - executable.extend(pygo_channel_param) |
223 | | - executable.extend(gopy_channel_param) |
224 | 219 | if self.create_p2p_logfile: |
225 | 220 | outfile = open(self.pigeon_logfile, "+w") |
226 | 221 | else: |
@@ -649,7 +644,7 @@ def main(self): |
649 | 644 | # give the pigeon time to put the multiaddr in the db |
650 | 645 | time.sleep(2) |
651 | 646 | multiaddr = self.db.get_multiaddr() |
652 | | - self.print(f"You Multiaddress is: {multiaddr}") |
| 647 | + self.print(f"You Multiaddress is: {multiaddr}\n") |
653 | 648 | self.mutliaddress_printed = True |
654 | 649 |
|
655 | 650 | except Exception: |
|
0 commit comments