You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+50-12Lines changed: 50 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -9,6 +9,7 @@ This is for minting NFTS. It includes the minting resource that you can use in y
9
9
-[Description](#description)
10
10
-[What is included in this repository?](#what-is-included-in-this-repository)
11
11
-[Supported Recipe Data](#recipe-data)
12
+
-[Deploying Recipe Contracts and Running Transactions Locally (Flow Emulator)](#deploying-recipe-contracts-and-running-transactions-locally-flow-emulator)
12
13
-[License](#license)
13
14
14
15
## Description
@@ -19,7 +20,6 @@ The Cadence Cookbook is a collection of code examples, recipes, and tutorials de
19
20
20
21
Each 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.
21
22
22
-
23
23
### Contributing to the Cadence Cookbook
24
24
25
25
Learn more about the contribution process [here](https://github.com/onflow/cadence-cookbook/blob/main/contribute.md).
@@ -34,17 +34,17 @@ Recipe metadata, such as title, author, and category labels, is stored in `index
34
34
35
35
```
36
36
recipe-name/
37
-
├── cadence/ # Cadence files for recipe examples
38
-
│ ├── contract.cdc # Contract code
39
-
│ ├── transaction.cdc # Transaction code
40
-
│ ├── tests.cdc # Tests code
41
-
├── explanations/ # Explanation files for recipe examples
## Deploying Recipe Contracts and Running Transactions Locally (Flow Emulator)
99
+
100
+
This section explains how to deploy the recipe's contracts to the Flow emulator, run the associated transaction with sample arguments, and verify the results.
101
+
102
+
### Prerequisites
103
+
104
+
Before deploying and running the recipe:
105
+
106
+
1. Install the Flow CLI. You can find installation instructions [here](https://docs.onflow.org/flow-cli/install/).
107
+
2. Ensure the Flow emulator is installed and ready to use with `flow version`.
108
+
109
+
### Step 1: Start the Flow Emulator
110
+
111
+
Start the Flow emulator to simulate the blockchain environment locally
112
+
113
+
```bash
114
+
flow emulator start
115
+
```
116
+
117
+
### Step 2: Install Dependencies and Deploy Project Contracts
118
+
119
+
Deploy contracts to the emulator. This will deploy all the contracts specified in the _deployments_ section of `flow.json` whether project contracts or dependencies.
120
+
121
+
```bash
122
+
flow dependencies install
123
+
flow project deploy --network=emulator
124
+
```
125
+
126
+
### Step 3: Run the Transaction
127
+
128
+
Transactions associated with the recipe are located in `./cadence/transactions`. To run a transaction, execute the following command:
To 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.
0 commit comments