diff --git a/mithril-test-lab/mithril-devnet/README.md b/mithril-test-lab/mithril-devnet/README.md index f07bcd65562..102824c70dc 100644 --- a/mithril-test-lab/mithril-devnet/README.md +++ b/mithril-test-lab/mithril-devnet/README.md @@ -40,6 +40,12 @@ chmod u+x *.sh # Run devnet with 1 BFT node and 2 SPO nodes (with remote docker images) MITHRIL_IMAGE_ID=main-c9213ca ./devnet-run.sh +# Run devnet with Cardano nodes only +NODES=cardano ./devnet-run.sh + +# Run devnet with Mithril nodes only +NODES=mithril ./devnet-run.sh + # Logs devnet ./devnet-log.sh @@ -49,8 +55,8 @@ MITHRIL_IMAGE_ID=main-c9213ca ./devnet-run.sh # Stop devnet ./devnet-stop.sh -# Visusalize devnet -./devnet-stop.sh +# Visualize devnet +./devnet-visualize.sh ``` ## One step run with custom configuration @@ -68,8 +74,8 @@ ROOT=artifacts ./devnet-query.sh # Stop devnet ROOT=artifacts ./devnet-stop.sh -# Visusalize devnet -ROOT=artifacts ./devnet-stop.sh +# Visualize devnet +ROOT=artifacts ./devnet-visualize.sh ``` ## Step by step run with custom configuration @@ -86,8 +92,11 @@ rm -rf ${ROOT} && ./devnet-mkfiles.sh ${ROOT} ${NUM_BFT_NODES} ${NUM_POOL_NODES} # Change directory cd ${ROOT} -# Start devnet -./start.sh +# Start devnet Cardano nodes +./start-cardano.sh + +# Start devnet Mithril nodes +./start-mithril.sh # Query devnet ./query.sh @@ -103,7 +112,6 @@ cd ${ROOT} ```bash # Example of artifacts -tree artifacts artifacts ├── activate.sh ├── addresses @@ -181,7 +189,8 @@ artifacts │ ├── topology.json │ └── tx ├── query.sh -├── start.sh +├── start-cardano.sh +├── start-mithril.sh └── stop.sh ``` diff --git a/mithril-test-lab/mithril-devnet/devnet-mkfiles.sh b/mithril-test-lab/mithril-devnet/devnet-mkfiles.sh index fb8c24658ca..e98647fc205 100755 --- a/mithril-test-lab/mithril-devnet/devnet-mkfiles.sh +++ b/mithril-test-lab/mithril-devnet/devnet-mkfiles.sh @@ -857,7 +857,7 @@ echo cd ${ROOT} echo echo "To start the nodes, in separate terminals use:" echo -cat >> start.sh <> start-cardano.sh <> Start Cardano network" killall cardano-node @@ -882,7 +882,7 @@ for NODE in ${BFT_NODES}; do EOF chmod u+x ${NODE}/start-node.sh - cat >> start.sh <> start-cardano.sh <> Starting Cardano node '${NODE}'" ./${NODE}/start-node.sh & @@ -907,7 +907,7 @@ for NODE in ${POOL_NODES}; do EOF chmod u+x ${NODE}/start-node.sh - cat >> start.sh <> start-cardano.sh <> Starting Cardano node '${NODE}'" ./${NODE}/start-node.sh & @@ -915,20 +915,7 @@ EOF done -cat >> start.sh <> Build Mithril node Docker images" - PWD=$(pwd) - cd ../../../ - echo ">>>> Building Mithril Aggregator node Docker image" - cd mithril-aggregator && make docker-build > /dev/null && cd .. - echo ">>>> Building Mithril Client node Docker image" - cd mithril-client && make docker-build > /dev/null && cd .. - echo ">>>> Building Mithril Signer node Docker image" - cd mithril-signer && make docker-build > /dev/null && cd .. - cd $PWD -fi - +cat >> start-cardano.sh <> Wait for Cardano network to be ready" while true do @@ -946,8 +933,23 @@ done echo ">> Activate Cardano pools" ./activate.sh ${ROOT} +EOF +chmod u+x start-cardano.sh +cat >> start-mithril.sh <> Start Mithril network" +if [ -z "\${MITHRIL_IMAGE_ID}" ]; then + echo ">> Build Mithril node Docker images" + PWD=$(pwd) + cd ../../../ + echo ">>>> Building Mithril Aggregator node Docker image" + cd mithril-aggregator && make docker-build > /dev/null && cd .. + echo ">>>> Building Mithril Client node Docker image" + cd mithril-client && make docker-build > /dev/null && cd .. + echo ">>>> Building Mithril Signer node Docker image" + cd mithril-signer && make docker-build > /dev/null && cd .. + cd $PWD +fi docker-compose rm -f if [ -z "\${MITHRIL_IMAGE_ID}" ]; then MITHRIL_AGGREGATOR_IMAGE="mithril/mithril-aggregator" @@ -960,7 +962,7 @@ else fi MITHRIL_AGGREGATOR_IMAGE=\${MITHRIL_AGGREGATOR_IMAGE} MITHRIL_CLIENT_IMAGE=\${MITHRIL_CLIENT_IMAGE} MITHRIL_SIGNER_IMAGE=\${MITHRIL_SIGNER_IMAGE} docker-compose -f docker-compose.yaml --profile mithril up --remove-orphans --force-recreate -d --no-build EOF -chmod u+x start.sh +chmod u+x start-mithril.sh cat >> stop.sh <> Stop Cardano network" @@ -1020,7 +1022,7 @@ echo ./activate.sh . echo echo "Or do all at once with:" echo -echo ./start.sh +echo "./start-cardano.sh && ./start-mithril.sh" echo echo "Then query the devnet:" echo diff --git a/mithril-test-lab/mithril-devnet/devnet-run.sh b/mithril-test-lab/mithril-devnet/devnet-run.sh index b65ce68f970..e4deacf2285 100755 --- a/mithril-test-lab/mithril-devnet/devnet-run.sh +++ b/mithril-test-lab/mithril-devnet/devnet-run.sh @@ -8,7 +8,9 @@ fi if [ -z "${NUM_POOL_NODES}" ]; then NUM_POOL_NODES="2" fi - +if [ -z "${NODES}" ]; then + NODES="*" +fi # Bootstrap devnet echo "=====================================================================" @@ -26,10 +28,22 @@ echo # Change directory cd ${ROOT} -# Start devnet -echo "=====================================================================" -echo " Start Mithril/Cardano devnet" -echo "=====================================================================" -echo -./start.sh -echo \ No newline at end of file +# Start devnet Mithril nodes +if [ "${NODES}" = "mithril" ] || [ "${NODES}" = "*" ]; then + echo "=====================================================================" + echo " Start Mithril nodes" + echo "=====================================================================" + echo + ./start-mithril.sh + echo +fi + +# Start devnet Cardano nodes +if [ "${NODES}" = "cardano" ] || [ "${NODES}" = "*" ]; then + echo "=====================================================================" + echo " Start Cardano nodes" + echo "=====================================================================" + echo + ./start-cardano.sh + echo +fi \ No newline at end of file