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
- Go
- openssl
On Go 1.16 and newer:
$ go install github.com/hyperledger/firefly-cli/ff@latest
On earlier versions of Go:
$ go get github.com/hyperledger/firefly-cli/ff
NOTE: For Linux users, it is recommended that you add your user to the
dockergroup so that you do not have to runffordockerasrootor withsudo. For more information about Docker permissions on Linux, please see Docker's documentation on the topic.
$ ff init <stack_name>
$ ff start <stack_name>
$ ff logs <stack_name>
NOTE: You can use the
-fflag on thelogscommand 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
