diff --git a/docs/build/tools/flow-cli/flow.json/configuration.md b/docs/build/tools/flow-cli/flow.json/configuration.md index 4653c56175..d070e4ef5e 100644 --- a/docs/build/tools/flow-cli/flow.json/configuration.md +++ b/docs/build/tools/flow-cli/flow.json/configuration.md @@ -45,9 +45,9 @@ The `networks` section defines which Flow networks your project can connect to. ``` **Common Networks:** -- `emulator`: Your local development environment -- `testnet`: Flow's test network for development and testing -- `mainnet`: Flow's production network +- `emulator`: Your local development environment. +- `testnet`: Flow's test network for development and testing. +- `mainnet`: Flow's production network. **Secure Connections:** For enhanced security, you can specify network keys: @@ -65,7 +65,7 @@ For enhanced security, you can specify network keys: The `accounts` section defines the accounts you can use for transactions and deployments. -#### Simple Account Format +#### Simple account format ```json "accounts": { @@ -76,7 +76,7 @@ The `accounts` section defines the accounts you can use for transactions and dep } ``` -#### Advanced Account Format +#### Advanced account format For more control over key management: @@ -96,10 +96,10 @@ For more control over key management: ``` **Key Types:** -- `hex`: Standard hex-encoded private key -- `file`: Read key from a separate file -- `bip44`: Derive from mnemonic phrase -- `google-kms`: Use Google Cloud KMS +- `hex`: Standard hex-encoded private key. +- `file`: Read key from a separate file. +- `bip44`: Derive from mnemonic phrase. +- `google-kms`: Use Google Cloud KMS. **File-Based Keys:** For better security, you can store private keys in separate files: @@ -116,7 +116,7 @@ For better security, you can store private keys in separate files: } ``` -The key file should contain only the hex-encoded private key (e.g., `ae1b44c0f5e8f6992ef2348898a35e50a8b0b9684000da8b1dade1b3bcd6ebee`). +The key file should contain only the hex-encoded private key (for example, `ae1b44c0f5e8f6992ef2348898a35e50a8b0b9684000da8b1dade1b3bcd6ebee`). **Special Address Values:** - `"service"`: Use the default service account (emulator only) @@ -125,7 +125,7 @@ The key file should contain only the hex-encoded private key (e.g., `ae1b44c0f5e The `contracts` section maps contract names to their source files. -#### Simple Contract Format +#### Simple contract format ```json "contracts": { @@ -134,7 +134,7 @@ The `contracts` section maps contract names to their source files. } ``` -#### Advanced Contract Format with Aliases +#### Advanced contract format with aliases Use aliases when contracts are already deployed on specific networks: @@ -151,13 +151,13 @@ Use aliases when contracts are already deployed on specific networks: ``` **When to Use Aliases:** -- For core contracts already deployed on mainnet/testnet -- To avoid redeploying dependencies -- To use the official versions of common contracts +- For core contracts already deployed on mainnet or testnet. +- To avoid dependency redeployment. +- To use the official versions of common contracts. -#### Cadence Import Aliasing +#### Cadence import aliasing -When deploying the same contract to multiple addresses with different names, use the `canonical` field to reference the original contract. This allows you to import multiple instances of the same contract with different identifiers. +When you deploy the same contract to multiple addresses with different names, use the `canonical` field to reference the original contract. This allows you to import multiple instances of the same contract with different identifiers. ```json "contracts": { @@ -209,9 +209,9 @@ The `deployments` section defines which contracts get deployed to which accounts **Format:** `"NETWORK": { "ACCOUNT": ["CONTRACT1", "CONTRACT2"] }` **Important Notes:** -- Don't deploy contracts that have aliases defined for that network -- Contracts are deployed in dependency order automatically -- You can deploy the same contract to multiple accounts (but not in the same deploy command) +- Don't deploy contracts that have aliases defined for that network. +- Contracts are deployed in dependency order automatically. +- You can deploy the same contract to multiple accounts (but not in the same deploy command). ### Emulators @@ -226,7 +226,7 @@ Customize emulator settings (optional): } ``` -## Complete Example +## Complete example Here's a complete `flow.json` for a project with multiple contracts and networks: @@ -272,9 +272,9 @@ Here's a complete `flow.json` for a project with multiple contracts and networks } ``` -## Managing Configuration +## Manage configuration -Instead of editing `flow.json` manually, use the CLI commands: +Rather than edit `flow.json` manually, use the CLI commands: ```bash # Add an account @@ -292,16 +292,23 @@ flow config remove account my-account ## Best Practices -1. **Use CLI commands** when possible instead of manual editing -2. **Keep private keys secure** - consider using file-based keys for production -3. **Use aliases** for core contracts to avoid redeployment -4. **Test on emulator first** before deploying to testnet -5. **Use different accounts** for different networks -6. **Backup your configuration** before making major changes +1. **Use CLI commands** when possible instead of manual editing. +2. **Keep private keys secure** - consider file-based keys for production. +3. **Use aliases** for core contracts to avoid redeployment. +4. **Test on emulator first** before you deploy to testnet. +5. **Use different accounts** for different networks. +6. **Backup your configuration** before you make major changes. ## Related Commands -- [`flow init`](./initialize-configuration.md) - Initialize a new project -- [`flow config add`](./manage-configuration.md) - Add configuration items -- [`flow project deploy`](../deployment/deploy-project-contracts.md) - Deploy contracts -- [`flow accounts create`](../accounts/create-accounts.md) - Create new accounts +- [`flow init`] - Initialize a new project +- [`flow config add`] - Add configuration items +- [`flow project deploy`] - Deploy contracts +- [`flow accounts create`] - Create new accounts + + + +[`flow init`]: ./initialize-configuration.md +[`flow config add`]: ./manage-configuration.md +[`flow project deploy`]: ../deployment/deploy-project-contracts.md +[`flow accounts create`]: ../accounts/create-accounts.md \ No newline at end of file diff --git a/docs/build/tools/flow-cli/flow.json/initialize-configuration.md b/docs/build/tools/flow-cli/flow.json/initialize-configuration.md index 5f0e2bbb90..e0bfc3e813 100644 --- a/docs/build/tools/flow-cli/flow.json/initialize-configuration.md +++ b/docs/build/tools/flow-cli/flow.json/initialize-configuration.md @@ -4,9 +4,9 @@ description: How to initialize Flow configuration using CLI sidebar_position: 1 --- -The `flow init` command creates a new Flow project with a basic `flow.json` configuration file. This is the first step in setting up any Flow project. +The `flow init` command creates a new Flow project with a basic `flow.json` configuration file. This is the first step to set up any Flow project. -## Basic Usage +## Basic usage ```shell flow init @@ -14,15 +14,15 @@ flow init This command will: -- Create a new `flow.json` configuration file -- Set up default networks (emulator, testnet, mainnet) -- Create an emulator service account -- Generate a basic project structure with `cadence/` directories -- Give you options for project scaffolding +- Create a new `flow.json` configuration file. +- Set up default networks (emulator, testnet, mainnet). +- Create an emulator service account. +- Generate a basic project structure with `cadence/` directories. +- Give you options for project scaffolding. -## Project Structure +## Project structure -After running `flow init`, you'll have: +After you run `flow init`, you'll have: ``` my-project/ @@ -35,9 +35,9 @@ my-project/ └── tests/ ``` -## Configuration Only +## Configuration only -If you only want to generate the `flow.json` file without creating the full project structure, use the `--config-only` flag: +If you only want to generate the `flow.json` file, but not create the full project structure, use the `--config-only` flag: ```shell flow init --config-only @@ -45,11 +45,11 @@ flow init --config-only This is useful when: -- You already have a project structure -- You want to add Flow configuration to an existing project -- You're setting up configuration for a specific environment +- You already have a project structure. +- You want to add Flow configuration to a current project. +- You want to set up configuration for a specific environment. -## Global Configuration +## Global configuration You can create a global `flow.json` file that applies to all Flow projects on your system: @@ -67,9 +67,9 @@ flow init --global 1. Local `flow.json` (highest priority) 2. Global `flow.json` (lowest priority) -Local configuration files will override global settings for overlapping properties. +Local configuration files will override global settings for properties that overlap. -## Error Handling +## Error handling If a `flow.json` file already exists, you'll see this error: @@ -79,13 +79,13 @@ If a `flow.json` file already exists, you'll see this error: **Solutions:** -- Delete the existing `flow.json` file first -- Initialize in a different directory -- Use `--config-only` to create a new config in a different location +- Delete the current `flow.json` file first. +- Initialize in a different directory. +- Use `--config-only` to create a new config in a different location. ## Flags -### Configuration Only +### Configuration only ```shell flow init --config-only @@ -93,7 +93,7 @@ flow init --config-only Creates only the `flow.json` file without project structure. -### Global Flags +### Global flags The following global flags are also available: @@ -112,7 +112,7 @@ flow init --yes ## Next Steps -After initializing your configuration: +After you initialize the configuration: 1. **Review the generated `flow.json`** - Understand the default setup 2. **Add your contracts** - Use `flow config add contract` @@ -122,6 +122,12 @@ After initializing your configuration: ## Related Commands -- [`flow config add`](./manage-configuration.md) - Add configuration items -- [`flow accounts create`](../accounts/create-accounts.md) - Create new accounts -- [`flow project deploy`](../deployment/deploy-project-contracts.md) - Deploy contracts +- [`flow config add`] - Add configuration items +- [`flow accounts create`] - Create new accounts +- [`flow project deploy`] - Deploy contracts + + + +[`flow config add`]: ./manage-configuration.md +[`flow project deploy`]: ../deployment/deploy-project-contracts.md +[`flow accounts create`]: ../accounts/create-accounts.md \ No newline at end of file diff --git a/docs/build/tools/flow-cli/flow.json/manage-configuration.md b/docs/build/tools/flow-cli/flow.json/manage-configuration.md index 654f7ded07..ea6b459bde 100644 --- a/docs/build/tools/flow-cli/flow.json/manage-configuration.md +++ b/docs/build/tools/flow-cli/flow.json/manage-configuration.md @@ -4,9 +4,9 @@ description: How to configure the Flow CLI using config commands sidebar_position: 3 --- -Instead of manually editing `flow.json`, use the Flow CLI's `config` commands to add, remove, and manage your project configuration. These commands provide validation and ensure your configuration is properly formatted. +Rather than manually edit `flow.json`, use the Flow CLI's `config` commands to add, remove, and manage your project configuration. These commands provide validation and ensure your configuration is properly formatted. -## Basic Commands +## Basic commands ```shell # Add configuration items @@ -16,9 +16,9 @@ flow config add flow config remove ``` -## Adding Configuration +## Adding configuration -### Add an Account +### Add an account ```shell flow config add account @@ -54,7 +54,7 @@ flow config add account \ } ``` -### Add a Contract +### Add a contract ```shell flow config add contract @@ -90,7 +90,7 @@ flow config add contract \ } ``` -### Add a Network +### Add a network ```shell flow config add network @@ -120,7 +120,7 @@ flow config add network \ } ``` -### Add a Deployment +### Add a deployment ```shell flow config add deployment @@ -149,37 +149,41 @@ flow config add deployment \ } ``` -## Removing Configuration +## Remove configuration -### Remove an Account +### Remove an account ```shell flow config remove account my-testnet-account ``` -### Remove a Contract +### Remove a contract ```shell flow config remove contract MyToken ``` -### Remove a Network +### Remove a network ```shell flow config remove network custom-testnet ``` -### Remove a Deployment +### Remove a deployment ```shell flow config remove deployment my-testnet-account testnet ``` -**Note:** This removes all deployments for the specified account on the specified network. +:::info -## Configuration File Management +This removes all deployments for the specified account on the specified network. -### Using Custom Configuration Files +:: + +## Configuration file management + +### Use custom configuration files ```shell # Use a specific configuration file @@ -189,13 +193,13 @@ flow config add account --config-path ./config/flow.json flow config add account -f flow.json -f private.json ``` -### Configuration File Priority +### Configuration file priority -When using multiple configuration files with `-f` flag: +When you use multiple configuration files with `-f` flag: -1. Files are merged from left to right -2. Later files override earlier ones for overlapping properties -3. Non-overlapping properties are combined +1. Files are merged from left to right. +2. Later files override earlier ones when properties overlap. +3. Non-overlapping properties are combined. **Example:** ```shell @@ -204,9 +208,9 @@ flow config add account -f flow.json -f private.json If both files have an `admin-account`, the one from `private.json` will be used. -### Security Best Practices +### Security best practices -For better security, consider using separate configuration files for sensitive data: +For better security, consider separate configuration files for sensitive data: **Main configuration file (`flow.json`):** ```json @@ -240,29 +244,33 @@ For better security, consider using separate configuration files for sensitive d } ``` -⚠️ **Important:** Always add private files to `.gitignore` to prevent committing sensitive data to source control. +:::warning + +Always add private files to `.gitignore` to prevent committing sensitive data to source control. + +::: ## Validation The `config add` command validates all inputs: -- **Account addresses** must be valid Flow addresses (16-character hex) -- **Private keys** must be valid hex-encoded keys -- **Contract sources** must point to existing `.cdc` files -- **Network hosts** must be valid host:port combinations -- **Deployments** must reference existing accounts and contracts +- **Account addresses** must be valid Flow addresses (16-character hex). +- **Private keys** must be valid hex-encoded keys. +- **Contract sources** must point to current `.cdc` files. +- **Network hosts** must be valid host:port combinations. +- **Deployments** must reference current accounts and contracts. ## Best Practices -1. **Use CLI commands** instead of manual editing when possible -2. **Validate your configuration** by running `flow config add` commands -3. **Use descriptive names** for accounts and contracts -4. **Keep sensitive data separate** using multiple config files -5. **Test deployments** on emulator before adding to testnet/mainnet +1. **Use CLI commands** instead of manual edits when possible. +2. **Validate your configuration** by running `flow config add` commands. +3. **Use descriptive names** for accounts and contracts. +4. **Keep sensitive data separate** with multiple config files. +5. **Test deployments** on emulator before adding to testnet and mainnet. -## Common Use Cases +## Common use cases -### Setting Up a New Project +### Set up a new project ```shell # Initialize project @@ -281,7 +289,7 @@ flow config add deployment --network emulator --account emulator-account --contr flow config add deployment --network testnet --account testnet-account --contract MyToken --contract MyNFT ``` -### Adding to Existing Project +### Add to current project ```shell # Add new contract @@ -291,7 +299,7 @@ flow config add contract --name NewContract --filename ./cadence/contracts/NewCo flow config add deployment --network testnet --account testnet-account --contract NewContract ``` -### Managing Multiple Environments +### Manage multiple environments ```shell # Use separate config files for different environments @@ -299,14 +307,17 @@ flow config add account --name admin-account --address f8d6e0586b0a20c7 --privat flow config add account --name admin-account --address f1d6e0586b0a20c7 --private-key 3335dfdeb0ff03a7a73ef39788563b62c89adea67bbb21ab95e5f710bd1d40b7 -f private.json ``` -## Related Commands - -- [`flow init`](./initialize-configuration.md) - Initialize a new project -- [`flow project deploy`](../deployment/deploy-project-contracts.md) - Deploy contracts -- [`flow accounts create`](../accounts/create-accounts.md) - Create new accounts +## Related commands +- [`flow init`] - Initialize a new project +- [`flow project deploy`] - Deploy contracts +- [`flow accounts create`] - Create new accounts + +[`flow init`]: ./initialize-configuration.md +[`flow project deploy`]: ../deployment/deploy-project-contracts.md +[`flow accounts create`]: ../accounts/create-accounts.md diff --git a/docs/build/tools/flow-cli/flow.json/security.md b/docs/build/tools/flow-cli/flow.json/security.md index c5e760e581..9bf34223eb 100644 --- a/docs/build/tools/flow-cli/flow.json/security.md +++ b/docs/build/tools/flow-cli/flow.json/security.md @@ -4,26 +4,30 @@ description: How to securely use Flow CLI and protect your private keys sidebar_position: 4 --- -Managing accounts and private keys requires careful attention to security. This guide covers best practices for keeping your Flow accounts and private keys secure when using the Flow CLI. +To manage accounts and private keys requires careful attention to security. This guide covers best practices to keep your Flow accounts and private keys secure when you use the Flow Command Line Interface (CLI). ## Security Overview -⚠️ **Critical Warning**: Never commit private keys to source control. Always use secure methods to store and manage your private keys. +:::danger -The Flow CLI provides several secure options for managing private account data: +⚠️ **Never** commit private keys to source control. Always use secure methods to store and manage your private keys. -1. **File-based keys** - Store keys in separate files -2. **Environment variables** - Use system environment variables -3. **Private configuration files** - Separate sensitive config from main config -4. **Multiple config files** - Merge secure and public configurations +::: -## File-Based Keys +The Flow CLI provides several secure options to manage private account data: + +1. **File-based keys** - Store keys in separate files. +2. **Environment variables** - Use system environment variables. +3. **Private configuration files** - Separate sensitive config from main config. +4. **Multiple config files** - Merge secure and public configurations. + +## File-based keys Store private keys in separate files that are excluded from source control. ### Setup -1. **Create a key file** (e.g., `my-account.key`): +1. **Create a key file** (for example, `my-account.key`): ```bash # Only the hex-encoded private key 334232967f52bd75234ae9037dd4694c1f00baad63a10c35172bf65fbb8ad1111 @@ -59,7 +63,7 @@ private.json - ✅ Clear separation of concerns - ✅ Works with all Flow CLI commands -## Environment Variables +## Environment variables Use environment variables for sensitive data like private keys and addresses. @@ -89,12 +93,12 @@ FLOW_PRIVATE_KEY="your-key" flow project deploy ``` ### Benefits -- ✅ Keys never stored in files -- ✅ Easy to manage different environments -- ✅ Works with CI/CD systems -- ✅ Can be rotated easily +- ✅ Keys never stored in files. +- ✅ Easy to manage different environments. +- ✅ Works with CI or CD systems. +- ✅ Can be rotated easily. -## Private Configuration Files +## Private configuration files Create separate configuration files for sensitive data and merge them when needed. @@ -137,10 +141,10 @@ flow project deploy -f flow.json -f private.json ``` ### Benefits -- ✅ Clear separation of public and private data -- ✅ Easy to manage multiple environments -- ✅ Can be shared safely (without private files) -- ✅ Works with all CLI commands +- ✅ Clear separation of public and private data. +- ✅ Easy to manage multiple environments. +- ✅ Can be shared safely (without private files). +- ✅ Works with all CLI commands. ## Environment Files (.env) @@ -179,21 +183,22 @@ FLOW_NETWORK=testnet ``` ### Benefits -- ✅ Automatic loading by CLI -- ✅ Easy local development -- ✅ Can have different files for different environments -- ✅ Standard practice for many tools -## Multiple Configuration Files +- ✅ Automatic loading by CLI. +- ✅ Easy local development. +- ✅ Can have different files for different environments. +- ✅ Standard practice for many tools. + +## Multiple configuration files Merge multiple configuration files for complex setups. -### Priority Order +### Priority order -When using multiple files, they are merged in order: -1. **Left to right** - Files specified first have lowest priority -2. **Later files override** - Properties in later files take precedence -3. **Non-overlapping properties** - Are combined from all files +When you use multiple files, they are merged in order: +1. **Left to right** - Files specified first have lowest priority. +2. **Later files override** - Properties in later files take precedence. +3. **Non-overlapping properties** - Are combined from all files. ### Example @@ -203,7 +208,7 @@ flow project deploy -f flow.json -f private.json -f local.json **Result**: `local.json` overrides `private.json`, which overrides `flow.json` -### Use Cases +### Use cases - **Development**: `flow.json` + `dev-private.json` - **Staging**: `flow.json` + `staging-private.json` @@ -224,29 +229,29 @@ secrets.json *.private.json ``` -### 2. Use Different Keys for Different Environments +### 2. Use different keys for different environments -- **Development**: Use testnet keys -- **Staging**: Use separate testnet keys -- **Production**: Use mainnet keys with highest security +- **Development**: Use testnet keys. +- **Staging**: Use separate testnet keys. +- **Production**: Use mainnet keys with highest security. -### 3. Rotate Keys Regularly +### 3. Rotate keys regularly -- Generate new keys periodically -- Update configuration files -- Test with new keys before switching +- Generate new keys periodically. +- Update configuration files. +- Test with new keys before you switch. -### 4. Limit Key Permissions +### 4. Limit key permissions -- Use keys with minimal required permissions -- Consider using different keys for different operations -- Monitor key usage +- Use keys with minimal required permissions. +- Consider using different keys for different operations. +- Monitor key usage. -### 5. Secure Key Storage +### 5. Secure key storage -- Use hardware security modules (HSMs) for production -- Consider cloud key management services -- Encrypt key files when possible +- Use hardware security modules (HSMs) for production. +- Consider cloud key management services. +- Encrypt key files when possible. ## Common Security Mistakes @@ -281,23 +286,23 @@ secrets.json } ``` -## Troubleshooting +## Troubleshoot -### Environment Variables Not Loading +### Environment variables won't load Check that your environment variables are set: ```bash echo $FLOW_PRIVATE_KEY ``` -### Key File Not Found +### Key file not found Verify the key file path in your configuration: ```bash ls -la ./my-account.key ``` -### Multiple Config Files Not Merging +### Multiple config files not merging Check the order of your `-f` flags: ```bash @@ -305,8 +310,14 @@ Check the order of your `-f` flags: flow config add account -f flow.json -f private.json ``` -## Related Commands +## Related commands + +- [`flow config add`] - Add configuration items securely +- [`flow project deploy`] - Deploy with secure configuration +- [`flow accounts create`] - Create accounts securely + + -- [`flow config add`](./manage-configuration.md) - Add configuration items securely -- [`flow project deploy`](../deployment/deploy-project-contracts.md) - Deploy with secure configuration -- [`flow accounts create`](../accounts/create-accounts.md) - Create accounts securely +[`flow config add`]: ./manage-configuration.md +[`flow project deploy`]: ../deployment/deploy-project-contracts.md +[`flow accounts create`]: ../accounts/create-accounts.md \ No newline at end of file diff --git a/docs/build/tools/flow-cli/get-flow-data/get-blocks.md b/docs/build/tools/flow-cli/get-flow-data/get-blocks.md index 00e0fe1030..0cc2a20784 100644 --- a/docs/build/tools/flow-cli/get-flow-data/get-blocks.md +++ b/docs/build/tools/flow-cli/get-flow-data/get-blocks.md @@ -4,7 +4,7 @@ description: How to get a block from the command line sidebar_position: 1 --- -The Flow CLI provides a command to fetch any block from the Flow network. +The Flow Command Line Interface (CLI) provides a command to fetch any block from the Flow network. ```shell flow blocks get @@ -66,7 +66,7 @@ Specify the block to retrieve by block ID or block height. - 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 @@ -89,7 +89,7 @@ Include additional values in the response. - Flag: `--signer` - 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. +Specify the name of the account to use to sign the transaction. ### Host @@ -97,17 +97,14 @@ Specify the name of the account that will be used to sign the 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 to use to execute the command. This flag overrides any host defined by the `--network` flag. ### 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 to use to create a secure GRPC client when you execute the command. ### Network @@ -140,7 +137,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 @@ -158,13 +155,15 @@ 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. + + + +[account address]: ../../../cadence/basics/accounts.md \ No newline at end of file diff --git a/docs/build/tools/flow-cli/get-flow-data/get-collections.md b/docs/build/tools/flow-cli/get-flow-data/get-collections.md index a10d9fb3f3..b8c837ef5d 100644 --- a/docs/build/tools/flow-cli/get-flow-data/get-collections.md +++ b/docs/build/tools/flow-cli/get-flow-data/get-collections.md @@ -10,7 +10,7 @@ The Flow CLI provides a command to fetch any collection from the Flow network. flow collections get ``` -## Example Usage +## Example usage ```shell flow collections get 3e694588e789a72489667a36dd73104dea4579bcd400959d47aedccd7f930eeb \ @@ -44,17 +44,14 @@ ae8bfbc85ce994899a3f942072bfd3455823b1f7652106ac102d161c17fcb55c - 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 to use 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 +- 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 to use to create a secure GRPC client when you execute the command. ### Network @@ -87,7 +84,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 @@ -105,11 +102,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/get-flow-data/get-events.md b/docs/build/tools/flow-cli/get-flow-data/get-events.md index d6282bd432..25aabf17e4 100644 --- a/docs/build/tools/flow-cli/get-flow-data/get-events.md +++ b/docs/build/tools/flow-cli/get-flow-data/get-events.md @@ -4,16 +4,16 @@ description: How to get an event from the command line sidebar_position: 2 --- -Use the event command to fetch a single or multiple events in a specific range of blocks. -You can provide start and end block height range, but also specify number of the latest blocks to -be used to search for specified event. Events are fetched concurrently by using multiple workers which +Use the event command to fetch a single or multiple events in a specific range of blocks. You can provide start and end block height range, but also specify number of the latest blocks to use to search for specified event. + +Events are fetched concurrently via multiple workers, which optionally you can also control by specifying the flags. ```shell flow events get ``` -## Example Usage +## Example usage Get the event by name `A.0b2a3299cc857e29.TopShot.Deposit` from the last 20 blocks on mainnet. ```shell @@ -85,13 +85,12 @@ and `A.1654653399040a61.FlowToken.TokensWithdrawn` in the block height range on ## Arguments -### Event Name +### Event name - Name: `event_name` - Valid Input: String -Fully-qualified identifier for the events. -You can provide multiple event names separated by a space. +Fully-qualified identifier for the events. You can provide multiple event names separated by a space. ## Flags @@ -100,16 +99,14 @@ You can provide multiple event names separated by a space. - Flag: `--start` - Valid inputs: valid block height -Specify the start block height used alongside the end flag. -This will define the lower boundary of the block range. +Specify the start block height used alongside the end flag. This will define the lower boundary of the block range. ### End - Flag: `--end` - Valid inputs: valid block height -Specify the end block height used alongside the start flag. -This will define the upper boundary of the block range. +Specify the end block height used alongside the start flag. This will define the upper boundary of the block range. ### Last @@ -117,8 +114,7 @@ This will define the upper boundary of the block range. - Valid inputs: number - Default: `10` -Specify the number of blocks relative to the last block. Ignored if the -start flag is set. Used as a default if no flags are provided. +Specify the number of blocks relative to the last block. Ignored if the start flag is set. Used as a default if no flags are provided. ### Batch @@ -134,8 +130,7 @@ Number of blocks each worker will fetch. - Valid inputs: number - Default: `10` -Number of workers to use when fetching events concurrently. - +Number of workers to use when you fetch events concurrently. ### Host @@ -143,17 +138,14 @@ Number of workers to use when fetching events concurrently. - 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 to use 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 +- 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 to use to create a secure GRPC client when you execute the command. ### Network @@ -186,7 +178,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 @@ -204,11 +196,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/get-flow-data/get-status.md b/docs/build/tools/flow-cli/get-flow-data/get-status.md index 82660779da..a99bb00002 100644 --- a/docs/build/tools/flow-cli/get-flow-data/get-status.md +++ b/docs/build/tools/flow-cli/get-flow-data/get-status.md @@ -4,11 +4,11 @@ description: How to get access node status from the command line sidebar_position: 4 --- -The Flow CLI provides a command to get network status of specified Flow Access Node +The Flow CLI provides a command to get network status of specified Flow Access Node. `flow status` -## Example Usage +## Example usage ```shell > flow status --network testnet @@ -34,17 +34,14 @@ Specify which network you want the command to use for execution. - 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 to use 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 +- 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 to use to create a secure GRPC client when you execute the command. ### Filter @@ -68,7 +65,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 @@ -86,11 +83,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/keys/decode-keys.md b/docs/build/tools/flow-cli/keys/decode-keys.md index 1a54978986..9040496b97 100644 --- a/docs/build/tools/flow-cli/keys/decode-keys.md +++ b/docs/build/tools/flow-cli/keys/decode-keys.md @@ -10,9 +10,9 @@ The Flow CLI provides a command to decode encoded public account keys. flow keys decode ``` -## Example Usage +## Example usage -### Decode RLP Encoded Public Key +### Decode RLP encoded public key ```shell > flow keys decode rlp f847b84084d716c14b051ad6b001624f738f5d302636e6b07cc75e4530af7776a4368a2b586dbefc0564ee28384c2696f178cbed52e62811bcc9ecb59568c996d342db2402038203e8 @@ -23,7 +23,7 @@ Weight 1000 Revoked false ``` -### Decode PEM Encoded Public Key From File +### Decode PEM encoded public key from file ```shell > flow keys decode pem --from-file key.pem @@ -41,16 +41,15 @@ Revoked false First argument specifies a valid encoding of the public key provided. -### Optional: Public Key +### Optional: public key - Name: `encoded public key` - Valid inputs: valid encoded key content -Optional second argument provides content of the encoded public key. -If this argument is omitted the `--from-file` must be used instead. +Optional second argument provides content of the encoded public key. If this argument is omitted, the `--from-file` must be used instead. ## Flags -### From File +### From file - Flag: `--from-file` - Valid inputs: valid filepath @@ -79,9 +78,9 @@ 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. -### Version Check +### Version check - Flag: `--skip-version-check` - Default: `false` diff --git a/docs/build/tools/flow-cli/keys/derive-keys.md b/docs/build/tools/flow-cli/keys/derive-keys.md index c6426b5f47..d0e95aa19e 100644 --- a/docs/build/tools/flow-cli/keys/derive-keys.md +++ b/docs/build/tools/flow-cli/keys/derive-keys.md @@ -10,7 +10,7 @@ The Flow CLI provides a command to derive Public Key from a Private Key. flow keys derive ``` -## Example Usage +## Example usage ### Derive Public Key from a Private Key ```shell @@ -35,7 +35,7 @@ Public Key 584245c57e5316d6606c53b1ce46dae29f5c9bd26e9e8...aaa5091b2eebcb2a ## Flags -### Signature Algorithm +### Signature algorithm - Flag: `--sig-algo` - Valid inputs: `"ECDSA_P256", "ECDSA_secp256k1"` @@ -67,4 +67,4 @@ 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. diff --git a/docs/build/tools/flow-cli/keys/generate-keys.md b/docs/build/tools/flow-cli/keys/generate-keys.md index 409d0b2f11..288f9ebd08 100644 --- a/docs/build/tools/flow-cli/keys/generate-keys.md +++ b/docs/build/tools/flow-cli/keys/generate-keys.md @@ -4,16 +4,19 @@ description: How to generate key pair from the command line sidebar_position: 1 --- -The Flow CLI provides a command to generate ECDSA key pairs -that can be [attached to new or existing Flow accounts](../../../cadence/basics/accounts.md). +The Flow CLI provides a command to generate ECDSA key pairs that can be [attached to new or existing Flow accounts]. ```shell flow keys generate ``` +:::danger + ⚠️ Store private key safely and don't share with anyone! -## Example Usage +::: + +## Example usage ```shell flow keys generate @@ -36,17 +39,15 @@ Public Key 584245c57e5316d6606c53b1ce46dae29f5c9bd26e9e8...aaa5091b2eebcb2ac71 - Flag: `--seed` - Valid inputs: any string with length >= 32 -Specify a UTF-8 seed string that will be used to generate the key pair. -Key generation is deterministic, so the same seed will always -result in the same key. +Specify a UTF-8 seed string to use to generate the key pair. Key generation is deterministic, so the same seed will always result in the same key. + +If no seed is specified, a random 32-byte seed will generate the key pair. -If no seed is specified, the key pair will be generated using -a random 32 byte seed. +:::danger -⚠️ Using seed with production keys can be dangerous if seed was not generated -by using safe random generators. +⚠️ It's dangerous to use seed with production keys if seed wasn't generated with safe random generators. -### Signature Algorithm +### Signature algorithm - Flag: `--sig-algo` - Valid inputs: `"ECDSA_P256", "ECDSA_secp256k1"` @@ -95,13 +96,15 @@ 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. + + + +[attached to new or existing Flow accounts]: ../../../cadence/basics/accounts.md \ No newline at end of file diff --git a/docs/build/tools/flow-cli/scripts/execute-scripts.md b/docs/build/tools/flow-cli/scripts/execute-scripts.md index e5fd15ad6f..108f701650 100644 --- a/docs/build/tools/flow-cli/scripts/execute-scripts.md +++ b/docs/build/tools/flow-cli/scripts/execute-scripts.md @@ -4,14 +4,13 @@ description: How to execute a Cadence script on Flow from the command line sidebar_position: 6 --- -The Flow CLI provides a command to execute a Cadence script on -the Flow execution state with any Flow Access API. +The Flow CLI provides a command to execute a Cadence script on the Flow execution state with any Flow Access API. ```shell flow scripts execute [ ...] [flags] ``` -## Example Usage +## Example usage ```shell # Execute a script on Flow Testnet @@ -34,17 +33,15 @@ access(all) fun main(greeting: String, who: String): String { - Name: `filename` - Valid inputs: a path in the current filesystem. -The first argument is a path to a Cadence file containing the +The first argument is a path to a Cadence file that contains the script to be executed. ### Arguments -- Name: `argument` -- Valid inputs: valid [cadence values](https://cadencelang.dev/docs/1.0/json-cadence-spec) - matching argument type in script 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 executing the flow script like this: `flow scripts execute script.cdc nil`. +- Name: `argument` +- Valid inputs: valid [cadence values] that matches argument type in script code. +Input arguments values matching corresponding types in the source code and passed in the same order. To pass a `nil` value to optional arguments, you can execute the flow script like this: `flow scripts execute script.cdc nil`. ## Flags @@ -54,9 +51,7 @@ You can pass a `nil` value to optional arguments by executing the flow script li - Valid inputs: arguments in JSON-Cadence form. - Example: `flow scripts execute script.cdc '[{"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]. ### Host @@ -64,17 +59,14 @@ Cadence JSON format contains `type` and `value` keys and is - 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 to use 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 to use to create a secure GRPC client when you execute the command. ### Network @@ -125,9 +117,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 @@ -135,3 +125,8 @@ several configuration files. - Default: `false` Skip version check during start up to speed up process for slow connections. + + + +[documented here]: https://cadencelang.dev/docs/1.0/json-cadence-spec +[cadence values]: https://cadencelang.dev/docs/1.0/json-cadence-spec \ No newline at end of file