MAINNET:
Loading...
TESTNET:
Loading...
/
onflow.org
Flow Playground

Flow Operators

FAQ


What is the expected TPS (transactions per second) for the forseeable future?

Not all transactions are equal, so throughput numbers alone doesn't tell the whole story. Flow’s transaction throughput depends on a variety of factors, such as networking bandwidth available to the nodes and optimizations in Flow's implementation. The dominant factor is transaction complexity, impacted by the number of instructions your transaction executes, the number of ledger reads and writes your transaction performs and how many signatures have to be checked to confirm that your transaction has the required privileges. For benchmark loads of simple token balance transfers (essentially an addition and subtraction plus two signature verifications), Flow's current implementation easily sustained a throughput of significantly more than 100 tps. However, we observed that transactions on Mainnet are generally considerably more complex (requiring several signature verifications; many ledger reads and writes; and running relatively complex computations). For the near-term future, 100tps seems like a realistic magnitude. We are working hard towards sustaining 100tps of the kind which are currently run on Mainnet. If your transactions are much simpler than the average Mainnet transaction, Flow potentially already satisfies your desired throughput. The best way to find out would be to test a benchmark set of your specific transactions on TestNet.

Does the blockheight go up 1 every second?

Flow targets 1 second block times but the protocol is still early in its development and further optimizations are needed to achieve that. As of Feb 2021, the rate of block finalization on Mainnet is 0.4 blocks/s; with a standard deviation of ±0.1 blocks/s. Hence, a new block is finalized on average every 2.5 seconds. Note that block height only has a loose correlation with time, as the block rate naturally fluctuates.

Does Flow have a block explorer?

There are two block explorers live today. You can find them here:

How can I connect to and query the Access Nodes? What data is available there?

At the protocol level, you can connect to an access node via GRPC. We provide JavaScript and Golang SDKs to do this for you.

Once you have connected to an access node, you can fetch information regarding accounts, contracts, blocks, collections, transactions, and events. You can also execute scripts to query the current state of the Flow blockchain.

Available Data

Accounts, Contracts, Blocks, Collections, Transactions, Events

These types are documented on the Access API page.

The SDKs expose Flow data as types. For example the Go Flow Block data type implementation can be found here:

https://github.com/onflow/flow-go-sdk/blob/master/block.go

You can query historical data and fetch contract code using the SDKs.

Scripts

Flow allows you to actively query the state of the blockchain using scripts written in the Cadence programming language. You can find out more about Cadence here:

https://docs.onflow.org/cadence

Running scripts and parsing their output is supported by the SDKs.

Scripts can access multiple contracts and accounts, calculate values, and ensure that data is correct using Cadence's type system. They can only access the current state of the blockchain.

Using The SDKs

JavaScript

You can download the FCL (Flow Client Library) here:

https://github.com/onflow/fcl-js

To connect to an access node you will need to provide a URL to the SDK. testnet: https://access-testnet.onflow.org mainnet: https://access.onflow.org

Here are examples of querying an access node at the bottom of this page:

https://github.com/onflow/fcl-js/tree/master/packages/sdk

Here are examples of creating a script and Cadence data types:

https://github.com/onflow/fcl-js/tree/master/packages/types#scripts

And here are examples of parsing script output:

https://github.com/onflow/fcl-js/tree/master/packages/decode

Go

You can download the Go SDK here:

https://github.com/onflow/flow-go-sdk

To connect to an access node you will need to provide a URL to the SDK. testnet: access.devnet.nodes.onflow.org:9000 mainnet: access.mainnet.nodes.onflow.org:9000

You can find examples of querying an access node at the bottom of this page:

https://github.com/onflow/flow-go-sdk/blob/master/README.md

You can find examples using the emulator that can be adapted to use an access node here:

https://github.com/onflow/flow-go-sdk/blob/master/examples/query_events/main.go

And here is an example of using a script:

https://github.com/onflow/flow-go-sdk#executing-a-script

Other Programming Languages

For an example of implementing access node communication using another programming language, see "Interact with Flow using Ruby" by Daniel Podaru: https://www.onflow.org/post/interact-with-flow-using-ruby

How do apps consume events? How do events work?

Flow transactions can emit informative "events" containing data intended to be used by off-chain observers. Events can be used to trigger backend or UI events, for example.

Note that a single transaction may emit many events, and that the order of events may surprise you if a non-standard transaction is being used. Event parameters may be optional, which means that they might be nil in some scenarios. All of this means that you must be careful when parsing events.

Defining Events

Events are implemented within Flow smart contracts using the Cadence programming language.

You can find out more about events in Cadence here:

https://docs.onflow.org/cadence/language/events/

As an example of the kinds of information events can contain, see the documentation of the events that the staking protocol emits:

https://docs.onflow.org/staking/events

Consuming Events

To consume events, you must query a Flow Access Node and specify the type of event and the range of blocks you wish to fetch those events from. You can then parse any returned events and handle the information that they contain.

Using Go

Once you connect to an Access Node using the Go SDK you can query for events.

This is documented here:

https://github.com/onflow/flow-go-sdk#querying-events

And there is an example of usage here:

https://github.com/onflow/flow-go-sdk/tree/master/examples/query_events

Using JavaScript

Once you connect to an Access Node using the FCL (Flow Client Library) you can query for events.

This is documented here:

https://github.com/onflow/fcl-js/tree/master/packages/sdk#getevents-usage And there is an example of usage here:

https://github.com/onflow/kitty-items/tree/master/kitty-items-js/src/workers

Using Other Programming Languages

Currently, we only provide Go and FCL-JS (Flow Client Library) for Flow. For an example of accessing the Flow blockchain and consuming events from it using another programming language, see "Interact with Flow using Ruby" by Daniel Podaru:

https://www.onflow.org/post/interact-with-flow-using-ruby

I staked and now I can't see my FLOW - what happened?

Once you complete a successful staking or delegation request, your tokens are sent to the staking contract. Your tokens are not lost - they are staked! To view your active stake or delegation, navigate to the Stake & Delegate page on Flow Port (left side bar, or this URL + your address after the last slash (https://port.onflow.org/stake-delegate/)

What do I do when I get this error: Node start up issue - could not process block proposal: invalid extension of protocol state?

It sounds like you didn't wipe your data folder? Turn off your node, remove the data folder and restart the node.

What errors are acceptable to see when my node is running?

No errors should be considered acceptable. If there are errors that are constantly recurring, please bring it to attention so logging can be adjusted accordingly, if required.

Is there a testnet/devnet?

There is an access node for you to develop against on the testnet/devnet. You can learn more about it here https://docs.onflow.org/dapp-development/testnet-deployment#accessing-flow-testnet

Is there a public node?

Yes, an access node is publicly accessible to submit transactions and read data from the blockchain. If you’d like to access the devnet access node to build against, you can do so here

Is it possible to add multiple public keys to a given account/address so that it can be controlled by more than one private key?

Yes, accounts support multiple, weighted keys, here using AuthAccount’s fun addPublicKey(_ publicKey: [UInt8])and 
fun removePublicKey(_ index: Int) functions.

How do keys and accounts work on Flow?

Accounts are created with associated keys. There can be multiple keys on an account. To execute transactions from the account, a total of 1000 weight keys need to sign. The account holds a field for FLOW balance. When transactions move flow, that balance is updated by the protocol. The account also holds place for storage and contract code.

FLOW supports a variety of signature schemes for adding keys to an account.

Details: https://docs.onflow.org/concepts/accounts-and-keys

How do I create a Flow account if I do not have a service account?

Instructions to generate an address are here: https://docs.onflow.org/flow-go-sdk/creating-accounts. You don't need a service account.

Can you query events between a block range?

You can query the access API to get events for a block range. See Access API spec here: https://docs.onflow.org/access-api.

Where can I follow feature releases on Flow?

You can follow Flow node software releases here: https://github.com/onflow/flow-go/releases.

How do I run a Flow node and become a node operator?

See the dedicated section on node operation: https://docs.onflow.org/node-operation/