Examples

The examples section provides information on some examples of how Solo can be used and leveraged.

The usage of examples in Solo

Table of Contents

Example DirectoryDescription
address-bookExample of using Yahcli to pull the ledger and mirror node address book
custom-network-configDeploy a Solo network with custom configuration settings (log4j2, properties, etc.)
external-database-testDeploy a Solo network with an external PostgreSQL database
hardhat-with-soloExample of using Hardhat to test a smart contract with a local Solo deployment
local-build-with-custom-configExample of how to create and manage a custom Hiero Hashgraph Solo deployment using locally built consensus nodes
network-with-block-nodeDeploy a Solo network that includes a block node
network-with-domain-namesSetup a network using custom domain names for all components
node-create-transactionManually write a NodeCreateTransaction and use the add-prepare/prepare-upgrade/freeze-upgrade/add-execute commands.
node-delete-transactionManually write a NodeDeleteTransaction and use the add-prepare/prepare-upgrade/freeze-upgrade/add-execute commands.
node-update-transactionManually write a NodeUpdateTransaction and use the add-prepare/prepare-upgrade/freeze-upgrade/add-execute commands.
one-shot-falconExample of how to use the Solo one-shot falcon commands
rapid-fireExample of how to use the Solo rapid-fire commands
running-solo-inside-clusterExample showing how to run Solo inside a Kubernetes cluster
state-save-and-restoreSave network state, recreate network, and restore state with mirror node (with optional external database)
version-upgrade-testExample of how to upgrade all components of a Hedera network to current versions

Prerequisites

  • install taskfile: npm install -g @go-task/cli

Running the examples with Taskfile

  • cd into the directory under examples that has the Taskfile.yml, e.g. (from solo repo root directory) cd examples/network-with-block-node/
  • make sure that your current kubeconfig context is pointing to the cluster that you want to deploy to
  • run task which will do the rest and deploy the network and take care of many of the pre-requisites

NOTES:

  • Some of these examples are for running against large clusters with a lot of resources available.
  • Edit the values of the variables as needed.

Customizing the examples

  • take a look at the Taskfile.yml sitting in the subdirectory for the deployment you want to run
  • make sure your cluster can handle the number in SOLO_NETWORK_SIZE, if not, then you will have to update that and make it match the number of nodes in the init-containers-values.yaml: hedera.nodes[]
  • take a look at the init-containers-values.yaml file and make sure the values are correct for your deployment with special attention to:
    • resources
    • nodeSelector
    • tolerations

Address Book Example

Example of how to use Yahcli to read/update ledger and mirror node address book

Custom Network Config Example

Example of how to create and manage a custom Solo deployment and configure it with custom settings

Local Build with Custom Config Example

Example of how to create and manage a custom Hiero Hashgraph Solo deployment using locally built consensus nodes with custom configuration settings

Network with an External PostgreSQL Database Example

example of how to deploy a Solo network with an external PostgreSQL database

Network with Block Node Example

Example of how to create and manage a custom Solo deployment and configure it with custom settings

Network With Domain Names Example

Example of how to deploy a Solo network with custom domain names

Node Create Transaction Example

Using Solo with a custom NodeCreateTransaction from an SDK call

Node Delete Transaction Example

Using Solo with a custom NodeDeleteTransaction from an SDK call

Node Update Transaction Example

Using Solo with a custom NodeUpdateTransaction from an SDK call

One-Shot Falcon Deployment Example

Example of how to use the Solo one-shot falcon commands.

Rapid-Fire Example

Example of how to use the Solo rapid-fire commands.

Solo deployment with Hardhat Example

example of how to deploy a Solo network and run Hardhat tests against it

Solo Inside a Cluster Example

Example of how to deploy a Solo network within a Kubernetes cluster

State Save and Restore Example

Example of how to save network state and restore it later

Version Upgrade Test Example

Example of how to upgrade all components of a Hedera network to current versions