Start the node.
(self, extra_args=None, *, cwd=None, stdout=None, stderr=None, **kwargs)
| 199 | return getattr(RPCOverloadWrapper(self.rpc, descriptors=self.descriptors), name) |
| 200 | |
| 201 | def start(self, extra_args=None, *, cwd=None, stdout=None, stderr=None, **kwargs): |
| 202 | """Start the node.""" |
| 203 | if extra_args is None: |
| 204 | extra_args = self.extra_args |
| 205 | |
| 206 | # Add a new stdout and stderr file each time bitcoind is started |
| 207 | if stderr is None: |
| 208 | stderr = tempfile.NamedTemporaryFile(dir=self.stderr_dir, delete=False) |
| 209 | if stdout is None: |
| 210 | stdout = tempfile.NamedTemporaryFile(dir=self.stdout_dir, delete=False) |
| 211 | self.stderr = stderr |
| 212 | self.stdout = stdout |
| 213 | |
| 214 | if cwd is None: |
| 215 | cwd = self.cwd |
| 216 | |
| 217 | # Delete any existing cookie file -- if such a file exists (eg due to |
| 218 | # unclean shutdown), it will get overwritten anyway by bitcoind, and |
| 219 | # potentially interfere with our attempt to authenticate |
| 220 | delete_cookie_file(self.datadir, self.chain) |
| 221 | |
| 222 | # add environment variable LIBC_FATAL_STDERR_=1 so that libc errors are written to stderr and not the terminal |
| 223 | subp_env = dict(os.environ, LIBC_FATAL_STDERR_="1") |
| 224 | |
| 225 | self.process = subprocess.Popen(self.args + extra_args, env=subp_env, stdout=stdout, stderr=stderr, cwd=cwd, **kwargs) |
| 226 | |
| 227 | self.running = True |
| 228 | self.log.debug("bitcoind started, waiting for RPC to come up") |
| 229 | |
| 230 | if self.start_perf: |
| 231 | self._start_perf() |
| 232 | |
| 233 | def wait_for_rpc_connection(self): |
| 234 | """Sets up an RPC connection to the bitcoind process. Returns False if unable to connect.""" |
no test coverage detected