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 -v
The -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-blocks
Get accounts by address in specific block on Flow
make get-accounts
Get events emitted by transactions.
make get-events
make get-collection
make send-transactions
make send-transactions
make create-account
Add a key to an existing account.
make add-account-key
Deploy a Cadence smart contract.
make deploy-contract
Submit a transaction with Cadence arguments.
make transaction-arguments
Sign a transaction with a single account.
make single-party
Sign a transaction with a single account using multiple signatures.
make single-party-multisig
Sign a transaction with multiple accounts.
make multi-party
Sign a transaction with multiple accounts and authorize for both of them.
make multi-party-two-authorizers
Sign a transaction with multiple accounts using multiple signatures.
make multi-party-multisig
Sign an arbitrary user message.
make user-signature
make user-signature-verify-all
make user-signature-verify-all
Verify events emitted in a block.
make verify-events