Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ Once it's installed, you'll need to initialize Flow in your Next.js project. Fro
flow init --config-only
```

The `--config-only` flag [initializes a project] with the just the config file. This allows the Flow CLI to interact with your project without adding any unnecessary files.
The `--config-only` flag [initializes a project] with the just the config file. This allows the Flow CLI to interact with your project without adding adding the other files you want for most projects.

Next, you'll need to do a little bit of config work so that your project knows how to read Cadence files. Install the Flow Cadence Plugin:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Create a [new project] with the [Flow CLI]:
flow init
```

Follow the prompts and create your project. You do **not** need to install any dependencies.
Follow the prompts and create a `Basic Cadence project (no dependencies)`.

### Install dependencies

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ You'll work with a `Counter` contract—a simple but comprehensive example that

**Time Commitment:** Approximately 30-45 minutes

**Prerequisites:**
**Prerequisites:**

- Basic command line familiarity
- Code editor (VSCode recommended)
- Node.js installed (for future frontend development)
Expand Down Expand Up @@ -91,8 +92,9 @@ flow init
```

When prompted:

1. **Project name:** Enter your preferred project name
2. **Install core contracts:** Select `No` for this tutorial
2. Select `Basic Cadence project (no dependencies)`.

The `flow init` command creates:

Expand Down Expand Up @@ -182,7 +184,6 @@ access(all) contract Counter {
- **Events**: `CounterIncremented` and `CounterDecremented` notify listeners when changes occur
- **Initializer**: `init()` sets the initial count to 0 when the contract is deployed
- **Public Functions**:

- `increment()`: Increases count by 1 and emits an event
- `decrement()`: Decreases count by 1 and emits an event
- `getCount()`: Returns the current count (read-only, marked with `view`)
Expand Down Expand Up @@ -219,18 +220,18 @@ This shows which networks your configured accounts are accessible on:
🌐 Network 🟢 Local (running) 🔴 Local (stopped) ✓ Found ✗ Error
─────────────────────────────────────────────────────

🟢 emulator
🟢 emulator
✓ default (f3fcd2c1a78f5eee): 0.00100000 FLOW
✓ emulator-account (f8d6e0586b0a20c7): 999999999.99300000 FLOW
✓ test-account (e03daebed8ca0615): 0.00100000 FLOW

🌐 mainnet
🌐 mainnet
No accounts found

🌐 testnet
🌐 testnet
No accounts found

🟢 testing
🟢 testing
✓ default (f3fcd2c1a78f5eee): 0.00100000 FLOW
✓ emulator-account (f8d6e0586b0a20c7): 999999999.99300000 FLOW
✓ test-account (e03daebed8ca0615): 0.00100000 FLOW
Expand All @@ -239,7 +240,7 @@ This shows which networks your configured accounts are accessible on:
💡 Tip: To fund testnet accounts, run: flow accounts fund
```

This is a great tool to visualize your different accounts and balances when you are developing.
This is a great tool to visualize your different accounts and balances when you are developing.

### Configure Contract Deployment

Expand All @@ -250,6 +251,7 @@ flow config add deployment
```

Follow the prompts:

1. **Network:** Select `emulator`
2. **Account:** Select `test-account`
3. **Contract:** Select `Counter`
Expand Down Expand Up @@ -390,15 +392,18 @@ If you want to learn more about writing transactions, please read the docs for [
You've successfully established a solid foundation for building on Flow. Let's recap what you've accomplished and learned. Through this hands-on tutorial, you've successfully built a complete Flow development foundation:

✅ **Complete Flow Development Environment**

- Flow CLI installed and configured for project management
- Local Flow emulator running and ready for development
- Project creation and management workflow with `flow init`

✅ **Smart Contract Deployment Skills**

- Counter contract successfully deployed to your local emulator
- Account creation and contract deployment configuration mastered

✅ **Blockchain Interactions**

- Scripts to query contract state (reading blockchain data)
- Transactions to modify contract state (writing to blockchain)
- Real-time interaction with blockchain data through CLI commands
Expand Down Expand Up @@ -429,4 +434,4 @@ Welcome to the Flow developer community—you're ready to build the future of di
[configuration docs]: ../../../build/tools/flow-cli/flow.json/configuration.md
[Flow Discord Community]: https://discord.com/invite/flow
[Cadence Language Reference]: https://cadence-lang.org
[Flow GitHub]: https://github.com/onflow
[Flow GitHub]: https://github.com/onflow
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Flow fixes this problem with **scheduled transactions**. Scheduled Transactions
After completing this tutorial, you will be able to:

- Understand the concept of scheduled transactions and how they solve blockchain limitations
- Explain the key components of the FlowTransactionScheduler system
- Explain the key components of the `FlowTransactionScheduler` system
- Implement a basic scheduled transaction using the provided scaffold
- Analyze the structure and flow of scheduled transaction transactions
- Create custom scheduled transaction contracts and handlers
Expand All @@ -52,9 +52,9 @@ This tutorial assumes you have a modest knowledge of [Cadence]. If you don't, yo

## Getting Started

Begin by creating a new repo using the [Scheduled Transactions Scaffold] as a template.
Begin by running `flow init` and select `Scheduled Transactions project`. Open the project.

This repository has a robust quickstart in the readme. Complete that first. It doesn't seem like much at first. The counter was at `0`, you ran a transaction, now it's at `1`. What's the big deal?
The readme has a robust getting started guide. Complete that to set up and run the demo scheduled transaction. It doesn't seem like much at first. The counter was at `0`, you ran a transaction, now it's at `1`. What's the big deal?

Let's try again to make it clearer what's happening. Open `cadence/transactions/ScheduleIncrementIn.cdc` and look at the arguments for the transaction:

Expand Down Expand Up @@ -339,7 +339,7 @@ transaction() {
// Create and save the Manager resource
let manager <- FlowTransactionSchedulerUtils.createManager()
signer.storage.save(<-manager, to: FlowTransactionSchedulerUtils.managerStoragePath)

// Create a capability for the Manager
let managerCap = signer.capabilities.storage.issue<&FlowTransactionSchedulerUtils.Manager>(FlowTransactionSchedulerUtils.managerStoragePath)

Expand All @@ -364,6 +364,7 @@ manager.schedule(
```

The Manager also provides utility methods for:

- Scheduling another transaction with a previously used handler
- Getting scheduled transaction information in many different ways
- Canceling scheduled transactions
Expand Down Expand Up @@ -503,7 +504,7 @@ assert(
if RickRollTransactionHandler.account.storage.borrow<&AnyResource>(from: /storage/RickRollTransactionHandler) == nil {
let handler <- RickRollTransactionHandler.createHandler()
RickRollTransactionHandler.account.storage.save(<-handler, to: /storage/RickRollTransactionHandler)

// Issue a non-entitled public capability for the handler that is publicly accessible
let publicCap = RickRollTransactionHandler.account.capabilities.storage
.issue<&{FlowTransactionScheduler.TransactionHandler}>(/storage/RickRollTransactionHandler)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ Once you have the Flow CLI installed, you can set up a new project using the `fl
flow init FooToken
```

> Note: Select "No" when it asks you to install core contracts for the purposes of this tutorial.
Select `Basic Cadence project (no dependencies)`.

Upon execution, the command will generate the following directory structure:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Once you have the Flow CLI installed, you can set up a new project using the `fl
flow init foobar-nft
```

> Note: Select "No" when it asks you to install core contracts for the purposes of this tutorial.
Select `Basic Cadence project (no dependencies)`.

Upon execution, the command will generate the following directory structure:

Expand Down
26 changes: 6 additions & 20 deletions docs/build/tools/flow-cli/flow.json/initialize-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,12 @@ 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

## Example Output

```shell
> flow init

Configuration initialized
Service account: 0xf8d6e0586b0a20c7

Start emulator by running: 'flow emulator'
Reset configuration using: 'flow init --reset'
```
- Give you options for project scaffolding

## Project Structure

Expand All @@ -54,6 +44,7 @@ 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
Expand All @@ -67,10 +58,12 @@ flow init --global
```

**Global configuration locations:**

- **macOS/Linux:** `~/flow.json`
- **Windows:** `C:\Users\$USER\flow.json`

**Priority order:**

1. Local `flow.json` (highest priority)
2. Global `flow.json` (lowest priority)

Expand All @@ -85,6 +78,7 @@ 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
Expand All @@ -99,8 +93,6 @@ flow init --config-only

Creates only the `flow.json` file without project structure.



### Global Flags

The following global flags are also available:
Expand Down Expand Up @@ -133,9 +125,3 @@ After initializing your configuration:
- [`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