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: docs/zkapps/how-to-deploy-a-zkapp.mdx
+54-28Lines changed: 54 additions & 28 deletions
Original file line number
Diff line number
Diff line change
@@ -17,27 +17,29 @@ zkApp programmability is not yet available on the Mina Mainnet, but zkApps can n
17
17
18
18
# How to Deploy a zkApp
19
19
20
-
Before deploying, you must first define a few settings, such as which network you are deploying to.
20
+
Before deploying, you must first define a few settings, such as which network you are deploying your zkApp to.
21
21
22
22
## Add a deploy alias to config.json
23
23
24
-
Create a [deploy alias](/zkapps/tutorials/deploying-to-a-network#deploy-alias) in the `config.json` file in your smart contract project.
25
-
26
-
First, change into the directory that contains your smart contract and then run the
27
-
following command:
24
+
First, change into the directory that contains your smart contract and then run the following command:
28
25
29
26
```sh
30
27
zk config
31
28
```
32
29
33
-
When prompted, specify a name (can be anything), the target network (`testnet` or `mainnet`), the URL to deploy to, fee (in
34
-
MINA) to be used when sending your deploy transaction, and the fee payer account.
30
+
When prompted, specify:
31
+
32
+
- The name (can be anything)
33
+
- The target network kind (`Testnet`, `Mainnet` or enter the custom network kind id) to deploy your zkApp to
34
+
- The URL to send the deploy transaction to
35
+
- Transaction fee (in MINA) to use when deploying
36
+
- The fee payer account to pay transaction fees from
35
37
36
-
For more details, see [Deploy alias](/zkapps/tutorials/deploying-to-a-network#deploy-alias) in Tutorial 3: Deploy to a Live Network.
38
+
For more details, see [deploy alias](/zkapps/tutorials/deploying-to-a-network#deploy-alias)section in corresponding tutorial.
37
39
38
40
:::tip
39
41
If your project contains multiple smart contracts (for example, `Foo` and `Bar`) that
40
-
you intend to deploy to the same network, a best practice is to follow a naming convention such as `berkeley-foo` and `berkeley-bar` when naming your deploy aliases. You can change these alias names at any time in `config.json`.
42
+
you intend to deploy to the same network, the best practice is to follow the naming convention such as `berkeley-foo` and `berkeley-bar` when naming your deploy aliases. You can change these alias names at any time by manually editing the `config.json` file.
41
43
:::
42
44
43
45
You see the following output:
@@ -46,28 +48,34 @@ You see the following output:
46
48
$ zk config
47
49
48
50
Add a new network:
49
-
✔ Choose a name (can be anything): · berkeley
50
-
✔ Set URL to deploy to: · https://proxy.berkeley.minaexplorer.com/graphql
51
+
✔ Create a name (can be anything): · berkeley
52
+
✔ Choose the target network: · Testnet
53
+
✔ Set the Mina GraphQL API URL to deploy to: · https://proxy.berkeley.minaexplorer.com/graphql
51
54
✔ Set transaction fee to use when deploying (in MINA): · 0.1
52
-
✔ Create key pair at keys/berkeley.json
53
-
✔ Add network to config.json
55
+
✔ Choose an account to pay transaction fees: · Use stored account MyFeePayer (public key: B62...)
56
+
✔ Use stored fee payer MyFeePayer (public key: B62...)
To deploy your zkApp, you must have funds to pay for transaction fees.
71
+
To deploy your zkApp, your fee payer account must have funds to pay for transaction fees.
67
72
68
-
To get funds on the Berkeley Testnet, use the URL that was shown from the zkApp CLI output. Visit `https://faucet.minaprotocol.com/?address=<YOUR-ADDRESS>` and click **Request**.
73
+
To get funds on the Berkeley Testnet, use the URL that was shown in the zkApp CLI output:
- Choose the corresponding network you're going to deploy your zkApp to
76
+
- And click the **Request** button
69
77
70
-
Before proceeding to the next step, wait a few minutes for the next block to include your transaction, so tMINA is available.
78
+
Before proceeding to the next step, wait a few minutes for the next block to include your transaction, so that tMINA becomes available for the fee payer account.
71
79
72
80
## Deploy your smart contract
73
81
@@ -77,9 +85,9 @@ To deploy your smart contract to the network, run the following command:
77
85
zk deploy berkeley
78
86
```
79
87
80
-
When running the deploy command, the zkApp CLI computes a verification key for your zkApp CLI. Computing the verification key can take 1-2 minutes, so please be patient. The zkApp CLI shows the details of the transaction, such as the network name, the URL, and the smart contract to deploy.
88
+
Among other activities, when running the deploy command, zkApp CLI computes the verification key for your zkApp. Computing verification key can take 10-30 seconds, so please be patient. The zkApp CLI shows the details of the process, such as the network name, the URL, and the smart contract to deploy.
81
89
82
-
Finally, enter `yes` or `y` when prompted to confirm and send the transaction.
90
+
Finally, enter `yes` or `y` when prompted to confirm and send the deploy transaction.
83
91
84
92
You see the following output:
85
93
@@ -91,24 +99,42 @@ $ zk deploy berkeley
91
99
Only one smart contract exists in the project: Add
After a few minutes, the transaction is included in the next block. To see your changes, go to on [berkeley.minaexplorer.com](https://berkeley.minaexplorer.com) and search for the address that you used.
134
+
After a few minutes, the transaction is included in the next block.
135
+
To see the zkApp transaction and navigate to accounts involved you can follow the transaction link provided to you in zkApp CLI output.
136
+
Or use the [Minascan](https://minascan.io) explorer to search for the account with deployed zkApp.
109
137
110
138
## Next Steps
111
139
112
-
More local development and testing! Use Lightnet to test your zkApp locally on an accurate representation of the Mina blockchain. See [Testing zkApps with Lightnet](/zkapps/testing-zkapps-lightnet).
113
-
114
-
Now that you've learned how to deploy a smart contract, you can now learn [how to write a UI for your zkApp](how-to-write-a-zkapp-ui).
140
+
Now that you've learned how to deploy a smart contract, you can learn [how to write the UI for your zkApp](how-to-write-a-zkapp-ui).
Copy file name to clipboardExpand all lines: docs/zkapps/testing-zkapps-locally.mdx
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -188,4 +188,4 @@ See the [Jest Getting Started](https://jestjs.io/docs/getting-started) documenta
188
188
189
189
## Next Steps
190
190
191
-
Now that you know how to test a smart contract on a simulated local blockchain, you can move on to [Testing zkApps with Lightnet](/zkapps/testing-zkapps-lightnet) before you learn [how to deploy a zkApp](how-to-deploy-a-zkapp).
191
+
Now that you know how to test a smart contract on a simulated local blockchain, you can move on to [Testing zkApps with Lightnet](/zkapps/testing-zkapps-lightnet) before you learn [how to deploy your zkApp](how-to-deploy-a-zkapp) to public networks.
0 commit comments