@@ -44,7 +44,7 @@ spopd() {
44
44
}
45
45
46
46
inst_pp () {
47
- [ " $1 " = true ] && echo " *Install *" || echo " -"
47
+ [ " $1 " = true ] && echo " *Installed *" || echo " -"
48
48
}
49
49
50
50
append_target () {
@@ -117,12 +117,14 @@ else
117
117
OUT_REDIR=" >/dev/null 2>&1"
118
118
fi
119
119
120
+ ALL_SERVERS=" All servers"
121
+
120
122
if [ -z " $install_target " ]; then
121
123
install_mpspdz=true
122
124
install_prover=true
123
125
install_verifier=true
124
126
install_notary=true
125
- install_target=" All servers "
127
+ install_target=ALL_SERVERS
126
128
fi
127
129
128
130
if [ " $install_prover " = true ] || [ " $install_verifier " = true ] || [ " $install_notary " = true ]; then
@@ -269,6 +271,20 @@ if [ "$install_rust" = true ]; then
269
271
print " Building Notary Server..."
270
272
spushd notary/server
271
273
eval " cargo build --release $OUT_REDIR "
274
+
275
+ # Generate self-signed certificate if all servers configuration
276
+ if [ " $install_target " = " $ALL_SERVERS " ]; then
277
+ spushd fixture/tls
278
+
279
+ openssl genpkey -algorithm RSA -out notary.key -pkeyopt rsa_keygen_bits:2048 \
280
+ && openssl req -new -key notary.key -out request.csr -subj " /C=US/ST=State/L=City/O=Organization/OU=Department/CN=127.0.0.1" \
281
+ && openssl x509 -req -in request.csr -signkey notary.key -out notary.crt -days 365 -extfile openssl.cnf -extensions v3_req
282
+
283
+ # copy notary.crt to repository root so that binance prover can use
284
+ cp notary.crt $MPC_DEMO_INFRA_ROOT
285
+ spopd # pushd fixture/tls
286
+ fi
287
+
272
288
cp -R fixture ../target/release
273
289
mkdir -p ../target/release/config
274
290
cp $MPC_DEMO_INFRA_ROOT /mpc_demo_infra/notary_server/docker/config.yaml ../target/release/config
0 commit comments