{"id":23081469,"url":"https://github.com/switchboard-xyz/solana-functions-template","last_synced_at":"2025-04-03T14:15:52.294Z","repository":{"id":175907887,"uuid":"654653472","full_name":"switchboard-xyz/solana-functions-template","owner":"switchboard-xyz","description":"Template repository to build a custom Switchboard function on Solana","archived":false,"fork":false,"pushed_at":"2023-10-17T03:25:55.000Z","size":59,"stargazers_count":0,"open_issues_count":2,"forks_count":1,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-02-09T02:45:31.245Z","etag":null,"topics":["defi","oracles","serverless","solana","switchboard"],"latest_commit_sha":null,"homepage":"","language":"Makefile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/switchboard-xyz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2023-06-16T15:57:26.000Z","updated_at":"2023-06-16T18:37:30.000Z","dependencies_parsed_at":null,"dependency_job_id":"cc31da4c-a20d-4a64-b99f-2e3fd270e325","html_url":"https://github.com/switchboard-xyz/solana-functions-template","commit_stats":null,"previous_names":["switchboard-xyz/solana-functions-template"],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/switchboard-xyz%2Fsolana-functions-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/switchboard-xyz%2Fsolana-functions-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/switchboard-xyz%2Fsolana-functions-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/switchboard-xyz%2Fsolana-functions-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/switchboard-xyz","download_url":"https://codeload.github.com/switchboard-xyz/solana-functions-template/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247014521,"owners_count":20869376,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["defi","oracles","serverless","solana","switchboard"],"created_at":"2024-12-16T13:52:40.256Z","updated_at":"2025-04-03T14:15:52.268Z","avatar_url":"https://github.com/switchboard-xyz.png","language":"Makefile","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/switchboard-xyz/sbv2-core/raw/main/website/static/img/icons/switchboard/avatar.png\" /\u003e\n\n  \u003ch1\u003eSwitchboard\u003cbr\u003eSolana Functions Template\u003c/h1\u003e\n\n  \u003cp\u003e\n    \u003ca href=\"https://discord.gg/switchboardxyz\"\u003e\n      \u003cimg alt=\"Discord\" src=\"https://img.shields.io/discord/841525135311634443?color=blueviolet\u0026logo=discord\u0026logoColor=white\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://twitter.com/switchboardxyz\"\u003e\n      \u003cimg alt=\"Twitter\" src=\"https://img.shields.io/twitter/follow/switchboardxyz?label=Follow+Switchboard\" /\u003e\n    \u003c/a\u003e\n  \u003c/p\u003e\n\u003c/div\u003e\n\n## Switchboard Functions\n\nSwitchboards V3 architecture allows users to permissionlessly build and run any\ncode you like and we attest the output is from your code.\n\n## Table of Content\n\n- [Project Setup](#setup)\n- [Examples](./examples/README.md)\n  - [Binance](./examples/binance/binance.rs)\n  - [Randomness](./examples/randomness/randomness.rs)\n  - [Secrets](./examples/secrets/README.md)\n\n## Setup\n\nEdit the Makefile with your docker image name. Make sure to include your docker\norganization if publishing to the repository (For example:\n`switchboard/my-function`).\n\n## Build\n\nRun the following command to build the docker image with your custom function\n\n```bash\nmake\n```\n\nYou should see a `measurement.txt` in the root of the project containing the\nbase64 encoding of the MRENCLAVE measurement. You will need to re-generate this\nmeasurement anytime your source code or dependencies change.\n\n## Publishing\n\n```bash\nmake publish\n```\n\n## Integration\n\nTo get started, you will first need to:\n\n1. Build your docker image and upload to a Docker/IPFS repository\n2. Generate your MRENCLAVE measurement\n\nNext, you will need to create a Function account for your given MRENCLAVE\nmeasurement. Head over to [app.switchboard.xyz](https://app.switchboard.xyz) and\ncreate a new function with your given repository and MRENCLAVE measurement.\n\nAlternatively, create a function with the Switchboard CLI:\n\n```bash\nnpm i --global @switchboard-xyz/cli\n\nsbv2 solana function create CkvizjVnm2zA5Wuwan34NhVT3zFc7vqUyGnA6tuEF5aE \\\n  --name \"My Function\" \\\n  --metadata \"Basic binance oracle with TWAP\" \\\n  --fundAmount 0.25 \\\n  --schedule \"30 * * * * *\" \\\n  --container switchboardlabs/basic-oracle-function \\\n  --keypair ~/.config/id/solana.json\n\n# or fund an existing function\nsbv2 solana function fund $MY_FUNCTION_PUBKEY \\\n  --fundAmount 0.25 \\\n  --keypair ~/.config/id/solana.json\n```\n\n## More Info\n\nSee [docs.switchboard.xyz](https://docs.switchboard.xyz/guides/solana/functions)\nto get started.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswitchboard-xyz%2Fsolana-functions-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fswitchboard-xyz%2Fsolana-functions-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswitchboard-xyz%2Fsolana-functions-template/lists"}