[[ ":$PATH:" != *":$HOME/.bky:"* ]] && export PATH="$PATH:$HOME/.bky" ln -sf "$HOME/.bky/bky-as-v0.1.0-beta.13" "$HOME/.bky/bky-as" git clone --branch main git@github.com:blocky/attestation-service-examples.git cd attestation-service-examples/attest_fn_call bky-c build --reproducible . ./main.wasm ## Overview The Blocky AS CLI tool provides a local non-TEE server that executes functions and provides mock attestations. This is useful for cost savings and quick local development loops. If you would like to run your functions on genuine TEEs, however, we also offer free developer API keys that are preloaded with 500 complimentary calls. Follow the steps below to claim a key and configure the Blocky AS CLI to communicate with our production servers. ## Get a Developer API Key 1. Head over to our [Developer Portal](https://portal.bky.sh/) and sign-up to claim your free API key. 2. Add your API key to the example [config.toml](https://github.com/blocky/attestation-service-examples/tree/release/v0.1.0-beta.13/attest-fn-call/config.toml): BKY_AS_API_KEY=your_api_key_here sed -i -e "s|^(auth_token *= *)".*"|\1"$BKY_AS_API_KEY"|" config.toml 3. Fetch the TEE platform and Blocky AS server code measurement for the latest [release](/releases) and add it to the config: MEASUREMENT=$(curl -s https://docs.blocky.rocks/v0.1.0-beta.13/code_measurement.toml) PLATFORM=$(echo "$MEASUREMENT" | yq -p toml '.code_measurement[0].platform') CODE=$(echo "$MEASUREMENT" | yq -p toml '.code_measurement[0].code') sed -i '/acceptable_measurements = [/,/]/c acceptable_measurements = [ { platform = "'"$PLATFORM"'", code = "'"$CODE"'" }, ]' config.toml 4. Update the host to the latest release URL: sed -i 's|^host = .*|host = "https://api.bky.sh/prod/delphi/v0.1.0-beta.13"|' config.toml 5. Your config should now resemble: cat config.toml 6. Re-run our example function and you should now see that it was executed by one of our production Blocky AS servers on a real TEE platform: cat fn-call.json | bky-as attest-fn-call > out.json jq -r ".enclave_attested_application_public_key.claims.enclave_measurement" out.json which outputs ```bash { "platform": "nitro", "code": "933fdfbf5a849ed07c0a8201f8813b8ab976f72e93722b3e4a28dbb41d2741fb581604845b6272b04a0fa5a8b59647bd.4b4d5b3661b3efc12920900c80e126e4ce783c522de6c02a2a5bf7af3a2b9327b86776f188e4be1c1c404a129dbda493.7e1fadfbec59aba9d45e3042fd322d5e61b3e849d7c7ea20084d946fce976d48773ae723c0e57e2d6311ff3667a3a8b5" } ``` ## Next Steps If you would like to purchase additional API calls contact us via [email](mailto:info@blocky.rocks) for subscription pricing and details. Additionally, join our [Discord](https://discord.gg/rWSXvXDtmh) server if you have general questions about setup and tool usage. rm -rf attestation-service-examples