MCPcopy Create free account
hub / github.com/ElementsProject/elements / start

Method start

contrib/assets_tutorial/test_framework/daemon.py:53–74  ·  view source on GitHub ↗
(self, ext_args = None, keep_datadir = False)

Source from the content-addressed store, hash-verified

51 print ("Leaving %s datadir at %s." % (self.name, self.datadir_path))
52
53 def start(self, ext_args = None, keep_datadir = False):
54 if keep_datadir and self.datadir_path is not None:
55 temp = self.datadir_path
56 self.datadir_path = None
57 self.shutdown()
58 self.datadir_path = temp
59 else:
60 self.shutdown()
61 # Create datadir and copy config into place
62 self.datadir_path = tempfile.mkdtemp()
63 shutil.copyfile(self.conf_path, self.datadir_path + '/' + self.daemon + '.conf')
64 print("%s datadir: %s" % (self.name, self.datadir_path))
65
66 # Start process
67 print ("Starting %s" % self.name)
68 if ext_args is None:
69 ext_args = []
70 self.proc = subprocess.Popen([self.path, "-datadir=" + self.datadir_path] + ext_args)
71 self.rpc = AuthServiceProxy("http://" + self.config["rpcuser"] + ":" + self.config["rpcpassword"] + "@127.0.0.1:" + self.config["rpcport"])
72
73 # Give daemon a moment to start up
74 time.sleep(1)
75
76 def connect_to(self, other):
77 self.addnode("localhost:%s" % other.config['port'], "onetry")

Callers 3

restartMethod · 0.95
assets_tutorial.pyFile · 0.45

Calls 2

shutdownMethod · 0.95
AuthServiceProxyClass · 0.90

Tested by

no test coverage detected