diff --git a/docs/build/tools/clients/fcl-js/cross-vm/index.md b/docs/build/tools/clients/fcl-js/cross-vm/index.md index a8df6a50c9..12dff94c33 100644 --- a/docs/build/tools/clients/fcl-js/cross-vm/index.md +++ b/docs/build/tools/clients/fcl-js/cross-vm/index.md @@ -5,34 +5,45 @@ description: FCL packages for cross-VM (Flow + EVM) applications. # FCL Cross-VM Packages -These packages enable you to leverage Flow’s Cadence-Owned Account (COA) within Ethereum tooling (e.g., Wagmi, RainbowKit). They provide a unified approach for cross-VM apps on Flow and EVM, letting you perform EVM-like operations using Cadence accounts. +These packages allow you to leverage Flow’s Cadence-Owned Account (COA) within Ethereum tooling (for example, Wagmi, RainbowKit). They provide a unified approach for cross-VM apps on Flow and EVM, which lets you perform EVM-like operations will Cadence accounts. -For background and motivation, see the [FCL Ethereum Provider for Cross-VM Apps FLIP #316](https://github.com/onflow/flips/blob/c0fe9b71a9afb85fe70a69cf7c0870b5d327e679/application/20241223-fcl-ethereum-provider.md). +For background and motivation, see the [FCL Ethereum Provider for Cross-VM Apps FLIP #316]. | Package | Purpose | |-----------------------------------------------|-------------------------------------------------------------------------------------------------| -| [@onflow/fcl-ethereum-provider](#onflowfcl-ethereum-provider) | Provides an EIP-1193-compliant Ethereum provider backed by an FCL-authenticated COA. | -| [@onflow/fcl-wagmi-adapter](#onflowfcl-wagmi-adapter) | Integrates Flow-based COAs with Wagmi, exposing them as Ethereum accounts in your dApp. | -| [@onflow/fcl-rainbowkit-adapter](#onflowfcl-rainbowkit-adapter)| Enables a Flow-based wallet option in your RainbowKit wallet selection modal. | +| [@onflow/fcl-ethereum-provider] | Provides an EIP-1193-compliant Ethereum provider backed by an FCL-authenticated COA. | +| [@onflow/fcl-wagmi-adapter] | Integrates Flow-based COAs with Wagmi, and exposes them as Ethereum accounts in your dApp. | +| [@onflow/fcl-rainbowkit-adapter]| Allows a Flow-based wallet option in your RainbowKit wallet selection modal. | ## `@onflow/fcl-ethereum-provider` -- **Description**: A drop-in EIP-1193 provider that authenticates users via [FCL](https://developers.flow.com/) and lets them sign transactions/messages with their COA. +- **Description**: A drop-in EIP-1193 provider that authenticates users via [Flow Client Library (FCL)] and lets them sign transactions and messages with their COA. - **Use Cases**: - Integrate Flow EVM with any generic EVM library or framework. - - Direct control over JSON-RPC calls (e.g., `provider.request({ method: 'eth_sendTransaction' })`). -- **Link to Docs**: [Read the @onflow/fcl-ethereum-provider Reference »](ethereum-provider.mdx) + - Direct control over JSON-RPC calls (for example, `provider.request({ method: 'eth_sendTransaction' })`). +- **Link to Docs**: [Read the @onflow/fcl-ethereum-provider Reference »] ## `@onflow/fcl-wagmi-adapter` - **Description**: A Wagmi connector that uses `@onflow/fcl-ethereum-provider` under the hood so you can sign in with your COA through standard Wagmi flows. - **Use Cases**: - - Add Flow-based COAs to an existing Wagmi-powered dApp as if they were Ethereum wallets. -- **Link to Docs**: [Read the @onflow/fcl-wagmi-adapter Reference »](wagmi-adapter.mdx) + - Add Flow-based COAs to a current Wagmi-powered dApp as if they were Ethereum wallets. +- **Link to Docs**: [Read the @onflow/fcl-wagmi-adapter Reference »] ## `@onflow/fcl-rainbowkit-adapter` -- **Description**: A RainbowKit adapter that surfaces a Flow-based wallet in the wallet selection modal, making it easy to sign transactions via COAs in a RainbowKit environment. +- **Description**: A RainbowKit adapter that surfaces a Flow-based wallet in the wallet selection modal, wheich makes it easy to sign transactions via COAs in a RainbowKit environment. - **Use Cases**: - - Offer Flow-based wallets (e.g., Flow Wallet) alongside popular Ethereum wallets in RainbowKit. -- **Link to Docs**: [Read the @onflow/fcl-rainbowkit-adapter Reference »](rainbowkit-adapter.mdx) + - Offer Flow-based wallets (such as Flow Wallet) alongside popular Ethereum wallets in RainbowKit. +- **Link to Docs**: [Read the @onflow/fcl-rainbowkit-adapter Reference »] + + + +[FCL Ethereum Provider for Cross-VM Apps FLIP #316]: https://github.com/onflow/flips/blob/c0fe9b71a9afb85fe70a69cf7c0870b5d327e679/application/20241223-fcl-ethereum-provider.md +[@onflow/fcl-ethereum-provider]: #onflowfcl-ethereum-provider +[@onflow/fcl-wagmi-adapter]: #onflowfcl-wagmi-adapter +[@onflow/fcl-rainbowkit-adapter]: #onflowfcl-rainbowkit-adapter +[Flow Client Library (FCL)]: https://developers.flow.com/ +[Read the @onflow/fcl-ethereum-provider Reference »]: ethereum-provider.mdx +[Read the @onflow/fcl-wagmi-adapter Reference »]: wagmi-adapter.mdx +[Read the @onflow/fcl-rainbowkit-adapter Reference »]: rainbowkit-adapter.mdx \ No newline at end of file diff --git a/docs/build/tools/emulator/index.md b/docs/build/tools/emulator/index.md index 88f078853a..69cc441022 100644 --- a/docs/build/tools/emulator/index.md +++ b/docs/build/tools/emulator/index.md @@ -62,23 +62,23 @@ This starts a local Flow network with: - REST API on `http://localhost:8888` - Admin API on port `8080` -## Available Commands +## Available commands - `snapshot`: Create/Load/List emulator snapshots. See: [Create Emulator Snapshot] -## Key Flags +## Key flags - **Networking** - - `--host `: Host to listen on for gRPC/REST/Admin (default: all interfaces) + - `--host `: Host to listen on for gRPC, REST, and Admin (default: all interfaces) - `--port, -p `: gRPC port (default `3569`) - `--rest-port `: REST API port (default `8888`) - `--admin-port `: Admin API port (default `8080`) - `--debugger-port `: Debug Adapter Protocol port (default `2345`) - - `--grpc-debug`: Enable gRPC server reflection - - `--rest-debug`: Enable REST API debug output + - `--grpc-debug`: Turn on gRPC server reflection + - `--rest-debug`: Turn on REST API debug output -- **State & Persistence** - - `--persist`: Enable persistent storage (default disabled) +- **State and Persistence** + - `--persist`: Turn on persistent storage (default disabled) - `--dbpath `: Directory for on-disk state (default `./flowdb`) - `--sqlite-url `: Use SQLite storage backend - `--redis-url `: Use Redis storage backend @@ -87,15 +87,15 @@ This starts a local Flow network with: - **Forking** - `--fork `: Start the emulator in fork mode using a network from `flow.json`. If provided without a value, defaults to `mainnet`. - - `--fork-host `: Access node to query when forking Mainnet/Testnet - - `--fork-height `: Starting block height when forking - -- **Cadence & VM** - - `--block-time, -b `: Time between sealed blocks (e.g. `1s`, `300ms`) - - `--coverage-reporting`: Enable code coverage reporting - - `--computation-reporting`: Enable computation reporting - - `--legacy-upgrade`: Enable legacy contract upgrade behavior - - `--scheduled-transactions`: Enable scheduled transactions (default true) + - `--fork-host `: Access node to query when you fork Mainnet or Testnet + - `--fork-height `: Starting block height when you fork + +- **Cadence and VM** + - `--block-time, -b `: Time between sealed blocks (for exxample, `1s`, `300ms`) + - `--coverage-reporting`: Turn on code coverage reporting + - `--computation-reporting`: Turn on computation reporting + - `--legacy-upgrade`: Turn on legacy contract upgrade behavior + - `--scheduled-transactions`: Turn on scheduled transactions (default true) - `--script-compute-limit `: Compute unit limit for scripts (default `100000`) - `--transaction-max-compute-limit `: Max transaction compute unit limit (default `9999`) - `--transaction-expiry `: Transaction expiry in blocks (default `10`) @@ -104,21 +104,21 @@ This starts a local Flow network with: - `--storage-limit`: Enforce account storage limit (default true) - `--storage-per-flow `: MB of storage per 1 FLOW token - `--token-supply `: Initial FLOW token supply (default `1000000000.0`) - - `--transaction-fees`: Enable transaction fees + - `--transaction-fees`: Turn on transaction fees - `--setup-evm`: Deploy EVM contracts (default true) - `--setup-vm-bridge`: Deploy VM Bridge contracts (default true) -- **Service Account & Identity** +- **Service Account and Identity** - `--chain-id `: Address generation chain (default `emulator`) - `--service-priv-key ` / `--service-pub-key `: Service account keys - `--service-sig-algo `: Service key signature algo (default `ECDSA_P256`) - `--service-hash-algo `: Service key hash algo (default `SHA3_256`) - - `--min-account-balance `: Minimum account balance / account creation cost + - `--min-account-balance `: Minimum account balance or account creation cost - `--contracts`: Deploy common contracts on start - `--contract-removal`: Allow contract removal for development (default true) - `--init`: Initialize a new account profile -- **Logging & Output** +- **Logging and Output** - `--verbose, -v`: Verbose logging - `--log-format `: Logging output format (default `text`) @@ -168,15 +168,15 @@ For the complete and current list of flags, run: flow emulator --help ``` -## Debugging & Testing +## Debugging and Testing - **Code Coverage**: Add `--coverage-reporting` flag and visit `http://localhost:8080/emulator/codeCoverage` - **Debugging**: Use `#debugger()` pragma in Cadence code for breakpoints -- **Fork mode note**: When using `flow emulator --fork`, only Flow chain state is available. External oracles/APIs and cross-chain reads are not live; mock these or run local stub services for E2E. +- **Fork mode note**: When you use `flow emulator --fork`, only Flow chain state is available. External oracles/APIs and cross-chain reads are not live; mock these or run local stub services for E2E. ## Snapshots -The Flow CLI provides a command to create emulator snapshots, which are points in blockchain history you can later jump to and reset the state to that moment. This can be useful for testing where you establish a beginning state, run tests and after revert back to the initial state. +The Flow CLI provides a command to create emulator snapshots, which are points in blockchain history you can later jump to and reset the state to that moment. This can be useful to test where you establish a beginning state, run tests and after revert back to the initial state. ### Quick snapshot workflow @@ -201,7 +201,7 @@ Create a new emulator snapshot at the current block with a name of `myInitialSta flow emulator snapshot create myInitialState ``` -### Load an existing snapshot +### Load a current snapshot To jump to a previously created snapshot we use the load command in combination with the name. @@ -209,17 +209,17 @@ To jump to a previously created snapshot we use the load command in combination flow emulator snapshot load myInitialState ``` -### List all existing snapshots +### List all snapshots -To list all the existing snapshots we previously created and can load to run: +To list all the snapshots we previously created and can load to run: ```shell flow emulator list ``` -## Additional Resources +## Additional resources -To learn more about using the Emulator, please have a look at the [public GitHub repository]. +To learn more about how to use the Emulator, have a look at the [public GitHub repository]. diff --git a/docs/build/tools/flow-cli/accounts/account-add-contract.md b/docs/build/tools/flow-cli/accounts/account-add-contract.md index a4baf7d27c..eb87eb629b 100644 --- a/docs/build/tools/flow-cli/accounts/account-add-contract.md +++ b/docs/build/tools/flow-cli/accounts/account-add-contract.md @@ -3,18 +3,18 @@ title: Deploy a Contract sidebar_position: 3 --- -Deploy a new contract to a Flow account using the Flow CLI. +Deploy a new contract to a Flow account with the Flow CLI. ```shell flow accounts add-contract [ ...] [flags] ``` -⚠️ Deprecation notice: using name argument in adding contract command will be deprecated soon. +⚠️ Deprecation notice: we will deprecate the name argument in adding contract command soon. ```shell flow accounts add-contract [ ...] [flags] ``` -## Example Usage +## Example usage ```shell > flow accounts add-contract ./FungibleToken.cdc @@ -36,7 +36,7 @@ Key 0 Public Key 640a5a359bf3536d15192f18d872d57c98a96cb871b92b70cecb0739c2d5c Contracts Deployed: 1 Contract: 'FungibleToken' ``` -**Testnet Example** +**Testnet example** ``` > flow accounts add-contract ./FungibleToken.cdc --signer alice --network testnet @@ -79,10 +79,10 @@ Path to the file containing the contract source code. ### 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. +Input arguments values that match corresponding types in the source code and passed in the same order. Example: ```shell @@ -113,9 +113,9 @@ Specify the name of the account that will be used to sign the transaction. 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). +[documented here]. -### Include Fields +### Include fields - Flag: `--include` - Valid inputs: `contracts` @@ -129,17 +129,14 @@ Specify fields to include in the result output. Applies only to the text output. - 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 @@ -191,12 +188,17 @@ Specify the log level. Control how much output you want to see during command ex - 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. -### Version Check +You can use the `-f` flag multiple times to merge several configuration files. + +### 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/accounts/account-fund.md b/docs/build/tools/flow-cli/accounts/account-fund.md index 2e07878878..5319fafced 100644 --- a/docs/build/tools/flow-cli/accounts/account-fund.md +++ b/docs/build/tools/flow-cli/accounts/account-fund.md @@ -6,19 +6,19 @@ sidebar_position: 7 :::info -The [Flow Testnet Faucet](https://testnet-faucet.onflow.org/) allows users to create accounts and receive 1,000 Testnet FLOW tokens for testing and development purposes. You can also fund an existing Testnet accounts without needing to create one through the site, or through the CLI. +The [Flow Testnet Faucet] allows users to create accounts and receive 1,000 Testnet FLOW tokens for testing and development purposes. You can also fund a current Testnet account without the need to create one through the site, or through the CLI. ::: -Fund a valid Testnet Flow Account using the Flow CLI. +Fund a valid Testnet Flow Account with the Flow CLI. ```shell flow accounts fund [address|name] ``` -## Example Usage +## Example usage -### Fund by Address +### Fund by address ``` > flow accounts fund 8e94eaa81771313a @@ -29,7 +29,7 @@ If there is an issue, please use this link instead: https://testnet-faucet.onflo ``` -### Fund by Account Name +### Fund by account name ``` > flow accounts fund testnet-account @@ -40,7 +40,7 @@ If there is an issue, please use this link instead: https://testnet-faucet.onflo ``` -### Interactive Prompt +### Interactive prompt ``` > flow accounts fund @@ -53,7 +53,7 @@ If there is an issue, please use this link instead: https://testnet-faucet.onflo ## Arguments -### Address or Account Name (Optional) +### Address or account name (optional) - Name: `address|name` - Valid Input: Flow Testnet account address or account name from `flow.json` @@ -62,3 +62,8 @@ You can provide: - A Flow [account address](../../../cadence/basics/accounts.md) (prefixed with `0x` or not) - An account name configured in your `flow.json` - No argument to get an interactive prompt for account selection + + + +[Flow Testnet Faucet]: https://testnet-faucet.onflow.org/ +[account address]: ../../../cadence/basics/accounts.md \ No newline at end of file diff --git a/docs/build/tools/flow-cli/accounts/account-remove-contract.md b/docs/build/tools/flow-cli/accounts/account-remove-contract.md index 82cbc672f1..577c2677c7 100644 --- a/docs/build/tools/flow-cli/accounts/account-remove-contract.md +++ b/docs/build/tools/flow-cli/accounts/account-remove-contract.md @@ -4,13 +4,13 @@ sidebar_position: 5 --- _This feature is only found in the Emulator. You **cannot** remove a contract on Testnet or Mainnet._ -Remove an existing contract deployed to a Flow account using the Flow CLI. +Remove a contract deployed to a Flow account with the Flow CLI. ```shell flow accounts remove-contract ``` -## Example Usage +## Example usage ```shell > flow accounts remove-contract FungibleToken @@ -31,7 +31,7 @@ Key 0 Public Key 640a5a359bf3536d15192f18d872d57c98a96cb871b92b70cecb0739c2d5c Contracts Deployed: 0 ``` -**Testnet Example** +**Testnet example** ``` > flow accounts remove-contract FungibleToken --signer alice --network testnet @@ -72,7 +72,7 @@ Name of the contract as it is defined in the contract source code. Specify the name of the account that will be used to sign the transaction. -### Include Fields +### Include fields - Flag: `--include` - Valid inputs: `contracts` @@ -86,17 +86,14 @@ Specify fields to include in the result output. Applies only to the text output. - 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 executing the command. ### Network @@ -147,9 +144,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 @@ -157,3 +152,5 @@ several configuration files. - Default: `false` Skip version check during start up to speed up process for slow connections. + + diff --git a/docs/build/tools/flow-cli/accounts/account-staking-info.md b/docs/build/tools/flow-cli/accounts/account-staking-info.md index c874dbfe05..783eab74f5 100644 --- a/docs/build/tools/flow-cli/accounts/account-staking-info.md +++ b/docs/build/tools/flow-cli/accounts/account-staking-info.md @@ -4,13 +4,13 @@ description: How to get staking info sidebar_position: 6 --- -Retrieve staking information for the account on the Flow network using Flow CLI. +Retrieve staking information for the account on the Flow network with Flow CLI. ```shell flow accounts staking-info
``` -## Example Usage +## Example usage ```shell > accounts staking-info 535b975637fb6bee --host access.testnet.nodes.onflow.org:9000 @@ -49,11 +49,11 @@ Account Delegation Info: - Name: `address` - Valid Input: Flow account address. -Flow [account address](../../../cadence/basics/accounts.md) (prefixed with `0x` or not). +Flow [account address] (prefixed with `0x` or not). ## Flags -### Include Fields +### Include fields - Flag: `--include` - Valid inputs: `contracts` @@ -66,17 +66,14 @@ Specify fields to include in the result output. Applies only to the text output. - 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 @@ -131,9 +128,13 @@ 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. + + + +[account address]: ../../../cadence/basics/accounts.md \ No newline at end of file diff --git a/docs/build/tools/flow-cli/accounts/account-update-contract.md b/docs/build/tools/flow-cli/accounts/account-update-contract.md index 52276a24b7..b798ea5ccd 100644 --- a/docs/build/tools/flow-cli/accounts/account-update-contract.md +++ b/docs/build/tools/flow-cli/accounts/account-update-contract.md @@ -3,18 +3,18 @@ title: Update a Contract sidebar_position: 4 --- -Update an existing contract deployed to a Flow account using the Flow CLI. +Update a contract deployed to a Flow account with the Flow CLI. ```shell flow accounts update-contract [ ...] [flags] ``` -⚠️ Deprecation notice: using name argument in update contract command will be deprecated soon. +⚠️ Deprecation notice: We will depreate the name argument in update contract command soon. ```shell flow accounts update-contract [ ...] [flags] ``` -## Example Usage +## Example usage ```shell > flow accounts update-contract ./FungibleToken.cdc @@ -36,7 +36,7 @@ Key 0 Public Key 640a5a359bf3536d15192f18d872d57c98a96cb871b92b70cecb0739c2d5c Contracts Deployed: 1 Contract: 'FungibleToken' ``` -**Testnet Example** +**Testnet example** ``` > flow accounts update-contract ./FungibleToken.cdc --signer alice --network testnet @@ -73,14 +73,13 @@ Name of the contract as it is defined in the contract source code. - Name: `filename` - Valid inputs: Any filename and path valid on the system. -Filename of the file containing contract source code. +Filename of the file that contains contract source code. ### 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 thr argument type in transaction code. -Input arguments values matching corresponding types in the source code and passed in the same order. +Input arguments values that match corresponding types in the source code and passed in the same order. Example: ```shell @@ -108,7 +107,7 @@ Specify the name of the account that will be used to sign the transaction. - Flag: `--show-diff` - Valid inputs: `true`, `false` -Shows a diff to approve before updating between deployed contract and new contract updates. +Shows a diff to approve before you update between deployed contract and new contract updates. ### Arguments JSON @@ -117,8 +116,8 @@ Shows a diff to approve before updating between deployed contract and new contra - Example: `flow accounts update-contract ./tx.cdc '[{"type": "String", "value": "Hello"}]'` 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). + +Cadence JSON format contains `type` and `value` keys and is [documented here]. ### Include Fields @@ -133,17 +132,14 @@ Specify fields to include in the result output. Applies only to the text output. - 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 @@ -195,12 +191,17 @@ Specify the log level. Control how much output you want to see during command ex - 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. + +You can use the `-f` flag multiple times to merge several configuration files. ### Version Check - Flag: `--skip-version-check` - Default: `false` -Skip version check during start up to speed up process for slow connections. \ No newline at end of file +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/accounts/create-accounts.md b/docs/build/tools/flow-cli/accounts/create-accounts.md index 2a40a737c0..702f704bd7 100644 --- a/docs/build/tools/flow-cli/accounts/create-accounts.md +++ b/docs/build/tools/flow-cli/accounts/create-accounts.md @@ -4,18 +4,19 @@ description: How to create a Flow account from the command line sidebar_position: 2 --- -The Flow CLI provides a command to submit an account creation -transaction to any Flow Access API. There are two options how to create an account, you can use the -interactive mode which guides you through the process and creates the account for you or by using -the manual process which requires a pre-existing account on the network you chose. +The Flow CLI provides a command to submit an account creation transaction to any Flow Access API. + +There are two options how to create an account: +- Use the interactive mode which guides you through the process and creates the account for you. +- Use the manual process which requires a current account on the network you chose. ## Interactive Mode -Creating the account in interactive mode prompts you for an account name and network selection. -After you enter the required information the account will be created for you and saved to `flow.json`. -If account creation is done on testnet or mainnet the account key will be saved to a separate key file, -which will also be put in `.gitignore`. You can [read more about key security here](../flow.json/security.md). -💡 _Please note that the account creation process can take up to a minute so please be patient._ +When you create the account in interactive mode, the system prompts you for an account name and network selection. + +After you enter the required information, the system creates the account for you and saves it to `flow.json`. If account creation is done on testnet or mainnet the account key is saved to a separate key file, which will also be put in `.gitignore`. You can [read more about key security here]. + +💡 _The account creation process can take up to a minute, so please be patient._ ```shell flow accounts create @@ -31,10 +32,11 @@ Here’s a summary of all the actions that were taken: - Added mike.pkey to .gitignore. ``` -## Manual Mode -Manual mode requires you to have a pre-existing account on the network which you will have to provide as a signer. -That account must be added to `flow.json` for the command to work. You also have to generate a key pair, we -suggest using the `flow keys generate` command, [which you can read more about here](../keys/generate-keys.md). +## Manual mode + +Manual mode requires you to have a current account on the network, which you will have to provide as a signer. You must add that account to `flow.json` for the command to work. + +You also have to generate a key pair, we suggest you use the `flow keys generate` command, [which you can read more about here]. ```shell # Create an account on Flow Testnet @@ -69,15 +71,14 @@ In the above example, the `flow.json` file would look something like this: ## Flags -### Public Key +### Public key - Flag: `--key` - Valid inputs: a hex-encoded public key in raw form. -Specify the public key that will be added to the new account -upon creation. +Specify the public key that the system adds to the new account upon creation. -### Key Weight +### Key weight - Flag: `--key-weight` - Valid inputs: number between 0 and 1000 @@ -85,46 +86,41 @@ upon creation. Specify the weight of the public key being added to the new account. -When opting to use this flag, you must specify a `--key-weight` flag for each public `--key` flag provided. +When you use this flag, you must specify a `--key-weight` flag for each public `--key` flag provided. -### Public Key Signature Algorithm +### Public key signature algorithm - Flag: `--sig-algo` - Valid inputs: `"ECDSA_P256", "ECDSA_secp256k1"` - Default: `"ECDSA_P256"` -Specify the ECDSA signature algorithm for the provided public key. -This option can only be used together with the `--key` flag. +Specify the ECDSA signature algorithm for the provided public key. This option can only be used together with the `--key` flag. 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"` - Default: `"SHA3_256"` -Specify the hash algorithm that will be paired with the public key -upon account creation. +Specify the hash algorithm that will be paired with the public key upon account creation. ### Signer - Flag: `--signer` - Valid inputs: the name of an account defined in `flow.json`. -Specify the name of the account that will be used to sign the transaction -and pay the account creation fee. +Specify the name of the account that will be used to sign the transaction and pay the account creation fee. ### Contract - Flag: `--contract` -- Valid inputs: String with format `name:filename`, where `name` is - name of the contract as it is defined in the contract source code - and `filename` is the filename of the contract source code. +- Valid inputs: String with format `name:filename`, where `name` is the name of the contract as it is defined in the contract source code, and `filename` is the filename of the contract source code. Specify one or more contracts to be deployed during account creation. -### Include Fields +### Include fields - Flag: `--include` - Valid inputs: `contracts` @@ -137,17 +133,14 @@ Specify fields to include in the result output. Applies only to the text output. - 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 @@ -180,7 +173,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 the result to be saved. ### Log @@ -198,13 +191,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. \ No newline at end of file +Skip version check during start up to speed up process for slow connections. + + + +[read more about key security here]: ../flow.json/security.md +[which you can read more about here]: ../keys/generate-keys.md diff --git a/docs/build/tools/flow-cli/accounts/get-accounts.md b/docs/build/tools/flow-cli/accounts/get-accounts.md index e77de5ce7a..42efb6a6a5 100644 --- a/docs/build/tools/flow-cli/accounts/get-accounts.md +++ b/docs/build/tools/flow-cli/accounts/get-accounts.md @@ -10,7 +10,7 @@ The Flow CLI provides a command to fetch any account by its address from the Flo flow accounts get
``` -## Example Usage +## Example usage ```shell flow accounts get 0xf8d6e0586b0a20c7 @@ -45,11 +45,11 @@ Contract: 'FlowStorageFees' - Name: `address` - Valid Input: Flow account address -Flow [account address](../../../cadence/basics/accounts.md) (prefixed with `0x` or not). +Flow [account address] (prefixed with `0x` or not). ## Flags -### Include Fields +### Include fields - Flag: `--include` - Valid inputs: `contracts` @@ -62,17 +62,14 @@ Specify fields to include in the result output. Applies only to the text output. - 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 @@ -105,7 +102,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 the result to be saved. ### Log @@ -124,12 +121,16 @@ Specify the log level. Control how much output you want to see during command ex - 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. -### Version Check +You can use the `-f` flag multiple times to merge several configuration files. + +### Version check - Flag: `--skip-version-check` - Default: `false` Skip version check during start up to speed up process for slow connections. + + + +[account address]: ../../../cadence/basics/accounts.md \ No newline at end of file diff --git a/docs/build/tools/flow-cli/deployment/deploy-project-contracts.md b/docs/build/tools/flow-cli/deployment/deploy-project-contracts.md index 94682c9a8a..c91cbc182d 100644 --- a/docs/build/tools/flow-cli/deployment/deploy-project-contracts.md +++ b/docs/build/tools/flow-cli/deployment/deploy-project-contracts.md @@ -8,14 +8,18 @@ sidebar_position: 3 flow project deploy ``` -This command automatically deploys your project's contracts based on the -configuration defined in your `flow.json` file. +This command automatically deploys your project's contracts based on the configuration defined in your `flow.json` file. -**Important:** Use Flow CLI commands to configure your project instead of manually editing `flow.json`. -Before using this command, read about how to -[configure project contracts and deployment targets](./project-contracts.md) using CLI commands. +:::info -## Example Usage +Use Flow CLI commands to configure your project rather than manually edit `flow.json`. + +Before you use this command, read about how to +[configure project contracts and deployment targets] with CLI commands. + +::: + +## Example usage ```shell > flow project deploy --network=testnet @@ -28,9 +32,11 @@ KittyItems -> 0x8910590293346ec4 ✨ All contracts deployed successfully ``` -**Note:** The `flow.json` configuration shown below is created automatically when you use CLI commands. -You should use `flow config add contract` and `flow config add deployment` to configure your project -rather than manually editing the file. See [Add Project Contracts](./project-contracts.md) for details. +:::info + +The `flow.json` configuration shown below is created automatically when you use CLI commands. You should use `flow config add contract` and `flow config add deployment` to configure your project rather than manually edit the file. See [Add Project Contracts] for details. + +::: Your `flow.json` file might look something like this: @@ -66,16 +72,18 @@ access(all) contract KittyItems { } ``` -## Initialization Arguments +## Initialization arguments + +To deploy contracts that take initialization arguments, you must add those arguments to the deployment configuration. + +:::info -Deploying contracts that take initialization arguments requires adding those arguments to the deployment configuration. +For basic deployments, use `flow config add deployment` to configure your contracts. Initialization arguments are an advanced feature that may require you to manually edit `flow.json` after the basic deployment is configured with CLI commands. -**Note:** For basic deployments, use `flow config add deployment` to configure your contracts. -Initialization arguments are an advanced feature that may require manual editing of `flow.json` -after the basic deployment is configured with CLI commands. +::: -Each deployment can be specified as an object containing -`name` and `args` keys specifying arguments to be +You can specify each deployment as an object that contains +`name` and `args` keys that specify arguments to be used during the deployment. Example: ```json @@ -97,30 +105,26 @@ used during the deployment. Example: } ``` -⚠️ **Security Warning:** Never put raw private keys in `flow.json`. Always use `.pkey` files for key storage. -Before proceeding, we recommend reading the [Flow CLI security guidelines](../flow.json/security.md) +:::danger + +⚠️ **Never** put raw private keys in `flow.json`. Always use `.pkey` files for key storage. Before you proceed, we recommend that you read the [Flow CLI security guidelines] to learn about the best practices for private key storage. -## Dependency Resolution +## Dependency resolution The `deploy` command attempts to resolve the import statements in all contracts being deployed. -After the dependencies are found, the CLI will deploy the contracts in a deterministic order -such that no contract is deployed until all of its dependencies are deployed. -The command will return an error if no such ordering exists due to one or more cyclic dependencies. +After the dependencies are found, the CLI will deploy the contracts in a deterministic order such that no contract is deployed until all of its dependencies are deployed. The command will return an error if no such ordering exists due to one or more cyclic dependencies. In the example above, `NonFungibleToken` will always be deployed before `KittyItems` since `KittyItems` imports `NonFungibleToken`. -## Address Replacement +## Address replacement -After resolving all dependencies, the `deploy` command rewrites each contract so -that its dependencies are imported from their _target addresses_ rather than their -source file location. +After it resolves all dependencies, the `deploy` command rewrites each contract so that its dependencies are imported from their _target addresses_ rather than their source file location. -The rewritten versions are then deployed to their respective targets, -leaving the original contract files unchanged. +The rewritten versions are then deployed to their respective targets, which leaves the original contract files unchanged. -### Contracts Importing from Other Contracts +### Contracts that import from other contracts In the example above, the `KittyItems` contract would be rewritten like this: @@ -132,7 +136,7 @@ access(all) contract KittyItems { } ``` -### Contracts Importing from Dependencies +### Contracts that import from dependencies When your contracts import from the `dependencies` section, the deploy command uses the network-specific aliases defined in those dependencies. @@ -211,18 +215,23 @@ access(all) contract ExampleConnectors { The deploy command automatically uses the addresses from the `dependencies` section's aliases for the target network. Notice how the addresses change based on the network—testnet uses `0x9a0766d93b6608b7` for `FungibleToken`, while mainnet uses `0xf233dcee88fe0abe`. Contracts in the `dependencies` section are not deployed—they're assumed to already exist on the network at the addresses specified in their aliases. -## Merging Multiple Configuration Files +## Merge multiple configuration files You can use the `-f` flag multiple times to merge several configuration files. -If there is an overlap in any of the fields in the configuration between two or more configuration files, the value of -the overlapped field in the resulting configuration will come from the configuration file that is on the further right -order in the list of configuration files specified in the `-f` flag. +If there is an overlap in any of the fields in the configuration between two or more configuration files, the value of the overlapped field in the configuration that results will come from the configuration file that is on the further right order in the list of configuration files specified in the `-f` flag. + +:::danger + +**Never** put raw private keys in `flow.json`. Always use `.pkey` files for key storage. + +::: -**Important:** Never put raw private keys in `flow.json`. Always use `.pkey` files for key storage. +:::info -**Note:** Use `flow config add account` to create accounts in your main `flow.json` file. -The merging feature is useful for separating sensitive account information into a separate file that you can exclude from version control. +Use `flow config add account` to create accounts in your main `flow.json` file. The merging feature is useful to separate sensitive account information into a separate file that you can exclude from version control. + +::: **Example usage:** @@ -267,8 +276,8 @@ flow project deploy -f flow.json -f private.json } ``` -When using multiple configuration files with overlapping fields, the rightmost file takes precedence. -In this example, the resulting merged configuration will be: +When you use multiple configuration files with overlapping fields, the rightmost file takes precedence. +In this example, the merged configuration that results will be: ```json { @@ -295,22 +304,21 @@ In this example, the resulting merged configuration will be: ## Flags -### Allow Updates +### Allow updates - Flag: `--update` - Valid inputs: `true`, `false` - Default: `false` -Indicate whether to overwrite and upgrade existing contracts. Only contracts with difference with existing contracts -will be overwritten. +Indicate whether to overwrite and upgrade current contracts. The system will only overwrite contracts that are different from current contracts. -### Show Update Diff +### Show update diff - Flag: `--show-diff` - Valid inputs: `true`, `false` - Default: `false` -Shows a diff to approve before updating between deployed contract and new contract updates. +Shows a diff to approve before an update between deployed contract and new contract updates. ### Host @@ -318,17 +326,14 @@ Shows a diff to approve before updating between deployed contract and new contra - 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 executing the command. ### Network @@ -389,3 +394,9 @@ several configuration files. - Default: `false` Skip version check during start up to speed up process for slow connections. + + + +[configure project contracts and deployment targets]: ./project-contracts.md +[Add Project Contracts]: ./project-contracts.md +[Flow CLI security guidelines]: ../flow.json/security.md \ No newline at end of file diff --git a/docs/build/tools/flow-cli/deployment/project-contracts.md b/docs/build/tools/flow-cli/deployment/project-contracts.md index e697c4c09c..0940ca71d8 100644 --- a/docs/build/tools/flow-cli/deployment/project-contracts.md +++ b/docs/build/tools/flow-cli/deployment/project-contracts.md @@ -6,7 +6,7 @@ sidebar_position: 2 ## Generate a Contract -Create a new contract file using the Flow CLI: +Create a new contract file with the Flow CLI: ```bash flow generate contract Foo @@ -14,9 +14,9 @@ flow generate contract Foo This command creates `cadence/contracts/Foo.cdc` with a basic contract template and automatically adds it to your `flow.json` configuration. -## Add a Contract to Configuration +## Add a contract to configuration -If you have an existing contract file, add it to your project configuration using the CLI: +If you have a contract file, add it to your project configuration with the CLI: ```bash flow config add contract @@ -24,8 +24,8 @@ flow config add contract Follow the interactive prompts: -1. **Contract name**: Enter the contract name (e.g., `Foo`) -2. **Contract filename**: Enter the path to your contract file (e.g., `./cadence/contracts/Foo.cdc`) +1. **Contract name**: Enter the contract name (for exxample, `Foo`) +2. **Contract filename**: Enter the path to your contract file (for example, `./cadence/contracts/Foo.cdc`) 3. **Add aliases**: Optionally add network aliases for dependencies You can also use flags to specify all details at once: @@ -46,9 +46,9 @@ flow config add contract \ } ``` -## Configure Contract Deployment Targets +## Configure contract deployment targets -Once a contract is added to your configuration, configure deployment targets using the CLI: +After a contract is added to your configuration, configure deployment targets with the CLI: ```bash flow config add deployment @@ -56,9 +56,9 @@ flow config add deployment Follow the interactive prompts: -1. **Network**: Select the network (e.g., `testnet`, `mainnet`, `emulator`) -2. **Account**: Select the account to deploy to (e.g., `my-testnet-account`) -3. **Contract**: Select the contract to deploy (e.g., `Foo`) +1. **Network**: Select the network (for example, `testnet`, `mainnet`, `emulator`) +2. **Account**: Select the account to deploy to (for example, `my-testnet-account`) +3. **Contract**: Select the contract to deploy (for example, `Foo`) 4. **Deploy more contracts**: Choose `yes` to add additional contracts to the same deployment You can also use flags to specify all details: @@ -82,7 +82,7 @@ flow config add deployment \ } ``` -## Add Multiple Contracts to a Deployment +## Add multiple contracts to a deployment To deploy multiple contracts to the same account, run the deployment configuration command multiple times or use the interactive prompt to add more contracts: @@ -102,7 +102,7 @@ This adds `Bar` to the existing deployment: } ``` -## Remove Contracts and Deployments +## Remove contracts and deployments Remove contracts or deployments using the CLI: @@ -116,9 +116,14 @@ flow config remove deployment testnet my-testnet-account Foo ## Best Practices -- **Use CLI commands**: Always use `flow config add` and `flow config remove` instead of manually editing `flow.json` +- **Use CLI commands**: Always use `flow config add` and `flow config remove` rather than manually edit `flow.json` - **Generate contracts**: Use `flow generate contract` to create new contracts with proper structure - **Verify configuration**: Use `flow accounts list` and check your `flow.json` to verify your configuration - **Network-specific deployments**: Configure separate deployments for each network (emulator, testnet, mainnet) -For more information, see [Manage Configuration](../flow.json/manage-configuration.md) and [Production Deployment](../../../../blockchain-development-tutorials/cadence/getting-started/production-deployment.md). +For more information, see [Manage Configuration] and [Production Deployment]. + + + +[Manage Configuration]: ../flow.json/manage-configuration.md +[Production Deployment]: ../../../../blockchain-development-tutorials/cadence/getting-started/production-deployment.md \ No newline at end of file