The FireFly CLI can be used to create local FireFly stacks for offline development of blockchain apps. This allows developers to rapidly iterate on their idea without needing to set up a bunch of infrastructure before they can write the first line of code.
In order to run the FireFly CLI, you will need a few things installed on your dev machine:
- Docker
- Docker Compose
- openssl
The easiest way to get up and running with the FireFly CLI is to download a pre-compiled binary of the latest release.
Go to the latest release page and download the package for your OS and CPU architecture.
Assuming you downloaded the package from GitHub into you Downloads
directory, run the following command:
sudo tar -zxf ~/Downloads/firefly-cli_*.tar.gz -C /usr/local/bin ff
If you downloaded the package from GitHub into a different directory, you will need to change the tar
command above to wherever the firefly-cli_*.tar.gz
file is located.
NOTE: On recent versions of macOS, default security settings will prevent the FireFly CLI binary from running, because it was downloaded from the internet. You will need to allow the FireFly CLI in System Preferences, before it will run.
NOTE: For Windows users, we recommend that you use Windows Subsystem for Linux 2 (WSL2). Binaries provided for Linux will work in this environment.
NOTE: For Linux users, it is recommended that you add your user to the
docker
group so that you do not have to runff
ordocker
asroot
or withsudo
. For more information about Docker permissions on Linux, please see Docker's documentation on the topic.
If you have a local Go development environment, and you have included ${GOPATH}/bin
in your path, you can install with:
go install github.com/hyperledger/firefly-cli/ff@latest
$ ff init <stack_name>
$ ff start <stack_name>
$ ff logs <stack_name>
NOTE: You can use the
-f
flag on thelogs
command to follow the log output from all nodes in the stack
$ ff stop <stack_name>
This command clears all data in a stack, but leaves the stack itself. This is useful for testing when you want to start with a clean slate but don't want to actually recreate the resources in the stack itself. Note: this will also stop the stack if it is running.
$ ff reset <stack_name>
This command will completely delete a stack, including all of its data and configuration.
$ ff remove <stack_name>
This command will print out information about a particular stack, including whether it is running or not.
$ ff info <stack_name>
This command will list all stacks that have been created on your machine.
$ ff ls