This package contains code samples that interact with the Flow Emulator.
- Running the emulator with the Flow CLI
- Running the examples
- Get Blocks
- Get Accounts
- Get Events
- Get Collection
- Execute Script
- Send Transaction
- Create Account
- Add Account Key
- Deploy Contract
- Transaction Arguments
- Transaction Signing
The emulator is bundled with the Flow CLI, a command-line interface for working with Flow.
Follow these steps to install the Flow CLI.
Start the emulator by running the following command in this directory:
flow emulator start -vThe -v flag enables verbose log output, which is useful for testing
In a separate process, run any of the example programs below. Watch the emulator logs to see transaction output.
Get blocks by ID, height or latest on Flow.
make get-blocksGet accounts by address in specific block on Flow
make get-accountsGet events emitted by transactions.
make get-eventsmake get-collectionmake send-transactionsmake send-transactionsmake create-accountAdd a key to an existing account.
make add-account-keyDeploy a Cadence smart contract.
make deploy-contractSubmit a transaction with Cadence arguments.
make transaction-argumentsSign a transaction with a single account.
make single-partySign a transaction with a single account using multiple signatures.
make single-party-multisigSign a transaction with multiple accounts.
make multi-partySign a transaction with multiple accounts and authorize for both of them.
make multi-party-two-authorizersSign a transaction with multiple accounts using multiple signatures.
make multi-party-multisigSign an arbitrary user message.
make user-signaturemake user-signature-verify-allmake user-signature-verify-allVerify events emitted in a block.
make verify-events