From 772189318040660ffe105d144178fc5394ec3018 Mon Sep 17 00:00:00 2001 From: Serhii Shymkiv Date: Sat, 27 Apr 2024 14:01:17 +0300 Subject: [PATCH 01/12] Review of zkApp deployments. --- docs/zkapps/how-to-deploy-a-zkapp.mdx | 78 +++++++----- docs/zkapps/how-to-write-a-zkapp.mdx | 2 +- docs/zkapps/testing-zkapps-locally.mdx | 2 +- .../tutorials/03-deploying-to-a-network.mdx | 115 ++++++++---------- 4 files changed, 106 insertions(+), 91 deletions(-) diff --git a/docs/zkapps/how-to-deploy-a-zkapp.mdx b/docs/zkapps/how-to-deploy-a-zkapp.mdx index 3158d5d2e..74701221d 100644 --- a/docs/zkapps/how-to-deploy-a-zkapp.mdx +++ b/docs/zkapps/how-to-deploy-a-zkapp.mdx @@ -17,27 +17,29 @@ zkApp programmability is not yet available on the Mina Mainnet, but zkApps can n # How to Deploy a zkApp -Before deploying, you must first define a few settings, such as which network you are deploying to. +Before deploying, you must first define a few settings, such as which network you are deploying your zkApp to. ## Add a deploy alias to config.json -Create a [deploy alias](/zkapps/tutorials/deploying-to-a-network#deploy-alias) in the `config.json` file in your smart contract project. - -First, change into the directory that contains your smart contract and then run the -following command: +First, change into the directory that contains your smart contract and then run the following command: ```sh zk config ``` -When prompted, specify a name (can be anything), the target network (`testnet` or `mainnet`), the URL to deploy to, fee (in -MINA) to be used when sending your deploy transaction, and the fee payer account. +When prompted, specify: + +- The name (can be anything) +- The target network kind (`Testnet`, `Mainnet` or enter the custom network kind id) to deploy your zkApp to +- The URL to send the deploy transaction to +- Transaction fee (in MINA) to use when deploying +- The fee payer account to pay transaction fees from -For more details, see [Deploy alias](/zkapps/tutorials/deploying-to-a-network#deploy-alias) in Tutorial 3: Deploy to a Live Network. +For more details, see [deploy alias](/zkapps/tutorials/deploying-to-a-network#deploy-alias) section in corresponding tutorial. :::tip If your project contains multiple smart contracts (for example, `Foo` and `Bar`) that -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`. +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. ::: You see the following output: @@ -46,28 +48,34 @@ You see the following output: $ zk config Add a new network: -✔ Choose a name (can be anything): · berkeley -✔ Set URL to deploy to: · https://proxy.berkeley.minaexplorer.com/graphql +✔ Create a name (can be anything): · berkeley +✔ Choose the target network: · Testnet +✔ Set the Mina GraphQL API URL to deploy to: · https://proxy.berkeley.minaexplorer.com/graphql ✔ Set transaction fee to use when deploying (in MINA): · 0.1 -✔ Create key pair at keys/berkeley.json -✔ Add network to config.json +✔ Choose an account to pay transaction fees: · Use stored account MyFeePayer (public key: B62...) +✔ Use stored fee payer MyFeePayer (public key: B62...) +✔ Create zkApp key pair at keys/berkeley.json +✔ Add deploy alias to config.json Success! Next steps: -- If this is a testnet, request tMINA at: - https://faucet.minaprotocol.com/?address= -- To deploy, run: `zk deploy berkeley` +- If this is the testnet, request tMINA at: + https://faucet.minaprotocol.com/?address= +- To deploy zkApp, run: `zk deploy berkeley` ``` -## Request funds from the faucet +## Request funds from the Faucet -To deploy your zkApp, you must have funds to pay for transaction fees. +To deploy your zkApp, your fee payer account must have funds to pay for transaction fees. -To get funds on the Berkeley Testnet, use the URL that was shown from the zkApp CLI output. Visit `https://faucet.minaprotocol.com/?address=` and click **Request**. +To get funds on the Berkeley Testnet, use the URL that was shown in the zkApp CLI output: +- Visit `https://faucet.minaprotocol.com/?address=` +- Choose the corresponding network you're going to deploy your zkApp to +- And click the **Request** button -Before proceeding to the next step, wait a few minutes for the next block to include your transaction, so tMINA is available. +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. ## Deploy your smart contract @@ -77,9 +85,9 @@ To deploy your smart contract to the network, run the following command: zk deploy berkeley ``` -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. +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. zkApp CLI shows the details of the process, such as the network name, the URL, and the smart contract to deploy. -Finally, enter `yes` or `y` when prompted to confirm and send the transaction. +Finally, enter `yes` or `y` when prompted to confirm and send the deploy transaction. You see the following output: @@ -91,9 +99,22 @@ $ zk deploy berkeley Only one smart contract exists in the project: Add Your config.json was updated to always use this smart contract when deploying to this network. -✔ Generate verification key (takes 1-2 min) +✔ Generate verification key (takes 10-30 sec) ✔ Build transaction ✔ Confirm to send transaction + + |-----------------|-------------------------------------------------| + | Deploy Alias | berkeley | + |-----------------|-------------------------------------------------| + | Fee Payer Alias | MyFeePayer | + |-----------------|-------------------------------------------------| + | URL | https://proxy.berkeley.minaexplorer.com/graphql | + |-----------------|-------------------------------------------------| + | Smart Contract | Add | + |-----------------|-------------------------------------------------| + | zkApp account | B62... | + |-----------------|-------------------------------------------------| + Are you sure you want to send (yes/no)? · y ✔ Send to network @@ -101,14 +122,15 @@ Success! Deploy transaction sent. Next step: Your smart contract will be live (or updated) + at B62... as soon as the transaction is included in a block: - https://berkeley.minaexplorer.com/transaction/ + https://minascan.io/berkeley/tx/?type=zk-tx ``` -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. +After a few minutes, the transaction is included in the next block. +To see the zkApp transaction and navigate to accounts involved you can follow the transaction link provided to you in zkApp CLI output. +Or use the [Minascan](https://minascan.io) explorer to search for the account with deployed zkApp. ## Next Steps -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). - -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). +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). diff --git a/docs/zkapps/how-to-write-a-zkapp.mdx b/docs/zkapps/how-to-write-a-zkapp.mdx index 6f3825774..2d0be8633 100644 --- a/docs/zkapps/how-to-write-a-zkapp.mdx +++ b/docs/zkapps/how-to-write-a-zkapp.mdx @@ -107,7 +107,7 @@ Examples are based on the standard project structure and provide additional file The deploy alias name does not have to match the network name. -1. Choose the target network: +1. Choose the target network kind: ```text Testnet diff --git a/docs/zkapps/testing-zkapps-locally.mdx b/docs/zkapps/testing-zkapps-locally.mdx index 96c268e13..6deb367d4 100644 --- a/docs/zkapps/testing-zkapps-locally.mdx +++ b/docs/zkapps/testing-zkapps-locally.mdx @@ -188,4 +188,4 @@ See the [Jest Getting Started](https://jestjs.io/docs/getting-started) documenta ## Next Steps -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). +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. diff --git a/docs/zkapps/tutorials/03-deploying-to-a-network.mdx b/docs/zkapps/tutorials/03-deploying-to-a-network.mdx index d7c3a6c39..a787eb0ae 100644 --- a/docs/zkapps/tutorials/03-deploying-to-a-network.mdx +++ b/docs/zkapps/tutorials/03-deploying-to-a-network.mdx @@ -26,9 +26,9 @@ zkApp programmability is not yet available on the Mina Mainnet, but zkApps can n # Tutorial 3: Deploy to a Live Network -In previous tutorials, you learned how to deploy and run transactions on a local network. +In previous tutorials, you learned how to deploy and execute transactions on a local network. -In this tutorial, you use the `zk config` command to create a deploy alias, request tMINA funds to pay for transaction fees, and deploy a project to a live network. +In this tutorial, you will use the `zk config` command to create the deploy alias, request tMINA funds to pay for transaction fees, and deploy zkApp to a live network. This tutorial reuses the `Square` contract that you created in [Tutorial 1: Hello World](hello-world). @@ -36,8 +36,8 @@ This tutorial reuses the `Square` contract that you created in [Tutorial 1: Hell This tutorial has been tested with: -- [zkApp CLI](https://github.com/o1-labs/zkapp-cli) version `0.17.2` -- [o1js](https://www.npmjs.com/package/o1js) version `0.16.2`. +- [zkApp CLI](https://github.com/o1-labs/zkapp-cli) version `0.20.0` +- [o1js](https://www.npmjs.com/package/o1js) version `1.0.1`. Ensure your environment meets the [Prerequisites](/zkapps/tutorials#prerequisites) for zkApp Developer Tutorials. @@ -65,7 +65,7 @@ npm update -g zkapp-cli svelte nuxt empty - ❯ none + > none ``` The expected output is: @@ -87,7 +87,7 @@ npm update -g zkapp-cli git push -u origin main ``` - The `zk project` command creates the `03-deploying-to-a-live-network` directory that contains the scaffolding for your project, including tools such as the Prettier code formatting tool, the ESLint static code analysis tool, and the Jest JavaScript testing framework. + The `zk project` command creates the `03-deploying-to-a-live-network` directory that contains the scaffolding for your project, including tools such as the Prettier code formatting, the ESLint static code analysis, and the Jest JavaScript testing framework. 1. Change into the `03-deploying-to-a-live-network` directory. @@ -105,15 +105,10 @@ Start by deleting the default files that come with the new project. $ rm src/Add.ts $ rm src/Add.test.ts $ rm src/interact.ts + $ rm src/index.ts ``` -1. Now, create a new file for your smart contract: - - ```sh - $ zk file src/Square - ``` - -1. Copy the `src/Square.ts` and `src/index.ts` files from the example files for first tutorial [01-hello-world/src](https://github.com/o1-labs/docs2/tree/main/examples/zkapps/01-hello-world/src) to your local `03-deploying-to-a-live-network/src` directory. If prompted, replace existing files. +1. Copy the `src/Square.ts` and `src/index.ts` files from the files of the first tutorial [01-hello-world/src](https://github.com/o1-labs/docs2/tree/main/examples/zkapps/01-hello-world/src) to your local `03-deploying-to-a-live-network/src` directory. If prompted, replace existing files. Now that your smart contract is in place, you are ready to deploy your smart contract to Berkeley Testnet. @@ -121,11 +116,11 @@ Now that your smart contract is in place, you are ready to deploy your smart con You installed the zkApp CLI as part of the [Prerequisites](/zkapps/tutorials#prerequisites), so you already have the tools to manage deployments. -In some cases, you might need to create a custom account for your zkApp, for example, to deploy a zkApp to a different key than the fee payer key, programmatically parameterize a zkApp before you initialize it, or create a smart contract programmatically for users as part of an application. For details, see [Interacting with zkApps server-side](/zkapps/tutorials/interacting-with-zkapps-server-side). +In some cases, you might need to create a custom account for your zkApp, programmatically parameterize a zkApp before you initialize it, or create a smart contract programmatically for users as part of an application. For details, please see [Interacting with zkApps server-side](/zkapps/tutorials/interacting-with-zkapps-server-side). ## Deploy the smart contract -The `config.json` configuration file contains the configuration to deploy your zkApp. This file was automatically scaffolded when you created your project with the `zk project` command. +The `config.json` configuration file contains the configuration to deploy your zkApp. This file was automatically created during the project scaffold with the `zk project` command. However, the generated configuration file does not yet contain the deploy alias. @@ -138,19 +133,16 @@ You can have one or more deploy aliases for your project. A deploy alias consists of: - A self-describing name that can be anything. Using naming patterns is helpful when you have more than one deploy alias. +- The target network kind (`Testnet`, `Mainnet` or custom network kind id) - The Mina GraphQL API URL that defines the network that receives your deploy transaction and broadcasts it to the appropriate Mina network (Testnet, Devnet, Mainnet, and so on) - The transaction fee (in MINA) to use when deploying - Two key pairs: - - - A key pair for the zkApp account. Public and private keys to use in your application are automatically generated in `keys/berkeley.json`. - + - A key pair for the zkApp account. Public and private keys to use in your application are automatically generated in `keys/.json`. - A key pair to use as a fee payer account for updates and deployments. Public and private keys are stored on your local computer and can be used across multiple projects. - - Fee payer account alias - - A fee payer account is required, you can choose to use an existing account or create a new fee payer account. -1. To configure your deployment, run the `zk config` command and respond to the prompts: +1. To configure your deploy alias, run the `zk config` command and respond to the prompts: ```sh $ zk config @@ -162,7 +154,7 @@ A deploy alias consists of: This tutorial uses `berkeley`, but the deploy alias name can be anything and does not have to match the network name. - - Target network: `testnet` + - Target network kind: `Testnet` - Mina GraphQL API URL: `https://proxy.berkeley.minaexplorer.com/graphql` @@ -177,11 +169,11 @@ A deploy alias consists of: If this is the first time you are running the `zk config` command, you see these options: ```text - ❯ Recover fee payer account from an existing base58 private key + > Recover fee payer account from an existing base58 private key Create a new fee payer key pair ``` - A third option to choose another saved fee payer account is shown only if you have a cached fee payer account. + A third option to choose another saved fee payer account is shown only if you have a cached fee payer accounts. 1. Select to create a new fee payer key pair: @@ -190,20 +182,12 @@ A deploy alias consists of: NOTE: the private key will be stored in plain text on this computer. ``` - A fee payer account is a developer account that can always pay fees immediately for local testing. Do not use an account that holds a substantial amount of MINA. - -1. When prompted to create an alias for this account, give an alias to your new fee payer key pair: - - ```text - testing-feepayer - ``` - - Your key pairs and deploy alias are created. + Please **do not** use the fee payer account that holds a substantial amount of MINA. 1. When prompted, give an alias to your new fee payer key pair. For this tutorial, use `03-deploy`: ```sh - Create an alias for this account: berkeley + ✔ Create an alias for this account · 03-deploy ``` Your key pairs and deploy alias are created: @@ -216,16 +200,22 @@ A deploy alias consists of: Success! Next steps: - - If this is a testnet, request tMINA at: - https://faucet.minaprotocol.com/?address=B62qqK5JgYAtmh2DHsQfUjUSKwQ6CFSPkGvyMZd19j1BUHfEJEqpKGo&?explorer=minaexplorer - - To deploy, run: `zk deploy berkeley` + - If this is the testnet, request tMINA at: + https://faucet.minaprotocol.com/?address= + - To deploy zkApp, run: `zk deploy berkeley` ``` 1. Request funds from the Testnet Faucet to fund your fee payer account. - Follow the prompts to request tMINA. For this tutorial, your MINA address is populated on the Testnet Faucet. tMINA arrives at your address when the next block is produced (~3 minutes). + Follow the prompts to request tMINA. + To get funds on the Berkeley Testnet, use the URL that was shown in the zkApp CLI output: + - Visit `https://faucet.minaprotocol.com/?address=` + - Choose the corresponding network you're going to deploy your zkApp to (`Berkeley` in this case) + - And click the **Request** button + + 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. -1. To deploy your project: +1. To deploy your project execute the following command: ```sh $ zk deploy @@ -235,7 +225,7 @@ A deploy alias consists of: ```text ? Which deploy alias would you like to deploy to? … - ❯ berkeley + > berkeley ``` A verification key for your smart contract is generated (takes 10-30 seconds). @@ -256,17 +246,20 @@ A deploy alias consists of: 1. Review and confirm the details of the transaction: ```text - ✖ Confirm to send transaction - - ┌─────────────────┬──────────────────────────────────────────────────┐ - │ Deploy Alias │ berkeley │ - ├─────────────────┼──────────────────────────────────────────────────┤ - │ Fee-Payer Alias │ testing-feepayer │ - ├─────────────────┼──────────────────────────────────────────────────┤ - │ URL │ https://proxy.berkeley.minaexplorer.com/graphql │ - ├─────────────────┼──────────────────────────────────────────────────┤ - │ Smart Contract │ Square │ - └─────────────────┴──────────────────────────────────────────────────┘ + ✔ Confirm to send transaction + + |-----------------|-------------------------------------------------| + | Deploy Alias | berkeley | + |-----------------|-------------------------------------------------| + | Fee Payer Alias | testing-feepayer | + |-----------------|-------------------------------------------------| + | URL | https://proxy.berkeley.minaexplorer.com/graphql | + |-----------------|-------------------------------------------------| + | Smart Contract | Square | + |-----------------|-------------------------------------------------| + | zkApp account | B62... | + |-----------------|-------------------------------------------------| + ``` When prompted, type `yes` to confirm and send the transaction to the network. @@ -278,19 +271,19 @@ A deploy alias consists of: Next step: Your smart contract will be live (or updated) + at B62... as soon as the transaction is included in a block: + https://minascan.io/berkeley/tx/?type=zk-tx ``` -1. To see the zkApp transaction, go to `https://minascan.io/berkeley/tx/`, where `` is the transaction hash that is output to your terminal. - - - The zkApp Pending Transaction (Transaction Type `zkApp Tx`) shows until the transaction is included in the next block. - - The zkApp Transaction shows after the transaction is included in a block. +1. To see the zkApp transaction and navigate to accounts involved you can follow the transaction link provided to you in zkApp CLI output. +Or use the [Minascan](https://minascan.io) explorer to search for the account with deployed zkApp. ## Success After the transaction is included in a block, your smart contract is deployed! -- The Mina account at this public key now contains the verification key associated with this smart contract. +- The Mina account used to deploy zkAPp now contains the verification key associated with this smart contract. You ran the `zk config` command to: @@ -298,12 +291,12 @@ You ran the `zk config` command to: - Create a fee payer key pair at `${HOME}/.cache/zkapp-cli/keys/03-deploy.json` - Create a zkApp key pair at `keys/berkeley.json` -You requested tMINA to fund your deploy transactions. Use the remaining tMINA to keep building and testing. +You requested tMINA to fund your fee payer account and pay your deploy transaction fees. Use the remaining tMINA to keep building and testing. You ran the `zk deploy` command to: - Generate a verification key for your smart contract -- Add the deploy alias to the project `config.json` +- Add send the deploy transaction to the network Congratulations! @@ -311,15 +304,15 @@ To test, configure, and deploy your zkApp on a local representation of the Mina ## About the Smart Contract Transactions -Because this tutorial used the smart contract for Tutorial 1: Hello World, the smart contract `editState` permissions require that a transaction must contain a valid zk proof that was created by the private key associated with this zkApp account. +Because this tutorial used the smart contract from `Tutorial 1: Hello World`, the smart contract's `editState` permissions require that the transaction must contain a valid zk proof that was created by the private key associated with this zkApp account. - When a user interacts with this smart contract by providing a proof, the proof is generated locally on the user's device and included in a transaction. - When the transaction is submitted to the network, the proof is checked to ensure it is correct and matches the on-chain verification key. - After the transaction is accepted, the proof and transaction are recursively proved and bundled into Mina's recursive zero knowledge proof. -When you change the smart contract code, the associated verification key also changes. Use the same steps to redeploy the smart contract. +When you change the smart contract code, the associated verification key also changes. Use the same steps to re-deploy your zkApp. -For a typical smart contract, permissions are set to allow only proof authorization: the proof in zero knowledge proof. You learn more about setting permissions in a later tutorial. +For a typical smart contract, permissions are set to only allow proof authorization. You learn more about setting permissions in the later tutorials. ## Video From b22867a258db61838ea12430db70a3a10a6ef6a1 Mon Sep 17 00:00:00 2001 From: Serhii Shymkiv Date: Sun, 28 Apr 2024 10:42:34 +0300 Subject: [PATCH 02/12] Reflect zkapp cli updated output. --- docs/zkapps/how-to-deploy-a-zkapp.mdx | 9 +++++++-- docs/zkapps/tutorials/03-deploying-to-a-network.mdx | 9 +++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/docs/zkapps/how-to-deploy-a-zkapp.mdx b/docs/zkapps/how-to-deploy-a-zkapp.mdx index 74701221d..a37fa46a4 100644 --- a/docs/zkapps/how-to-deploy-a-zkapp.mdx +++ b/docs/zkapps/how-to-deploy-a-zkapp.mdx @@ -106,13 +106,18 @@ $ zk deploy berkeley |-----------------|-------------------------------------------------| | Deploy Alias | berkeley | |-----------------|-------------------------------------------------| - | Fee Payer Alias | MyFeePayer | + | Network kind | testnet | |-----------------|-------------------------------------------------| | URL | https://proxy.berkeley.minaexplorer.com/graphql | |-----------------|-------------------------------------------------| + | Fee Payer | Alias: MyFeePayer | + | | Account: B62... | + |-----------------|-------------------------------------------------| + | zkApp | Account: B62... | + |-----------------|-------------------------------------------------| | Smart Contract | Add | |-----------------|-------------------------------------------------| - | zkApp account | B62... | + | Transaction fee | 0.1 Mina | |-----------------|-------------------------------------------------| Are you sure you want to send (yes/no)? · y diff --git a/docs/zkapps/tutorials/03-deploying-to-a-network.mdx b/docs/zkapps/tutorials/03-deploying-to-a-network.mdx index a787eb0ae..f4e8cc7c4 100644 --- a/docs/zkapps/tutorials/03-deploying-to-a-network.mdx +++ b/docs/zkapps/tutorials/03-deploying-to-a-network.mdx @@ -251,13 +251,18 @@ A deploy alias consists of: |-----------------|-------------------------------------------------| | Deploy Alias | berkeley | |-----------------|-------------------------------------------------| - | Fee Payer Alias | testing-feepayer | + | Network kind | testnet | |-----------------|-------------------------------------------------| | URL | https://proxy.berkeley.minaexplorer.com/graphql | |-----------------|-------------------------------------------------| + | Fee Payer | Alias: 03-deploy | + | | Account: B62... | + |-----------------|-------------------------------------------------| + | zkApp | Account: B62... | + |-----------------|-------------------------------------------------| | Smart Contract | Square | |-----------------|-------------------------------------------------| - | zkApp account | B62... | + | Transaction fee | 0.1 Mina | |-----------------|-------------------------------------------------| ``` From 353718694e4074dfe698455aa06d4c2b8c77254e Mon Sep 17 00:00:00 2001 From: Serhii Shymkiv Date: Sun, 28 Apr 2024 18:24:55 +0300 Subject: [PATCH 03/12] Update how-to-deploy-a-zkapp.mdx --- docs/zkapps/how-to-deploy-a-zkapp.mdx | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/docs/zkapps/how-to-deploy-a-zkapp.mdx b/docs/zkapps/how-to-deploy-a-zkapp.mdx index a37fa46a4..4eda7f60b 100644 --- a/docs/zkapps/how-to-deploy-a-zkapp.mdx +++ b/docs/zkapps/how-to-deploy-a-zkapp.mdx @@ -104,18 +104,17 @@ $ zk deploy berkeley ✔ Confirm to send transaction |-----------------|-------------------------------------------------| - | Deploy Alias | berkeley | + | Deploy alias | berkeley | |-----------------|-------------------------------------------------| | Network kind | testnet | |-----------------|-------------------------------------------------| | URL | https://proxy.berkeley.minaexplorer.com/graphql | |-----------------|-------------------------------------------------| - | Fee Payer | Alias: MyFeePayer | - | | Account: B62... | + | Fee payer | Alias : MyFeePayer | + | | Account : B62... | |-----------------|-------------------------------------------------| - | zkApp | Account: B62... | - |-----------------|-------------------------------------------------| - | Smart Contract | Add | + | zkApp | Smart contract: Add | + | | Account : B62... | |-----------------|-------------------------------------------------| | Transaction fee | 0.1 Mina | |-----------------|-------------------------------------------------| From 5020c0b7a9f041df03268b660381ca12406b7a8e Mon Sep 17 00:00:00 2001 From: Serhii Shymkiv Date: Sun, 28 Apr 2024 18:26:02 +0300 Subject: [PATCH 04/12] Update 03-deploying-to-a-network.mdx --- docs/zkapps/tutorials/03-deploying-to-a-network.mdx | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/docs/zkapps/tutorials/03-deploying-to-a-network.mdx b/docs/zkapps/tutorials/03-deploying-to-a-network.mdx index f4e8cc7c4..43c9696f5 100644 --- a/docs/zkapps/tutorials/03-deploying-to-a-network.mdx +++ b/docs/zkapps/tutorials/03-deploying-to-a-network.mdx @@ -249,18 +249,17 @@ A deploy alias consists of: ✔ Confirm to send transaction |-----------------|-------------------------------------------------| - | Deploy Alias | berkeley | + | Deploy alias | berkeley | |-----------------|-------------------------------------------------| | Network kind | testnet | |-----------------|-------------------------------------------------| | URL | https://proxy.berkeley.minaexplorer.com/graphql | |-----------------|-------------------------------------------------| - | Fee Payer | Alias: 03-deploy | - | | Account: B62... | + | Fee payer | Alias : 03-deploy | + | | Account : B62... | |-----------------|-------------------------------------------------| - | zkApp | Account: B62... | - |-----------------|-------------------------------------------------| - | Smart Contract | Square | + | zkApp | Smart contract: Square | + | | Account : B62... | |-----------------|-------------------------------------------------| | Transaction fee | 0.1 Mina | |-----------------|-------------------------------------------------| From e3cf5ecf84a642734872bc3bf3b1ef6b9fc3cbb2 Mon Sep 17 00:00:00 2001 From: Serhii Shymkiv Date: Tue, 30 Apr 2024 14:35:01 +0300 Subject: [PATCH 05/12] Update docs/zkapps/how-to-deploy-a-zkapp.mdx Co-authored-by: Yoni Mekuria --- docs/zkapps/how-to-deploy-a-zkapp.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/zkapps/how-to-deploy-a-zkapp.mdx b/docs/zkapps/how-to-deploy-a-zkapp.mdx index 4eda7f60b..96744efb8 100644 --- a/docs/zkapps/how-to-deploy-a-zkapp.mdx +++ b/docs/zkapps/how-to-deploy-a-zkapp.mdx @@ -85,7 +85,7 @@ To deploy your smart contract to the network, run the following command: zk deploy berkeley ``` -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. zkApp CLI shows the details of the process, such as the network name, the URL, and the smart contract to deploy. +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. Finally, enter `yes` or `y` when prompted to confirm and send the deploy transaction. From 50ca22f30aea68b48ce7362dcd0a85111e730c6f Mon Sep 17 00:00:00 2001 From: Serhii Shymkiv Date: Tue, 30 Apr 2024 14:35:08 +0300 Subject: [PATCH 06/12] Update docs/zkapps/tutorials/03-deploying-to-a-network.mdx Co-authored-by: Yoni Mekuria --- docs/zkapps/tutorials/03-deploying-to-a-network.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/zkapps/tutorials/03-deploying-to-a-network.mdx b/docs/zkapps/tutorials/03-deploying-to-a-network.mdx index 43c9696f5..f87d20209 100644 --- a/docs/zkapps/tutorials/03-deploying-to-a-network.mdx +++ b/docs/zkapps/tutorials/03-deploying-to-a-network.mdx @@ -36,7 +36,7 @@ This tutorial reuses the `Square` contract that you created in [Tutorial 1: Hell This tutorial has been tested with: -- [zkApp CLI](https://github.com/o1-labs/zkapp-cli) version `0.20.0` +- [zkApp CLI](https://github.com/o1-labs/zkapp-cli) version `0.21.0` - [o1js](https://www.npmjs.com/package/o1js) version `1.0.1`. Ensure your environment meets the [Prerequisites](/zkapps/tutorials#prerequisites) for zkApp Developer Tutorials. From d29bc44ed60b9dc54d0770fcef55624eb4ebefc0 Mon Sep 17 00:00:00 2001 From: Serhii Shymkiv Date: Tue, 30 Apr 2024 14:35:30 +0300 Subject: [PATCH 07/12] Update docs/zkapps/tutorials/03-deploying-to-a-network.mdx Co-authored-by: Yoni Mekuria --- docs/zkapps/tutorials/03-deploying-to-a-network.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/zkapps/tutorials/03-deploying-to-a-network.mdx b/docs/zkapps/tutorials/03-deploying-to-a-network.mdx index f87d20209..119b4220f 100644 --- a/docs/zkapps/tutorials/03-deploying-to-a-network.mdx +++ b/docs/zkapps/tutorials/03-deploying-to-a-network.mdx @@ -173,7 +173,7 @@ A deploy alias consists of: Create a new fee payer key pair ``` - A third option to choose another saved fee payer account is shown only if you have a cached fee payer accounts. + A third option to choose another saved fee payer account is shown only if you have multiple cached fee payer accounts. 1. Select to create a new fee payer key pair: From 340bf0bdb0cec37b4b7e29d1e24b0077379cca40 Mon Sep 17 00:00:00 2001 From: Serhii Shymkiv Date: Tue, 30 Apr 2024 14:36:18 +0300 Subject: [PATCH 08/12] Update docs/zkapps/tutorials/03-deploying-to-a-network.mdx Co-authored-by: Yoni Mekuria --- docs/zkapps/tutorials/03-deploying-to-a-network.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/zkapps/tutorials/03-deploying-to-a-network.mdx b/docs/zkapps/tutorials/03-deploying-to-a-network.mdx index 119b4220f..d6a5d084b 100644 --- a/docs/zkapps/tutorials/03-deploying-to-a-network.mdx +++ b/docs/zkapps/tutorials/03-deploying-to-a-network.mdx @@ -287,7 +287,7 @@ Or use the [Minascan](https://minascan.io) explorer to search for the account wi After the transaction is included in a block, your smart contract is deployed! -- The Mina account used to deploy zkAPp now contains the verification key associated with this smart contract. +- The Mina account used to deploy the zkApp now contains the verification key associated with this smart contract. You ran the `zk config` command to: From 77a7aa5b6b741977f2350eefec09af1469ced6d8 Mon Sep 17 00:00:00 2001 From: Serhii Shymkiv Date: Tue, 30 Apr 2024 14:36:28 +0300 Subject: [PATCH 09/12] Update docs/zkapps/tutorials/03-deploying-to-a-network.mdx Co-authored-by: Yoni Mekuria --- docs/zkapps/tutorials/03-deploying-to-a-network.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/zkapps/tutorials/03-deploying-to-a-network.mdx b/docs/zkapps/tutorials/03-deploying-to-a-network.mdx index d6a5d084b..e14b0b93e 100644 --- a/docs/zkapps/tutorials/03-deploying-to-a-network.mdx +++ b/docs/zkapps/tutorials/03-deploying-to-a-network.mdx @@ -314,7 +314,7 @@ Because this tutorial used the smart contract from `Tutorial 1: Hello World`, th - When the transaction is submitted to the network, the proof is checked to ensure it is correct and matches the on-chain verification key. - After the transaction is accepted, the proof and transaction are recursively proved and bundled into Mina's recursive zero knowledge proof. -When you change the smart contract code, the associated verification key also changes. Use the same steps to re-deploy your zkApp. +When you change the smart contract code, the associated verification key also changes. Use the same steps to redeploy your zkApp. For a typical smart contract, permissions are set to only allow proof authorization. You learn more about setting permissions in the later tutorials. From 76633835571e3e4eb868caad7a2091cf278fafe6 Mon Sep 17 00:00:00 2001 From: Serhii Shymkiv Date: Tue, 30 Apr 2024 14:39:46 +0300 Subject: [PATCH 10/12] Update 03-deploying-to-a-network.mdx --- docs/zkapps/tutorials/03-deploying-to-a-network.mdx | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/zkapps/tutorials/03-deploying-to-a-network.mdx b/docs/zkapps/tutorials/03-deploying-to-a-network.mdx index e14b0b93e..0ede7f113 100644 --- a/docs/zkapps/tutorials/03-deploying-to-a-network.mdx +++ b/docs/zkapps/tutorials/03-deploying-to-a-network.mdx @@ -105,7 +105,6 @@ Start by deleting the default files that come with the new project. $ rm src/Add.ts $ rm src/Add.test.ts $ rm src/interact.ts - $ rm src/index.ts ``` 1. Copy the `src/Square.ts` and `src/index.ts` files from the files of the first tutorial [01-hello-world/src](https://github.com/o1-labs/docs2/tree/main/examples/zkapps/01-hello-world/src) to your local `03-deploying-to-a-live-network/src` directory. If prompted, replace existing files. From b5a0099f562bdc2e36c9ed73d9ccfa14d1716f03 Mon Sep 17 00:00:00 2001 From: Serhii Shymkiv Date: Tue, 30 Apr 2024 14:47:43 +0300 Subject: [PATCH 11/12] Update 03-deploying-to-a-network.mdx --- docs/zkapps/tutorials/03-deploying-to-a-network.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/zkapps/tutorials/03-deploying-to-a-network.mdx b/docs/zkapps/tutorials/03-deploying-to-a-network.mdx index 0ede7f113..a38ce9211 100644 --- a/docs/zkapps/tutorials/03-deploying-to-a-network.mdx +++ b/docs/zkapps/tutorials/03-deploying-to-a-network.mdx @@ -181,7 +181,7 @@ A deploy alias consists of: NOTE: the private key will be stored in plain text on this computer. ``` - Please **do not** use the fee payer account that holds a substantial amount of MINA. + Please mind the note above and **do not** use the fee payer account that holds a substantial amount of MINA. 1. When prompted, give an alias to your new fee payer key pair. For this tutorial, use `03-deploy`: From fef8faf8676d18740a4ac6fbfbcc1d2daf5c25ee Mon Sep 17 00:00:00 2001 From: Serhii Shymkiv Date: Wed, 1 May 2024 15:29:16 +0300 Subject: [PATCH 12/12] Update docs/zkapps/tutorials/03-deploying-to-a-network.mdx Co-authored-by: Yoni Mekuria --- docs/zkapps/tutorials/03-deploying-to-a-network.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/zkapps/tutorials/03-deploying-to-a-network.mdx b/docs/zkapps/tutorials/03-deploying-to-a-network.mdx index a38ce9211..13ab4a148 100644 --- a/docs/zkapps/tutorials/03-deploying-to-a-network.mdx +++ b/docs/zkapps/tutorials/03-deploying-to-a-network.mdx @@ -37,7 +37,7 @@ This tutorial reuses the `Square` contract that you created in [Tutorial 1: Hell This tutorial has been tested with: - [zkApp CLI](https://github.com/o1-labs/zkapp-cli) version `0.21.0` -- [o1js](https://www.npmjs.com/package/o1js) version `1.0.1`. +- [o1js](https://www.npmjs.com/package/o1js) version `1.1.0`. Ensure your environment meets the [Prerequisites](/zkapps/tutorials#prerequisites) for zkApp Developer Tutorials.