Skip to content

Commit 134673d

Browse files
committed
update to M4
1 parent 8721e87 commit 134673d

File tree

6 files changed

+22
-34
lines changed

6 files changed

+22
-34
lines changed

DockerfileM4

+6-6
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ ENV sdk_bin https://download.01.org/intel-sgx/linux-2.5/ubuntu18.04-server/sgx_l
3737
ENV psw_deb https://download.01.org/intel-sgx/linux-2.5/ubuntu18.04-server/libsgx-enclave-common_2.5.101.50123-bionic1_amd64.deb
3838
ENV psw_dev_deb https://download.01.org/intel-sgx/linux-2.5/ubuntu18.04-server/libsgx-enclave-common-dev_2.5.101.50123-bionic1_amd64.deb
3939
ENV psw_dbgsym_deb https://download.01.org/intel-sgx/linux-2.5/ubuntu18.04-server/libsgx-enclave-common-dbgsym_2.5.101.50123-bionic1_amd64.ddeb
40-
ENV substratee_node https://github.com/scs/substraTEE-node/archive/master.zip # FIXME: update to M4
41-
ENV substratee_worker https://github.com/scs/substraTEE-worker/archive/master.zip # FIXME: update to M4
40+
ENV substratee_node https://github.com/scs/substraTEE-node/archive/M4.zip
41+
ENV substratee_worker https://github.com/scs/substraTEE-worker/archive/M4.zip
4242
ENV rust_toolchain nightly
4343
ENV DEBIAN_FRONTEND=noninteractive
4444
ENV TERM xterm
@@ -99,12 +99,12 @@ RUN /root/.cargo/bin/rustup install nightly-2019-05-21 && \
9999
# init the rust environment
100100
RUN source /opt/sgxsdk/environment && \
101101
source /root/.cargo/env && \
102-
/substraTEE/substraTEE-node-master/scripts/init.sh
102+
/substraTEE/substraTEE-node-M4/scripts/init.sh
103103

104104
# build the substraTEE-node
105105
RUN source /opt/sgxsdk/environment && \
106106
source /root/.cargo/env && \
107-
cd /substraTEE/substraTEE-node-master && \
107+
cd /substraTEE/substraTEE-node-M4 && \
108108
./scripts/build.sh && \
109109
cargo build --release
110110

@@ -114,15 +114,15 @@ RUN source /opt/sgxsdk/environment && \
114114
source /root/.cargo/env && \
115115
/root/.cargo/bin/rustup default nightly && \
116116
/root/.cargo/bin/rustup target add wasm32-unknown-unknown && \
117-
cd /substraTEE/substraTEE-worker-master && \
117+
cd /substraTEE/substraTEE-worker-M4 && \
118118
/root/.cargo/bin/rustup override set nightly-2019-05-22 && \
119119
make
120120

121121
# copy the shell scripts to the docker to launch to node and the workers
122122
COPY scriptsM4/* /substraTEE/
123123

124124
# copy the certificates for the RA
125-
COPY intel_cert/* /substraTEE/substraTEE-worker-master/bin/
125+
COPY intel_cert/* /substraTEE/substraTEE-worker-M4/bin/
126126

127127
# install ipfs
128128
RUN mkdir /ipfs && \

M4.sh

+7-7
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,13 @@ then
7474
\"/substraTEE/start_worker2.sh\"" Enter
7575

7676
# start the substratee-client in pane 2
77-
# tmux send-keys -t2 "docker run -ti \
78-
# --device /dev/isgx \
79-
# -v $(pwd)/output:/substraTEE/output \
80-
# -v $(pwd)/rust-sgx-sdk:/root/sgx \
81-
# -v /var/run/aesmd:/var/run/aesmd \
82-
# substratee \
83-
# \"/substraTEE/start_client.sh\"" Enter
77+
tmux send-keys -t2 "docker run -ti \
78+
--ip=192.168.10.30 \
79+
--network=substratee-net \
80+
-v $(pwd)/output:/substraTEE/output \
81+
-v /home/marcel/substraTEE-worker:/substraTEE/worker_local \
82+
substratee \
83+
\"/substraTEE/start_client.sh\"" Enter
8484
fi
8585

8686
# Attach to session

scriptsM4/start_client.sh

+6-8
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,21 @@ clear
66
sleep 30s
77

88
# start the client and send first transaction
9-
cd /substraTEE/substraTEE-worker-master/bin
10-
./substratee_client -p 9977 2>&1 | tee /substraTEE/output/client_first.log
9+
cd /substraTEE/substraTEE-worker-M4/bin
10+
./substratee_client -p 9977 -s 192.168.10.10 2>&1 | tee /substraTEE/output/client_first.log
1111

1212
# wait until worker 2 registered
1313
sleep 10s
1414

1515
# start the client and send second transaction
16-
cd /substraTEE/substraTEE-worker-master/bin
17-
./substratee_client -p 9977 2>&1 | tee /substraTEE/output/client_second.log
16+
cd /substraTEE/substraTEE-worker-M4/bin
17+
./substratee_client -p 9977 -s 192.168.10.10 2>&1 | tee /substraTEE/output/client_second.log
1818

1919
# wait until transaction is processed
2020
sleep 20s
2121

2222
# query the counter
23-
cd /substraTEE/substraTEE-worker-master/bin
24-
./substratee_client -p 9977 getcounter 2>&1 | tee /substraTEE/output/client_counter.log
25-
26-
echo "Client finished"
23+
cd /substraTEE/substraTEE-worker-M4/bin
24+
./substratee_client -p 9977 -s 192.168.10.10 getcounter 2>&1 | tee /substraTEE/output/client_counter.log
2725

2826
read -p "Press enter to continue"

scriptsM4/start_node.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ clear
55

66
# start the dev node
77
# with specific ws-port and listening to external connections
8-
/substraTEE/substraTEE-node-master/target/release/substratee-node --dev --ws-port 9977 --ws-external 2>&1 | tee /substraTEE/backup/node.log
8+
/substraTEE/substraTEE-node-M4/target/release/substratee-node --dev --ws-port 9977 --ws-external 2>&1 | tee /substraTEE/backup/node.log

scriptsM4/start_worker1.sh

+1-6
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,8 @@ ipfs daemon > /substraTEE/output/ipfs_daemon1.log &
1010
# allow the node to get ready
1111
sleep 3s
1212

13-
# copy from the local build
14-
# FIXME: remove this step
15-
cp -R worker_local/bin/bin ./bin
16-
cd bin
17-
1813
# start the worker 1
19-
# cd /substraTEE/substraTEE-worker-master/bin
14+
cd /substraTEE/substraTEE-worker-M4/bin
2015
./substratee_worker getsignkey 2>&1 | tee /substraTEE/output/worker1_getsignkey.log
2116
./substratee_worker getpublickey 2>&1 | tee /substraTEE/output/worker1_getpublickey.log
2217
./substratee_worker -p 9977 -w 9111 -r 8111 --ns 192.168.10.10 --ws 192.168.10.21 worker 2>&1 | tee /substraTEE/output/worker1.log

scriptsM4/start_worker2.sh

+1-6
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,8 @@ ipfs daemon > /substraTEE/output/ipfs_daemon2.log &
1010
# wait until the worker 1 and the client have interacted
1111
sleep 1m
1212

13-
# copy from the local build
14-
# FIXME: remove this step
15-
cp -R worker_local/bin/bin ./bin
16-
cd bin
17-
1813
# start the worker 2
19-
# cd /substraTEE/substraTEE-worker-master/bin
14+
cd /substraTEE/substraTEE-worker-M4/bin
2015
./substratee_worker getsignkey 2>&1 | tee /substraTEE/output/worker2_getsignkey.log
2116
./substratee_worker getpublickey 2>&1 | tee /substraTEE/output/worker2_getpublickey.log
2217
./substratee_worker -p 9977 -w 9112 -r 8112 --ns 192.168.10.10 --ws 192.168.10.22 worker 2>&1 | tee /substraTEE/output/worker2.log

0 commit comments

Comments
 (0)