Skip to main content

Modifying the config file using the CLI

the Harbor CLI is a great tool as it allows you to directly modify the configuration file without even touching it! Let's explore adding actors through the CLI.

Adding chains​

To add a chain, run the command:

harbor configure add chain <flags>

The following flags you can add are:

  • artifacts-path the path to the chain's smart contract artifacts
  • chain-id the id to be used for the chain
  • depends-on the dependencies for the chain
  • deploy-path the path to the chain's smart contract deploy folder
  • config specifies the location of the config file you want to modify
  • include-paths the paths to be included while building the chain
  • name the name of the chain. Accepted names are:
  • tag the string that identifies the current version of the chain
    • If we are updating the chain, then we must add a new tag value and run harbor apply <testnet-name>
  • token the symbol(s) of coins needed. Examples are:
    • ETH
    • DAI
  • wallet the number of wallets
  • amount the number of tokens, respectively according to the order of the token symbols provided.

The artifacts-path, deploy-path, name and tag are all mandatory flags.

Example​

To add an Ethereum chain, here's a command you can run:

harbor configure add chain --name ethereum --artifacts-path /path/to/artifacts/ --deploy-path /path/to/deploy --tag v1 --config harbor.config.json

This will give you the config:

{
"chains": [
{
"chain": "ethereum",
"config": {
"artifactsPath": "/path/to/artifacts",
"deploy": {
"scripts": "/path/to/deploy"
}
},
"tag": "v1"
}
]
}

Adding off-chain actors​

The prefix of adding an off-chain actor is: harbor configure add off-chain-actor. This alone won't work, as we need to specify the flags required.

The accepted flags are:

  • build-path the build path pointing towards the Dockerfile directory for our off-chain actor
  • docker-file the path to the Dockerfile of the off-chain actor
  • command the command to be used for the off-chain actor
  • config specifies the location of the config file you want to modify
  • depends-on is the array of dependencies for the off-chain actor
  • env array containing environment variables to be set
  • image the public image that the off-chain actor will be based off
  • name the name of the actor
  • ports the array of specified ports for the actor
  • schedule-exp The rate schedule expression for the off-chain actor which determines the frequency with which the actor has to be invoked
    • i.e: rate (1 minute) as a value of schedule-exp means that the off-chain actor is invoked every 1 minute
    • Set the expression for how often an off-chain actor should run
  • tag the string that identifies the current version of the off-chain actor
    • If we are updating the off-chain actor, then we must add a new tag value and run harbor apply <testnet-name>
    • Only + - = . _ : / @ are allowed as special characters

The image (if public image actor) or docker-file/build-path (if locally built actor), name, ports and tag are mandatory flags.

Example​

If you wanted to add an ipfs actor, you can run the following command:

harbor configure add off-chain-actor --name ipfs --image ipfs/go-ipfs:v0.4.23 --ports 5000 --tag v1

Remove an actor​

To remove an actor, you need to access the config file after it's created and manually remove the actor.

Other examples​

For more examples, check out the CLI Commands page