Skip to content

Commit

Permalink
Merge branch 'main' into cf/fcl-hw
Browse files Browse the repository at this point in the history
  • Loading branch information
chasefleming committed Nov 4, 2024
2 parents d0211af + ae24cd4 commit 5666f11
Show file tree
Hide file tree
Showing 19 changed files with 2,069 additions and 301 deletions.
111 changes: 0 additions & 111 deletions docs/build/guides/flow-cli.md

This file was deleted.

9 changes: 4 additions & 5 deletions docs/build/guides/fungible-token.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,14 @@ please follow [the installation guide here](https://developers.flow.com/tools/fl

> 💡 Note: Here is [a link to the completed code](https://github.com/chasefleming/FooToken) if you want to skip ahead or reference as you follow along.
Once you have the Flow CLI installed, you can set up a new project
using the `flow setup` command. This command initializes
the necessary directory structure and a `flow.json` configuration file
(a way to configure your project for contract sources, deployments, accounts, and more):
Once you have the Flow CLI installed, you can set up a new project using the `flow init` command. This command initializes the necessary directory structure and a `flow.json` configuration file (a way to configure your project for contract sources, deployments, accounts, and more):

```bash
flow setup FooToken
flow init FooToken
```

> Note: Select "No" when it asks you to install core contracts for the purposes of this tutorial.
Upon execution, the command will generate the following directory structure:

```
Expand Down
9 changes: 4 additions & 5 deletions docs/build/guides/nft.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,14 @@ please follow [the installation guide here](../../tools/flow-cli/install.md).

> 💡 Note: Here is [a link to the completed code](https://github.com/chasefleming/foobar-nft) if you want to skip ahead or reference as you follow along.
Once you have the Flow CLI installed, you can set up a new project
using the `flow setup` command. This command initializes
the necessary directory structure and a `flow.json` configuration file
(a way to configure your project for contract sources, deployments, accounts, and more):
Once you have the Flow CLI installed, you can set up a new project using the `flow init` command. This command initializes the necessary directory structure and a `flow.json` configuration file (a way to configure your project for contract sources, deployments, accounts, and more):

```bash
flow setup foobar-nft
flow init foobar-nft
```

> Note: Select "No" when it asks you to install core contracts for the purposes of this tutorial.
Upon execution, the command will generate the following directory structure:

```
Expand Down
2 changes: 1 addition & 1 deletion docs/build/smart-contracts/deploying.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Anyone can deploy and update contracts on mainnet. Audits are encouraged but not
### Create and deploy a mainnet project
The tool of choice is Flow CLI, there are quickstarts and guides that use Flow CLI, [Getting Started](../getting-started/flow-cli)
- It is highly encouraged to test your contracts, transactions and scripts on Testnet, have strong smart contract test coverage and follow any additional guidelines set out here: [Smart Contract Testing Guidelines](./testing.md).
- Follow the Flow CLI instructions to [Create a Project](../../tools/flow-cli/index.md). You have the Flow CLI installed and ran `flow init` or `flow setup` in your project folder and generating a `flow.json` file
- Follow the Flow CLI instructions to [Create a Project](../../tools/flow-cli/index.md). You have the Flow CLI installed and ran `flow init` in your project folder and generating a `flow.json` file
- Mainnet account: You completed the mainnet account setup, (see above) and have your key pair and mainnet address ready.
- [Deploy your project](../../tools/flow-cli/deployment/deploy-project-contracts.md), notice that your account now has contracts deployed on mainnet.
- [Deploy a contract](../../tools/flow-cli/accounts/account-add-contract.md) to mainnet. You can deploy contracts individually using the `account-add-contract` command.
Expand Down
2 changes: 1 addition & 1 deletion docs/networks/node-ops/_category_.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
position: 2
label: Node Ops
label: Node Ops
1 change: 1 addition & 0 deletions docs/networks/node-ops/access-onchain-data/_category_.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
label: Accessing On-chain Data
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
label: Access Nodes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
label: Accessing Data
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
redirect: /http-api
title: Access HTTP API ↗️
sidebar_position: 2
---

# Access HTTP API

Go to [HTTP API](/http-api)

<meta http-equiv="refresh" content="0; url=/http-api" />
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
label: Light Nodes
1 change: 0 additions & 1 deletion docs/networks/node-ops/node-operation/_category_.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
label: Participating in the Network
position: 5
51 changes: 5 additions & 46 deletions docs/tools/flow-cli/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@ The **Flow Command Line Interface (CLI)** is a powerful tool that enables develo

With Flow CLI, developers can:

- **Initialize Projects**: Quickly set up new Flow projects using the `flow init` command, which creates the necessary files and directories, sets up your project configuration, and installs any core contract dependencies.
- **Manage Contract Dependencies**: Use the [Dependency Manager](dependency-manager.md) to install and manage smart contract dependencies effortlessly, simplifying the integration of external contracts into your project.
- **Manage Accounts**: Create and manage Flow accounts, configure keys, and handle account-related operations.
- **Send Transactions**: Build, sign, and submit transactions to the Flow network, allowing for contract interaction and fund transfers.
- **Query Chain State**: Retrieve data from the Flow blockchain, including account balances, event logs, and the status of specific transactions.
- **Deploy Smart Contracts**: Easily deploy and update Cadence smart contracts on any Flow environment (emulator, testnet, or mainnet).
- **Use the Emulator:** Set up a local Flow blockchain instance with the Flow emulator to test and debug smart contracts in a development environment before deploying them on the network.
- **Interact with the [Flow Access API](https://developers.flow.com/http-api)**: Automate complex workflows using configuration files and command-line scripting, which allows for greater flexibility in continuous integration (CI) or custom development tools.
- **Interact with the [Flow Access API](/http-api)**: Automate complex workflows using configuration files and command-line scripting, which allows for greater flexibility in continuous integration (CI) or custom development tools.
- **Access Flow’s Tooling Ecosystem**: Integrate Flow CLI with other developer tools like the [Cadence Extension for VSCode](https://marketplace.visualstudio.com/items?itemName=onflow.cadence) to enhance your development experience.

The Flow CLI is essential for developers looking to build, test, and maintain decentralized applications on the Flow blockchain efficiently, offering a feature-rich, user-friendly interface for both beginners and experienced blockchain developers.
Expand All @@ -23,49 +25,6 @@ The Flow CLI is essential for developers looking to build, test, and maintain de
Follow [these steps](../flow-cli/install.md) to install the Flow CLI on
macOS, Linux, and Windows.

## Create your first project
The Flow CLI is Flow’s primary development and testing environment, similar to Hardhat and Foundry for developers familiar with writing in Solidity. With the Flow CLI super commands, initiating your new project becomes effortless. Execute the `flow setup` command and make a selection from a variety of accessible scaffolds.

```
> flow setup hello-world --scaffold
🔨 General Scaffolds
[1] Empty Cadence Project - Empty project containing only basic folder structure and flow.json configuration.
[2] Simple Cadence Project - Scaffold contains required folder structure as well as some example Cadence code.
[3] Cadence NFT Project - Scaffold contains the ExampleNFT sample NFT contract.
[4] Hybrid Custody Project - Starter for exploring & implementing Hybrid Custody.
💻 Web Scaffolds
[5] FCL Web Dapp - Simple TypeScript web application using next.js, FCL, and Cadence.
📱 Mobile Scaffolds
[6] Swift iOS simple example - iOS example demonstrating usage of FCL and Flow interactions.
[7] Android simple example - Android example demonstrating usage of FCL and Flow interactions.
[8] FCL React Native Mobile Dapp - React Native (Expo) mobile dapp example demonstrating FCL and Flow interactions.
🏀 Unity Scaffolds
[9] Simple Unity - Simple example demonstrating how to interact with the Flow network using Unity SDK.
[10] Mobile Unity Game - Example words game built on Flow using the Unity SDK.
```

After you have created your new project you can proceed writing contracts and by running `dev`
command the CLI will make sure they are deployed to the Flow emulator for you. Flow emulator is
a simplified version of Flow network you can use locally to develop.

So proceed by starting the emulator:

```
> flow emulator
```

After creating your new project you are ready to start writing contracts. The Flow emulator is a simplified local simulation of the Flow network. Running the dev command in the CLI ensures that the contracts are deployed to the Flow emulator for you.

And then the flow dev:
```
> flow dev
```

### Next steps

As part of the next steps you can read more about [flow dev command](super-commands.md).
## Create Your First Project

To get started with creating your first Flow project and to learn more about how to use the Flow CLI super commands, please refer to the [Super Commands documentation](super-commands.md). These commands simplify the setup and development process, allowing you to focus on building your application without worrying about the underlying configurations.
4 changes: 3 additions & 1 deletion docs/tools/flow-cli/super-commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ sidebar_position: 2
Flow CLI Super commands are set of commands that can be used during development of your dApp to greatly simplify the workflow. The result is you can focus on writing the contracts and the commands will take care of the rest.

## Init
The initial command to start your new Flow project is `flow init`. It will ask you a few questions about how you'd like to configure your project and then create the necessary files and folders, setup the configuration file, and install any core contracts dependencies you might need.
The initial command to start your new Flow project is flow init. It will ask you a few questions about how you'd like to configure your project and then create the necessary files and folders, set up the configuration file, and install any core contract dependencies you might need.

During the initialization process, `flow init` will prompt you if you want to install any core smart contracts (e.g. `NonFungibleToken`) and set them up in your project. If you choose to install core contracts, the CLI will use the [Dependency Manager](dependency-manager.md) under the hood to automatically install any required smart contract dependencies.

> Note: If you just want the `flow.json` configured without creating any folders or files, you can run `flow init --config-only`.
Expand Down
18 changes: 1 addition & 17 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ const config = {
{
to: 'evm/about',
position: 'left',
label: 'Build with EVM',
label: 'Build With EVM',
activeBasePath: '/evm',
},
{
Expand Down Expand Up @@ -631,26 +631,10 @@ const config = {
async: true,
onload: mixpanelOnLoad,
},
{
src: 'https://widget.kapa.ai/kapa-widget.bundle.js',
'data-website-id': '0f0b3ed1-7761-4986-851e-09336ea6ef1c',
'data-project-name': 'Flow',
'data-project-color': '#2E8555',
'data-project-logo': 'https://cryptologos.cc/logos/flow-flow-logo.png',
async: true,
},
{
src: `${baseUrl}hotjar.js`,
async: true,
},
{
src: 'https://widget.kapa.ai/kapa-widget.bundle.js',
'data-website-id': '0f0b3ed1-7761-4986-851e-09336ea6ef1c',
'data-project-name': 'Flow',
'data-project-color': '#2E8555',
'data-project-logo': 'https://cryptologos.cc/logos/flow-flow-logo.png',
async: true,
},
],
clientModules: [require.resolve('./src/modules/toolscards.ts')],
};
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
},
"dependencies": {
"@code-hike/mdx": "^0.9.0",
"@cookbookdev/docsbot": "^4.24.0",
"@docusaurus/core": "^3.5.2",
"@docusaurus/plugin-client-redirects": "^3.5.2",
"@docusaurus/preset-classic": "^3.5.2",
Expand Down
Loading

0 comments on commit 5666f11

Please sign in to comment.