flow-go

module
v0.10.4-reload-pending... Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 30, 2020 License: AGPL-3.0

README

Flow GoDoc

Flow is a fast, secure, and developer-friendly blockchain built to support the next generation of games, apps and the digital assets that power them. Read more about it here.

Table of Contents

Getting started

Documentation

You can find an overview of the Flow architecture on the documentation website.

Development on Flow is divided into work streams. Each work stream has a home directory containing high-level documentation for the stream, as well as links to documentation for relevant components used by that work stream.

The following table lists all work streams and links to their home directory and documentation:

Work Stream Home directory
Access Node /cmd/access
Collection Node /cmd/collection
Consensus Node /cmd/consensus
Execution Node /engine/execution
Verification Node /cmd/verification
HotStuff /consensus/hotstuff
Storage /storage
Ledger /ledger
Networking /network
Cryptography /crypto

Installation

Clone Repository
  • Clone this repository
  • Clone this repository's submodules:
git submodule update --init --recursive
Install Dependencies
  • Install Go (Flow supports Go 1.13 and later)
  • Install CMake, which is used for building the crypto library
  • Install Docker, which is used for running a local network and integration tests
  • All remaining dependencies can be installed automatically:
make install-tools

At this point, you should be ready to build, test, and run Flow! 🎉

Note: if there is error about "relic" or "crypto", trying force removing the relic build and reinstall the tools again:

rm -rf crypto/relic
make install-tools

Development Workflow

Testing

Flow has a unit test suite and an integration test suite. Unit tests for a module live within the module they are testing. Integration tests live in integration/tests.

Run the unit test suite:

make test

Run the integration test suite:

make integration-test
Building

The recommended way to build and run Flow for local development is using Docker.

Build a Docker image for all nodes:

make docker-build-flow

Build a Docker image for a particular node role (replace $ROLE with collection, consensus, etc.):

make docker-build-$ROLE
Local Network

A local version of the network can be run for manual testing and integration. See the Local Network Guide for instructions.

Code Generation

Generated code is kept up to date in the repository, so should be committed whenever it changes.

Run all code generators:

make generate

Generate protobuf stubs:

make generate-proto

Generate mocks used for unit tests:

make generate-mocks

Directories

Path Synopsis
cmd
bootstrap/cmd
contains CLI logic that can exit the program and read/write files.
contains CLI logic that can exit the program and read/write files.
bootstrap/run
contains reusable logic that does not know about a CLI.
contains reusable logic that does not know about a CLI.
testclient Module
hotstuff/committee
(c) 2020 Dapper Labs - ALL RIGHTS RESERVED (c) 2020 Dapper Labs - ALL RIGHTS RESERVED
(c) 2020 Dapper Labs - ALL RIGHTS RESERVED (c) 2020 Dapper Labs - ALL RIGHTS RESERVED
crypto module
collection/ingest
Package ingest implements an engine for receiving transactions that need to be packaged into a collection.
Package ingest implements an engine for receiving transactions that need to be packaged into a collection.
collection/pusher
Package pusher implements an engine for providing access to resources held by the collection node, including collections, collection guarantees, and transactions.
Package pusher implements an engine for providing access to resources held by the collection node, including collections, collection guarantees, and transactions.
fvm
insecure module
integration module
common/encoding
Package encoding provides byte serialization and deserialization of trie and ledger structs.
Package encoding provides byte serialization and deserialization of trie and ledger structs.
common/pathfinder
Package pathfinder computes the trie storage path for any given key/value pair
Package pathfinder computes the trie storage path for any given key/value pair
model
bootstrap
Package bootstrap defines canonical models and encoding for bootstrapping.
Package bootstrap defines canonical models and encoding for bootstrapping.
cluster
Package cluster contains models related to collection node cluster consensus.
Package cluster contains models related to collection node cluster consensus.
flow
(c) 2019 Dapper Labs - ALL RIGHTS RESERVED
(c) 2019 Dapper Labs - ALL RIGHTS RESERVED
ingress
Package ingress implements accepting transactions into the system.
Package ingress implements accepting transactions into the system.
mempool
(c) 2019 Dapper Labs - ALL RIGHTS RESERVED
(c) 2019 Dapper Labs - ALL RIGHTS RESERVED
mempool/stdmap
(c) 2019 Dapper Labs - ALL RIGHTS RESERVED
(c) 2019 Dapper Labs - ALL RIGHTS RESERVED
mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
(c) 2019 Dapper Labs - ALL RIGHTS RESERVED
(c) 2019 Dapper Labs - ALL RIGHTS RESERVED
gossip/libp2p
Package libp2p encapsulates the libp2p library
Package libp2p encapsulates the libp2p library
mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
tools
utils
dsl
io

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL