Welcome! We're glad you're here! This is the guide that we will be going through during the workshop.
IMPORTANT: Please make sure you have done the following before the workshop so that we can hit the ground running when the workshop starts.
The FireFly CLI uses docker and docker-compose to create a local development environment on your machine for offline development. Please make sure you have the latest (or very recent) version of Docker and docker-compose on your machine.
For details on how to get started with Docker, please see: https://www.docker.com/get-started/
NOTE: For Linux users, it is recommended that you add your user to the docker group so that you do not have to run ff or docker as root or with sudo. For more information about Docker permissions on Linux, please see Docker’s documentation on the topic.
NOTE: For Windows users, we recommend that you use Windows Subsystem for Linux 2 (WSL2). FireFly binaries provided for Linux will work in this environment.
To verify installation, you can run:
docker --version
Docker version 20.10.14, build a224086
docker-compose --version
Docker Compose version v2.4.1
The FireFly CLI also uses Open SSL for certificate generation. You probably already have a version of it installed. If not, please use your system's package manager to install Open SSL
To verify installation you can run:
openssl version
LibreSSL 2.8.3
We will be using Hardhat to compile and deploy a custom smart contract during the workshop, so you'll need to make sure you have a recent version of Node.js installed.
To install Node.js for your platform please visit: https://nodejs.org/en/
To verify installation you can run:
node --version
v16.14.0
npm --version
8.3.1
For this portion of this workshop we will be going through the first two sections of the Getting Started Guide in the FireFly Docs to Install the FireFly CLI and Start your environment. Please follow along there.
To boostrap our custom smart contract, we will follow Hardhat's Getting Started guide here: https://hardhat.org/getting-started/
After creating our project directory, we need to update the hardhat.config.js file which has a module.exports section at the bottom. To get Hardhat to talk to the same blockchain node that our FireFly network is using, make the bottom of the file look like this:
module.exports = {
solidity: "0.8.4",
defaultNetwork: "firefly",
networks: {
firefly: {
url: "http://127.0.0.1:5100"
}
}
};npx hardhat compile
npx hardhat run scripts/sample-script.js
Greeter deployed to: 0x3FA91D0571e8C99A88A7155138293c691bf935bb
In this case, the hex string 0x3FA91D0571e8C99A88A7155138293c691bf935bb is our deployed contract address. This is what we will use when creating a Contract API in the FireFly Sandbox.