Local Development

You can test your node or application easily with setting up local network. Use multi-node localnet, you can test Settlus more thoroughly with multiple nodes. You can reset the chain to the Genesis point, modify the code within Settlus directly, change any parameters, understand how Settlus operates, and test the impacts of these changes. If you want to run Settlus with multi node configuration, it is running on Docker by default. Single node configuration is powered by Ignite CLI.

Prerequisites

Single Node Configuration

Settlus utilizes Ignite CLI to simplify blockchain development process. Learn more on Ignite CLI page.

Install necessary dependencies

curl https://get.ignite.com/cli! | bash
brew install golangci-lint

Set config

config.yml file contains necessary initial config for initializing Settlus through Ignite CLI. You can change the relevant parameter in order to test Settlus.

Run the chain

ignite chain serve --skip-proto

serve command installs dependencies, builds, initializes, and starts your blockchain in development. Learn about various options on ignite cli command reference.

Alternatively, if you build locally, simply run the below command with the relevant options where the binary is located after initialization:

# initialize the chain
settlusd init

# start the chain with the initialized config
settlusd start

Multi Node Configuration

Build Localnet

As mentioned above, if you are changing some codes or parameters directly from original code, you must build your own docker image.

make localnet-build

and you will get the image tagged with settlus/localnet. The initial parameters can currently be changed by modifying the file before building the image. In the future, it will be available to separately configure the parameters through a config file.

Start & Setting up Localnet

You can start the multi-node localnet with just one line command.

make localnet-start

The local network runs on your Docker, with specifications defined in the docker-compose.yml file. After executing the command, a .testnets folder will be created in your cloned repository. By default, Localnet operates with four nodes, and their configurations and volumes are stored in the respective .testnets/node{x} folders.

Stop Localnet

To clean up the localnet work, run the command:

make localnet-stop

It will stop and remove the running Docker process. And it will also delete the .testnets folder created by the start command. If you want to persist the status of blockchain, you should copy the .testnets folder in another location before you run the stop command.

Last updated