diff --git a/docs/build/tools/flow-cli/commands.md b/docs/build/tools/flow-cli/commands.md index 9ab0baf34e..1444f20aa5 100644 --- a/docs/build/tools/flow-cli/commands.md +++ b/docs/build/tools/flow-cli/commands.md @@ -4,11 +4,11 @@ description: Essential Flow CLI commands for project development sidebar_position: 2 --- -Flow CLI provides a set of powerful commands that simplify your development workflow. These "super commands" handle complex tasks automatically, letting you focus on writing your smart contracts while the CLI manages the rest. +Flow CLI provides a set of powerful commands that simplify your development workflow. These "super commands" handle complex tasks automatically, which lets you focus on writing your smart contracts while the CLI manages the rest. -## Project Lifecycle +## Project lifecycle -### 1. Initialize a Project +### 1. Initialize a project Start a new Flow project with `flow init`: @@ -34,9 +34,9 @@ flow init --global flow init --service-private-key ``` -πŸ“– **[Learn more about project initialization](./flow.json/initialize-configuration.md)** +πŸ“– **[Learn more about project initialization]** -### 2. Generate Project Files +### 2. Generate project files Create new files with the `flow generate` command: @@ -54,7 +54,7 @@ flow generate transaction TransferTokens flow generate test MyToken ``` -**Generated Structure:** +**Generated structure:** ``` cadence/ β”œβ”€β”€ contracts/ @@ -67,7 +67,7 @@ cadence/ └── MyToken_test.cdc ``` -πŸ“– **[Learn more about generating Cadence boilerplate](./generate.md)** +πŸ“– **[Learn more about generating Cadence boilerplate]** ### 3. Run Tests @@ -87,9 +87,9 @@ flow test --coverage flow test --verbose ``` -πŸ“– **[Learn more about testing](./tests.md)** +πŸ“– **[Learn more about testing]** -### 4. Deploy Contracts +### 4. Deploy contracts Deploy your contracts with `flow project deploy`: @@ -107,11 +107,11 @@ flow project deploy --network=mainnet flow project deploy --update ``` -πŸ“– **[Learn more about project deployment](./deployment/deploy-project-contracts.md)** +πŸ“– **[Learn more about project deployment]** -## Configuration Management +## Configuration management -### Add Configuration Items +### Add configuration items Use `flow config add` to manage your project configuration: @@ -126,7 +126,7 @@ flow config add contract --name MyToken --filename ./cadence/contracts/MyToken.c flow config add deployment --network testnet --account my-account --contract MyToken ``` -### Remove Configuration Items +### Remove configuration items ```bash # Remove an account @@ -139,18 +139,18 @@ flow config remove contract MyToken flow config remove deployment testnet my-account MyToken ``` -πŸ“– **[Learn more about configuration management](./flow.json/manage-configuration.md)** +πŸ“– **[Learn more about configuration management]** -## Account Management +## Account management -### List Accounts +### List accounts ```bash # List all configured accounts with status flow accounts list ``` -### Create Accounts +### Create accounts ```bash # Interactive account creation @@ -163,7 +163,7 @@ flow accounts create --network testnet flow accounts create --key ``` -### Fund Accounts +### Fund accounts ```bash # Interactive funding prompt @@ -176,7 +176,7 @@ flow accounts fund testnet-account flow accounts fund 0x8e94eaa81771313a ``` -### Manage Account Keys +### Manage account keys ```bash # Generate new key pair @@ -189,11 +189,11 @@ flow keys decode flow keys derive ``` -πŸ“– **[Learn more about account management](./accounts/create-accounts.md)** +πŸ“– **[Learn more about account management]** -## Contract Interactions +## Contract interactions -### Execute Scripts +### Execute scripts ```bash # Run a script @@ -206,7 +206,7 @@ flow scripts execute cadence/scripts/GetBalance.cdc --arg 0x123 flow scripts execute cadence/scripts/GetBalance.cdc --network testnet ``` -### Send Transactions +### Send transactions ```bash # Send a transaction @@ -219,7 +219,7 @@ flow transactions send cadence/transactions/TransferTokens.cdc --arg 0x123 --arg flow transactions send cadence/transactions/TransferTokens.cdc --signer my-account ``` -### Get System Transactions +### Get system transactions ```bash # Get system transaction from latest block @@ -232,11 +232,12 @@ flow transactions get-system latest 07a8...b433 flow transactions get-system 12345 ``` -πŸ“– **[Learn more about scripts](./scripts/execute-scripts.md)** | **[Learn more about transactions](./transactions/send-transactions.md)** +- πŸ“– **[Learn more about scripts]** +- πŸ“– **[Learn more about transactions]** -## Dependency Management +## Dependency management -### Install Dependencies +### Install dependencies ```bash # Install a contract dependency @@ -249,7 +250,7 @@ flow dependencies install mainnet://f233dcee88fe0abe.FungibleToken flow dependencies install testnet://8a4dce54554b225d.NumberFormatter --account my-account ``` -### Manage Dependencies +### Manage dependencies ```bash # List installed dependencies @@ -262,43 +263,43 @@ flow dependencies discover flow dependencies install testnet://8a4dce54554b225d.NumberFormatter ``` -πŸ“– **[Learn more about dependency management](./dependency-manager.md)** +πŸ“– **[Learn more about dependency management]** -## Scheduled Transactions +## Scheduled transactions -### Setup Manager Resource +### Setup manager resource ```bash # Initialize Manager resource for scheduled transactions flow schedule setup --network testnet --signer my-account ``` -### List Scheduled Transactions +### List scheduled transactions ```bash # List all scheduled transactions for an account flow schedule list my-account --network testnet ``` -### Get Transaction Details +### Get transaction details ```bash # Get details for a specific scheduled transaction flow schedule get 123 --network testnet ``` -### Cancel Scheduled Transaction +### Cancel scheduled transaction ```bash # Cancel a scheduled transaction and receive refund flow schedule cancel 123 --network testnet --signer my-account ``` -πŸ“– **[Learn more about scheduled transactions](./scheduled-transactions.md)** +πŸ“– **[Learn more about scheduled transactions]** -## Development Workflow +## Development workflow -### Local Development +### Local development 1. **Start the emulator:** ```bash @@ -325,7 +326,7 @@ flow scripts execute cadence/scripts/GetBalance.cdc flow transactions send cadence/transactions/TransferTokens.cdc ``` -### Testnet Deployment +### Testnet deployment 1. **Configure testnet account:** ```bash @@ -342,7 +343,7 @@ flow project deploy --network=testnet flow scripts execute cadence/scripts/GetBalance.cdc --network=testnet ``` -## Import Schema +## Import schema Use simplified imports in your Cadence code: @@ -358,9 +359,9 @@ The CLI automatically resolves imports based on your `flow.json` configuration. ## Best Practices -### 1. Use Configuration Commands +### 1. Use configuration commands -Instead of manually editing `flow.json`, use CLI commands: +Rather than manually edit `flow.json`, use CLI commands: ```bash # βœ… Good flow config add account --name my-account --address 0x123 @@ -369,9 +370,9 @@ flow config add account --name my-account --address 0x123 # Manually editing flow.json ``` -### 2. Test Locally First +### 2. Test locally first -Always test on emulator before deploying: +Always test on emulator before you deploy: ```bash # 1. Start emulator flow emulator start @@ -386,7 +387,7 @@ flow test flow project deploy --network=testnet ``` -### 3. Use Descriptive Names +### 3. Use descriptive names Choose clear names for accounts and contracts: ```bash @@ -399,7 +400,7 @@ flow config add account --name acc1 flow generate contract c1 ``` -### 4. Secure Your Keys +### 4. Secure your keys Use secure key management: ```bash @@ -410,12 +411,31 @@ flow config add account --name my-account --key-file ./keys/my-account.key FLOW_PRIVATE_KEY=abc123 flow project deploy ``` -πŸ“– **[Learn more about security best practices](./flow.json/security.md)** +πŸ“– **[Learn more about security best practices]** ## Related Documentation -- **[Configuration Management](./flow.json/manage-configuration.md)** - Learn how to manage your `flow.json` file -- **[Project Deployment](./deployment/deploy-project-contracts.md)** - Deploy contracts to different networks -- **[Account Management](./accounts/create-accounts.md)** - Create and manage Flow accounts -- **[Testing](./tests.md)** - Write and run tests for your contracts -- **[Security](./flow.json/security.md)** - Secure your private keys and configuration \ No newline at end of file +- **[Configuration Management]** - Learn how to manage your `flow.json` file +- **[Project Deployment]** - Deploy contracts to different networks +- **[Account Management]** - Create and manage Flow accounts +- **[Testing]** - Write and run tests for your contracts +- **[Security]** - Secure your private keys and configuration + + + +[Learn more about project initialization]: ./flow.json/initialize-configuration.md +[Learn more about generating Cadence boilerplate]: ./generate.md +[Learn more about testing]: ./tests.md +[Learn more about project deployment]: ./deployment/deploy-project-contracts.md +[Learn more about configuration management]: ./flow.json/manage-configuration.md +[Learn more about account management]: ./accounts/create-accounts.md +[Learn more about scripts]: ./scripts/execute-scripts.md +[Learn more about transactions]: ./transactions/send-transactions.md +[Learn more about dependency management]: ./dependency-manager.md +[Learn more about scheduled transactions]: ./scheduled-transactions.md +[Learn more about security best practices]: ./flow.json/security.md +[Configuration Management]: ./flow.json/manage-configuration.md +[Project Deployment]: ./deployment/deploy-project-contracts.md +[Account Management]: ./accounts/create-accounts.md +[Testing]: ./tests.md +[Security]: ./flow.json/security.md \ No newline at end of file diff --git a/docs/build/tools/flow-cli/data-collection.md b/docs/build/tools/flow-cli/data-collection.md index 975f71cf77..4c7da4ee1c 100644 --- a/docs/build/tools/flow-cli/data-collection.md +++ b/docs/build/tools/flow-cli/data-collection.md @@ -4,27 +4,26 @@ description: Data collected from Flow CLI usage sidebar_position: 17 --- -Flow CLI tracks flow command usage count using Mixpanel. +Flow CLI tracks flow command usage count with Mixpanel. + +Data collection is turned on by default. To opt out of our data collection, users can run `flow settings metrics disable`. -Data collection is enabled by default. Users can opt out of our data collection through running `flow settings metrics disable`. To opt back in, users can run `flow settings metrics enable`. -## Why do we collect data about flow cli usage? +## Why do we collect data about flow CLI usage? -Collecting aggregate command count allow us to prioritise features and fixes based on how users use flow cli. +When we collect aggregate command count, it allow us to prioritise features and fixes based on how users use flow CLI. ## What data do we collect? We only collect the number of times a command is executed. -We don't keep track of the values of arguments, flags used -and the values of the flags used. We also don't associate any commands to any particular user. +We don't keep track of the values of arguments, flags used and the values of the flags used. We also don't associate any commands to any particular user. -The only property that we collect from our users are their preferences for opting in / out of data collection. -The analytics user ID is specific to Mixpanel and does not permit Flow CLI maintainers to e.g. track you across websites you visit. +The only property that we collect from our users are their opt in / out data collection preferences. +T +he analytics user ID is specific to Mixpanel and does not permit Flow CLI maintainers to, for exxample, track you across websites you visit. -Further details regarding the data collected can be found under Mixpanel's data collection page in `Ingestion API` -section of https://help.mixpanel.com/hc/en-us/articles/115004613766-Default-Properties-Collected-by-Mixpanel. +For more information about the data collected, see Mixpanel's data collection page in the `Ingestion API` section of https://help.mixpanel.com/hc/en-us/articles/115004613766-Default-Properties-Collected-by-Mixpanel. -Please note that although Mixpanel's page above mentions that geolocation properties are recorded by default, -we have turned off geolocation data reporting to Mixpanel. +Although Mixpanel's page above mentions that geolocation properties are recorded by default, we have turned off geolocation data reporting to Mixpanel. diff --git a/docs/build/tools/flow-cli/dependency-manager.md b/docs/build/tools/flow-cli/dependency-manager.md index f9f3d00686..6246b6d55b 100644 --- a/docs/build/tools/flow-cli/dependency-manager.md +++ b/docs/build/tools/flow-cli/dependency-manager.md @@ -7,15 +7,15 @@ sidebar_position: 11 The Dependency Manager in the Flow CLI streamlines the development process when you use contracts from outside your project. It eliminates the manual tasks of copying, pasting, and updating contracts that you use or build upon, such as core contracts or any other ecosystem contracts. -For example, if you wanted to build a new application using the `FlowToken` contract, you would traditionally need to locate the contract on the network, copy it into your local project, and add it to your `flow.json`. You would repeat this process for each import (dependency) it relies on, like the `NonFungibleToken` contract. The Dependency Manager simplifies this process with a few straightforward commands. +For example, if you wanted to build a new application with the `FlowToken` contract, you would traditionally need to locate the contract on the network, copy it into your local project, and add it to your `flow.json` file. You would repeat this process for each import (dependency) it relies on, like the `NonFungibleToken` contract. The Dependency Manager simplifies this process with a few straightforward commands. ## `install` The `install` command allows you to install dependencies and all their sub-dependencies with ease. You can use it to install specific dependencies or to install all dependencies listed in your `flow.json`. -### Installing Specific Dependencies +### Install specific dependencies -If you know the address and name of the contract you want to install (which can often be found via the [Contract Browser](https://contractbrowser.com/)), you can use the following syntax: +If you know the address and name of the contract you want to install (which can often be found via the [Contract Browser]), you can use the following syntax: ```bash flow dependencies install testnet://7e60df042a9c0868.FlowToken @@ -29,9 +29,9 @@ In this command, the string `testnet://7e60df042a9c0868.FlowToken` used as the ` This specifies the remote source of the contract on the network that will be used as the source of truth. -### Installing Core Contracts Using Simplified Syntax +### Install core contracts with simplified syntax -For core contracts (and [DeFiActions](https://github.com/onflow/FlowActions/tree/main?tab=readme-ov-file#deployments)), you can use a simplified syntax that defaults to the Flow Mainnet: +For core contracts (and [DeFiActions]), you can use a simplified syntax that defaults to the Flow Mainnet: ```bash flow dependencies install FlowToken @@ -43,7 +43,7 @@ This command is functionally equivalent to: flow dependencies install mainnet://1654653399040a61.FlowToken ``` -### Installing Multiple Dependencies +### Install multiple dependencies You can also install multiple dependencies at once. For example: @@ -53,9 +53,9 @@ flow dependencies install testnet://7e60df042a9c0868.FlowToken NonFungibleToken This command installs both the `FlowToken` contract from Testnet and the `NonFungibleToken` contract from Mainnet. -### Installing All Dependencies From an Address +### Install all dependencies from an address -Sometimes you may want to install all the contracts that exist at a particular address, rather than specifying each contract name individually. You can do this by omitting the contract name in the dependency source. For example: +Sometimes you may want to install all the contracts that exist at a particular address, rather than specify each contract name individually. To do this, omit the contract name in the dependency source. For example: ```bash flow dependencies install testnet://7e60df042a9c0868 @@ -63,9 +63,9 @@ flow dependencies install testnet://7e60df042a9c0868 This tells the Dependency Manager to fetch every contract deployed at the `7e60df042a9c0868` address on `testnet` and store them in your `imports` folder. You can later import these contracts in your code or use them in your deployments as needed. -### Installing Dependencies from `flow.json` +### Install dependencies from `flow.json` -If you run the `install` command without specifying any dependencies, it will install all the dependencies listed in your `flow.json` file and ensure they are up to date: +If you run the `install` command but don't specify any dependencies, it will install all the dependencies listed in your `flow.json` file and ensure they are up to date: ```bash flow dependencies install @@ -73,9 +73,9 @@ flow dependencies install This command checks all the dependencies specified in your `flow.json`, installs them, and updates them if there have been changes on the network. -### Example `flow.json` Entry +### Example `flow.json` entry -After installing, your `flow.json` might include an entry like: +After installation, your `flow.json` might include an entry like: ```json { @@ -90,16 +90,16 @@ After installing, your `flow.json` might include an entry like: } ``` -### Other Things to Note +### Other things to note -- After installation, a local folder named `imports` will be created. It's recommended to add this folder to your `.gitignore`, as it stores your dependencies locally. -- If the contracts change on the network, the Dependency Manager will prompt you to update the local dependencies in your `imports` folder. The hash saved in the dependency object is used for this check, so avoid removing it. -- Dependencies function just like local contracts. You can add them to [`deployments` in your `flow.json`](./deployment/deploy-project-contracts.md) and run `flow project deploy`. You can also import them in your scripts, transactions, and contracts (e.g., `import "FlowToken"`). +- After installation, a local folder named `imports` will be created. We recommend that you add this folder to your `.gitignore`, as it stores your dependencies locally. +- If the contracts change on the network, the Dependency Manager will prompt you to update the local dependencies in your `imports` folder. The hash saved in the dependency object is used for this check, so don't remove it. +- Dependencies function just like local contracts. You can add them to [`deployments` in your `flow.json`](./deployment/deploy-project-contracts.md) and run `flow project deploy`. You can also import them in your scripts, transactions, and contracts (for example, `import "FlowToken"`). - Core contract aliases are automatically added for you across all networks. ## `discover` -The `discover` command helps you interactively find and install core contracts for your project. Core contracts are standard smart contracts maintained by the Flow Foundation and are commonly used across the Flow ecosystem (learn more about core contracts [here](../../cadence/core-contracts/index.md)). +The `discover` command helps you interactively find and install core contracts for your project. Core contracts are standard smart contracts maintained by the Flow Foundation and are commonly used across the Flow ecosystem (learn more about core contracts [here]). To use the `discover` command, run: @@ -131,7 +131,7 @@ After selecting the contracts, press `enter` to confirm. The selected contracts ## `list` -The `list` command displays all the dependencies currently installed in your project. This is useful for reviewing what contracts your project depends on and their sources. +The `list` command displays all the dependencies currently installed in your project. This is useful to review what contracts your project depends on and their sources. To list your installed dependencies, run: @@ -139,4 +139,10 @@ To list your installed dependencies, run: flow dependencies list ``` -This command will show you all the dependencies from your `flow.json` file along with their source information, helping you keep track of what external contracts your project is using. +This command will show you all the dependencies from your `flow.json` file along with their source information, which helps you keep track of what external contracts your project uses. + + + +[Contract Browser]: https://contractbrowser.com/ +[DeFiActions]: https://github.com/onflow/FlowActions/tree/main?tab=readme-ov-file#deployments +[here]: ../../cadence/core-contracts/index.md \ No newline at end of file diff --git a/docs/build/tools/flow-cli/flix.md b/docs/build/tools/flow-cli/flix.md index 217f834716..65db5f06b8 100644 --- a/docs/build/tools/flow-cli/flix.md +++ b/docs/build/tools/flow-cli/flix.md @@ -5,11 +5,11 @@ description: Flow Interaction Templates (FLIX) via the CLI sidebar_position: 15 --- -FLIX helps developers reuse existing Cadence transactions and scripts to easily integrate with existing Cadence smart contracts. Get more information about [Flow Interaction Templates](../../cadence/advanced-concepts/flix.md) +FLIX helps developers reuse current Cadence transactions and scripts to easily integrate with current Cadence smart contracts. Get more information about [Flow Interaction Templates] (FLIX). ## Introduction -The Flow CLI provides a `flix` command with a few sub commands `execute` and `package`. Get familiar with Flow Interaction Templates [(FLIX)](https://github.com/onflow/flips/blob/main/application/20220503-interaction-templates.md). FLIX are a standard for distributing Cadence scripts and transactions, and metadata in a way that is consumable by tooling and wallets. FLIX can be audited for correctness and safety by auditors in the ecosystem. +The Flow CLI provides a `flix` command with a few sub commands `execute` and `package`. [(FLIX)] are a standard for Cadence scripts and transaction distribution, and metadata in a way that is consumable by tooling and wallets. Auditors in the ecosystem can audit FLIX for correctness and safety. ```shell >flow flix @@ -28,7 +28,7 @@ Available Commands: ### Execute -The Flow CLI provides a `flix` command to `execute` FLIX. The Cadence being execute in the FLIX can be a transaction or script. +The Flow CLI provides a `flix` command to `execute` FLIX. The Cadence that's executed in the FLIX can be a transaction or script. ```shell flow flix execute [ ...] [flags] @@ -36,13 +36,13 @@ flow flix execute [ ...] [flags] :::warning -A FLIX template might only support testnet and/or mainnet. Generally, emulator is not supported. This can be the case if the FLIX template relies on contract dependencies. +A FLIX template might only support testnet or mainnet. Generally, emulator is not supported. This can be the case if the FLIX template relies on contract dependencies. ::: Queries can be a FLIX `id`, `name`, `url` or `path` to a local FLIX file. -### Execute Usage +### Execute use ```shell # Execute a FLIX transaction by name on Testnet @@ -59,11 +59,11 @@ flow flix execute bd10ab0bf472e6b58ecc0398e9b3d1bd58a4205f14a7099c52c0640d958929 flow flix execute ./multiply.template.json 2 3 --network testnet ``` -The Flow CLI provides a `flix` command to `package` up generated plain and simple JavaScript. This JavaScript uses FCL (Flow Client Library) to call the cadence the Flow Interaction Templates (FLIX) is based on. +The Flow CLI provides a `flix` command to `package` up generated plain and simple JavaScript. This JavaScript uses FCL (Flow Client Library) to call the cadence the FLIX is based on. :::info -Currently, `flix package` command only supports generating FCL (Flow Client Library) specific JavaScript and TypeScirpt, there are plans to support other languages like golang. +Currently, `flix package` command only supports generating FCL-specific JavaScript and TypeScirpt. There are plans to support other languages like golang. ::: @@ -76,22 +76,22 @@ flow flix package [flags] Generate FLIX json file. This command will take in a Cadence file and produce a FLIX json file. There are two ways to provide metadata to populate the FLIX json structure. - Use `--pre-fill` flag to pass in a pre populated FLIX json structure -- Use `--exclude-networks` flag to specify excluded networks when generating a FLIX templates. Example, `--exclude-networks testnet,mainnet` +- Use `--exclude-networks` flag to specify excluded networks when you generate a FLIX template. For example, `--exclude-networks testnet,mainnet` :::warning -When generating a FLIX template, make sure all contract dependencies have been deployed to the supported networks. Add any aliases to your flow.json that will be needed to populate dependencies. Verify all dependencies have been populated after generating. +When you generate a FLIX template, make sure all contract dependencies have been deployed to the supported networks. Add any aliases to your flow.json that you need to populate dependencies. Verify all dependencies were populated after you generate the FLIX template. ::: -### Generate Usage +### Generate use ```shell # Generate FLIX json file using cadence transaction or script, this example is not using a prefilled json file so will not have associated message metadata flow flix generate cadence/transactions/update-helloworld.cdc --save cadence/templates/update-helloworld.template.json ``` -Example of Cadence simple, no metadata associated +Example of Cadence simple, no metadata associated: ```cadence @@ -101,9 +101,11 @@ access(all) fun main(): String { } ``` -### Cadence Doc Pragma: +### Cadence doc pragma: -It's recommended to use pragma to set the metadata for the script or transaction. More information on [Cadence Doc Pragma FLIP](https://github.com/onflow/flips/blob/main/application/20230406-interaction-template-cadence-doc.md) +It's recommended to use pragma to set the metadata for the script or transaction. + +View more information about [Cadence Doc Pragma FLIP]. A pragma is short for "pragmatic information", it's special instructions to convey information to a processor in this case the utility that generates FLIX. @@ -131,10 +133,12 @@ transaction(greeting: String) { ``` :::info -Cadence v0.42.7 supports additional Cadence pragma functionality that FlIX utility can use to generate FLIX. It will support parameters "title" and "description". + +Cadence v0.42.7 supports additional Cadence pragma functionality that FlIX utility can use to generate FLIX. It will support parameters "title" and "description" + ::: -The resulting json metadata is extracted from Cadence Doc Pragma +The json metadata that results is extracted from Cadence Doc Pragma. ```json { @@ -178,13 +182,13 @@ The resulting json metadata is extracted from Cadence Doc Pragma } ``` -Example of using a prefilled FLIX json file. No need to use Cadence pragma when using a prefilled FLIX json file. This method separates FLIX specific information from the transaction or script Cadence. Use the `flow flix generate` command: +Example of when you use a prefilled FLIX json file. No need to use Cadence pragma when you use a prefilled FLIX json file. This method separates FLIX specific information from the transaction or script Cadence. Use the `flow flix generate` command: ```shell flow flix generate cadence/scripts/read-helloworld.cdc --pre-fill cadence/templates/read-helloworld.prefill.json --save cadence/templates/read-helloworld.template.json ``` -Using a pre-filled FLIX template, the cadence can be simple but no metadata accompanies it. +With a pre-filled FLIX template, the cadence can be simple but no metadata accompanies it. ```cadence import "HelloWorld" @@ -227,7 +231,7 @@ Example of json prefill file with message metadata: } ``` -The resulting FLIX json file after generation: +The FLIX json file that results after generation: ```json { @@ -296,15 +300,15 @@ The resulting FLIX json file after generation: ### Package -Queries can be a FLIX `url` or `path` to a local FLIX file. This command leverages [FCL](../clients/fcl-js/) which will execute FLIX cadence code. Package files can be generated in JavaScript or TypeScript. +Queries can be a FLIX `url` or `path` to a local FLIX file. This command leverages [FCL] which will execute FLIX cadence code. Package files can be generated in JavaScript or TypeScript. :::warning -Currently package doesn't support `id`, `name` flix query. +Currently, package doesn't support `id`, `name` flix query. ::: -### Package Usage +### Package use ```shell # Generate packaged code that leverages FCL to call the Cadence transaction code, `--save` flag will save the output to a specific file @@ -326,7 +330,7 @@ flow flix package ./multiply.template.json --save ./multiply.js flow flix package ./multiply.template.json --lang ts --save ./multiply.ts ``` -### Example Package Output +### Example package output ```shell flow flix package https://flix.flow.com/v1/templates\?name\=transfer-flow @@ -406,19 +410,18 @@ Notice that fcl v1.9.0 is needed to use FLIX v1.1 templates ## Resources -To find out more about FLIX, see the [read the FLIP](https://github.com/onflow/flips/blob/main/application/20220503-interaction-templates.md). +To find out more about FLIX, see the [read the FLIP]. -For a list of all templates, check out the [FLIX template repository](https://github.com/onflow/flow-interaction-template-service/tree/master/templates). +For a list of all templates, check out the [FLIX template repository]. -To generate a FLIX, see the [FLIX CLI readme](https://github.com/onflow/flow-interaction-template-tools/tree/master/cli). +To generate a FLIX, see the [FLIX CLI readme]. ## Arguments - Name: `argument` -- Valid input: valid [FLIX](https://github.com/onflow/flips/blob/main/application/20220503-interaction-templates.md) +- Valid input: valid [FLIX] -Input argument value matching corresponding types in the source code and passed in the same order. -You can pass a `nil` value to optional arguments by executing the flow FLIX execute script like this: `flow flix execute template.json nil`. +Input argument value that match types which correspond in the source code and passed in the same order. To pass a `nil` value to optional arguments, you can execute the flow FLIX execute script like this: `flow flix execute template.json nil`. ## Flags @@ -428,14 +431,12 @@ You can pass a `nil` value to optional arguments by executing the flow FLIX exec - Valid inputs: arguments in JSON-Cadence form. - Example: `flow flix execute template.script.json '[{"type": "String", "value": "Hello World"}]'` -Arguments passed to the Cadence script in the Cadence JSON format. -Cadence JSON format contains `type` and `value` keys and is -[documented here](https://cadencelang.dev/docs/1.0/json-cadence-spec). +Arguments passed to the Cadence script in the Cadence JSON format. Cadence JSON format contains `type` and `value` keys and is [documented here]. ## Pre Fill - Flag: `--pre-fill` -- Valid inputs: a json file in the FLIX json structure [FLIX json format](https://github.com/onflow/flips/blob/main/application/20220503-interaction-templates.md) +- Valid inputs: a json file in the FLIX json structure [FLIX json format] ## Block Height @@ -459,23 +460,23 @@ Specify the name of the account that will be used to sign the transaction. - Flag: `--proposer` - Valid inputs: the name of an account defined in the configuration (`flow.json`) -Specify the name of the account that will be used as proposer in the transaction. +Specify the name of the account that will be used as the proposer in the transaction. ### Payer - Flag: `--payer` - Valid inputs: the name of an account defined in the configuration (`flow.json`) -Specify the name of the account that will be used as payer in the transaction. +Specify the name of the account that will be used as the payer in the transaction. ### Authorizer - Flag: `--authorizer` - Valid inputs: the name of a single or multiple comma-separated accounts defined in the configuration (`flow.json`) -Specify the name of the account(s) that will be used as authorizer(s) in the transaction. If you want to provide multiple authorizers separate them using commas (e.g. `alice,bob`) +Specify the name of the account(s) that will be used as authorizer(s) in the transaction. If you want to provide multiple authorizers, use commas to separate them (for example, `alice,bob`) -### Compute Limit +### Compute limit - Flag: `--compute-limit` - Valid inputs: an integer greater than zero. @@ -489,17 +490,14 @@ Specify the compute unit (gas) limit for this transaction. - Valid inputs: an IP address or hostname. - Default: `127.0.0.1:3569` (Flow Emulator) -Specify the hostname of the Access API that will be -used to execute the command. This flag overrides -any host defined by the `--network` flag. +Specify the hostname of the Access API that will be used to execute the command. This flag overrides any host defined by the `--network` flag. -### Network Key +### Network key - Flag: `--network-key` - Valid inputs: A valid network public key of the host in hex string format -Specify the network public key of the Access API that will be -used to create a secure GRPC client when executing the command. +Specify the network public key of the Access API that will be used to create a secure GRPC client when you execute the command. ### Network @@ -532,7 +530,7 @@ Specify the format of the command results. - Short Flag: `-s` - Valid inputs: a path in the current filesystem. -Specify the filename where you want the result to be saved +Specify the filename where you want to save the result. ### Log @@ -550,9 +548,7 @@ Specify the log level. Control how much output you want to see during command ex - Valid inputs: a path in the current filesystem. - Default: `flow.json` -Specify the path to the `flow.json` configuration file. -You can use the `-f` flag multiple times to merge -several configuration files. +Specify the path to the `flow.json` configuration file. You can use the `-f` flag multiple times to merge several configuration files. ### Version Check @@ -560,3 +556,16 @@ several configuration files. - Default: `false` Skip version check during start up to speed up process for slow connections. + + + +[Flow Interaction Templates]: ../../cadence/advanced-concepts/flix.md +[(FLIX)]: https://github.com/onflow/flips/blob/main/application/20220503-interaction-templates.md +[Cadence Doc Pragma FLIP]: https://github.com/onflow/flips/blob/main/application/20230406-interaction-template-cadence-doc.md +[FCL]: ../clients/fcl-js/ +[read the FLIP]: https://github.com/onflow/flips/blob/main/application/20220503-interaction-templates.md +[FLIX template repository]: https://github.com/onflow/flow-interaction-template-service/tree/master/templates +[FLIX CLI readme]: https://github.com/onflow/flow-interaction-template-tools/tree/master/cli +[FLIX]: https://github.com/onflow/flips/blob/main/application/20220503-interaction-templates.md +[documented here]: https://cadencelang.dev/docs/1.0/json-cadence-spec +[FLIX json format]: https://github.com/onflow/flips/blob/main/application/20220503-interaction-templates.md \ No newline at end of file diff --git a/docs/build/tools/flow-cli/generate.md b/docs/build/tools/flow-cli/generate.md index 8c1f57b75a..0d3e57f3e3 100644 --- a/docs/build/tools/flow-cli/generate.md +++ b/docs/build/tools/flow-cli/generate.md @@ -5,7 +5,7 @@ description: Generate template files for common Cadence code using the Flow CLI sidebar_position: 12 --- -The `flow generate` command provides a convenient way to create boilerplate template files for common Cadence code components. This command streamlines the development process by automatically generating properly structured files with the correct syntax and organization. +The `flow generate` command provides a convenient way to create boilerplate template files for common Cadence code components. TO streamline the development process, this command automatically generates properly structured files with the correct syntax and organization. ## Overview @@ -15,14 +15,14 @@ flow generate [command] **Aliases:** `generate`, `g` -The generate command supports four main subcommands for creating different types of Cadence files: +The generate command supports four main subcommands to create different types of Cadence files: -- **contract** - Generate Cadence smart contract templates -- **script** - Generate Cadence script templates -- **test** - Generate Cadence test templates -- **transaction** - Generate Cadence transaction templates +- **contract** - Generate Cadence smart contract templates. +- **script** - Generate Cadence script templates. +- **test** - Generate Cadence test templates. +- **transaction** - Generate Cadence transaction templates. -## Generate Contract +## Generate contract Creates a new Cadence smart contract with a basic template structure. @@ -47,20 +47,22 @@ access(all) contract HelloWorld { ``` :::info -When generating a contract, a corresponding test file will also be created automatically (unless `--skip-tests` is used). For example, generating `HelloWorld` contract will also create `cadence/tests/HelloWorld.test.cdc`. + +When you generate a contract, a test file that corresponds to that contracts is also created automatically (unless `--skip-tests` is used). For example, when you generate `HelloWorld`, the contract will also create `cadence/tests/HelloWorld.test.cdc`. + ::: ### Flags -- `--dir string` - Directory to generate files in (defaults to `cadence/contracts/`) -- `--skip-tests` - Skip generating test files -- `-h, --help` - Help for contract command +- `--dir string` - Directory to generate files in (defaults to `cadence/contracts/`). +- `--skip-tests` - Skip test file generation. +- `-h, --help` - Help for contract command. -## Generate Transaction +## Generate transaction Creates a new Cadence transaction with a basic template structure. -### Usage +### Use ```bash flow generate transaction [flags] @@ -84,15 +86,15 @@ transaction() { ### Flags -- `--dir string` - Directory to generate files in (defaults to `cadence/transactions/`) -- `--skip-tests` - Skip generating test files -- `-h, --help` - Help for transaction command +- `--dir string` - Directory to generate files in (defaults to `cadence/transactions/`). +- `--skip-tests` - Skip test file generation. +- `-h, --help` - Help for transaction command. -## Generate Script +## Generate script Creates a new Cadence script with a basic template structure. -### Usage +### Use ```bash flow generate script [flags] @@ -112,15 +114,15 @@ access(all) fun main() {} ### Flags -- `--dir string` - Directory to generate files in (defaults to `cadence/scripts/`) -- `--skip-tests` - Skip generating test files -- `-h, --help` - Help for script command +- `--dir string` - Directory to generate files in (defaults to `cadence/scripts/`). +- `--skip-tests` - Skip test file generation. +- `-h, --help` - Help for script command. -## Generate Test +## Generate test Creates a new Cadence test file with a basic template structure. -### Usage +### Use ```bash flow generate test [flags] @@ -134,15 +136,15 @@ flow generate test MyToken This command creates a file `cadence/tests/MyToken.test.cdc` with a basic test structure. -After generating a test, you can run it using `flow test`. For more information about writing and running Cadence tests, see the [Cadence Tests documentation](./tests.md). +After you generate a test, you can run it using `flow test`. For more information about how to write and run Cadence tests, see the [Cadence Tests documentation]. ### Flags -- `--dir string` - Directory to generate files in (defaults to `cadence/tests/`) -- `--skip-tests` - Skip generating test files -- `-h, --help` - Help for test command +- `--dir string` - Directory to generate files in (defaults to `cadence/tests/`). +- `--skip-tests` - Skip test file generation. +- `-h, --help` - Help for test command. -## Custom Directory Usage +## Custom directory use All generate commands support the `--dir` flag to specify a custom directory for the generated files. This is useful when your project requires a different organizational structure than the default. @@ -162,9 +164,9 @@ flow generate script GetData --dir=src/scripts flow generate test MyToken --dir=src/tests ``` -## Project Structure +## Project structure -When using the default directories, the generate command creates the following structure: +When you use the default directories, the generate command creates the following structure: ``` cadence/ @@ -178,4 +180,8 @@ cadence/ └── MyToken.test.cdc ``` -The generate command is an essential tool for accelerating Flow development by providing standardized, well-structured boilerplate code for all common Cadence components. +The generate command is an essential tool to accelerate Flow development with standardized, well-structured boilerplate code for all common Cadence components. + + + +[Cadence Tests documentation]: ./tests.md \ No newline at end of file diff --git a/docs/build/tools/flow-cli/index.md b/docs/build/tools/flow-cli/index.md index e8c0fd8d05..5f9e49e7bf 100644 --- a/docs/build/tools/flow-cli/index.md +++ b/docs/build/tools/flow-cli/index.md @@ -4,30 +4,30 @@ sidebar_label: Flow CLI sidebar_position: 3 --- -The **Flow Command Line Interface (CLI)** is a powerful tool that enables developers to seamlessly interact with the Flow blockchain across various environments, including testnet, mainnet, and local development using the Flow Emulator. Designed for ease of use, the Flow CLI simplifies common blockchain tasks such as managing accounts and contract dependencies, sending transactions, querying chain state, deploying smart contracts, and much more. +The **Flow Command Line Interface (CLI)** is a powerful tool that allows developers to seamlessly interact with the Flow blockchain across various environments, such as testnet, mainnet, and local development with the Flow Emulator. Designed for ease of use, the Flow CLI simplifies common blockchain tasks such as account and contract dependency management, sending transactions, querying chain state, smart contract deployment, and much more. With Flow CLI, developers can: - **Initialize Projects**: Quickly set up new Flow projects using the `flow init` command, which creates the necessary files and directories, sets up your project configuration, and installs any core contract dependencies. -- **Manage Contract Dependencies**: Use the [Dependency Manager](dependency-manager.md) to install and manage smart contract dependencies effortlessly, simplifying the integration of external contracts into your project. +- **Manage Contract Dependencies**: Use the [Dependency Manager] to install and manage smart contract dependencies effortlessly, which simplifies the integration of external contracts into your project. - **Manage Accounts**: Create and manage Flow accounts, configure keys, and handle account-related operations. -- **Send Transactions**: Build, sign, and submit transactions to the Flow network, allowing for contract interaction and fund transfers. -- **Query Chain State**: Retrieve data from the Flow blockchain, including account balances, event logs, and the status of specific transactions. +- **Send Transactions**: Build, sign, and submit transactions to the Flow network, which allows for contract interaction and fund transfers. +- **Query Chain State**: Retrieve data from the Flow blockchain, such as account balances, event logs, and the status of specific transactions. - **Deploy Smart Contracts**: Easily deploy and update Cadence smart contracts on any Flow environment (emulator, testnet, or mainnet). -- **Use the Emulator:** Set up a local Flow blockchain instance with the Flow emulator to test and debug smart contracts in a development environment before deploying them on the network. -- **Interact with the [Flow Access API](/http-api)**: Automate complex workflows using configuration files and command-line scripting, which allows for greater flexibility in continuous integration (CI) or custom development tools. -- **Access Flow’s Tooling Ecosystem**: Integrate Flow CLI with other developer tools like the [Cadence Extension for VSCode](https://marketplace.visualstudio.com/items?itemName=onflow.cadence) to enhance your development experience. +- **Use the Emulator:** Set up a local Flow blockchain instance with the Flow emulator to test and debug smart contracts in a development environment before you deploy them on the network. +- **Interact with the [Flow Access API]**: Automate complex workflows with configuration files and command-line scripting, which allows for greater flexibility in continuous integration (CI) or custom development tools. +- **Access Flow’s Tooling Ecosystem**: Integrate Flow CLI with other developer tools like the [Cadence Extension for VSCode] to enhance your development experience. -The Flow CLI is essential for developers looking to build, test, and maintain decentralized applications on the Flow blockchain efficiently, offering a feature-rich, user-friendly interface for both beginners and experienced blockchain developers. +The Flow CLI is essential for developers who want to build, test, and maintain decentralized applications on the Flow blockchain efficiently. It offers a feature-rich, user-friendly interface for both beginners and experienced blockchain developers. ## Installation -Follow [these steps](../flow-cli/install.md) to install the Flow CLI on +Follow [these steps] to install the Flow CLI on macOS, Linux, and Windows. -## Create Your First Project +## Create your first project -Get started by running: +To get started, run: ```zsh flow init @@ -35,4 +35,12 @@ flow init The `flow init` command gets you up and running with a new project setup in one command. Choose from scaffolds for scheduled transactions, DeFi actions, stablecoins, and more, or start with a basic Cadence project. -To learn more about Flow CLI commands and how to use them, please refer to the [Commands documentation](./commands.md). +To learn more about Flow CLI commands and how to use them, see the [Commands documentation]. + + + +[Dependency Manager]: dependency-manager.md +[Flow Access API]: /http-api +[Cadence Extension for VSCode]: https://marketplace.visualstudio.com/items?itemName=onflow.cadence +[these steps]: ../flow-cli/install.md +[Commands documentation]: ./commands.md \ No newline at end of file diff --git a/docs/build/tools/flow-cli/install.md b/docs/build/tools/flow-cli/install.md index 86882b9d5e..ebad86cda4 100644 --- a/docs/build/tools/flow-cli/install.md +++ b/docs/build/tools/flow-cli/install.md @@ -4,7 +4,7 @@ description: How to install the Flow command-line interface (CLI) sidebar_position: 1 --- -The Flow CLI can be installed on macOS, Windows (7 or greater) and most Linux systems. +You can install the Flow CLI on macOS, Windows (7 or greater) and most Linux systems. ## macOS @@ -54,9 +54,9 @@ sudo sh -ci "$(curl -fsSL https://raw.githubusercontent.com/onflow/flow-cli/mast ### From a pre-built binary -_This installation method only works on Windows 10, 8.1, or 7 (SP1, with [PowerShell 3.0](https://www.microsoft.com/en-ca/download/details.aspx?id=34595)), on x86-64._ +_This installation method only works on Windows 10, 8.1, or 7 (SP1, with [PowerShell 3.0]), on x86-64._ -1. Open PowerShell ([Instructions](https://docs.microsoft.com/en-us/powershell/scripting/install/installing-windows-powershell?view=powershell-7#finding-powershell-in-windows-10-81-80-and-7)) +1. Open PowerShell ([Instructions]) 2. In PowerShell, run: ```powershell @@ -101,29 +101,37 @@ sudo sh -ci "$(curl -fsSL https://raw.githubusercontent.com/onflow/flow-cli/mast ### From a pre-built binary -_This update method only works on Windows 10, 8.1, or 7 (SP1, with [PowerShell 3.0](https://www.microsoft.com/en-ca/download/details.aspx?id=34595)), on x86-64._ +_This update method only works on Windows 10, 8.1, or 7 (SP1, with [PowerShell 3.0]), on x86-64._ -1. Open PowerShell ([Instructions](https://docs.microsoft.com/en-us/powershell/scripting/install/installing-windows-powershell?view=powershell-7#finding-powershell-in-windows-10-81-80-and-7)) +1. Open PowerShell ([Instructions]) 2. In PowerShell, run: ```powershell iex "& { $(irm 'https://raw.githubusercontent.com/onflow/flow-cli/master/install.ps1') }" ``` -## Uninstalling Flow CLI +## Uninstall Flow CLI -To remove the flow CLI you can run the following command if it was previously installed using a pre-built binary. +To remove the flow CLI, you can run the following command if it was previously installed from a pre-built binary. - macOS: `rm /usr/local/bin/flow` - Linux: `rm ~/.local/bin/flow` - Windows: `rm ~/Users/{user}/AppData/Flow/flow.exe` -If you installed it using Hombrew you can remove it using: `brew uninstall flow-cli`. +If you installed it with Hombrew, you can remove it with: `brew uninstall flow-cli`. -## Next Steps +## Next steps Now that you have the Flow CLI installed, you can: -- **[Get started with Flow CLI commands](./commands.md)** - Learn the essential commands for project development -- **[Initialize a new project](./flow.json/initialize-configuration.md)** - Create your first Flow project -- **[Configure your project](./flow.json/configuration.md)** - Set up your `flow.json` configuration file +- **[Get started with Flow CLI commands]** - Learn the essential commands for project development. +- **[Initialize a new project]** - Create your first Flow project. +- **[Configure your project]** - Set up your `flow.json` configuration file. + + + +[PowerShell 3.0]: https://www.microsoft.com/en-ca/download/details.aspx?id=34595 +[Instructions]: https://docs.microsoft.com/en-us/powershell/scripting/install/installing-windows-powershell?view=powershell-7#finding-powershell-in-windows-10-81-80-and-7 +[Get started with Flow CLI commands]: ./commands.md +[Initialize a new project]: ./flow.json/initialize-configuration.md +[Configure your project]: ./flow.json/configuration.md diff --git a/docs/build/tools/flow-cli/lint.md b/docs/build/tools/flow-cli/lint.md index 1f86bfb83c..8acc70205c 100644 --- a/docs/build/tools/flow-cli/lint.md +++ b/docs/build/tools/flow-cli/lint.md @@ -4,7 +4,7 @@ description: A static-analysis tool for finding potential issues in Cadence code sidebar_position: 14 --- -The Cadence Linter is a static-analysis tool for finding potential issues in Cadence code. It is available in the Flow CLI & is designed to help developers write better code by identifying common mistakes and potential issues before they become problems. +The Cadence Linter is a static-analysis tool you can use to find potential issues in Cadence code. It is available in the Flow CLI and is designed to help developers write better code by identifying common mistakes and potential issues before they become problems. The linter will also check your code for any syntax or semantic errors, and provide suggestions for how to fix them. @@ -12,13 +12,13 @@ The linter will also check your code for any syntax or semantic errors, and prov flow cadence lint [files] ``` -## Example Usage +## Example use ```shell flow cadence lint **/*.cdc ``` -## Example Output +## Example output ```shell test.cdc:27:6: semantic-error: cannot find variable in this scope: `abc` @@ -29,5 +29,11 @@ test.cdc:35:6: removal-hint: unnecessary force operator ``` :::info -The Cadence Linter is also available in the [Cadence VSCode extension](../vscode-extension/index.md), which provides real-time feedback as you write your code. -::: \ No newline at end of file + +The Cadence Linter is also available in the [Cadence VSCode extension], which provides real-time feedback as you write your code. + +::: + + + +[Cadence VSCode extension]: ../vscode-extension/index.md \ No newline at end of file diff --git a/docs/build/tools/flow-cli/scheduled-transactions.md b/docs/build/tools/flow-cli/scheduled-transactions.md index 7b0e4e7330..860b813258 100644 --- a/docs/build/tools/flow-cli/scheduled-transactions.md +++ b/docs/build/tools/flow-cli/scheduled-transactions.md @@ -8,33 +8,33 @@ The Flow CLI provides commands to manage scheduled transactions. These commands ## What are Scheduled Transactions? -Scheduled transactions enable smart contracts to schedule autonomous execution in the future without external triggers. This allows for use cases like recurring payments, automated arbitrage, and time-based contract logic. +Scheduled transactions allow smart contracts to schedule autonomous execution in the future without external triggers. This allows for use cases like recurring payments, automated arbitrage, and time-based contract logic. The scheduled transactions system uses priorities (High, Medium, Low) with different execution guarantees and fee multipliers to ensure predictable performance while enabling novel autonomous blockchain patterns. -πŸ“– **[Learn more about scheduled transactions](../../../blockchain-development-tutorials/forte/scheduled-transactions/scheduled-transactions-introduction.md)** +πŸ“– **[Learn more about scheduled transactions]** ## Prerequisites -Before using the scheduled transactions commands, you must initialize a Manager resource in your account storage. The Manager resource is provided by the **FlowTransactionSchedulerUtils** core contract and provides a convenient way to group, schedule, cancel, and query scheduled transactions through a single resource. +Before you use the scheduled transactions commands, you must initialize a Manager resource in your account storage. The Manager resource is provided by the **FlowTransactionSchedulerUtils** core contract and provides a convenient way to group, schedule, cancel, and query scheduled transactions through a single resource. -## Why Use the Manager? +## Why use the Manager? While it's possible to schedule transactions directly, **using the Manager resource is essential for proper tooling integration**. The Manager provides a standardized interface that allows CLI commands, block explorers, and other developer tools to discover and interact with your scheduled transactions. **Key benefits of using the Manager:** -- **Tooling Integration**: CLI commands and other tools can automatically discover and manage your scheduled transactions -- **Centralized Management**: All your scheduled transactions are organized in one place for easy tracking -- **Enhanced Querying**: Query transactions by handler type, timestamp, or status through standardized interfaces -- **Metadata Access**: Tools can resolve handler views and metadata to provide richer information about your scheduled transactions +- **Tooling Integration**: CLI commands and other tools can automatically discover and manage your scheduled transactions. +- **Centralized Management**: All your scheduled transactions are organized in one place for easy tracking. +- **Enhanced Querying**: Query transactions by handler type, timestamp, or status through standardized interfaces. +- **Metadata Access**: Tools can resolve handler views and metadata to provide richer information about your scheduled transactions. Without the Manager, your scheduled transactions exist but cannot be easily discovered or managed through tooling, requiring manual tracking and interaction. ## Commands -### Setup Manager Resource +### Setup Manager resource -Initialize a Manager resource in your account storage to start managing scheduled transactions. +Initialize a Manager resource in your account storage to manage scheduled transactions. ```shell flow schedule setup @@ -42,7 +42,7 @@ flow schedule setup This command creates and stores a Manager resource at the standard storage path, allowing you to manage scheduled transactions for your account. -#### Example Usage +#### Example use ```shell flow schedule setup --network testnet --signer my-account @@ -57,7 +57,7 @@ flow schedule setup --network testnet --signer my-account --- -### List Scheduled Transactions +### List scheduled transactions List all scheduled transactions for a given account that has a Manager resource. @@ -73,7 +73,7 @@ flow schedule list The account address or name that has scheduled transactions to list. -#### Example Usage +#### Example use ```shell flow schedule list 0x01cf0e2f2f715450 --network testnet @@ -90,7 +90,7 @@ flow schedule list 0x01cf0e2f2f715450 --network testnet --- -### Get Transaction Details +### Get transaction details Get detailed information about a specific scheduled transaction by its ID. @@ -106,7 +106,7 @@ flow schedule get The unique identifier of the scheduled transaction to retrieve. -#### Example Usage +#### Example use ```shell flow schedule get 123 --network testnet @@ -123,7 +123,7 @@ flow schedule get 123 --network testnet --- -### Cancel Scheduled Transaction +### Cancel scheduled transaction Cancel a scheduled transaction and receive a partial fee refund. @@ -141,7 +141,7 @@ When you cancel a scheduled transaction, a portion of the fees paid will be refu The unique identifier of the scheduled transaction to cancel. -#### Example Usage +#### Example use ```shell flow schedule cancel 123 --network testnet --signer my-account @@ -157,7 +157,7 @@ flow schedule cancel 123 --network testnet --signer my-account --- -## Common Flags +## Common flags These flags are available across all scheduled transactions commands: @@ -178,7 +178,7 @@ Specify which network you want the command to use for execution. Specify the hostname of the Access API that will be used to execute the commands. This flag overrides any host defined by the `--network` flag. -### Network Key +### Network key - Flag: `--network-key` - Valid inputs: A valid network public key of the host in hex string format @@ -227,9 +227,13 @@ Specify the filename where you want the result to be saved. Specify the log level. Control how much output you want to see during command execution. -### Version Check +### Version check - Flag: `--skip-version-check` - Default: `false` Skip version check during start up to speed up process for slow connections. + + + +[Learn more about scheduled transactions]: ../../../blockchain-development-tutorials/forte/scheduled-transactions/scheduled-transactions-introduction.md \ No newline at end of file diff --git a/docs/build/tools/flow-cli/tests.md b/docs/build/tools/flow-cli/tests.md index 25ca681b8a..1df656a4ba 100644 --- a/docs/build/tools/flow-cli/tests.md +++ b/docs/build/tools/flow-cli/tests.md @@ -28,7 +28,7 @@ keywords: - spork boundaries --- -The Flow CLI provides a straightforward command to execute Cadence tests, enabling developers to validate their scripts and smart contracts effectively. +The Flow CLI provides a straightforward command to execute Cadence tests, which allows developers to validate their scripts and smart contracts effectively. To run all tests in your project, simply use: @@ -38,15 +38,19 @@ flow test The `flow test` command automatically discovers and runs all test scripts in your project that end with `_test.cdc`. -> **Note:** The `test` command requires a properly initialized configuration. If you haven’t set up your Flow project yet, refer to the [flow init](flow.json/initialize-configuration.md) guide for assistance. +:::info + +The `test` command requires a properly initialized configuration. If you haven’t set up your Flow project yet, refer to the [flow init] guide for assistance. + +::: ## Prerequisites -Before running your tests, ensure that your contracts are properly configured in your `flow.json` file, including any necessary testing aliases. +Before you run your tests, ensure that your contracts are properly configured in your `flow.json` file, particularly any necessary testing aliases. -### Setting Up Testing Aliases in Contracts +### Set up testing aliases in contracts -If your tests involve deploying or interacting with contracts, you need to add your contracts to the `contracts` section in the `flow.json` configuration file. Specifically, include the contract name, source location, and an address alias for the `testing` environment. +If your tests involve contract deployment or contract interaction, you need to add your contracts to the `contracts` section in the `flow.json` configuration file. Specifically, include the contract name, source location, and an address alias for the `testing` environment. Example `flow.json` configuration: @@ -85,11 +89,15 @@ For the `testing` alias, you can use one of the following addresses: - `0x000000000000000D` - `0x000000000000000E` -> **Note**: For more information on setting up contracts and aliases, refer to the [Flow CLI Configuration](flow.json/initialize-configuration.md) documentation. +:::info + +For more information on how to set up contracts and aliases, refer to the [Flow CLI Configuration] documentation. -## Example Usage +::: -Assuming you have a test script named `test_script_test.cdc` in your project directory, which verifies the functionality of a Cadence script executed in the testing environment: +## Example use + +This example assumes you have a test script named `test_script_test.cdc` in your project directory, which verifies the functionality of a Cadence script executed in the testing environment: ```cadence // test_script_test.cdc @@ -112,26 +120,26 @@ access(all) fun testSumOfTwo() { This script defines a single test case, `testSumOfTwo`, which checks if a Cadence script that adds two integers `(a + b)` works as expected. The test passes if the result matches the expected value of `5`. -You can run all tests in your project using the CLI: +You can run all tests in your project with the CLI: ```shell $ flow test ``` -The Flow CLI will discover all test scripts ending with `_test.cdc` and execute them. The results will be displayed in the terminal: +The Flow CLI will discover all test scripts that end with `_test.cdc` and execute them. The results will be displayed in the terminal: ```shell Test results: - PASS: test_script_test.cdc > testSumOfTwo ``` -To learn more about writing tests in Cadence, visit the [Cadence Testing Framework](../../cadence/smart-contracts/testing.md) documentation. +To learn more about how to write tests in Cadence, visit the [Cadence Testing Framework] documentation. --- -### Running Specific Tests and Files +### Run specific tests and files -Run specific test scripts or directories by providing their paths: +To run specific test scripts or directories, by provide their paths: ```shell flow test path/to/your/test_script_test.cdc path/to/another_test.cdc tests/subsuite/ @@ -143,14 +151,14 @@ This executes only the tests contained in the specified files and directories. ## Flags -The `flow test` command supports several flags that provide additional functionality for managing test execution and coverage reporting. +The `flow test` command supports several flags that provide additional functionality to manage test execution and coverage reports. -### **Coverage Report** +### **Coverage report** - **Flag:** `--cover` - **Default:** `false` -The `--cover` flag calculates the coverage of the code being tested, helping you identify untested parts of your scripts and contracts. +The `--cover` flag calculates the coverage of the code being tested, which helps you identify untested parts of your scripts and contracts. ```shell $ flow test --cover @@ -166,7 +174,7 @@ Coverage: 96.5% of statements --- -### Coverage Report Output File +### Coverage report output file - **Flag:** `--coverprofile` - **Valid Inputs:** A valid filename with extension `.json` or `.lcov` @@ -186,13 +194,13 @@ The generated coverage file can then be inspected: $ cat coverage.lcov ``` -### Coverage Code Type +### Coverage code type - **Flag:** `--covercode` - **Valid Inputs:** `"all"` (default) or `"contracts"` - **Default:** `"all"` -The `--covercode` flag lets you limit the coverage report to specific types of code. Setting the value to `"contracts"` excludes scripts and transactions from the coverage analysis. +The `--covercode` flag lets you limit the coverage report to specific types of code. Set the value to `"contracts"` to exclude scripts and transactions from the coverage analysis. ```shell $ flow test --cover --covercode="contracts" @@ -208,7 +216,7 @@ There are no statements to cover > **Note:** In this example, the coverage report is empty because the `--covercode` flag is set to `"contracts"`, and the test script only contains scripts, not contracts. -### Random Execution of Test Cases +### Random execution of test cases - **Flag:** `--random` - **Default:** `false` @@ -219,22 +227,26 @@ Use the `--random` flag to execute test cases in a random order. This can help i flow test --random ``` -### Seed for Random Execution +### Seed for random execution - **Flag:** `--seed` - **Default:** `0` -Use the `--seed` flag to specify a seed value for the random execution order of test cases. This allows you to reproduce a specific random order by using the same seed value, which is helpful for debugging flaky tests. +Use the `--seed` flag to specify a seed value for the random execution order of test cases. This allows you to reproduce a specific random order when you use the same seed value, which is helpful to debug flaky tests. ```shell flow test --seed=12345 ``` -> **Note:** If both `--random` and `--seed` are provided, the `--random` flag will be ignored, and the seed value from `--seed` will be used for randomization. +:::info + +If both `--random` and `--seed` are provided, the `--random` flag will be ignored, and the seed value from `--seed` will be used for randomization. + +::: --- -### Run Specific Test by Name +### Run specific test by name - **Flag:** `--name` - **Default:** `""` (empty string) @@ -247,15 +259,15 @@ flow test --name=testSumOfTwo This command will run only the test function named `testSumOfTwo` across all test scripts that contain it. -To dive deeper into testing the functionality of your Cadence scripts and contracts, explore the [Cadence Testing Framework](https://cadence-lang.org/docs/testing-framework) documentation. +To dive deeper into testing the functionality of your Cadence scripts and contracts, explore the [Cadence Testing Framework] documentation. --- -### Fork Testing Flags +### Fork testing flags -Run tests against forked mainnet or testnet state. For a step-by-step tutorial, see: [Fork Testing with Cadence](../../../blockchain-development-tutorials/cadence/fork-testing/index.md). For background and best practices, see the guide: [Testing Strategy on Flow](../../cadence/smart-contracts/testing-strategy.md). +Run tests against forked mainnet or testnet state. For a step-by-step tutorial, see: [Fork Testing with Cadence]. For background and best practices, see the guide: [Testing Strategy on Flow]. -#### Configuring Fork Tests +#### Configure fork tests **Recommended**: Use the `#test_fork` pragma in your test file: @@ -275,7 +287,7 @@ Then run with: flow test ``` -The pragma configures fork testing directly in your test files, making tests self-documenting. You can also use CLI flags (documented below) to override or configure fork tests without modifying test files. +The pragma configures fork testing directly in your test files, which makes the tests self-documenting. You can also use CLI flags (documented below) to override or configure fork tests and not modify test files. #### --fork @@ -292,8 +304,8 @@ flow test --fork mynet # Uses a custom network defined in flow.json Requirements: -- The network must exist in `flow.json` -- The network must have a valid `host` configured +- The network must exist in `flow.json`. +- The network must have a valid `host` configured. #### --fork-host @@ -306,7 +318,7 @@ Directly specify a GRPC access node host. This bypasses the `flow.json` network flow test --fork-host access.mainnet.nodes.onflow.org:9000 ``` -See public access node URLs in [Flow Networks](../../../protocol/flow-networks/index.md). +See public access node URLs in [Flow Networks]. #### --fork-height @@ -318,5 +330,19 @@ Pin the fork to a specific block height for historical state testing. Only block ```shell flow test --fork mainnet --fork-height 85432100 ``` +:::note + +Historical data beyond spork boundaries is not available via standard access nodes. See the [Network Upgrade (Spork) Process]. + +::: + + -> Note: Historical data beyond spork boundaries is not available via standard access nodes. See the [Network Upgrade (Spork) Process](../../../protocol/node-ops/node-operation/network-upgrade.md). +[flow init]: flow.json/initialize-configuration.md +[Flow Networks]: ../../../protocol/flow-networks/index.md +[Cadence Testing Framework]: ../../cadence/smart-contracts/testing.md +[Network Upgrade (Spork) Process]: ../../../protocol/node-ops/node-operation/network-upgrade.md +[Flow CLI Configuration]: flow.json/initialize-configuration.md +[Cadence Testing Framework]: https://cadence-lang.org/docs/testing-framework +[Fork Testing with Cadence]: ../../../blockchain-development-tutorials/cadence/fork-testing/index.md +[Testing Strategy on Flow]: ../../cadence/smart-contracts/testing-strategy.md \ No newline at end of file diff --git a/docs/build/tools/flow-cli/transactions/build-transactions.md b/docs/build/tools/flow-cli/transactions/build-transactions.md index a257b26376..b8267e77e0 100644 --- a/docs/build/tools/flow-cli/transactions/build-transactions.md +++ b/docs/build/tools/flow-cli/transactions/build-transactions.md @@ -4,11 +4,9 @@ description: How to build a Flow transaction from the command line sidebar_position: 3 --- -The Flow CLI provides a command to build a transactions with options to specify -authorizer accounts, payer account and proposer account. +The Flow CLI provides a command to build a transactions with options to specify authorizer accounts, payer account and proposer account. -The `build` command doesn't produce any signatures and instead -is designed to be used with the `sign` and `send-signed` commands. +The `build` command doesn't produce any signatures. Instead, use it with the `sign` and `send-signed` commands. Use this functionality in the following order: @@ -20,7 +18,7 @@ Use this functionality in the following order: flow transactions build [ ...] [flags] ``` -## Example Usage +## Example use ```shell > flow transactions build ./transaction.cdc "Meow" \ @@ -74,22 +72,21 @@ JSON arguments from a file example: ## Arguments -### Code Filename +### Code filename - Name: `filename` - Valid inputs: Any filename and path valid on the system. -The first argument is a path to a Cadence file containing the -transaction to be executed. +The first argument is a path to a Cadence file that contains the transaction to be executed. ### Arguments - Name: `argument` -- Valid inputs: valid [cadence values](https://cadencelang.dev/docs/1.0/json-cadence-spec) - matching argument type in transaction code. +- Valid inputs: valid [cadence values] that match argument type in transaction code. -Input arguments values matching corresponding types in the source code and passed in the same order. -For passing complex argument values see [send transaction](./send-transactions.md#example-usage) document. +Input arguments values that match the types that correspond in the source code and passed in the same order. + +To pass complex argument values, see the [send transaction] document. ## Flags @@ -99,8 +96,7 @@ For passing complex argument values see [send transaction](./send-transactions.m - Valid Inputs: Flow address or account name from configuration. - Default: service account -Specify account address that will be paying for the transaction. -Read more about payers [here](../../../cadence/basics/transactions.md). +Specify account address that will pay for the transaction. Read more about payers [here]. ### Proposer @@ -125,8 +121,7 @@ Specify key index for the proposer account. - Valid Inputs: Flow address or account name from configuration. - Default: service account -Additional authorizer addresses to add to the transaction. -Read more about authorizers [here](../../../cadence/basics/transactions.md). +Additional authorizer addresses to add to the transaction. Read more about authorizers [here]. ### Arguments JSON @@ -134,11 +129,10 @@ Read more about authorizers [here](../../../cadence/basics/transactions.md). - Valid inputs: arguments in JSON-Cadence form. - Example: `flow transactions build ./tx.cdc '[{"type": "String", "value": "Hello World"}]'` -Arguments passed to the Cadence transaction in Cadence JSON format. -Cadence JSON format contains `type` and `value` keys and is -[documented here](https://cadencelang.dev/docs/1.0/json-cadence-spec). +Arguments passed to the Cadence transaction in Cadence JSON format. Cadence JSON format contains `type` and `value` keys and is +[documented here]. -### Gas Limit +### Gas limit - Flag: `--compute-limit` - Valid inputs: an integer greater than zero. @@ -152,16 +146,14 @@ Specify the compute unit (gas) limit for this transaction. - Valid inputs: an IP address or hostname. - Default: `127.0.0.1:3569` (Flow Emulator) -Specify the hostname of the Access API that will be -used to execute the commands. +Specify the hostname of the Access API that will be used to execute the commands. -### Network Key +### Network key - Flag: `--network-key` - Valid inputs: A valid network public key of the host in hex string format -Specify the network public key of the Access API that will be -used to create a secure GRPC client when executing the command. +Specify the network public key of the Access API that will be used to create a secure GRPC client when you execute the command. ### Network @@ -172,7 +164,7 @@ used to create a secure GRPC client when executing the command. Specify which network you want the command to use for execution. -### Include Fields +### Include fields - Flag: `--include` - Valid inputs: `code`, `payload`, `signatures` @@ -218,12 +210,18 @@ Specify the log level. Control how much output you want to see while command exe - Short Flag: `-f` - Valid inputs: valid filename -Specify a filename for the configuration files, you can provide multiple configuration -files by using `-f` flag multiple times. +Specify a filename for the configuration files. To provide multiple configuration files, pass the `-f` flag multiple times. -### Version Check +### Version check - Flag: `--skip-version-check` - Default: `false` Skip version check during start up to speed up process for slow connections. + + + +[cadence values]: https://cadencelang.dev/docs/1.0/json-cadence-spec +[send transaction]: ./send-transactions.md#example-usage +[here]: ../../../cadence/basics/transactions.md +[documented here]: https://cadencelang.dev/docs/1.0/json-cadence-spec \ No newline at end of file diff --git a/docs/build/tools/flow-cli/transactions/complex-transactions.md b/docs/build/tools/flow-cli/transactions/complex-transactions.md index 755d90078d..d983c5fbb8 100644 --- a/docs/build/tools/flow-cli/transactions/complex-transactions.md +++ b/docs/build/tools/flow-cli/transactions/complex-transactions.md @@ -6,26 +6,23 @@ sidebar_position: 4 **Simple Transactions** -Sending a transaction using the Flow CLI can simply be -achieved by using the [send command documented here](./send-transactions.md). +To send a transaction with the Flow CLI use the [send command documented here]. **Complex Transactions** -If you would like to build more complex transactions the Flow CLI provides -commands to build, sign and send transactions allowing you to specify different -authorizers, signers and proposers. +If you would like to build more complex transactions the Flow CLI provides commands to build, sign and send transactions that allow you to specify different authorizers, signers and proposers. -The process of sending a complex transactions includes three steps: +To send a complex transactions includes three steps: -1. [build a transaction](./build-transactions.md) -2. [sign the built transaction](./sign-transaction.md) -3. [send signed transaction](./send-signed-transactions.md) +1. [build a transaction] +2. [sign the built transaction] +3. [send signed transaction] Read more about each command flags and arguments in the above links. ## Examples -We will describe common examples for complex transactions. All examples are using an [example configuration](./complex-transactions.md#configuration). +We will describe common examples for complex transactions. All examples use an [example configuration]. ### Single payer, proposer and authorizer @@ -65,7 +62,7 @@ transaction { ### Single payer and proposer, multiple authorizers -A transaction that declares same payer and proposer but multiple authorizers each required to sign the transaction. Please note that the order of signing is important, and [the payer must sign last](../../../cadence/basics/transactions.md#payer-signs-last). +A transaction that declares same payer and proposer but multiple authorizers each required to sign the transaction. The order of signing is important, and [the payer must sign last]. Build the transaction: @@ -114,8 +111,7 @@ transaction { ### Different payer, proposer and authorizer -A transaction that declares different payer, proposer and authorizer each signing separately. -Please note that the order of signing is important, and [the payer must sign last](../../../cadence/basics/transactions.md#payer-signs-last). +A transaction that declares different payer, proposer and authorizer each signing separately. The order of signing is important, and [the payer must sign last]. Build the transaction: @@ -208,7 +204,7 @@ transaction { ### Configuration -This is an example configuration using mock values: +This is an example configuration that uses mock values: ```json { @@ -238,3 +234,12 @@ This is an example configuration using mock values: ... } ``` + + + +[send command documented here]: ./send-transactions.md +[build a transaction]: ./build-transactions.md +[sign the built transaction]: ./sign-transaction.md +[send signed transaction]: ./send-signed-transactions.md +[example configuration]: ./complex-transactions.md#configuration +[the payer must sign last]: ../../../cadence/basics/transactions.md#payer-signs-last \ No newline at end of file diff --git a/docs/build/tools/flow-cli/transactions/decode-transactions.md b/docs/build/tools/flow-cli/transactions/decode-transactions.md index 87cd36b5f3..e0993a1d70 100644 --- a/docs/build/tools/flow-cli/transactions/decode-transactions.md +++ b/docs/build/tools/flow-cli/transactions/decode-transactions.md @@ -4,8 +4,7 @@ description: How to decode a Flow transaction from the command line sidebar_position: 7 --- -The Flow CLI provides a command to decode a transaction -from RLP in a file. It uses same transaction format as get command +The Flow CLI provides a command to decode a transaction from RLP in a file. It uses same transaction format as get command ```shell flow transactions decode @@ -42,11 +41,11 @@ Payload (hidden, use --include payload) - Name: `` - Valid Input: file name. -The first argument is the filename containing the transaction RLP. +The first argument is the filename that contains the transaction RLP. ## Flags -### Include Fields +### Include fields - Flag: `--include` - Valid inputs: `code`, `payload`, `signatures` @@ -69,7 +68,7 @@ Specify the format of the command results. Specify the filename where you want the result to be saved -### Version Check +### Version check - Flag: `--skip-version-check` - Default: `false` diff --git a/docs/build/tools/flow-cli/transactions/get-system-transactions.md b/docs/build/tools/flow-cli/transactions/get-system-transactions.md index 9e768a57c2..775f8c3a0d 100644 --- a/docs/build/tools/flow-cli/transactions/get-system-transactions.md +++ b/docs/build/tools/flow-cli/transactions/get-system-transactions.md @@ -30,12 +30,12 @@ Querying with a system transaction ID (`[tx_id]`) is part of the Forte network u :::: -## Use Cases +## Use cases - System chunk transaction for protocol operations: see [Epoch Scripts and Events] and [Staking rewards via system chunk]. - Transactions related to scheduled transactions: see [Introduction to Scheduled Transactions]. Consider `--include fee-events` for scheduled transaction fee details. -## Example Usage +## Example use ```shell > flow transactions get-system latest --network mainnet @@ -71,7 +71,7 @@ Select a specific system transaction within the block by ID: ## Arguments -### Block Reference +### Block reference - Name: `` - Valid Input: a block ID (hex), the keyword `latest`, or a block height (number). @@ -87,14 +87,14 @@ Optionally narrow the result to a specific system transaction within the referen ## Flags -### Include Fields +### Include fields - Flag: `--include` - Valid inputs: `code`, `payload`, `signatures`, `fee-events` Specify fields to include in the result output. Applies only to the text output. -### Exclude Fields +### Exclude fields - Flag: `--exclude` - Valid inputs: `events` @@ -107,17 +107,14 @@ Specify fields to exclude from the result output. Applies only to the text outpu - Valid inputs: an IP address or host address. - Default: `127.0.0.1:3569` (Flow Emulator) -Specify the host address of the Access API that will be -used to execute the command. This flag overrides -any host defined by the `--network` flag. +Specify the host address of the Access API that will be used to execute the command. This flag overrides any host defined by the `--network` flag. -### Network Key +### Network key - Flag: `--network-key` - Valid inputs: A valid network public key of the host in hex string format -Specify the network public key of the Access API that will be -used to create secure client connections when executing the command. +Specify the network public key of the Access API that will be used to create secure client connections when you execute the command. ### Network @@ -150,7 +147,7 @@ Specify the format of the command results. - Short Flag: `-s` - Valid inputs: a path in the current file system. -Specify the filename where you want the result to be saved +Specify the filename where you want to save the result. ### Log @@ -168,11 +165,9 @@ Specify the log level. Control how much output you want to see during command ex - Valid inputs: a path in the current file system. - Default: `flow.json` -Specify the path to the `flow.json` configuration file. -You can use the `-f` flag multiple times to merge -several configuration files. +Specify the path to the `flow.json` configuration file. You can use the `-f` flag multiple times to merge several configuration files. -### Version Check +### Version check - Flag: `--skip-version-check` - Default: `false` @@ -183,8 +178,10 @@ Skip version check during start up to speed up process for slow connections. System transactions currently cover: -- System chunk transactions used by protocol operations. See an overview of system chunks and service events: [Epoch Scripts and Events]. -- Scheduled transaction execution. Learn more: [Introduction to Scheduled Transaction]. +- System chunk transactions used by protocol operations. See an overview of system chunks and service events: + - [Epoch Scripts and Events] +- Scheduled transaction execution. Learn more: + - [Introduction to Scheduled Transactions] More resources: diff --git a/docs/build/tools/flow-cli/transactions/get-transactions.md b/docs/build/tools/flow-cli/transactions/get-transactions.md index 8b16fa52b3..460164b724 100644 --- a/docs/build/tools/flow-cli/transactions/get-transactions.md +++ b/docs/build/tools/flow-cli/transactions/get-transactions.md @@ -4,14 +4,13 @@ description: How to get a Flow transaction from the command line sidebar_position: 2 --- -The Flow CLI provides a command to fetch a transaction -that was previously submitted to an Access API. +The Flow CLI provides a command to fetch a transaction that was previously submitted to an Access API. ```shell flow transactions get ``` -## Example Usage +## Example use ```shell > flow transactions get 40bc4b100c1930c61381c22e0f4c10a7f5827975ee25715527c1061b8d71e5aa --network mainnet @@ -53,8 +52,6 @@ Events: - amount (UFix64): 0.00100000 - to ({}?): 5068e27f275c546c - - Code (hidden, use --include code) Payload (hidden, use --include payload) @@ -71,22 +68,21 @@ The first argument is the ID (hash) of the transaction. ## Flags -### Include Fields +### Include fields - Flag: `--include` - Valid inputs: `code`, `payload`, `signatures` Specify fields to include in the result output. Applies only to the text output. -### Wait for Seal +### Wait for seal - Flag: `--sealed` - Default: `false` -Indicate whether to wait for the transaction to be sealed -before displaying the result. +Indicate whether to wait for the transaction to be sealed before itdisplays the result. -### Exclude Fields +### Exclude fields - Flag: `--exclude` - Valid inputs: `events` @@ -99,17 +95,14 @@ Specify fields to exclude from the result output. Applies only to the text outpu - Valid inputs: an IP address or hostname. - Default: `127.0.0.1:3569` (Flow Emulator) -Specify the hostname of the Access API that will be -used to execute the command. This flag overrides -any host defined by the `--network` flag. +Specify the hostname of the Access API that will be used to execute the command. This flag overrides any host defined by the `--network` flag. -### Network Key +### Network key - Flag: `--network-key` - Valid inputs: A valid network public key of the host in hex string format -Specify the network public key of the Access API that will be -used to create a secure GRPC client when executing the command. +Specify the network public key of the Access API that will be used to create a secure GRPC client when you execute the command. ### Network @@ -142,7 +135,7 @@ Specify the format of the command results. - Short Flag: `-s` - Valid inputs: a path in the current filesystem. -Specify the filename where you want the result to be saved +Specify the filename where you want to save the result. ### Log @@ -160,11 +153,9 @@ Specify the log level. Control how much output you want to see during command ex - Valid inputs: a path in the current filesystem. - Default: `flow.json` -Specify the path to the `flow.json` configuration file. -You can use the `-f` flag multiple times to merge -several configuration files. +Specify the path to the `flow.json` configuration file. You can use the `-f` flag multiple times to merge several configuration files. -### Version Check +### Version check - Flag: `--skip-version-check` - Default: `false` diff --git a/docs/build/tools/flow-cli/transactions/send-signed-transactions.md b/docs/build/tools/flow-cli/transactions/send-signed-transactions.md index d6f63c42eb..a498592e8f 100644 --- a/docs/build/tools/flow-cli/transactions/send-signed-transactions.md +++ b/docs/build/tools/flow-cli/transactions/send-signed-transactions.md @@ -4,8 +4,7 @@ description: How to send a signed Flow transaction from the command line sidebar_position: 6 --- -The Flow CLI provides a command to send signed transactions to -any Flow Access API. +The Flow CLI provides a command to send signed transactions to any Flow Access API. Use this functionality in the following order: 1. Use the `build` command to build the transaction. @@ -16,7 +15,7 @@ Use this functionality in the following order: flow transactions send-signed ``` -## Example Usage +## Example use ```shell > flow transactions send-signed ./signed.rlp @@ -47,23 +46,23 @@ Payload (hidden, use --include payload) ## Arguments -### Signed Code Filename +### Signed code filename + - Name: `signed transaction filename` - Valid inputs: Any filename and path valid on the system. -The first argument is a path to a Cadence file containing the -transaction to be executed. +The first argument is a path to a Cadence file that contains the transaction to be executed. ## Flags -### Include Fields +### Include fields - Flag: `--include` - Valid inputs: `code`, `payload` Specify fields to include in the result output. Applies only to the text output. -### Exclude Fields +### Exclude fields - Flag: `--exclude` - Valid inputs: `events` @@ -88,13 +87,12 @@ Specify the hostname of the Access API that will be used to execute the command. This flag overrides any host defined by the `--network` flag. -### Network Key +### Network key - Flag: `--network-key` - Valid inputs: A valid network public key of the host in hex string format -Specify the network public key of the Access API that will be -used to create a secure GRPC client when executing the command. +Specify the network public key of the Access API that will be used to create a secure GRPC client when you execute the command. ### Network @@ -119,7 +117,7 @@ Specify the format of the command results. - Short Flag: `-s` - Valid inputs: a path in the current filesystem. -Specify the filename where you want the result to be saved +Specify the filename where you want to save the result. ### Log @@ -137,11 +135,9 @@ Specify the log level. Control how much output you want to see during command ex - Valid inputs: a path in the current filesystem. - Default: `flow.json` -Specify the path to the `flow.json` configuration file. -You can use the `-f` flag multiple times to merge -several configuration files. +Specify the path to the `flow.json` configuration file. You can use the `-f` flag multiple times to merge several configuration files. -### Version Check +### Version check - Flag: `--skip-version-check` - Default: `false` diff --git a/docs/build/tools/flow-cli/transactions/send-transactions.md b/docs/build/tools/flow-cli/transactions/send-transactions.md index 59cc81cff7..ea8502b179 100644 --- a/docs/build/tools/flow-cli/transactions/send-transactions.md +++ b/docs/build/tools/flow-cli/transactions/send-transactions.md @@ -11,7 +11,7 @@ any Flow Access API. flow transactions send [ ...] [flags] ``` -## Example Usage +## Example use ```shell > flow transactions send ./tx.cdc "Hello" @@ -74,26 +74,23 @@ JSON arguments from a file example: ## Arguments -### Code Filename +### Code filename - Name: `code filename` - Valid inputs: Any filename and path valid on the system. -The first argument is a path to a Cadence file containing the -transaction to be executed. +The first argument is a path to a Cadence file that contains the transaction to be executed. ### Arguments - Name: `argument` -- Valid inputs: valid [cadence values](https://cadencelang.dev/docs/1.0/json-cadence-spec) - matching argument type in transaction code. +- Valid inputs: valid [cadence values] that matches the argument type in transaction code. -Input arguments values matching corresponding types in the source code and passed in the same order. -You can pass a `nil` value to optional arguments by sending the transaction like this: `flow transactions send tx.cdc nil`. +Input arguments values that match types which correspond in the source code and passed in the same order. to can pass a `nil` value to optional arguments, send the transaction like this: `flow transactions send tx.cdc nil`. ## Flags -### Include Fields +### Include fields - Flag: `--include` - Valid inputs: `code`, `payload` @@ -112,7 +109,7 @@ Specify fields to include in the result output. Applies only to the text output. ⚠️ No longer supported: all transactions will provide result. -### Exclude Fields +### Exclude fields - Flag: `--exclude` - Valid inputs: `events` @@ -122,7 +119,7 @@ Specify fields to exclude from the result output. Applies only to the text outpu ### Signer - Flag: `--signer` -- Valid inputs: the name of an account defined in the configuration (`flow.json`) +- Valid inputs: the name of an account defined in the configuration (`flow.json`). Specify the name of the account that will be used to sign the transaction. @@ -131,21 +128,21 @@ Specify the name of the account that will be used to sign the transaction. - Flag: `--proposer` - Valid inputs: the name of an account defined in the configuration (`flow.json`) -Specify the name of the account that will be used as proposer in the transaction. +Specify the name of the account that will be used as the proposer in the transaction. ### Payer - Flag: `--payer` - Valid inputs: the name of an account defined in the configuration (`flow.json`) -Specify the name of the account that will be used as payer in the transaction. +Specify the name of the account that will be used as the payer in the transaction. ### Authorizer - Flag: `--authorizer` - Valid inputs: the name of a single or multiple comma-separated accounts defined in the configuration (`flow.json`) -Specify the name of the account(s) that will be used as authorizer(s) in the transaction. If you want to provide multiple authorizers separate them using commas (e.g. `alice,bob`) +Specify the name of the account(s) that will be used as authorizer(s) in the transaction. If you want to provide multiple authorizers, separate them with commas (for example, `alice,bob`) ### Arguments JSON @@ -154,8 +151,8 @@ Specify the name of the account(s) that will be used as authorizer(s) in the tra - Example: `flow transactions send ./tx.cdc '[{"type": "String", "value": "Hello World"}]'` Arguments passed to the Cadence transaction in Cadence JSON format. -Cadence JSON format contains `type` and `value` keys and is -[documented here](https://cadencelang.dev/docs/1.0/json-cadence-spec). +The Cadence JSON format contains `type` and `value` keys and is +[documented here]. ### Compute Limit @@ -171,17 +168,14 @@ Specify the compute unit (gas) limit for this transaction. - Valid inputs: an IP address or hostname. - Default: `127.0.0.1:3569` (Flow Emulator) -Specify the hostname of the Access API that will be -used to execute the command. This flag overrides -any host defined by the `--network` flag. +Specify the hostname of the Access API that will be used to execute the command. This flag overrides any host defined by the `--network` flag. -### Network Key +### Network key - Flag: `--network-key` - Valid inputs: A valid network public key of the host in hex string format -Specify the network public key of the Access API that will be -used to create a secure GRPC client when executing the command. +Specify the network public key of the Access API that will be used to create a secure GRPC client when you execute the command. ### Network @@ -214,7 +208,7 @@ Specify the format of the command results. - Short Flag: `-s` - Valid inputs: a path in the current filesystem. -Specify the filename where you want the result to be saved +Specify the filename where you want to save the result. ### Log @@ -232,13 +226,16 @@ Specify the log level. Control how much output you want to see during command ex - Valid inputs: a path in the current filesystem. - Default: `flow.json` -Specify the path to the `flow.json` configuration file. -You can use the `-f` flag multiple times to merge -several configuration files. +Specify the path to the `flow.json` configuration file. You can use the `-f` flag multiple times to merge several configuration files. -### Version Check +### Version check - Flag: `--skip-version-check` - Default: `false` Skip version check during start up to speed up process for slow connections. + + + +[cadence values]: https://cadencelang.dev/docs/1.0/json-cadence-spec +[documented here]: https://cadencelang.dev/docs/1.0/json-cadence-spec \ No newline at end of file diff --git a/docs/build/tools/flow-cli/transactions/sign-transaction.md b/docs/build/tools/flow-cli/transactions/sign-transaction.md index b08027b7bc..5c138fd0db 100644 --- a/docs/build/tools/flow-cli/transactions/sign-transaction.md +++ b/docs/build/tools/flow-cli/transactions/sign-transaction.md @@ -4,8 +4,7 @@ description: How to sign a Flow transaction from the command line sidebar_position: 5 --- -The Flow CLI provides a command to sign transactions with options to specify -authorizer accounts, payer accounts and proposer accounts. +The Flow CLI provides a command to sign transactions with options to specify authorizer accounts, payer accounts and proposer accounts. Use this functionality in the following order: 1. Use the `build` command to build the transaction. @@ -16,7 +15,7 @@ Use this functionality in the following order: flow transactions sign ``` -## Example Usage +## Example use ```shell > flow transactions sign ./built.rlp --signer alice \ @@ -64,25 +63,27 @@ f90184f...a199bfd9b837a11a0885f9104b54014750f5e3e5bfe4a5795968b0df86769dd54c0 ## Arguments -### Built Transaction Filename or Remote Server URL +### Built transaction filename or remote server URL + - Name: `built transaction filename | --from-remote-url ` - Valid inputs: Any filename and path valid on the system or --from-remote-url flag and fully qualified remote server url. -Specify the filename containing valid transaction payload that will be used for signing. -To be used with the `flow transaction build` command. +Specify the filename that contains valid transaction payload to use for signing. To be used with the `flow transaction build` command. When --from-remote-url flag is used the value needs to be a fully qualified url to transaction RLP Example: `flow transaction sign --from-remote-url https://fully/qualified/url --signer alice` + ## Flags -### From Remote Url +### From remote Url - Flag: `--from-remote-url` - Valid input: `http(s)://fully/qualified/server/url` -Specify this flag with a fully qualified url to transaction RLP. The RLP will be fetched from server then signed. The resulting signed RLP is then posted to the remote url. This feature is to support protocol level multiple signature transaction coordination between multiple signers. -Note: --yes flag is not supported and will fail `sign` command when this flag is used. This forces the user to verify the cadence code. +Specify this flag with a fully qualified url to transaction RLP. The RLP will be fetched from server then signed. The returned signed RLP is then posted to the remote url. This feature is to support protocol level multiple signature transaction coordination between multiple signers. -### Include Fields +The `--yes` flag is not supported and will fail `sign` command when this flag is used. This forces the user to verify the cadence code. + +### Include fields - Flag: `--include` - Valid inputs: `code`, `payload`, `signatures` @@ -97,20 +98,19 @@ Specify fields to include in the result output. Applies only to the text output. Specify the name of the account that will be used to sign the transaction. ### Host + - Flag: `--host` - Valid inputs: an IP address or hostname. - Default: `127.0.0.1:3569` (Flow Emulator) -Specify the hostname of the Access API that will be -used to execute the commands. +Specify the hostname of the Access API that will be used to execute the commands. -### Network Key +### Network key - Flag: `--network-key` - Valid inputs: A valid network public key of the host in hex string format -Specify the network public key of the Access API that will be -used to create a secure GRPC client when executing the command. +Specify the network public key of the Access API that will be used to create a secure GRPC client when you execute the command. ### Network @@ -152,7 +152,7 @@ Specify the filename where you want the result to be saved. - Valid inputs: `none`, `error`, `debug` - Default: `info` -Specify the log level. Control how much output you want to see while command execution. +Specify the log level. Control how much output you want to see while command executes. ### Configuration @@ -160,10 +160,9 @@ Specify the log level. Control how much output you want to see while command exe - Short Flag: `-f` - Valid inputs: valid filename -Specify a filename for the configuration files, you can provide multiple configuration -files by using `-f` flag multiple times. +Specify a filename for the configuration files. To provide multiple configuration files use the `-f` flag multiple times. -### Version Check +### Version check - Flag: `--skip-version-check` - Default: `false` diff --git a/docs/build/tools/flow-cli/utils/signature-generate.md b/docs/build/tools/flow-cli/utils/signature-generate.md index 0b91f9de5e..7fb8c519bd 100644 --- a/docs/build/tools/flow-cli/utils/signature-generate.md +++ b/docs/build/tools/flow-cli/utils/signature-generate.md @@ -3,7 +3,7 @@ title: Generate a Signature description: How to generate a new signature from the command line --- -Generate a signature using the private key of the signer account. +Generate a signature with the private key of the signer account. ```shell flow signatures generate @@ -12,7 +12,7 @@ flow signatures generate ⚠️ _Make sure the account you want to use for signing is saved in the `flow.json` configuration. The address of the account is not important, just the private key._ -## Example Usage +## Example use ```shell > flow signatures generate 'The quick brown fox jumps over the lazy dog' --signer alice @@ -27,6 +27,7 @@ Signature Algorithm ECDSA_P256 ## Arguments ### Message + - Name: `message` Message used for signing. @@ -36,7 +37,7 @@ Message used for signing. ### Signer - Flag: `--signer` -- Valid inputs: the name of an account defined in the configuration (`flow.json`) +- Valid inputs: the name of an account defined in the configuration (`flow.json`). Specify the name of the account that will be used to sign the transaction. @@ -71,7 +72,7 @@ Specify the filename where you want the result to be saved. - Valid inputs: `none`, `error`, `debug` - Default: `info` -Specify the log level. Control how much output you want to see while command execution. +Specify the log level. Control how much output you want to see while the command executes. ### Configuration @@ -79,15 +80,11 @@ Specify the log level. Control how much output you want to see while command exe - Short Flag: `-f` - Valid inputs: valid filename -Specify a filename for the configuration files, you can provide multiple configuration -files by using `-f` flag multiple times. +Specify a filename for the configuration files. To provide multiple configuration files, use the `-f` flag multiple times. -### Version Check +### Version check - Flag: `--skip-version-check` - Default: `false` -Skip version check during start up to speed up process for slow connections. - - - +Skip version check during start up to speed up process for slow connections. \ No newline at end of file diff --git a/docs/build/tools/flow-cli/utils/signature-verify.md b/docs/build/tools/flow-cli/utils/signature-verify.md index 30f983d309..d6d481b6e9 100644 --- a/docs/build/tools/flow-cli/utils/signature-verify.md +++ b/docs/build/tools/flow-cli/utils/signature-verify.md @@ -9,7 +9,7 @@ Verify validity of a signature based on provided message and public key of the s flow signatures verify ``` -## Example Usage +## Example use ```shell > flow signatures verify @@ -30,21 +30,23 @@ Signature Algorithm ECDSA_P256 ### Message - Name: `message` -Message data used for creating the signature. +Message data used to create the signature. ### Signature + - Name: `signature` Message signature that will be verified. ### Public Key + - Name: `public key` -Public key of the private key used for creating the signature. +Public key of the private key used to create the signature. ## Flags -### Public Key Signature Algorithm +### Public key signature algorithm - Flag: `--sig-algo` - Valid inputs: `"ECDSA_P256", "ECDSA_secp256k1"` @@ -53,7 +55,7 @@ Specify the ECDSA signature algorithm of the key pair used for signing. Flow supports the secp256k1 and P-256 curves. -### Public Key Hash Algorithm +### Public key hash algorithm - Flag: `--hash-algo` - Valid inputs: `"SHA2_256", "SHA3_256"` @@ -92,7 +94,7 @@ Specify the filename where you want the result to be saved. - Valid inputs: `none`, `error`, `debug` - Default: `info` -Specify the log level. Control how much output you want to see while command execution. +Specify the log level. Control how much output you want to see while the command executes. ### Version Check diff --git a/docs/build/tools/flow-cli/utils/snapshot-save.md b/docs/build/tools/flow-cli/utils/snapshot-save.md index 3f40c6bb10..ebb69cca47 100644 --- a/docs/build/tools/flow-cli/utils/snapshot-save.md +++ b/docs/build/tools/flow-cli/utils/snapshot-save.md @@ -9,20 +9,22 @@ The FLOW CLI provides a command to save the latest finalized protocol state snap flow snapshot save ``` -## Example Usage +## Example use ```shell flow snapshot save /tmp/snapshot.json --network testnet ``` ### Example response + ```shell snapshot saved: /tmp/snapshot.json ``` ## Arguments -### Output Path +### Output path + - Name: `output path` - Valid Input: any valid string path @@ -30,22 +32,19 @@ Output path where the protocol snapshot JSON file will be saved. ## Flags - ### Host - Flag: `--host` - Valid inputs: an IP address or hostname. - Default: `127.0.0.1:3569` (Flow Emulator) -Specify the hostname of the Access API that will be -used to execute the commands. +Specify the hostname of the Access API that will be used to execute the commands. ### Network Key - Flag: `--network-key` - Valid inputs: A valid network public key of the host in hex string format -Specify the network public key of the Access API that will be -used to create a secure GRPC client when executing the command. +Specify the network public key of the Access API that will be used to create a secure GRPC client when you execute the command. ### Network @@ -77,8 +76,4 @@ Specify in which format you want to display the result. - Flag: `--skip-version-check` - Default: `false` -Skip version check during start up to speed up process for slow connections. - - - - +Skip version check during start up to speed up process for slow connections. \ No newline at end of file diff --git a/docs/build/tools/flow-cli/utils/tools.md b/docs/build/tools/flow-cli/utils/tools.md index ad77ef4322..7cd9d28bff 100644 --- a/docs/build/tools/flow-cli/utils/tools.md +++ b/docs/build/tools/flow-cli/utils/tools.md @@ -3,28 +3,24 @@ title: Development Tools description: How to start development tools using the Flow CLI --- -The Flow CLI integrates different development tools, which can now be easily started -and managed from a single place. +The Flow CLI integrates different development tools, which you can now easily start and manage from a single place. -Currently the CLI supports starting: -- [Flow Development Wallet](https://github.com/onflow/fcl-dev-wallet) +Currently, the CLI supports starting [Flow Development Wallet] ## Flow Development Wallet -The Flow Dev Wallet is a mock Flow wallet that simulates the protocols used by FCL to interact with the Flow blockchain on behalf of simulated user accounts. +The Flow Dev Wallet is a mock Flow wallet that simulates the protocols used by Flow CLient Library (FCL) to interact with the Flow blockchain on behalf of simulated user accounts. -**Be sure you have the emulator running before starting this command** -_You can start it using the `flow emulator` command_. +**Be sure you started the emulator before you run this command** +_You can start it with the `flow emulator` command_. ```shell flow dev-wallet ``` -_⚠️ This project implements an FCL compatible -interface, but should **not** be used as a reference for -building a production grade wallet._ +_⚠️ This project implements an FCL compatible interface, but should **not** be used as a reference to build a production grade wallet._ -After starting dev-wallet, you can set your fcl config to use it like below: +After you start dev-wallet, you can set your fcl config to use it like below: ```javascript import * as fcl from "@onflow/fcl" @@ -35,8 +31,7 @@ fcl.config() // Point FCL at dev-wallet (default port) .put("discovery.wallet", "http://localhost:8701/fcl/authn") ``` -You can read more about setting up dev-wallet at [Flow Dev Wallet Project](https://github.com/onflow/fcl-dev-wallet) - +You can read more about how to set up dev-wallet at [Flow Dev Wallet Project]. ## Flags @@ -46,15 +41,15 @@ You can read more about setting up dev-wallet at [Flow Dev Wallet Project](https - Valid inputs: Number - Default: `8701` -Port on which the dev wallet server will listen on. +Port on which the dev wallet server will listen. -### Emulator Host +### Emulator host - Flag: `--emulator-host` - Valid inputs: a hostname - Default: `http://localhost:8080` -Specifies the host configuration for dev wallet +Specifies the host configuration for dev wallet. ### Configuration @@ -62,17 +57,16 @@ Specifies the host configuration for dev wallet - Short Flag: `-f` - Valid inputs: valid filename -Specify a filename for the configuration files, you can provide multiple configuration -files by using `-f` flag multiple times. - -Specify a filename for the configuration files, you can provide multiple configuration -files by using `-f` flag multiple times. +Specify a filename for the configuration files. To provide multiple configuration files, use the `-f` flag multiple times. -### Version Check +### Version check - Flag: `--skip-version-check` - Default: `false` Skip version check during start up to speed up process for slow connections. + +[Flow Development Wallet]: https://github.com/onflow/fcl-dev-wallet +[Flow Dev Wallet Project]: https://github.com/onflow/fcl-dev-wallet \ No newline at end of file