This is a minimal Quartz demo app to serve as a scaffold to learn and build off of.
It allows users to submit a message encrypted to the enclave's pubkey, and receive a response from the enclave encrypted to their own pubkey.
- Run
quartz --mock-sgx dev --unsafe-trust-latest --contract-manifest contracts/Cargo.toml
- Copy the contract address from the output and paste it onto line 46 of the
send_message.rs
script. - Copy the pub key from the handshake and paste it onto line 18 of
send_message.rs
.
The pubkey in the Ping
struct will be the user's pubkey, which you can leave untouched.
- Next, send this transaction to "Ping" the enclave.
cargo run --bin send_message
- Watch the logs from
quartz dev
. You should see the decrypted message printed.
Now let's find the enclave's response.
- Query the contract for its messages
neutrond query wasm contract-state smart $CONTRACT '{
"get_all_messages": {}
}' -o json
-
Copy the value from, what should be, the only entry in the map.
-
Go to
send_message.rs
and paste the hex value onto line 67. Rundecrypt_enclave_response
to see the decrypted output.