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 artifactschain-id
the id to be used for the chaindepends-on
the dependencies for the chaindeploy-path
the path to the chain's smart contract deploy folderconfig
specifies the location of the config file you want to modifyinclude-paths
the paths to be included while building the chainname
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 runharbor apply <testnet-name>
- If we are updating the chain, then we must add a new
token
the symbol(s) of coins needed. Examples are:ETH
DAI
wallet
the number of walletsamount
the number of tokens, respectively according to the order of thetoken
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 actordocker-file
the path to the Dockerfile of the off-chain actorcommand
the command to be used for the off-chain actorconfig
specifies the location of the config file you want to modifydepends-on
is the array of dependencies for the off-chain actorenv
array containing environment variables to be setimage
the public image that the off-chain actor will be based offname
the name of the actorports
the array of specified ports for the actorschedule-exp
Therate 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 ofschedule-exp
means that the off-chain actor is invoked every 1 minute - Set the expression for how often an off-chain actor should run
- i.e:
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 runharbor apply <testnet-name>
- Only
+ - = . _ : / @
are allowed as special characters
- If we are updating the off-chain actor, then we must add a new
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