{"id":19610863,"url":"https://github.com/onflow/create-a-topshot-set","last_synced_at":"2025-02-26T17:23:25.561Z","repository":{"id":200508682,"uuid":"703017809","full_name":"onflow/create-a-topshot-set","owner":"onflow","description":"Cadence Cookbook Recipe: Create a TopShot Set","archived":false,"fork":false,"pushed_at":"2024-12-20T23:37:47.000Z","size":33,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-01-09T10:16:33.278Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://cookbook.flow.com/create-a-topshot-set","language":"JavaScript","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/onflow.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}},"created_at":"2023-10-10T12:47:05.000Z","updated_at":"2024-12-15T22:44:59.000Z","dependencies_parsed_at":"2023-10-17T04:39:46.783Z","dependency_job_id":"b6a2894b-04e8-4670-b2ae-cf53c4097c19","html_url":"https://github.com/onflow/create-a-topshot-set","commit_stats":null,"previous_names":["lealobanov/create-a-topshot-set","onflow/create-a-topshot-set"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onflow%2Fcreate-a-topshot-set","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onflow%2Fcreate-a-topshot-set/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onflow%2Fcreate-a-topshot-set/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onflow%2Fcreate-a-topshot-set/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/onflow","download_url":"https://codeload.github.com/onflow/create-a-topshot-set/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240899308,"owners_count":19875358,"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":[],"created_at":"2024-11-11T10:34:17.507Z","updated_at":"2025-02-26T17:23:25.546Z","avatar_url":"https://github.com/onflow.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cadence Cookbook Recipe: Create a TopShot Set\n\n### What is this recipe about?\n\nUsing the TopShot contract, this is how you would create a set so that you could add plays to them and mint moments from those plays.\n\n## Table of Contents\n\n- [Description](#description)\n- [What is included in this repository?](#what-is-included-in-this-repository)\n- [Supported Recipe Data](#recipe-data)\n- [Deploying Recipe Contracts and Running Transactions Locally (Flow Emulator)](#deploying-recipe-contracts-and-running-transactions-locally-flow-emulator)\n- [License](#license)\n\n## Description\n\n### What is the Cadence Cookbook?\n\nThe Cadence Cookbook is a collection of code examples, recipes, and tutorials designed to help developers learn and understand the Cadence programming language. Cadence is the smart contract programming language used on the Flow blockchain. Whether you are new to Flow or an experienced blockchain developer, the Cadence Cookbook serves as a valuable resource to explore various aspects of Cadence and its applications in building dApps on the Flow blockchain.\n\nEach recipe in the Cadence Cookbook is a practical coding example that showcases a specific aspect of Cadence or use-case on Flow, including smart contract development, interaction, and best practices. By following these recipes, you can gain hands-on experience and learn how to leverage Cadence for your blockchain projects.\n\n### Contributing to the Cadence Cookbook\n\nLearn more about the contribution process [here](https://github.com/onflow/cadence-cookbook/blob/main/contribute.md).\n\n## What is included in this repository?\n\nEach recipe repository is subdivided into 2 main sections, Cadence code files (.cdc) under the `/cadence` directory, and explanation files (.txt) under the `/explanations` directory.\n\nThe Cadence Cookbook supports Cadence code and explanations for the contract, transaction, and testing elements of each recipe.\n\nRecipe metadata, such as title, author, and category labels, is stored in `index.js`. Each recipe also includes a link to a live, runnable example of the corresponding code in the [Flow Playground](https://play.flow.com).\n\n```\nrecipe-name/\n├── cadence/                          # Cadence files for recipe examples\n│   ├── contracts/Recipe.cdc          # Contract code\n│   ├── transactions/create_set.cdc   # Transaction code\n│   ├── tests/Recipe_test.cdc           # Tests code\n├── explanations/           # Explanation files for recipe examples\n│   ├── contract.txt        # Contract code explanation\n│   ├── transaction.txt     # Transaction code explanation\n│   ├── tests.txt           # Tests code explanation\n├── index.js                # Root file for storing recipe metadata\n├── README.md               # This README file\n└── LICENSE                 # License information\n```\n\n## Supported Recipe Data\n\n- `const recipe`: defines a unique identifier (slug) for the recipe\n- `title`: indicates the title of the recipe\n- `featuredText`(optional): a subheading for the recipe title\n- `coverUrl` (optional): path to a featured cover image for the recipe\n- `createdAt`: date on which recipe was added to the Cadence Cookbook\n- `author`: contributor of the recipe\n- `playgroundLink`: a link to Flow Playground containing the deployed recipe code\n- `excerpt`: a brief description of the recipe contents\n- `filters`: the filters object is used to perform filtering on recipes in the cookbook\n    - `difficulty`: the difficulty filter supports one of ['beginner', 'intermediate', 'advanced']\n\n\n```\n// Pass the repo name\nconst recipe = \"sample-recipe-name\";\n\nexport const sampleRecipe= {\n  slug: recipe,\n  title: \"\",\n  featuredText: \"\",\n  createdAt: Date(2022, 3, 1),\n  author: \"\",\n  playgroundLink: \"\",\n  excerpt: \"\",\n};\n```\n## Deploying Recipe Contracts and Running Transactions Locally (Flow Emulator)\n\nThis section explains how to deploy the recipe's contracts to the Flow emulator, run the associated transaction with sample arguments, and verify the results.\n\n### Prerequisites\n\nBefore deploying and running the recipe:\n\n1. Install the Flow CLI. You can find installation instructions [here](https://docs.onflow.org/flow-cli/install/).\n2. Ensure the Flow emulator is installed and ready to use with `flow version`.\n\n### Step 1: Start the Flow Emulator\n\nStart the Flow emulator to simulate the blockchain environment locally\n\n```bash\nflow emulator start\n```\n\n### Step 2: Install Dependencies and Deploy Project Contracts\n\nDeploy contracts to the emulator. This will deploy all the contracts specified in the _deployments_ section of `flow.json` whether project contracts or dependencies.\n\n```bash\nflow dependencies install\nflow project deploy --network=emulator                                  \n```\n\n### Step 3: Run the Transaction\n\nTransactions associated with the recipe are located in `./cadence/transactions`. To run a transaction, execute the following command:\n\n```bash\nflow transactions send cadence/transactions/TRANSACTION_NAME.cdc --signer emulator-account\n```\n\nTo verify the transaction's execution, check the emulator logs printed during the transaction for confirmation messages. You can add the `--log-level debug` flag to your Flow CLI command for more detailed output during contract deployment or transaction execution.\n\n## License\n\nThis repository is licensed under the [MIT License](LICENSE).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fonflow%2Fcreate-a-topshot-set","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fonflow%2Fcreate-a-topshot-set","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fonflow%2Fcreate-a-topshot-set/lists"}