Clone the projects and mount them in a container:
git clone -b polkadot-v0.9.20-dev [email protected]:ajuna-network/Ajuna.git Ajuna
git clone [email protected]:ajuna-network/worker.git worker
cd worker && git checkout 0c40097 && cd ..
docker run -it \
-v $(pwd)/worker:/root/work \
-v $(pwd)/Ajuna:/root/Ajuna \
integritee/integritee-dev:0.1.9
Build inside the container and exit:
# build enclave
cd /root/work && CARGO_NET_GIT_FETCH_WITH_CLI=true SGX_MODE=SW make
# build ajuna node
cd /root/Ajuna && cargo build-ajuna-solo --features skip-ias-check
# when finished
exit
Run compose with optinal logging (open http://localhost in your browser for app):
docker-compose up -d
docker logs ajuna-network-worker-1 -f
Bash into the worker container to start sending trusted calls:
docker exec -it ajuna-network-worker-1 /bin/bash
From the worker container:
# run the whole demo script
cd /root/worker/cli && ./demo_connect_four.sh -u ws://ajuna-node
# or test calls individually
export CLIENT="/root/worker/bin/integritee-cli -u ws://ajuna-node"
export MRENCLAVE=$($CLIENT list-workers | awk '/ MRENCLAVE: / { print $2; exit }')
${CLIENT} trusted --mrenclave ${MRENCLAVE} --direct set-balance //Alice 1000
${CLIENT} trusted --mrenclave ${MRENCLAVE} --direct set-balance //Bob 1000
${CLIENT} queue-game //Alice
${CLIENT} queue-game //Bob
${CLIENT} trusted --mrenclave ${MRENCLAVE} --direct drop-bomb //Alice 1 1
${CLIENT} trusted --mrenclave ${MRENCLAVE} --direct get-board //Alice