This commit is contained in:
Julien Maffre 2020-03-02 11:32:02 +00:00 коммит произвёл GitHub
Родитель 83b0f9d010
Коммит 16b0b36285
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
6 изменённых файлов: 26 добавлений и 25 удалений

Просмотреть файл

@ -8,7 +8,7 @@ Once this is done, you can quickly spin up a CCF network and start :ref:`issuing
.. code-block:: bash .. code-block:: bash
$ cd CCF/build $ cd CCF/build
$ ../start_test_network.sh ./liblogging.enclave.so.signed $ ../start_test_network.sh --package ./liblogging.enclave.so.signed
Setting up Python environment... Setting up Python environment...
Python environment successfully setup Python environment successfully setup
[2019-10-29 14:47:41.562] Starting 3 CCF nodes... [2019-10-29 14:47:41.562] Starting 3 CCF nodes...

Просмотреть файл

@ -10,7 +10,7 @@ For example, deploying the ``liblogging`` example application:
.. code-block:: bash .. code-block:: bash
$ cd CCF/build $ cd CCF/build
$ ../start_test_network.sh ./liblogging.enclave.so.signed $ ../start_test_network.sh --package ./liblogging.enclave.so.signed
Setting up Python environment... Setting up Python environment...
Python environment successfully setup Python environment successfully setup
[2019-10-29 14:47:41.562] Starting 3 CCF nodes... [2019-10-29 14:47:41.562] Starting 3 CCF nodes...
@ -22,7 +22,7 @@ For example, deploying the ``liblogging`` example application:
[2019-10-29 14:48:12.138] See https://microsoft.github.io/CCF/users/issue_commands.html for more information. [2019-10-29 14:48:12.138] See https://microsoft.github.io/CCF/users/issue_commands.html for more information.
[2019-10-29 14:48:12.138] Press Ctrl+C to shutdown the network. [2019-10-29 14:48:12.138] Press Ctrl+C to shutdown the network.
.. note:: To use CCF `virtual` mode, the same command can be run with ``TEST_ENCLAVE=virtual`` set as environment variable and the virtual version of the enclave application passed to the script. For example ``$ TEST_ENCLAVE=virtual ../start_test_network.sh ./liblogging.virtual.so``. .. note:: To use CCF `virtual` mode, the same command can be run with ``TEST_ENCLAVE=virtual`` set as environment variable and the virtual version of the enclave application passed to the script. For example ``$ TEST_ENCLAVE=virtual ../start_test_network.sh --package ./liblogging.virtual.so``.
The log files (``out`` and ``err``) and ledger (``<node_id>.ledger``) for each CCF node can be found under ``CCF/build/workspace/test_network_<node_id>``. The log files (``out`` and ``err``) and ledger (``<node_id>.ledger``) for each CCF node can be found under ``CCF/build/workspace/test_network_<node_id>``.

Просмотреть файл

@ -4,14 +4,6 @@
set -e set -e
if [ -z "$1" ]; then
echo "The application enclave file should be specified (e.g. liblogging)"
exit 1
fi
PACKAGE="$1"
shift
echo "Setting up Python environment..." echo "Setting up Python environment..."
if [ ! -f "env/bin/activate" ] if [ ! -f "env/bin/activate" ]
then then
@ -24,4 +16,8 @@ PATH_HERE=$(dirname "$(realpath -s "$0")")
pip install -q -U -r "${PATH_HERE}"/tests/requirements.txt pip install -q -U -r "${PATH_HERE}"/tests/requirements.txt
echo "Python environment successfully setup" echo "Python environment successfully setup"
CURL_CLIENT=ON python "${PATH_HERE}"/tests/start_network.py --package "${PACKAGE}" --label test_network "$@" CURL_CLIENT=ON \
python "${PATH_HERE}"/tests/start_network.py \
--gov-script "${PATH_HERE}"/src/runtime_config/gov.lua \
--label test_network \
"$@"

Просмотреть файл

@ -9,7 +9,7 @@ Running K6 against CCF
1. Start CCF, eg. 1. Start CCF, eg.
``` ```
$ ../start_test_network.sh liblogging.enclave.so.signed $ ../start_test_network.sh --package ./liblogging.enclave.so.signed
... ...
[2020-02-14 11:26:46.525] Started CCF network with the following nodes: [2020-02-14 11:26:46.525] Started CCF network with the following nodes:
[2020-02-14 11:26:46.525] Node [ 0] = 127.37.160.46:40523 [2020-02-14 11:26:46.525] Node [ 0] = 127.37.160.46:40523

Просмотреть файл

@ -210,21 +210,26 @@ class Network:
return primary return primary
def _setup_common_folder(self): def _setup_common_folder(self, gov_script):
LOG.info(f"Creating common folder: {self.common_dir}") LOG.info(f"Creating common folder: {self.common_dir}")
cmd = ["rm", "-rf", self.common_dir] cmd = ["rm", "-rf", self.common_dir]
infra.proc.ccall(*cmd) assert (
infra.proc.ccall(*cmd).returncode == 0
), f"Could not remove {self.common_dir} directory"
cmd = ["mkdir", "-p", self.common_dir] cmd = ["mkdir", "-p", self.common_dir]
infra.proc.ccall(*cmd) assert (
infra.proc.ccall(*cmd).returncode == 0
), f"Could not create {self.common_dir} directory"
cmd = ["cp", gov_script, self.common_dir]
assert (
infra.proc.ccall(*cmd).returncode == 0
), f"Could not copy governance {gov_script} to {self.common_dir}"
# It is more convenient to create a symlink in the common directory than generate # It is more convenient to create a symlink in the common directory than generate
# certs and keys in the top directory and move them across # certs and keys in the top directory and move them across
cmd = [ cmd = ["ln", "-s", os.path.join(os.getcwd(), self.KEY_GEN), self.common_dir]
"ln", assert (
"-s", infra.proc.ccall(*cmd).returncode == 0
os.path.join(os.getcwd(), self.KEY_GEN), ), f"Could not symlink {self.KEY_GEN} to {self.common_dir}"
os.path.join(self.common_dir, self.KEY_GEN),
]
infra.proc.ccall(*cmd)
def start_and_join(self, args): def start_and_join(self, args):
""" """
@ -233,7 +238,7 @@ class Network:
:param open_network: If false, only the nodes are started. :param open_network: If false, only the nodes are started.
""" """
self.common_dir = get_common_folder_name(args.workspace, args.label) self.common_dir = get_common_folder_name(args.workspace, args.label)
self._setup_common_folder() self._setup_common_folder(args.gov_script)
initial_members = list(range(max(1, args.initial_member_count))) initial_members = list(range(max(1, args.initial_member_count)))
self.consortium = infra.consortium.Consortium( self.consortium = infra.consortium.Consortium(

Просмотреть файл

@ -625,7 +625,7 @@ class CCFRemote(object):
cmd += [f"--member-info={mc},{mk}"] cmd += [f"--member-info={mc},{mk}"]
data_files.append(mc) data_files.append(mc)
data_files.append(mk) data_files.append(mk)
data_files += [gov_script] data_files += [os.path.basename(gov_script)]
elif start_type == StartType.join: elif start_type == StartType.join:
cmd += [ cmd += [
"join", "join",