tests/infra/node.py
def _start(
        self,
        start_type,
        lib_name,
        enclave_type,
        workspace,
        label,
        common_dir,
        target_rpc_address=None,
        snapshot_dir=None,
        members_info=None,
        **kwargs,
    ):
        """
        Creates a CCFRemote instance, sets it up (connects, creates the directory
        and ships over the files), and (optionally) starts the node by executing
        the appropriate command.
        If self.debug is set, it will not actually start up the node, but will
        prompt the user to do so manually.
        """
        lib_path = infra.path.build_lib_path(
            lib_name, enclave_type, library_dir=self.library_dir
        )
        if self.max_open_sessions:
            kwargs["max_open_sessions"] = self.max_open_sessions
        if self.max_open_sessions_hard:
            kwargs["max_open_sessions_hard"] = self.max_open_sessions_hard
        self.common_dir = common_dir

        self.remote = self.remote_shim(
            start_type,
            lib_path,
            enclave_type,
            self.remote_impl,
            workspace,
            common_dir,
            label=label,
            local_node_id=self.local_node_id,
            rpc_host=self.rpc_host,
            node_host=self.node_host,
            pub_host=self.pubhost,
            node_port=self.node_port,
            rpc_port=self.rpc_port,
            node_client_host=self.node_client_host,
            target_rpc_address=target_rpc_address,
            members_info=members_info,
            snapshot_dir=snapshot_dir,
            binary_dir=self.binary_dir,
            additional_raw_node_args=self.additional_raw_node_args,
            version=self.version,
            **kwargs,
        )
        self.remote.setup()
        self.network_state = NodeNetworkState.started
        if self.debug:
            with open("/tmp/vscode-gdb.sh", "a", encoding="utf-8") as f:
                f.write(f"if [ $1 -eq {self.remote.local_node_id} ]; then\n")
                f.write(f"cd {self.remote.remote.root}\n")
                f.write(f"{' '.join(self.remote.remote.cmd)}\n")
                f.write("fi\n")

            print("")
            print(
                "================= Please run the below command on "
                + self.rpc_host
                + " and press enter to continue ================="
            )
            print("")
            print(self.remote.debug_node_cmd())
            print("")
            input("Press Enter to continue...")
        else:
            if self.perf:
                self.remote.set_perf()
            self.remote.start()

        try:
            self.remote.get_startup_files(self.common_dir)
        except Exception as e:
            LOG.exception(e)
            self.remote.get_logs(tail_lines_len=None)
            raise

        self.consensus = kwargs.get("consensus")

        with open(
            os.path.join(self.common_dir, f"{self.local_node_id}.pem"), encoding="utf-8"
        ) as f:
            self.node_id = infra.crypto.compute_public_key_der_hash_hex_from_pem(
                f.read()
            )

        self._read_ports()
        LOG.info(f"Node {self.local_node_id} started: {self.node_id}")

        Creates a CCFRemote instance, sets it up (connects, creates the directory
        and ships over the files), and (optionally) starts the node by executing
        the appropriate command.
        If self.debug is set, it will not actually start up the node, but will
        prompt the user to do so manually.
        
Creates a CCFRemote instance, sets it up (connects, creates the directory
and ships over the files), and (optionally) starts the node by executing
the appropriate command.
If self.debug is set, it will not actually start up the node, but will
prompt the user to do so manually.
Creates a CCFRemote instance sets it up ( connects creates the directory and ships over the files ) and ( optionally ) starts the node by executing the appropriate command . If self . debug is set it will not actually start up the node but will prompt the user to do so manually .
def _start(
        self,
        start_type,
        lib_name,
        enclave_type,
        workspace,
        label,
        common_dir,
        target_rpc_address=None,
        snapshot_dir=None,
        members_info=None,
        **kwargs,
    ):
        lib_path = infra.path.build_lib_path(
            lib_name, enclave_type, library_dir=self.library_dir
        )
        if self.max_open_sessions:
            kwargs["max_open_sessions"] = self.max_open_sessions
        if self.max_open_sessions_hard:
            kwargs["max_open_sessions_hard"] = self.max_open_sessions_hard
        self.common_dir = common_dir
        self.remote = self.remote_shim(
            start_type,
            lib_path,
            enclave_type,
            self.remote_impl,
            workspace,
            common_dir,
            label=label,
            local_node_id=self.local_node_id,
            rpc_host=self.rpc_host,
            node_host=self.node_host,
            pub_host=self.pubhost,
            node_port=self.node_port,
            rpc_port=self.rpc_port,
            node_client_host=self.node_client_host,
            target_rpc_address=target_rpc_address,
            members_info=members_info,
            snapshot_dir=snapshot_dir,
            binary_dir=self.binary_dir,
            additional_raw_node_args=self.additional_raw_node_args,
            version=self.version,
            **kwargs,
        )
        self.remote.setup()
        self.network_state = NodeNetworkState.started
        if self.debug:
            with open("/tmp/vscode-gdb.sh", "a", encoding="utf-8") as f:
                f.write(f"if [ $1 -eq {self.remote.local_node_id} ]; then\n")
                f.write(f"cd {self.remote.remote.root}\n")
                f.write(f"{' '.join(self.remote.remote.cmd)}\n")
                f.write("fi\n")
            print("")
            print(
                "================= Please run the below command on "
                + self.rpc_host
                + " and press enter to continue ================="
            )
            print("")
            print(self.remote.debug_node_cmd())
            print("")
            input("Press Enter to continue...")
        else:
            if self.perf:
                self.remote.set_perf()
            self.remote.start()
        try:
            self.remote.get_startup_files(self.common_dir)
        except Exception as e:
            LOG.exception(e)
            self.remote.get_logs(tail_lines_len=None)
            raise
        self.consensus = kwargs.get("consensus")
        with open(
            os.path.join(self.common_dir, f"{self.local_node_id}.pem"), encoding="utf-8"
        ) as f:
            self.node_id = infra.crypto.compute_public_key_der_hash_hex_from_pem(
                f.read()
            )
        self._read_ports()
        LOG.info(f"Node {self.local_node_id} started: {self.node_id}")
def _start ( self , start_type , lib_name , enclave_type , workspace , label , common_dir , target_rpc_address = None , snapshot_dir = None , members_info = None , ** kwargs , ) : lib_path = infra . path . build_lib_path ( lib_name , enclave_type , library_dir = self . library_dir ) if self . max_open_sessions : kwargs [ "max_open_sessions" ] = self . max_open_sessions if self . max_open_sessions_hard : kwargs [ "max_open_sessions_hard" ] = self . max_open_sessions_hard self . common_dir = common_dir self . remote = self . remote_shim ( start_type , lib_path , enclave_type , self . remote_impl , workspace , common_dir , label = label , local_node_id = self . local_node_id , rpc_host = self . rpc_host , node_host = self . node_host , pub_host = self . pubhost , node_port = self . node_port , rpc_port = self . rpc_port , node_client_host = self . node_client_host , target_rpc_address = target_rpc_address , members_info = members_info , snapshot_dir = snapshot_dir , binary_dir = self . binary_dir , additional_raw_node_args = self . additional_raw_node_args , version = self . version , ** kwargs , ) self . remote . setup ( ) self . network_state = NodeNetworkState . started if self . debug : with open ( "/tmp/vscode-gdb.sh" , "a" , encoding = "utf-8" ) as f : f . write ( f"if [ $1 -eq {self.remote.local_node_id} ]; then\n" ) f . write ( f"cd {self.remote.remote.root}\n" ) f . write ( f"{' '.join(self.remote.remote.cmd)}\n" ) f . write ( "fi\n" ) print ( "" ) print ( "================= Please run the below command on " + self . rpc_host + " and press enter to continue =================" ) print ( "" ) print ( self . remote . debug_node_cmd ( ) ) print ( "" ) input ( "Press Enter to continue..." ) else : if self . perf : self . remote . set_perf ( ) self . remote . start ( ) try : self . remote . get_startup_files ( self . common_dir ) except Exception as e : LOG . exception ( e ) self . remote . get_logs ( tail_lines_len = None ) raise self . consensus = kwargs . get ( "consensus" ) with open ( os . path . join ( self . common_dir , f"{self.local_node_id}.pem" ) , encoding = "utf-8" ) as f : self . node_id = infra . crypto . compute_public_key_der_hash_hex_from_pem ( f . read ( ) ) self . _read_ports ( ) LOG . info ( f"Node {self.local_node_id} started: {self.node_id}" )
Creates a CCFRemote instance, sets it up (connects, creates the directory
and ships over the files), and (optionally) starts the node by executing
the appropriate command.
Creates a CCFRemote instance sets it up ( connects creates the directory and ships over the files ) and ( optionally ) starts the node by executing the appropriate command .
"""
        Creates a CCFRemote instance, sets it up (connects, creates the directory
        and ships over the files), and (optionally) starts the node by executing
        the appropriate command.
        If self.debug is set, it will not actually start up the node, but will
        prompt the user to do so manually.
        """
self
start_type
lib_name
enclave_type
workspace
label
common_dir
target_rpc_address
snapshot_dir
members_info