ChainIDE-Chinese
  • 1. ChainIDE - 相关介绍
  • 2. ChainIDE - 模块简介
    • 2.1. File System模块
    • 2.2. Editor模块
    • 2.3. File Preview模块
    • 2.4. Logger模块
    • 2.5. Compile模块
    • 2.6. Deplyment&Interaction模块
    • 2.7. Plugin System模块
      • 2.7.1 ChainIDE Debugger
      • 2.7.2. ChainIDE Flattener Plugin
      • 2.7.3 ChainIDE Verifier
    • 2.8. ChainIDE底部模块
  • 3. ChainIDE - 外部项目导入
  • 4. ChainIDE - 模板管理
  • 5. ChainIDE - 端口转发
  • chainide support
    • 1. Ethereum IDE
      • 1. Ethereum IDE 环境配置
      • 2. Ethereum IDE 使用流程演示
      • 3. 使用 Hardhat
      • 4. 使用 Ganache v7
      • 5. 使用 Truffle
    • 2. BNB Chain IDE
      • 1. BNB Chain IDE 环境配置
      • 2. BNB Chain IDE 使用流程演示
      • 3. 使用 Hardhat
      • 4. 使用 Ganache v7
      • 5. 使用 Truffle
    • 3. Conflux IDE
      • 1. Conflux IDE 环境配置
      • 2. Conflux IDE 使用流程演示
      • 3. 使用 Hardhat
      • 4. 使用 Ganache v7
      • 5. 使用 Truffle
      • 3. 使用 Conflux-truffle
    • 4. Internet Computer IDE
      • 1. Internet Computer IDE 使用流程演示
    • 5. Nervos IDE
      • 1. Nervos IDE 环境配置
      • 2. Nervos IDE 使用流程演示
      • 3. 使用 Hardhat
      • 3. 使用 Ganache v7
    • 6. Polygon IDE
      • 1. Polygon IDE 环境配置
      • 2. Polygon IDE 使用流程演示
      • 3. 使用 Hardhat
      • 4. 使用 Ganache v7
      • 5. 使用 Truffle
    • 7. Flow IDE
      • 1. Flow IDE 使用流程演示
    • 8. Fisco Bcos IDE
      • Fisco Bcos 环境配置
      • Fisco Bcos 使用流程演示
    • 9. Sui IDE
      • 1. Sui IDE 环境配置
      • 2. Sui IDE 使用流程演示
    • 10. Aptos IDE
      • 1. Aptos IDE 环境配置
      • 2. Aptos IDE 使用流程演示
    • 11. XDC IDE
      • 1. XDC IDE 环境配置
      • 2. XDC IDE 使用流程演示
      • 3. 使用 Hardhat
      • 4. 使用 Ganache v7
      • 5. 使用 Truffle
    • 12. Astar IDE
      • 1. Astar IDE 环境配置
      • 2. Astar EVM IDE 使用流程演示
      • 3. Astar WASM IDE 使用流程演示
    • 13. IRISnet IDE
      • 1. IRISnet IDE 环境配置
      • 2. IRISnet EVM IDE 使用流程演示
      • 3. IRISnet Cosmos IDE 使用流程演示
    • 14. Arbitrum IDE
      • 1. Arbitrum IDE 环境配置
      • 2. Arbitrum IDE 使用流程演示
      • 3. 使用 Hardhat
      • 4. 使用 Ganache v7
      • 5. 使用 Truffle
    • 15. Starknet IDE
      • 1. Starknet IDE 环境配置
      • 2. Starknet IDE 使用流程演示
    • 16. Mina IDE
      • 1. Mina IDE 环境配置
      • 2. Mina IDE 使用流程演示
Powered by GitBook
On this page
  • 1. 新建 Flow 项目
  • 2. WorkSpace 概览
  • 3. 账户面板
  • 4. Flow 合约部署、升级合约、发送交易、执行脚本
  • 4.1 合约部署
  • 4.2 更新合约
  • 4.3 发送交易
  • 4.4 执行脚本
  • 5. 使用 Terminal 进行 Flow 开发

Was this helpful?

  1. chainide support
  2. 7. Flow IDE

1. Flow IDE 使用流程演示

编写 Cadence 合约,部署、升级、发送交易、执行脚本

Previous7. Flow IDENext8. Fisco Bcos IDE

Last updated 8 months ago

Was this helpful?

1. 新建 Flow 项目

首先进入 的入口页面,点击 Try Now。

这里会选择你的登录方式,有 Github 和 Guest 两种。(选择 GIthub 登录才可使用 Sandbox 功能)。

点击 New Project 按钮。

出现一个弹窗,在弹窗的左侧选择 Flow,再点击一个项目模板创建项目。此处以模板 Hello World 为例。点击模板卡片后,即会创建此模板的工程并进入 WorkSpace。

2. WorkSpace 概览

进入工程后,展示当前工程的 workspace。整体上 workspace 可分为以下几部分:

  1. 顶部栏,包括 回退至 Dashboard 按钮、工程名称展示及修改用户信息

  2. 左侧 Panel,包括 Explorer(文件树)、Search All (文件搜索)、Plugin Manager(管理插件)、Port Manager (端口管理) 和 Git (GIt 管理)

  3. 右侧 Panel,与合约工程部署交互相关的插件在此处

  4. 底部栏,Welcome 及 Logger 的入口

用户可点击底部 Logger 唤起底部 Panel,以此查看 IDE 日志输出、Terminal、进行 port forward 等

3. 账户面板

在右侧 Accounts 插件面板中,可使用 FCL 进行 Authenticate 及 Unauthenticate。先选择要连接到的Mainnet or Testnet, 再点击Authenticate按钮连接钱包。

登录认证后,可在此面板查看当前登录账户地址,Flow 余额以及账户上的合约。

登录后,可点击Sign Out按钮进行登出,登出后可登录其他账户。

4. Flow 合约部署、升级合约、发送交易、执行脚本

在右侧Deploy & Interaction插件面板中,用户可进行 Flow 合约的部署、升级合约、发送交易以及执行 Flow 脚本。

4.1 合约部署

在 EXPLORER 中打开 contracts > HelloWorld.cdc,可以看到,右侧 Deploy 栏自动选中当前打开的合约文件。点击 Deploy,使用当前登录的用户进行 authorization,在钱包中进行确认即可进行合约部署。

部署成功后,切至 Accounts 面板,刷新当前账户的合约列表,可以看到 KittyVerse 合约成功部署至当前账户;点击 HelloWorld2,可以看到已部署的合约代码。

4.2 更新合约

如果你想更新合约内容,打开原来已部署的合约,修改合约内容后,再次点击部署。打开 contracts > HelloWorld2.cdc,将合约中的 return "Hello, World!" 修改为 return "Hello, World, 2023!", 切换到 Deploy & Interaction,点击 Deploy 。

二次确认无误后,点击 OK,即可更新该合约

4.3 发送交易

在 EXPLORER 中打开 transactions > Transaction.cdc,定位到开头处的代码

import HelloWorld from 0x01 // Replace 0x01 with HelloWorld.cdc smart contract address

将 0x01 修改为 HelloWorld 的合约地址,即为部署 HelloWorld 合约的账户地址。

import HelloWorld from 0x37635ca1570877c0 // Replace 0x01 with HelloWorld.cdc smart contract address

右侧切换 Deploy & Interaction 栏,可以在 TRANSACTION中,可以看到 Transaction.cdc 自动被选中。点击Send,使用当前登录的用户进行authorization,在钱包中进行确认即可发送交易。

4.4 执行脚本

在 EXPLORER 中打开 scripts > Script.cdc,点击 Execute, ChainIDE 会执行对应的脚本,并输出对应结果。

5. 使用 Terminal 进行 Flow 开发

在 ChainIDE 的 Flow(Ubuntu) 镜像中,预安装了 Flow-CLI、Flow-Emulator, 和 Node.js v16。

打开 Sandbox,在命令行中输入

flow

感谢你学习如何使用 Flow IDE。如果你遇到任何问题或有任何疑问,请不要犹豫,与我们联系。我们一直会为你们提供帮助!

Flow Testnet Faucet:

FLOW-CLI & Flow-Emulator 使用文档:

Node.js v16使用文档:

https://testnet-faucet.onflow.org/fund-account
https://developers.flow.com/tools/flow-cli/super-commands
https://nodejs.org/docs/latest-v16.x/api/
ChainIDE