Skip to main content

Operator

The operator command allows a user to operate job as an operator. The user will have to bond tokens before being allowed to operate as an operator. Then as the command runs, it decodes jobs from the network and determines if the job is processable by the configured user. If it is, then a transaction is sent to finalize the job.

Operator

When run without any flags, you will be asked to choose a network to look at and the password for the configuration wallet.

Usage

holograph operator

Help Output

USAGE
$ holograph operator [-m listen|manual|auto] [--unsafePassword <value>] [-h <value>] [--greedy] [--sync]
[--updateBlockHeight api|file|disable] [--networks seiTestnetArctic|lineaTestnetSepolia|mantleTestnetSepolia|lineaTe
stnetGoerli|zoraTestnetSepolia|baseTestnetSepolia|arbitrumTestnetSepolia|optimismTestnetSepolia|ethereumTestnetSepol
ia|mantleTestnet|polygonTestnet|avalancheTestnet|binanceSmartChainTestnet] [-r <value>] [--process-block-range]
[--healthCheckPort <value> --healthCheck] [--env mainnet|testnet|develop|experimental]

FLAGS
-h, --host=<value> The host to send data to
-m, --mode=<option> The mode in which to run the operator
<options: listen|manual|auto>
-r, --replay=<value> [default: 0] Replay block processing. Run between the closed range defined. E.g.
30909:30999
--env=<option> [default: testnet] Holograph environment to use
<options: mainnet|testnet|develop|experimental>
--greedy Enable greedy mode which will retry failed jobs with a higher gas limit in order to
execute
--healthCheck Launch server on http://localhost:6000 to make sure command is still running
--healthCheckPort=<value> This flag allows you to choose what port the health check sever is running on.
--networks=<option>... Space separated list of networks to use
<options:
seiTestnetArctic|lineaTestnetSepolia|mantleTestnetSepolia|lineaTestnetGoerli|zoraTestnet
Sepolia|baseTestnetSepolia|arbitrumTestnetSepolia|optimismTestnetSepolia|ethereumTestnet
Sepolia|mantleTestnet|polygonTestnet|avalancheTestnet|binanceSmartChainTestnet>
--process-block-range Process block ranges instead of single blocks.
--sync Start from last saved block position instead of latest block position
--unsafePassword=<value> Enter the plain text password for the wallet in the holograph cli config
--updateBlockHeight=<option> [default: file] Define how to save the last block that was processed.
<options: api|file|disable>

DESCRIPTION
Listen for jobs and execute jobs.

EXAMPLES
$ holograph operator --networks ethereumTestnetSepolia polygonTestnet avalancheTestnet --mode=auto --sync --env mainnet|testnet|develop|experimental

See code: src/commands/operator/index.ts

Flags

--mode, -m

The mode flag has three states and no default

  1. listen - Will listen to jobs but will not submit tx for any available jobs
  2. manual - Will prompt the user to submit tx
  3. auto - Submits tx to finalize a job whenever an available job is found

--healthCheck

As an operator you may be running the operator within your infrastructure. When enabled, a server on localhost:6000/healthcheck will be launched. It returns the network status of the providers that are configured.

{
"status": "alive",
"providerStatus": {
"goerli": "CONNECTED",
"fuji": "CONNECTED"
}
}

The possible states for any network are: ['CONNECTED', 'DISCONNECTED', 'NOT_CONFIGURED']

--healthCheckPort

By default, the healthcheck flag will use port 6000. If the healthcheck is on another port, then se this flag to the new port value.

--networks

When you set the networks flag, the command will only operate on those networks. The RPC must already be in the configuration file, otherwise an error is thrown. To add networks please see the holograph config command. The only acceptable values are:

1. seiTestnetArctic
2. lineaTestnetSepolia
3. mantleTestnetSepolia
4. lineaTestnetGoerli
5. zoraTestnetSepolia
6. baseTestnetSepolia
7. arbitrumTestnetSepolia
8. optimismTestnetSepolia
9. ethereumTestnetSepolia
10. mantleTestnet
11. polygonTestnet
12. avalancheTestnet
13. binanceSmartChainTestnet

--sync

If the command has paused or killed, for any reason, we save a local file of the last block processed. If the sync flag is set, then the operator will start from that block and check if there were any jobs found.

For example if the operator stopped processing on block 1000, and was restarted a minute later. The sync flag will check the current highest block (1007) and check all jobs until the current block height. Therefor blocks 1001-1007 will be looked at before moving onto block 1008.

--unsafePassword

If you are running the command within your internal infrastructure, you may need to automate unlocking the wallet. This flag allows you to set the password without requiring an input externally.

--environment

The network is the network the operator will bond to. The only acceptable values are: ['testnet', 'develop', 'experimental']. Until the holograph mainnet deployment, the CLI will default to the testnet environment.

--greedy

Enable greedy mode which will retry failed jobs with a higher gas limit in order to execute. This flag should make sure that if a transaction failed because of a gas related issue, the job will be retried.

--process-block-range

Some L2 networks create blocks quickly compared to ethereum. By enabling this flag, the CLI will process blocks in batches, rather than each individual block. This is a good flag to use if you need to catch up from a past block.

Operator Bond

To become an operator you must bond into a pod for a given network. It is highly recommended that you have the holograph operator:bond command running BEFORE bonding. This command will also ask you to start the operator command after bonding is completed.

Usage

holograph operator:bond

Help Output

USAGE
$ holograph operator:bond [--network
seiTestnetArctic|lineaTestnetSepolia|mantleTestnetSepolia|lineaTestnetGoerli|zoraTestnetSepolia|baseTestnetSepolia|a
rbitrumTestnetSepolia|optimismTestnetSepolia|ethereumTestnetSepolia|mantleTestnet|polygonTestnet|avalancheTestnet|bi
nanceSmartChainTestnet] [--pod <value>] [--amount <value>] [--env mainnet|testnet|develop|experimental]

FLAGS
--amount=<value> Amount of tokens to deposit
--env=<option> [default: testnet] Holograph environment to use
<options: mainnet|testnet|develop|experimental>
--network=<option> Name of network to use
<options: seiTestnetArctic|lineaTestnetSepolia|mantleTestnetSepolia|lineaTestnetGoerli|zoraTestnet
Sepolia|baseTestnetSepolia|arbitrumTestnetSepolia|optimismTestnetSepolia|ethereumTestnetSepolia|ma
ntleTestnet|polygonTestnet|avalancheTestnet|binanceSmartChainTestnet>
--pod=<value> Pod number to join

DESCRIPTION
Bond in to a pod.

EXAMPLES
$ holograph operator:bond --network <string> --pod <number> --amount <number> --env mainnet|testnet|develop|experimental

See code: src/commands/operator/bond.ts

Flags

--networks

The network is the network the operator will bond to. The only acceptable values are:

1. seiTestnetArctic
2. lineaTestnetSepolia
3. mantleTestnetSepolia
4. lineaTestnetGoerli
5. zoraTestnetSepolia
6. baseTestnetSepolia
7. arbitrumTestnetSepolia
8. optimismTestnetSepolia
9. ethereumTestnetSepolia
10. mantleTestnet
11. polygonTestnet
12. avalancheTestnet
13. binanceSmartChainTestnet

--amount

Enter the amount of to bond to a pod. Please note that pods have a minimum required to enter.

--pod

Enter the pod number to join. This will throw an error if the number does not exist on the defined network

--env

The network is the network the operator will bond to. The only acceptable values are: ['testnet', 'develop', 'experimental']. Until the holograph mainnet deployment, the CLI will default to the testnet environment.

Operator Un-Bond

To unbond from a pod you can call holograph operator:unbond. This command will check your current status and provide you a list of networks that you are bonded to.

Usage

holograph operator:unbond

Help Output

USAGE
$ holograph operator:unbond [--env mainnet|testnet|develop|experimental]

FLAGS
--env=<option> [default: testnet] Holograph environment to use
<options: mainnet|testnet|develop|experimental>

DESCRIPTION
Un-bond an operator from a pod

EXAMPLES
$ holograph operator:unbond --env mainnet|testnet|develop|experimental

See code: src/commands/operator/unbond.ts

Flags

--env

The network is the network the operator will bond to. The only acceptable values are: ['testnet', 'develop', 'experimental']. Until the holograph mainnet deployment, the CLI will default to the testnet environment.

Considerations

It is important to make sure your RPC is reliable, because if the RPC fails to reconnect, jobs may be lost.