{"id":37851550,"url":"https://github.com/blocky/attestation-service-examples","last_synced_at":"2026-01-16T16:13:24.174Z","repository":{"id":276253059,"uuid":"928713996","full_name":"blocky/attestation-service-examples","owner":"blocky","description":"A collection of fun things that one can do with the BLOCKY Attestation Service","archived":false,"fork":false,"pushed_at":"2025-11-06T15:04:22.000Z","size":830,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-11-06T16:28:09.196Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/blocky.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-02-07T05:19:56.000Z","updated_at":"2025-11-06T15:04:25.000Z","dependencies_parsed_at":"2025-03-12T03:23:44.539Z","dependency_job_id":"c661fb42-fcb8-48c4-bdd4-6595ae5e122b","html_url":"https://github.com/blocky/attestation-service-examples","commit_stats":null,"previous_names":["blocky/as-examples","blocky/attestation-service-examples"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/blocky/attestation-service-examples","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blocky%2Fattestation-service-examples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blocky%2Fattestation-service-examples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blocky%2Fattestation-service-examples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blocky%2Fattestation-service-examples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/blocky","download_url":"https://codeload.github.com/blocky/attestation-service-examples/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blocky%2Fattestation-service-examples/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28479495,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T11:59:17.896Z","status":"ssl_error","status_checked_at":"2026-01-16T11:55:55.838Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-16T16:13:24.095Z","updated_at":"2026-01-16T16:13:24.157Z","avatar_url":"https://github.com/blocky.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Blocky Attestation Service Examples\n\nThis repository contains examples of how to use the Blocky Attestation\nService (Blocky AS) to create TEE attestations over API data and offchain\ncomputation. The examples are designed to be easy to understand and modify, so\nyou can use them as a starting point for your own projects.\n\nHere's a list of the examples in this repository.\nIf you're new to Blocky AS, we recommend working though these examples in the\nfollowing order:\n\n- [Attesting a Function Call](attest_fn_call) shows\n  you how to use Blocky AS to attest simple function calls: You'll learn how to:\n   - Create a function that returns a `\"Hello, World!\"` message\n   - Invoke functions in the Blocky AS using its `bky-as` CLI\n   - Extract function output from the Blocky AS attestation\n- [Bringing A Blocky AS Function Call Attestation On Chain](on_chain)\n  shows you how to bring a Blocky AS function call attestation on chain. You'll\n  learn how to:\n   - Write a smart contract to verify and parse a function call attestation\n   - Test the smart contract locally\n- [Error Handling - Attested Function Calls](./error_handling_attest_fn_call)\n  shows you how to handle errors in your\n  Blocky AS functions. You'll learn how to:\n   - Use the result pattern in your function\n   - Return structured data from your function\n   - Report errors from your function\n   - Log errors in your function\n- [Random](./random) shows you how to generate random numbers in your Blocky AS\n  functions. You'll learn how to:\n  - Generate random numbers in the Blocky AS runtime\n  - Create a function that returns a random number within a given range\n- [Time](./time) shows you how to retrieve the wall clock time in your Blocky AS\n  functions.\n- [Getting Coin Prices From CoinGecko](./coin_prices_from_coingecko) shows you\n  how to use Blocky AS to fetch and process coin price data from the CoinGecko \n  API. You'll learn how to:\n   - Pass in parameters and secrets to your function\n   - Make an HTTP request to an external API in your function\n   - Parse a JSON response from an API\n- [Getting Esports Data From PandaScore](./esports_data_from_pandascore) shows\n  you how to use Blocky AS to attest and process esports data from the \n  PandaScore API.\n- [Getting Esports Data From Rimble](./esports_data_from_rimble) shows you how\n  to use Blocky AS to attest and process esports data from the Rimble API.\n  PandaScore API.\n- [Tracking a Shipment with DHL](./shipment_tracking_with_dhl) shows\n  you how to use Blocky AS to track a shipment using the DHL API.\n- [Time Weighted Average Price](./time_weighted_average_price) is a more\n  advanced example that shows you how to calculate the time weighted average\n  price of an asset through iterative calls to Blocky AS.\n\nTo learn more about Blocky AS, check out our\n[documentation](https://docs.blocky.rocks/).\n\n## Development\n\n### Testing\n\nExamples are tested using the `testscript` library and scripts in\n`/test/scripts`. See\n[here](https://pkg.go.dev/github.com/rogpeppe/go-internal/testscript) for an\noverview of the library.\n\nMany examples rely on secrets or configuration to run. For testing, these\nare provided as environment variables. The tests will notify you if any\nrequired environment variables are missing. Review the `_test.go` files in\n`/test` for the required variables and provide them in your shell when\nrunning tests.\n\nFor example:\n\n```bash\nLIVE_TEST_PLATFORM=nitro \\\nLIVE_TEST_CODE=${MEASURE} \\\nLIVE_TEST_AUTH_TOKEN=${TYK_API_DEV_KEY} \\\nLIVE_TEST_HOST=\"https://api.bky.sh/staging/delphi\" \\\nYOUR_COINGECKO_API_KEY=${COINGECKO_API_DEV_KEY} \\\nmake test-live\n```\n\n### Environment Management\n\nWe use nix to manage our development and CI environment.\n\n- Use `--argstr bkyAsVersion` to specify the version of the `bky-as` CLI.\n- Use `--pure` to run the shell in pure mode to prevent environment variables\n  from leaking into the nix shell.\n  - Pass env variables to the shell using the `--run` flag, or export them once\n    inside the shell.\n  - To preserve env variables from your current shell, do not use the `--pure`\n    flag.\n\nFor example, using nix-shell to run tests in pure mode:\n\n```bash\nnix-shell \\\n  --pure \\\n  --argstr bkyAsVersion \"latest\" \\\n  --run \"\\\n    YOUR_COINGECKO_API_KEY=${COINGECKO_API_DEV_KEY} \\\n    YOUR_PANDASCORE_API_ENDPOINT=${PANDASCORE_API_DEV_ENDPOINT} \\\n    YOUR_PANDASCORE_API_KEY=${PANDASCORE_API_DEV_KEY} \\\n    YOUR_RIMBLE_API_KEY=${RIMBLE_API_DEV_KEY} \\\n    YOUR_DHL_API_KEY=${DHL_API_DEV_KEY} \\\n    YOUR_SPORTRADAR_API_KEY=${SPORTRADAR_API_DEV_KEY} \\\n    make test\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblocky%2Fattestation-service-examples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblocky%2Fattestation-service-examples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblocky%2Fattestation-service-examples/lists"}