MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / start

Method start

test/functional/test_framework/test_node.py:142–166  ·  view source on GitHub ↗

Start the node.

(self, extra_args=None, *, stdout=None, stderr=None, **kwargs)

Source from the content-addressed store, hash-verified

140 return getattr(self.rpc, name)
141
142 def start(self, extra_args=None, *, stdout=None, stderr=None, **kwargs):
143 """Start the node."""
144 if extra_args is None:
145 extra_args = self.extra_args
146
147 # Add a new stdout and stderr file each time bitcoind is started
148 if stderr is None:
149 stderr = tempfile.NamedTemporaryFile(dir=self.stderr_dir, delete=False)
150 if stdout is None:
151 stdout = tempfile.NamedTemporaryFile(dir=self.stdout_dir, delete=False)
152 self.stderr = stderr
153 self.stdout = stdout
154
155 # Delete any existing cookie file -- if such a file exists (eg due to
156 # unclean shutdown), it will get overwritten anyway by bitcoind, and
157 # potentially interfere with our attempt to authenticate
158 delete_cookie_file(self.datadir)
159
160 # add environment variable LIBC_FATAL_STDERR_=1 so that libc errors are written to stderr and not the terminal
161 subp_env = dict(os.environ, LIBC_FATAL_STDERR_="1")
162
163 self.process = subprocess.Popen(self.args + extra_args, env=subp_env, stdout=stdout, stderr=stderr, **kwargs)
164
165 self.running = True
166 self.log.debug("bitcoind started, waiting for RPC to come up")
167
168 def wait_for_rpc_connection(self):
169 """Sets up an RPC connection to the bitcoind process. Returns False if unable to connect."""

Callers 7

run_testMethod · 0.45
run_testMethod · 0.45
setup_nodesMethod · 0.45
mainMethod · 0.45
start_nodeMethod · 0.45
start_nodesMethod · 0.45

Calls 1

delete_cookie_fileFunction · 0.85

Tested by

no test coverage detected