зеркало из https://github.com/microsoft/CCF.git
Fix issue with governance (#902)
This commit is contained in:
Родитель
83b0f9d010
Коммит
16b0b36285
|
@ -8,7 +8,7 @@ Once this is done, you can quickly spin up a CCF network and start :ref:`issuing
|
|||
.. code-block:: bash
|
||||
|
||||
$ cd CCF/build
|
||||
$ ../start_test_network.sh ./liblogging.enclave.so.signed
|
||||
$ ../start_test_network.sh --package ./liblogging.enclave.so.signed
|
||||
Setting up Python environment...
|
||||
Python environment successfully setup
|
||||
[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
|
||||
|
||||
$ cd CCF/build
|
||||
$ ../start_test_network.sh ./liblogging.enclave.so.signed
|
||||
$ ../start_test_network.sh --package ./liblogging.enclave.so.signed
|
||||
Setting up Python environment...
|
||||
Python environment successfully setup
|
||||
[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] 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>``.
|
||||
|
||||
|
|
|
@ -4,14 +4,6 @@
|
|||
|
||||
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..."
|
||||
if [ ! -f "env/bin/activate" ]
|
||||
then
|
||||
|
@ -24,4 +16,8 @@ PATH_HERE=$(dirname "$(realpath -s "$0")")
|
|||
pip install -q -U -r "${PATH_HERE}"/tests/requirements.txt
|
||||
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.
|
||||
|
||||
```
|
||||
$ ../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] Node [ 0] = 127.37.160.46:40523
|
||||
|
|
|
@ -210,21 +210,26 @@ class Network:
|
|||
|
||||
return primary
|
||||
|
||||
def _setup_common_folder(self):
|
||||
def _setup_common_folder(self, gov_script):
|
||||
LOG.info(f"Creating common folder: {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]
|
||||
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
|
||||
# certs and keys in the top directory and move them across
|
||||
cmd = [
|
||||
"ln",
|
||||
"-s",
|
||||
os.path.join(os.getcwd(), self.KEY_GEN),
|
||||
os.path.join(self.common_dir, self.KEY_GEN),
|
||||
]
|
||||
infra.proc.ccall(*cmd)
|
||||
cmd = ["ln", "-s", os.path.join(os.getcwd(), self.KEY_GEN), self.common_dir]
|
||||
assert (
|
||||
infra.proc.ccall(*cmd).returncode == 0
|
||||
), f"Could not symlink {self.KEY_GEN} to {self.common_dir}"
|
||||
|
||||
def start_and_join(self, args):
|
||||
"""
|
||||
|
@ -233,7 +238,7 @@ class Network:
|
|||
:param open_network: If false, only the nodes are started.
|
||||
"""
|
||||
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)))
|
||||
self.consortium = infra.consortium.Consortium(
|
||||
|
|
|
@ -625,7 +625,7 @@ class CCFRemote(object):
|
|||
cmd += [f"--member-info={mc},{mk}"]
|
||||
data_files.append(mc)
|
||||
data_files.append(mk)
|
||||
data_files += [gov_script]
|
||||
data_files += [os.path.basename(gov_script)]
|
||||
elif start_type == StartType.join:
|
||||
cmd += [
|
||||
"join",
|
||||
|
|
Загрузка…
Ссылка в новой задаче