wormhole/docs/operations.md

594 lines
24 KiB
Markdown
Raw Permalink Normal View History

docs: Update operations docs (#3883) * docs: always pull latest guardian image to run a spy * doc: how to run the guardian node behind a NAT Shoutout to @0xshipthecode and the RockawayX Infra team for helping test and develop the patch for this in #3786. * docs: add section to the ops docs on telemetry This shows new guardians how to enable telemetry. * docs: update wording on bootstrap peers * docs: remove terra light client daemon comment The lcd was built directly into the terra binary a long time ago and no longer requires a separate service for the lcd. This happened more than a year ago. * docs: wh dashboard and the fly healthcheck * mention the wormhole-dashboard github hosted instance * mention how to run the fly healthcheck to verify a guardian * docs: evm node requirements for archive nodes * docs: section on cosmos / ibc connected chains So that guardians know which nodes they need to run and which they can rely on wormchain for. * docs: split out the per-chain bits for terra * Since wormhole supports 30+ chains now and not just 5 chains, the solana, eth, terra, bsc bits were removed * The solana and terra content had the urls updated to reflect reality and moved into their own sections. * Made a reference to docs.wormhole.com's constants reference for chains * docs: clarify guardiand wormchain URL and ports Also mention threshold signing via horcrux and using the sentry node architecture to protect the validator from volumetric attacks. * docs: adding wormchain useful commands * docs: minor updates and ntt accountant enablement * high level overview of how to enable the NTT Accountant * emphasize all guardians need to run wormchain validators * remove the reference to checking out a v2.x branch as the main branch is for wormholev2 now and has been for some time. * docs: add section on ccq * docs: cspell updates * docs: remove default ccq port from operations.md Review feedback from: @bruce-riley * docs: review feedback Co-authored-by: @evan-gray * docs: operations wording clarification * docs: update header in operations doc Try to make things consistent for @evan-gray. * docs: fix a small tyop
2024-04-30 20:14:01 -07:00
# Running a Wormhole Guardian Node
2020-11-20 10:13:22 -08:00
![](images/nodearchitecture.svg)
## Connected chains
docs: Update operations docs (#3883) * docs: always pull latest guardian image to run a spy * doc: how to run the guardian node behind a NAT Shoutout to @0xshipthecode and the RockawayX Infra team for helping test and develop the patch for this in #3786. * docs: add section to the ops docs on telemetry This shows new guardians how to enable telemetry. * docs: update wording on bootstrap peers * docs: remove terra light client daemon comment The lcd was built directly into the terra binary a long time ago and no longer requires a separate service for the lcd. This happened more than a year ago. * docs: wh dashboard and the fly healthcheck * mention the wormhole-dashboard github hosted instance * mention how to run the fly healthcheck to verify a guardian * docs: evm node requirements for archive nodes * docs: section on cosmos / ibc connected chains So that guardians know which nodes they need to run and which they can rely on wormchain for. * docs: split out the per-chain bits for terra * Since wormhole supports 30+ chains now and not just 5 chains, the solana, eth, terra, bsc bits were removed * The solana and terra content had the urls updated to reflect reality and moved into their own sections. * Made a reference to docs.wormhole.com's constants reference for chains * docs: clarify guardiand wormchain URL and ports Also mention threshold signing via horcrux and using the sentry node architecture to protect the validator from volumetric attacks. * docs: adding wormchain useful commands * docs: minor updates and ntt accountant enablement * high level overview of how to enable the NTT Accountant * emphasize all guardians need to run wormchain validators * remove the reference to checking out a v2.x branch as the main branch is for wormholev2 now and has been for some time. * docs: add section on ccq * docs: cspell updates * docs: remove default ccq port from operations.md Review feedback from: @bruce-riley * docs: review feedback Co-authored-by: @evan-gray * docs: operations wording clarification * docs: update header in operations doc Try to make things consistent for @evan-gray. * docs: fix a small tyop
2024-04-30 20:14:01 -07:00
In addition to Wormhole itself, you need to run your own verifying node for every chain that Wormhole connects to except
for newer IBC connected chains that integrate through Wormhole Gateway. Please refer to the [constants reference](https://docs.wormhole.com/wormhole/reference/constants)
for all chains that Wormhole connects to.
2020-11-20 10:13:22 -08:00
**Do NOT use third-party RPC service providers** for any of the chains! You'd fully trust them, and they could lie to
you on whether an event has actually been observed. The whole point of Wormhole is not to rely on centralized nodes!
We strongly recommend running your own full nodes for both testnet and mainnet (where applicable)
so you can test changes for your mainnet full nodes and gain operational experience.
2020-11-20 10:13:22 -08:00
### Solana node requirements
docs: Update operations docs (#3883) * docs: always pull latest guardian image to run a spy * doc: how to run the guardian node behind a NAT Shoutout to @0xshipthecode and the RockawayX Infra team for helping test and develop the patch for this in #3786. * docs: add section to the ops docs on telemetry This shows new guardians how to enable telemetry. * docs: update wording on bootstrap peers * docs: remove terra light client daemon comment The lcd was built directly into the terra binary a long time ago and no longer requires a separate service for the lcd. This happened more than a year ago. * docs: wh dashboard and the fly healthcheck * mention the wormhole-dashboard github hosted instance * mention how to run the fly healthcheck to verify a guardian * docs: evm node requirements for archive nodes * docs: section on cosmos / ibc connected chains So that guardians know which nodes they need to run and which they can rely on wormchain for. * docs: split out the per-chain bits for terra * Since wormhole supports 30+ chains now and not just 5 chains, the solana, eth, terra, bsc bits were removed * The solana and terra content had the urls updated to reflect reality and moved into their own sections. * Made a reference to docs.wormhole.com's constants reference for chains * docs: clarify guardiand wormchain URL and ports Also mention threshold signing via horcrux and using the sentry node architecture to protect the validator from volumetric attacks. * docs: adding wormchain useful commands * docs: minor updates and ntt accountant enablement * high level overview of how to enable the NTT Accountant * emphasize all guardians need to run wormchain validators * remove the reference to checking out a v2.x branch as the main branch is for wormholev2 now and has been for some time. * docs: add section on ccq * docs: cspell updates * docs: remove default ccq port from operations.md Review feedback from: @bruce-riley * docs: review feedback Co-authored-by: @evan-gray * docs: operations wording clarification * docs: update header in operations doc Try to make things consistent for @evan-gray. * docs: fix a small tyop
2024-04-30 20:14:01 -07:00
Refer to the [Solana documentation](https://docs.solanalabs.com/operations/setup-an-rpc-node) on how to run an RPC
(full) node. [Solana's Discord server](https://solana.com/community) is a great resource for questions regarding
operations.
The `#rpc-server-operators` channel is especially useful for setting up Solana RPC nodes.
Your Solana RPC node needs the following parameters enabled:
```
--enable-rpc-transaction-history
--enable-cpi-and-log-storage
```
2022-08-26 09:35:22 -07:00
`--enable-rpc-transaction-history` enables historic transactions to be retrieved via the _getConfirmedBlock_ API,
which is required for Wormhole to find transactions.
`--enable-cpi-and-log-storage` stores metadata about CPI calls.
Be aware that these require extra disk space!
#### Account index
If you use the same RPC node for Wormhole v1, you also need the following additional parameters to speed up
`getProgramAccount` queries:
docs: quit the spelling spam typo fix PRs with cspell magic (#3845) * Add cspell configuration and custom dictionary The goal is to cut down on both incoming tyops, and well meaning but spammy tyop fix PRs. To run cspell locally install it and run: cspell '**/*.md' \ --config cspell.config.yaml \ --words-only \ --unique \ --quiet | sort --ignore-case * docs: cspell updates * wormchain: cspell updates * aptos: cspell updates * node: cspell updates * algorand: cspell updates * whitepapers: cspell updates * near: cspell updates * solana: cspell updates * terra: cspell updates * cosmwasm: cspell updates * ethereum: cspell updates * clients: cspell updates * cspell updates for DEVELOP document * github: run cspell github action * sdk: cspell updates * github: only run cspell on markdown files * algorand: EMMITTER --> EMITTER Suggested-by: @evan-gray * cspell: removed from dictionary Suggested-by: @evan-gray * aptos and node: cspell updates Suggested-by: @evan-gray * cosmowasm: doc updates for terra2 Suggested-by: @evan-gray * algorand: cspell updates Suggested-by: @evan-gray * algorand: cspell updates Suggested-by: @evan-gray * cspell: updated custom word dictionary This resorts the dictionary and adds a few new words from the algorand/MEMORY.md document around varints and integers. * cspell: sort the dictionary how vscode does it On macOS the sorting is locale dependent. To do this on macOS, you have to invert the case, do a character insensitive sort, and then invert the case again: LC_COLLATE="en_US.UTF-8" cspell '**/*.md' --config cspell.config.yaml \ --words-only \ --unique \ --no-progress \ --quiet \ | tr 'a-zA-Z' 'A-Za-z' \ | sort --ignore-case \ | tr 'a-zA-Z' 'A-Za-z' This requires the `LC_COLLATE` variable to be set to `en_US.UTF-8`, or it will not do the right thing. * docs: grammar clean up --------- Co-authored-by: Evan Gray <battledingo@gmail.com>
2024-03-20 12:40:02 -07:00
<!-- cspell:disable -->
```
[... see above for other required parameters ...]
--account-index program-id
--account-index-include-key WormT3McKhFJ2RkiGpdw9GKvNCrB2aB54gb2uV9MfQC # for mainnet
--account-index-include-key 5gQf5AUhAgWYgUCt9ouShm9H7dzzXUsLdssYwe5krKhg # for testnet
```
docs: quit the spelling spam typo fix PRs with cspell magic (#3845) * Add cspell configuration and custom dictionary The goal is to cut down on both incoming tyops, and well meaning but spammy tyop fix PRs. To run cspell locally install it and run: cspell '**/*.md' \ --config cspell.config.yaml \ --words-only \ --unique \ --quiet | sort --ignore-case * docs: cspell updates * wormchain: cspell updates * aptos: cspell updates * node: cspell updates * algorand: cspell updates * whitepapers: cspell updates * near: cspell updates * solana: cspell updates * terra: cspell updates * cosmwasm: cspell updates * ethereum: cspell updates * clients: cspell updates * cspell updates for DEVELOP document * github: run cspell github action * sdk: cspell updates * github: only run cspell on markdown files * algorand: EMMITTER --> EMITTER Suggested-by: @evan-gray * cspell: removed from dictionary Suggested-by: @evan-gray * aptos and node: cspell updates Suggested-by: @evan-gray * cosmowasm: doc updates for terra2 Suggested-by: @evan-gray * algorand: cspell updates Suggested-by: @evan-gray * algorand: cspell updates Suggested-by: @evan-gray * cspell: updated custom word dictionary This resorts the dictionary and adds a few new words from the algorand/MEMORY.md document around varints and integers. * cspell: sort the dictionary how vscode does it On macOS the sorting is locale dependent. To do this on macOS, you have to invert the case, do a character insensitive sort, and then invert the case again: LC_COLLATE="en_US.UTF-8" cspell '**/*.md' --config cspell.config.yaml \ --words-only \ --unique \ --no-progress \ --quiet \ | tr 'a-zA-Z' 'A-Za-z' \ | sort --ignore-case \ | tr 'a-zA-Z' 'A-Za-z' This requires the `LC_COLLATE` variable to be set to `en_US.UTF-8`, or it will not do the right thing. * docs: grammar clean up --------- Co-authored-by: Evan Gray <battledingo@gmail.com>
2024-03-20 12:40:02 -07:00
<!-- cspell:enable -->
Alternatively, if you want to run a general-purpose RPC node with indexes for all programs instead of only Wormhole,
leave out the filtering:
```
--account-index program-id
```
On mainnet, we strongly recommend blacklisting KIN and the token program to speed up catchup:
docs: quit the spelling spam typo fix PRs with cspell magic (#3845) * Add cspell configuration and custom dictionary The goal is to cut down on both incoming tyops, and well meaning but spammy tyop fix PRs. To run cspell locally install it and run: cspell '**/*.md' \ --config cspell.config.yaml \ --words-only \ --unique \ --quiet | sort --ignore-case * docs: cspell updates * wormchain: cspell updates * aptos: cspell updates * node: cspell updates * algorand: cspell updates * whitepapers: cspell updates * near: cspell updates * solana: cspell updates * terra: cspell updates * cosmwasm: cspell updates * ethereum: cspell updates * clients: cspell updates * cspell updates for DEVELOP document * github: run cspell github action * sdk: cspell updates * github: only run cspell on markdown files * algorand: EMMITTER --> EMITTER Suggested-by: @evan-gray * cspell: removed from dictionary Suggested-by: @evan-gray * aptos and node: cspell updates Suggested-by: @evan-gray * cosmowasm: doc updates for terra2 Suggested-by: @evan-gray * algorand: cspell updates Suggested-by: @evan-gray * algorand: cspell updates Suggested-by: @evan-gray * cspell: updated custom word dictionary This resorts the dictionary and adds a few new words from the algorand/MEMORY.md document around varints and integers. * cspell: sort the dictionary how vscode does it On macOS the sorting is locale dependent. To do this on macOS, you have to invert the case, do a character insensitive sort, and then invert the case again: LC_COLLATE="en_US.UTF-8" cspell '**/*.md' --config cspell.config.yaml \ --words-only \ --unique \ --no-progress \ --quiet \ | tr 'a-zA-Z' 'A-Za-z' \ | sort --ignore-case \ | tr 'a-zA-Z' 'A-Za-z' This requires the `LC_COLLATE` variable to be set to `en_US.UTF-8`, or it will not do the right thing. * docs: grammar clean up --------- Co-authored-by: Evan Gray <battledingo@gmail.com>
2024-03-20 12:40:02 -07:00
<!-- cspell:disable -->
```
--account-index-exclude-key kinXdEcpDQeHPEuQnqmUgtYykqKGVFq6CeVX5iAHJq6 # Mainnet only
--account-index-exclude-key TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA # Mainnet only
```
docs: quit the spelling spam typo fix PRs with cspell magic (#3845) * Add cspell configuration and custom dictionary The goal is to cut down on both incoming tyops, and well meaning but spammy tyop fix PRs. To run cspell locally install it and run: cspell '**/*.md' \ --config cspell.config.yaml \ --words-only \ --unique \ --quiet | sort --ignore-case * docs: cspell updates * wormchain: cspell updates * aptos: cspell updates * node: cspell updates * algorand: cspell updates * whitepapers: cspell updates * near: cspell updates * solana: cspell updates * terra: cspell updates * cosmwasm: cspell updates * ethereum: cspell updates * clients: cspell updates * cspell updates for DEVELOP document * github: run cspell github action * sdk: cspell updates * github: only run cspell on markdown files * algorand: EMMITTER --> EMITTER Suggested-by: @evan-gray * cspell: removed from dictionary Suggested-by: @evan-gray * aptos and node: cspell updates Suggested-by: @evan-gray * cosmowasm: doc updates for terra2 Suggested-by: @evan-gray * algorand: cspell updates Suggested-by: @evan-gray * algorand: cspell updates Suggested-by: @evan-gray * cspell: updated custom word dictionary This resorts the dictionary and adds a few new words from the algorand/MEMORY.md document around varints and integers. * cspell: sort the dictionary how vscode does it On macOS the sorting is locale dependent. To do this on macOS, you have to invert the case, do a character insensitive sort, and then invert the case again: LC_COLLATE="en_US.UTF-8" cspell '**/*.md' --config cspell.config.yaml \ --words-only \ --unique \ --no-progress \ --quiet \ | tr 'a-zA-Z' 'A-Za-z' \ | sort --ignore-case \ | tr 'a-zA-Z' 'A-Za-z' This requires the `LC_COLLATE` variable to be set to `en_US.UTF-8`, or it will not do the right thing. * docs: grammar clean up --------- Co-authored-by: Evan Gray <battledingo@gmail.com>
2024-03-20 12:40:02 -07:00
<!-- cspell:enable -->
Note that these indexes require extra disk space and may slow down catchup. The first startup after
adding these parameters will be slow since Solana needs to recreate all indexes.
2020-11-20 10:13:22 -08:00
### Ethereum node requirements
In order to observe events on the Ethereum chain, you need access to an Ethereum RPC endpoint. The most common
choice is geth, but for the sake of diversity, you may want to run something that isn't geth.
2020-11-20 10:13:22 -08:00
With RPC providers such as Alchemy, Infura, etc. you trust those operators to provide you with untampered chain data and
have no way of verifying correctness. Therefore, Wormhole requires either an Ethereum full-node or a light-client. The
node can be operated in the full, quick or light modes with no impact on security or performance of the bridge software.
As long as the node supports the Ethereum JSON RPC API, it will be compatible with the bridge so all major
implementations will work fine.
2022-08-26 09:35:22 -07:00
Generally, full-nodes will work better and be more reliable than light clients which are susceptible to DoS attacks
2020-11-20 10:13:22 -08:00
since only very few nodes support the light client protocol.
Running a full node typically requires ~500G of SSD storage, 8G of RAM and 4-8 CPU threads (depending on clock
frequency). Light clients have much lower hardware requirements.
docs: Update operations docs (#3883) * docs: always pull latest guardian image to run a spy * doc: how to run the guardian node behind a NAT Shoutout to @0xshipthecode and the RockawayX Infra team for helping test and develop the patch for this in #3786. * docs: add section to the ops docs on telemetry This shows new guardians how to enable telemetry. * docs: update wording on bootstrap peers * docs: remove terra light client daemon comment The lcd was built directly into the terra binary a long time ago and no longer requires a separate service for the lcd. This happened more than a year ago. * docs: wh dashboard and the fly healthcheck * mention the wormhole-dashboard github hosted instance * mention how to run the fly healthcheck to verify a guardian * docs: evm node requirements for archive nodes * docs: section on cosmos / ibc connected chains So that guardians know which nodes they need to run and which they can rely on wormchain for. * docs: split out the per-chain bits for terra * Since wormhole supports 30+ chains now and not just 5 chains, the solana, eth, terra, bsc bits were removed * The solana and terra content had the urls updated to reflect reality and moved into their own sections. * Made a reference to docs.wormhole.com's constants reference for chains * docs: clarify guardiand wormchain URL and ports Also mention threshold signing via horcrux and using the sentry node architecture to protect the validator from volumetric attacks. * docs: adding wormchain useful commands * docs: minor updates and ntt accountant enablement * high level overview of how to enable the NTT Accountant * emphasize all guardians need to run wormchain validators * remove the reference to checking out a v2.x branch as the main branch is for wormholev2 now and has been for some time. * docs: add section on ccq * docs: cspell updates * docs: remove default ccq port from operations.md Review feedback from: @bruce-riley * docs: review feedback Co-authored-by: @evan-gray * docs: operations wording clarification * docs: update header in operations doc Try to make things consistent for @evan-gray. * docs: fix a small tyop
2024-04-30 20:14:01 -07:00
### Terra
Terra is also sometimes referred to as Terra 2, but the correct name is just simply "Terra". The previous version was renamed to "Terra Classic".
Refer to the [Terra documentation](https://docs.terra.money/full-node/run-a-full-terra-node/set-up-production/) on how to run a full node.
#### Terra Classic
Refer to the [Terra Classic documentation](https://classic-docs.terra.money/docs/full-node/run-a-full-terra-node/README.html) on how to run a full node.
### Wormchain
All guardians **must run validators for wormchain**, the codename of [Wormhole Gateway](https://wormhole.com/gateway/).
The ``--wormchainURL` argument to the guardian node should point to `<validator address>:9090` which is the `grpc` port
in the app.toml.
Example port setup:
<!-- cspell:disable -->
config.toml:
```toml
[rpc]
laddr = "tcp://0.0.0.0:26657"
grpc_laddr = ""
pprof_laddr = "localhost:6060"
[p2p]
laddr = "tcp://0.0.0.0:26656"
external_address = ""
```
app.toml:
```toml
[grpc]
address = "0.0.0.0:9090"
[grpc-web]
address = "0.0.0.0:9091"
```
<!-- cspell:enable -->
For signing, consider setting up a remote threshold signer such as
[horcrux](https://github.com/strangelove-ventures/horcrux) and adopting the sentry node architecture with sentry nodes
in front of your wormchain validator.
#### Wormchain Useful Commands
Check the latest guardian set:
<!-- cspell:disable -->
```shell
$ wormchaind query wormhole latest-guardian-set-index
latestGuardianSetIndex: 4
```
<!-- cspell:enable -->
Upgrade the guardian set (with a valid governance vaa):
<!-- cspell:disable -->
```shell
wormchaind tx wormhole execute-governance-vaa <guardian_set_upgrade_VAA_in_hex_format>
```
<!-- cspell:enable -->
View Validator information:
<!-- cspell:disable -->
```shell
$ wormchaind q staking validators
... snip ...
- commission:
commission_rates:
max_change_rate: "0.020000000000000000"
max_rate: "0.200000000000000000"
rate: "0.000000000000000000"
update_time: "2024-04-16T19:13:45.210176030Z"
consensus_pubkey:
'@type': /cosmos.crypto.ed25519.PubKey
key: T+hsVX52EarrsL+mOwv3mL0byWa2EctsG6XmikUMFiQ=
delegator_shares: "0.000000000000000000"
description:
details: ""
identity: 11A4103C4BCBD2B4
moniker: RockawayX
security_contact: ""
website: https://rockawayx.com/infrastructure
jailed: false
min_self_delegation: "0"
operator_address: wormholevaloper1thl5syhmscgnj7whdyrydw3w6vy80044278fxp
status: BOND_STATUS_BONDED
tokens: "0"
unbonding_height: "0"
unbonding_time: "1970-01-01T00:00:00Z"
```
<!-- cspell:enable -->
### EVM node requirements
Some non-Ethereum EVM compatible blockchains need to run in archive mode for [Queries](https://wormhole.com/queries)
to function correctly. By default in geth, [historical state is only kept in memory for the previous 128 blocks](https://github.com/ethereum/go-ethereum/blob/4458905f261d5d9ba5fda3d664f9bb80346ab404/core/state/statedb.go#L1259-L1265).
After 128 blocks, older states are garbage collected. Many of these chains are forks of geth that maintain this
historical limitation.
* Arbitrum
* Base
* Optimism
Newer execution clients such as [reth](https://github.com/paradigmxyz/reth) lack this limitation and are worth
investigating once they are stable.
Additionally, if there is ever a scenario where the network fails to come to consensus on an EVM compatible chain due to
a hard fork or some unforeseen scenario, it might be required to run archive nodes for those chains temporarily to ensure
the transactions can be reobserved.
### Cosmos / IBC connected nodes
All modern Cosmos integrations happen by Wormhole observing IBC transactions on Gateway (wormchain). Guardian node operators do not need to run full nodes for these networks. For Cosmos based chains that were added before this functionality, a full node is still necessary.
The following Cosmos based nodes were added prior to Gateway and guardians need to run full nodes:
* Injective
* Terra
* Terra Classic
* XPLA
**NOTE**: All guardians must run validators for wormchain.
## Building guardiand
2020-12-07 08:44:03 -08:00
For security reasons, we do not provide a pre-built binary. You need to check out the repo and build the
guardiand binary from source. A Git repo is much harder to tamper with than release binaries.
2020-12-07 08:44:03 -08:00
node: upgrade to go 1.21.9 (#3855) * node: update quic-go Ran via: go get github.com/quic-go/quic-go@v0.42.0 * node: update mongo-drive dependency Ran via: go get go.mongodb.org/mongo-driver@latest * node: upgrade libp2p-go Ran via: go get github.com/libp2p/go-libp2p@v0.33.1 Refs: #3863 * node: fallout from the go upgrade in the go.sum Run via: go mod tidy This updates the go.sum and removes unnecessary indirect references. * docs: use go1.21.8 * github: use go1.21.8 Except for wormchain. * node: update dockerfiles to use go 1.21.8 This was done with scripts/update-go-version.sh * scripts: update linter dockerfile to use go 1.21.8 This was done with scripts/update-go-version.sh * wormchain: update ibc-relayer to use go 1.21.8 This was done with scripts/update-go-version.sh * scripts: add update-go-version.sh This is a little helper to make updating the version of go a bit nicer. * scripts: update-go-version.sh fixes * set the default docker command to "dokcer" * update the comment for the humongous sed command for dockerfiles * github: fix go linting * Upgrade golangci-lint to a version built with go 1.21.x. The older version was a binary version built with go 1.20.x and it was failing against the newer code built with go 1.21.x * print the golangci-lint version in each run to see what version of go it was built with in case there are incompatibilties during the next upgrade * remove the linter config skipping over pkg/supervisor entirely and instead put in an override to ignore the `unused` linter for the pkg/supervisor testhelpers bits for unsed test functions necessary to satisfy the test interface. * scripts: update golang linter cli invocation * github: use the latest version of golangci-lint Because 1.52.2 is built with go 1.20.x which has issues with this project now that it is upgraded to 1.21.8. * node: remove implicit memory aliasing in a loop Caught by an upgraded golangci-lint with the gosec linter: ::medium file=node/pkg/watchers/evm/connectors/batch_poller.go,line=226,col=8::G601: Implicit memory aliasing in for loop. (gosec) ::medium file=node/pkg/watchers/evm/connectors/batch_poller.go,line=285,col=8::G601: Implicit memory aliasing in for loop. (gosec) ::medium file=node/pkg/watchers/evm/connectors/batch_poller_test.go,line=128,col=37::G601: Implicit memory aliasing in for loop. (gosec) See also: https://husni.dev/beware-of-implicit-memory-aliasing-in-go-foor-loop/ * node: update logging * Update go to 1.21.9 Automated via: scripts/update-go-version.sh 1.21.9 * node: update test root context teardown time Otherwise things get really sad. * scripts: additions to update-go-versions.sh * Standardized on prefacing functions with `function` for consistency * Added a few more comments to explain how things work * Automatically increment the go version and toolchain in go.mod * Standardized on prefacing functions with `function` for consistency * Make the go image debian version a variable for ease of maintenance * node: update go.mod to specify 1.21.9 * node: update node tests Review feedback from @pires * scripts: run go mod tidy in update-go-version.sh Required after running go mod edit or it refuses to build. * node: update go.mod Running `go mod tidy` removes the toolchain so the build works. * node: update node tests --------- Co-authored-by: Ryan Hamphrey <hamphreyryan26@gmail.com>
2024-04-19 11:43:36 -07:00
To build the Wormhole node, you need [Go](https://golang.org/dl/) >= 1.21.9
2020-11-20 10:13:22 -08:00
First, check out the version of the Wormhole repo that you want to deploy:
```bash
2022-08-26 09:35:22 -07:00
git clone https://github.com/wormhole-foundation/wormhole && cd wormhole
2020-11-20 10:13:22 -08:00
```
Then, compile the release binary as an unprivileged build user:
2020-11-20 10:13:22 -08:00
```bash
make node
2020-11-20 10:13:22 -08:00
```
2022-08-26 09:35:22 -07:00
You'll end up with a `guardiand` binary in `build/`.
2020-11-20 10:13:22 -08:00
Consider these recommendations, not a tutorial to be followed blindly. You'll want to integrate this with your
existing build pipeline. If you need Dockerfile examples, you can take a look at our devnet deployment.
If you want to compile and deploy locally, you can run `sudo make install` to install the binary to /usr/local/bin.
2020-11-24 13:57:50 -08:00
2020-12-06 10:21:43 -08:00
If you deploy using a custom pipeline, you need to set the `CAP_IPC_LOCK` capability on the binary (e.g. doing the
equivalent to `sudo setcap cap_ipc_lock=+ep`) to allow it to lock its memory pages to prevent them from being paged out.
See below on why - this is a generic defense-in-depth mitigation which ensures that process memory is never swapped out
to disk. Please create a GitHub issue if this extra capability represents an operational or compliance concern.
## Key Generation
2020-11-24 13:57:50 -08:00
2020-12-06 10:21:43 -08:00
To generate a guardian key, install guardiand first. If you generate the key on a separate machine, you may want to
compile guardiand only without installing it:
2020-11-24 13:57:50 -08:00
make node
sudo setcap cap_ipc_lock=+ep ./build/bin/guardiand
2020-12-07 12:28:33 -08:00
Otherwise, use the same guardiand binary that you compiled using the regular instructions above.
2020-11-24 13:57:50 -08:00
2020-12-06 10:21:43 -08:00
Generate a new key using the `keygen` subcommand:
2020-11-24 13:57:50 -08:00
2020-12-06 10:21:43 -08:00
guardiand keygen --desc "Testnet key foo" /path/to/your.key
2020-11-24 13:57:50 -08:00
The key file includes a human-readable part which includes the public key hashes and the description.
2020-11-24 13:57:50 -08:00
2020-11-20 10:13:22 -08:00
## Deploying
2020-12-07 12:28:33 -08:00
We strongly recommend a separate user and systemd services for the Wormhole services.
2020-12-06 13:51:35 -08:00
See the separate [wormhole-networks](https://github.com/wormhole-foundation/wormhole-networks) repository for examples
on how to set up the guardiand unit for a specific network.
2020-12-06 13:51:35 -08:00
docs: Update operations docs (#3883) * docs: always pull latest guardian image to run a spy * doc: how to run the guardian node behind a NAT Shoutout to @0xshipthecode and the RockawayX Infra team for helping test and develop the patch for this in #3786. * docs: add section to the ops docs on telemetry This shows new guardians how to enable telemetry. * docs: update wording on bootstrap peers * docs: remove terra light client daemon comment The lcd was built directly into the terra binary a long time ago and no longer requires a separate service for the lcd. This happened more than a year ago. * docs: wh dashboard and the fly healthcheck * mention the wormhole-dashboard github hosted instance * mention how to run the fly healthcheck to verify a guardian * docs: evm node requirements for archive nodes * docs: section on cosmos / ibc connected chains So that guardians know which nodes they need to run and which they can rely on wormchain for. * docs: split out the per-chain bits for terra * Since wormhole supports 30+ chains now and not just 5 chains, the solana, eth, terra, bsc bits were removed * The solana and terra content had the urls updated to reflect reality and moved into their own sections. * Made a reference to docs.wormhole.com's constants reference for chains * docs: clarify guardiand wormchain URL and ports Also mention threshold signing via horcrux and using the sentry node architecture to protect the validator from volumetric attacks. * docs: adding wormchain useful commands * docs: minor updates and ntt accountant enablement * high level overview of how to enable the NTT Accountant * emphasize all guardians need to run wormchain validators * remove the reference to checking out a v2.x branch as the main branch is for wormholev2 now and has been for some time. * docs: add section on ccq * docs: cspell updates * docs: remove default ccq port from operations.md Review feedback from: @bruce-riley * docs: review feedback Co-authored-by: @evan-gray * docs: operations wording clarification * docs: update header in operations doc Try to make things consistent for @evan-gray. * docs: fix a small tyop
2024-04-30 20:14:01 -07:00
You need to open port 8999/udp in your firewall for the P2P network and 8996/udp for
[Cross Chain Queries](../whitepapers/0013_ccq.md). Nothing else has to be exposed externally if you do not run a public RPC.
2020-11-20 10:13:22 -08:00
journalctl can show guardiand's colored output using the `-a` flag for binary output, i.e.: `journalctl -a -f -u guardiand`.
2020-11-20 10:13:22 -08:00
### Kubernetes
2020-12-06 13:51:35 -08:00
Kubernetes deployment is fully supported.
2020-11-20 10:13:22 -08:00
Refer to [devnet/](../devnet) for example k8s deployments as a starting point for your own production deployment. You'll
have to build your own containers. Unless you already run Kubernetes in production, we strongly recommend a traditional
deployment on a dedicated instance - it's easier to understand and troubleshoot.
docs: Update operations docs (#3883) * docs: always pull latest guardian image to run a spy * doc: how to run the guardian node behind a NAT Shoutout to @0xshipthecode and the RockawayX Infra team for helping test and develop the patch for this in #3786. * docs: add section to the ops docs on telemetry This shows new guardians how to enable telemetry. * docs: update wording on bootstrap peers * docs: remove terra light client daemon comment The lcd was built directly into the terra binary a long time ago and no longer requires a separate service for the lcd. This happened more than a year ago. * docs: wh dashboard and the fly healthcheck * mention the wormhole-dashboard github hosted instance * mention how to run the fly healthcheck to verify a guardian * docs: evm node requirements for archive nodes * docs: section on cosmos / ibc connected chains So that guardians know which nodes they need to run and which they can rely on wormchain for. * docs: split out the per-chain bits for terra * Since wormhole supports 30+ chains now and not just 5 chains, the solana, eth, terra, bsc bits were removed * The solana and terra content had the urls updated to reflect reality and moved into their own sections. * Made a reference to docs.wormhole.com's constants reference for chains * docs: clarify guardiand wormchain URL and ports Also mention threshold signing via horcrux and using the sentry node architecture to protect the validator from volumetric attacks. * docs: adding wormchain useful commands * docs: minor updates and ntt accountant enablement * high level overview of how to enable the NTT Accountant * emphasize all guardians need to run wormchain validators * remove the reference to checking out a v2.x branch as the main branch is for wormholev2 now and has been for some time. * docs: add section on ccq * docs: cspell updates * docs: remove default ccq port from operations.md Review feedback from: @bruce-riley * docs: review feedback Co-authored-by: @evan-gray * docs: operations wording clarification * docs: update header in operations doc Try to make things consistent for @evan-gray. * docs: fix a small tyop
2024-04-30 20:14:01 -07:00
When running in kubernetes, or behind any kind of NAT, pass `--gossipAdvertiseAddress=external.ip.address` to the
guardiand node process to ensure the external address is advertized in p2p. If this is not done, reobservation
requests and [CCQ](https://wormhole.com/queries) will not function as intended.
### Monitoring
Wormhole exposes a status server for readiness and metrics. By default, it listens on port 6060 on localhost.
You can use a command line argument to expose it publicly: `--statusAddr=[::]:6060`.
docs: Update operations docs (#3883) * docs: always pull latest guardian image to run a spy * doc: how to run the guardian node behind a NAT Shoutout to @0xshipthecode and the RockawayX Infra team for helping test and develop the patch for this in #3786. * docs: add section to the ops docs on telemetry This shows new guardians how to enable telemetry. * docs: update wording on bootstrap peers * docs: remove terra light client daemon comment The lcd was built directly into the terra binary a long time ago and no longer requires a separate service for the lcd. This happened more than a year ago. * docs: wh dashboard and the fly healthcheck * mention the wormhole-dashboard github hosted instance * mention how to run the fly healthcheck to verify a guardian * docs: evm node requirements for archive nodes * docs: section on cosmos / ibc connected chains So that guardians know which nodes they need to run and which they can rely on wormchain for. * docs: split out the per-chain bits for terra * Since wormhole supports 30+ chains now and not just 5 chains, the solana, eth, terra, bsc bits were removed * The solana and terra content had the urls updated to reflect reality and moved into their own sections. * Made a reference to docs.wormhole.com's constants reference for chains * docs: clarify guardiand wormchain URL and ports Also mention threshold signing via horcrux and using the sentry node architecture to protect the validator from volumetric attacks. * docs: adding wormchain useful commands * docs: minor updates and ntt accountant enablement * high level overview of how to enable the NTT Accountant * emphasize all guardians need to run wormchain validators * remove the reference to checking out a v2.x branch as the main branch is for wormholev2 now and has been for some time. * docs: add section on ccq * docs: cspell updates * docs: remove default ccq port from operations.md Review feedback from: @bruce-riley * docs: review feedback Co-authored-by: @evan-gray * docs: operations wording clarification * docs: update header in operations doc Try to make things consistent for @evan-gray. * docs: fix a small tyop
2024-04-30 20:14:01 -07:00
**NOTE:** Parsing the log output for monitoring is NOT recommended. Log output is meant for human consumption and is
not considered a stable API. Log messages may be added, modified or removed without notice. Use the metrics :-)
#### `/readyz`
This endpoint returns a 200 OK status code once the Wormhole node is ready to serve requests. A node is
considered ready as soon as it has successfully connected to all chains and started processing requests.
2023-12-01 06:18:52 -08:00
This is **only for startup signaling** - it will not tell whether it _stopped_
processing requests at some later point. Once it's true, it stays true! Use metrics to figure that out.
2021-02-01 14:56:50 -08:00
#### `/metrics`
This endpoint serves [Prometheus metrics](https://prometheus.io/docs/concepts/data_model/) for alerting and
introspection. We recommend using Prometheus and Alertmanager, but any monitoring tool that can ingest metrics using the
standardized Prometheus exposition format will work.
Once we gained more operational experience with Wormhole, specific recommendations on appropriate symptoms-based
alerting will be documented here.
2021-02-04 11:09:33 -08:00
See [Wormhole.json](../dashboards/Wormhole.json) for an example Grafana dashboard.
docs: Update operations docs (#3883) * docs: always pull latest guardian image to run a spy * doc: how to run the guardian node behind a NAT Shoutout to @0xshipthecode and the RockawayX Infra team for helping test and develop the patch for this in #3786. * docs: add section to the ops docs on telemetry This shows new guardians how to enable telemetry. * docs: update wording on bootstrap peers * docs: remove terra light client daemon comment The lcd was built directly into the terra binary a long time ago and no longer requires a separate service for the lcd. This happened more than a year ago. * docs: wh dashboard and the fly healthcheck * mention the wormhole-dashboard github hosted instance * mention how to run the fly healthcheck to verify a guardian * docs: evm node requirements for archive nodes * docs: section on cosmos / ibc connected chains So that guardians know which nodes they need to run and which they can rely on wormchain for. * docs: split out the per-chain bits for terra * Since wormhole supports 30+ chains now and not just 5 chains, the solana, eth, terra, bsc bits were removed * The solana and terra content had the urls updated to reflect reality and moved into their own sections. * Made a reference to docs.wormhole.com's constants reference for chains * docs: clarify guardiand wormchain URL and ports Also mention threshold signing via horcrux and using the sentry node architecture to protect the validator from volumetric attacks. * docs: adding wormchain useful commands * docs: minor updates and ntt accountant enablement * high level overview of how to enable the NTT Accountant * emphasize all guardians need to run wormchain validators * remove the reference to checking out a v2.x branch as the main branch is for wormholev2 now and has been for some time. * docs: add section on ccq * docs: cspell updates * docs: remove default ccq port from operations.md Review feedback from: @bruce-riley * docs: review feedback Co-authored-by: @evan-gray * docs: operations wording clarification * docs: update header in operations doc Try to make things consistent for @evan-gray. * docs: fix a small tyop
2024-04-30 20:14:01 -07:00
#### Wormhole Dashboard
There is a [dashboard](https://wormhole-foundation.github.io/wormhole-dashboard) which shows the overall health of the
network and has metrics on individual guardians.
2022-02-04 01:37:35 -08:00
**NOTE:** Parsing the log output for monitoring is NOT recommended. Log output is meant for human consumption and is
not considered a stable API. Log messages may be added, modified or removed without notice. Use the metrics :-)
docs: Update operations docs (#3883) * docs: always pull latest guardian image to run a spy * doc: how to run the guardian node behind a NAT Shoutout to @0xshipthecode and the RockawayX Infra team for helping test and develop the patch for this in #3786. * docs: add section to the ops docs on telemetry This shows new guardians how to enable telemetry. * docs: update wording on bootstrap peers * docs: remove terra light client daemon comment The lcd was built directly into the terra binary a long time ago and no longer requires a separate service for the lcd. This happened more than a year ago. * docs: wh dashboard and the fly healthcheck * mention the wormhole-dashboard github hosted instance * mention how to run the fly healthcheck to verify a guardian * docs: evm node requirements for archive nodes * docs: section on cosmos / ibc connected chains So that guardians know which nodes they need to run and which they can rely on wormchain for. * docs: split out the per-chain bits for terra * Since wormhole supports 30+ chains now and not just 5 chains, the solana, eth, terra, bsc bits were removed * The solana and terra content had the urls updated to reflect reality and moved into their own sections. * Made a reference to docs.wormhole.com's constants reference for chains * docs: clarify guardiand wormchain URL and ports Also mention threshold signing via horcrux and using the sentry node architecture to protect the validator from volumetric attacks. * docs: adding wormchain useful commands * docs: minor updates and ntt accountant enablement * high level overview of how to enable the NTT Accountant * emphasize all guardians need to run wormchain validators * remove the reference to checking out a v2.x branch as the main branch is for wormholev2 now and has been for some time. * docs: add section on ccq * docs: cspell updates * docs: remove default ccq port from operations.md Review feedback from: @bruce-riley * docs: review feedback Co-authored-by: @evan-gray * docs: operations wording clarification * docs: update header in operations doc Try to make things consistent for @evan-gray. * docs: fix a small tyop
2024-04-30 20:14:01 -07:00
#### Wormhole Fly Healthcheck
In the [wormhole-dashboard](https://github.com/wormhole-foundation/wormhole-dashboard) repository, there is a small
[healthcheck application](https://github.com/wormhole-foundation/wormhole-dashboard/tree/main/fly/cmd/healthcheck)
which verifies that the guardian is gossiping out heartbeats, is submitting chain observations, and has a working
heartbeats API available. This is a very good way to verify a specific guardian is functioning as intended.
You can clone the repo and run the check against the [MCF Guardian](https://github.com/wormhole-foundation/wormhole-networks/blob/649dcc48f29d462fe6cb0062cb6530021d36a417/mainnetv2/guardianset/v3.prototxt#L58):
```shell
git clone https://github.com/wormhole-foundation/wormhole-dashboard
cd wormhole-dashboard/fly/cmd/healthcheck
# Run the fly
$ go run main.go --pubKey 0xDA798F6896A3331F64b48c12D1D57Fd9cbe70811 --url https://wormhole-v2-mainnet-api.mcf.rocks
✅ guardian heartbeat received {12D3KooWDZVv7BhZ8yFLkarNdaSWaB43D6UbQwExJ8nnGAEmfHcU: [/ip4/185.188.42.109/udp/8999/quic-v1]}
✅ 44 observations received
✅ /v1/heartbeats
```
If the guardian public RPC is not exposed, the `--url` flag can be omitted:
```shell
$ go run main.go --pubKey 0xDA798F6896A3331F64b48c12D1D57Fd9cbe70811
✅ guardian heartbeat received {12D3KooWDZVv7BhZ8yFLkarNdaSWaB43D6UbQwExJ8nnGAEmfHcU: [/ip4/185.188.42.109/udp/8999/quic-v1]}
✅ 41 observations received
--url not defined, skipping web checks
```
The bootstrap nodes and network defaults to mainnet and the values can be found in the [network constants](../node/pkg/p2p/network_consts.go).
It can also be used to test a specific bootstrap node/s:
```shell
$ go run main.go --pubKey 0xDA798F6896A3331F64b48c12D1D57Fd9cbe70811 --bootstrap /dns4/wormhole.mcf.rocks/udp/8999/quic/p2p/12D3KooWDZVv7BhZ8yFLkarNdaSWaB43D6UbQwExJ8nnGAEmfHcU
✅ guardian heartbeat received {12D3KooWDZVv7BhZ8yFLkarNdaSWaB43D6UbQwExJ8nnGAEmfHcU: [/ip4/185.188.42.109/udp/8999/quic-v1]}
✅ 44 observations received
--url not defined, skipping web checks
```
## Native Token Transfers
[NTT](https://github.com/wormhole-foundation/example-native-token-transfers) is an exciting feature of wormhole that builds upon the core bridge to allow mint/burn style transfers. Ensuring it runs correctly requires integrating it with the NTT Accountant. To enable this feature, create a **new** wormchain key. Do not reuse an existing global accountant key and add the following parameters:
<!-- cspell:disable -->
```shell
# You may already have these.
--wormchainURL URL_TO_YOUR_WORMCHAIN_NODE
--accountantWS HTTP_URL_OF_YOUR_WORMCHAIN_NODE
# This is the mainnet contract.
--accountantNttContract wormhole1mc23vtzxh46e63vq22e8cnv23an06akvkqws04kghkrxrauzpgwq2hmwm7
--accountantNttKeyPath PATH_TO_YOUR_NTT_ACCOUNTANT_KEY_FILE
--accountantNttKeyPassPhrase YOUR_NTT_ACCOUNTANT_KEY_PASS_PHRASE
```
<!-- cspell:enable -->
Please remember to allowlist the new NTT Accountant key for use with Wormchain! For instructions on how to do that, speak with someone from the Wormhole Foundation.
## Cross-Chain Queries
[CCQ](https://github.com/wormhole-foundation/wormhole/blob/main/whitepapers/0013_ccq.md) also known as [Wormhole Queries](https://wormhole.com/queries) is a feature to allow pulling attestations in a cross chain manner. To run ccq, a few additional flags need to be enabled on the guardian node:
<!-- cspell:disable -->
```shell
--ccqEnabled=true \
--ccqAllowedPeers="[ALLOWED,PEERS,GO,HERE]" \
--ccqAllowedRequesters="[ALLOWED,REQUESTORS,GO,HERE" \
```
<!-- cspell:enable -->
To test query functionality, follow the instructions in [node/hack/query/ccqlistener/ccqlistener.go](../node/hack/query/ccqlistener/ccqlistener.go).
## Running a public API endpoint
Wormhole v2 no longer uses Solana as a data availability layer (see [design document](../whitepapers/0005_data_availability.md)).
Instead, it relies on Guardian nodes exposing an API which web wallets and other clients can use to retrieve the signed VAA
message for a given transaction.
Guardian nodes are **strongly encouraged** to expose a public API endpoint to improve the protocol's robustness.
guardiand comes with a built-in REST and grpc-web server which can be enabled using the `--publicWeb` flag:
```
--publicWeb=[::]:443
```
For usage with web wallets, TLS needs to be supported. guardiand has built-in Let's Encrypt support:
```
--tlsHostname=wormhole-v2-mainnet-api.example.com
--tlsProdEnv=true
```
Alternatively, you can use a managed reverse proxy like CloudFlare to terminate TLS.
It is safe to expose the publicWeb port on signing nodes. For better resiliency against denial of service attacks,
future guardiand releases will include listen-only mode such that multiple guardiand instances without guardian keys
can be operated behind a load balancer.
docs: Update operations docs (#3883) * docs: always pull latest guardian image to run a spy * doc: how to run the guardian node behind a NAT Shoutout to @0xshipthecode and the RockawayX Infra team for helping test and develop the patch for this in #3786. * docs: add section to the ops docs on telemetry This shows new guardians how to enable telemetry. * docs: update wording on bootstrap peers * docs: remove terra light client daemon comment The lcd was built directly into the terra binary a long time ago and no longer requires a separate service for the lcd. This happened more than a year ago. * docs: wh dashboard and the fly healthcheck * mention the wormhole-dashboard github hosted instance * mention how to run the fly healthcheck to verify a guardian * docs: evm node requirements for archive nodes * docs: section on cosmos / ibc connected chains So that guardians know which nodes they need to run and which they can rely on wormchain for. * docs: split out the per-chain bits for terra * Since wormhole supports 30+ chains now and not just 5 chains, the solana, eth, terra, bsc bits were removed * The solana and terra content had the urls updated to reflect reality and moved into their own sections. * Made a reference to docs.wormhole.com's constants reference for chains * docs: clarify guardiand wormchain URL and ports Also mention threshold signing via horcrux and using the sentry node architecture to protect the validator from volumetric attacks. * docs: adding wormchain useful commands * docs: minor updates and ntt accountant enablement * high level overview of how to enable the NTT Accountant * emphasize all guardians need to run wormchain validators * remove the reference to checking out a v2.x branch as the main branch is for wormholev2 now and has been for some time. * docs: add section on ccq * docs: cspell updates * docs: remove default ccq port from operations.md Review feedback from: @bruce-riley * docs: review feedback Co-authored-by: @evan-gray * docs: operations wording clarification * docs: update header in operations doc Try to make things consistent for @evan-gray. * docs: fix a small tyop
2024-04-30 20:14:01 -07:00
## Enabling Telemetry
Optionally, the guardian can send telemetry to [Grafana Cloud Logs](https://grafana.com/products/cloud/logs/) aka "loki".
To enable this functionality, add the following flag:
```bash
--telemetryLokiURL=$PER_GUARDIAN_LOKI_URL_WITH_TOKEN
```
New guardians should talk to the Wormhole Foundation to get a Loki url.
### Binding to privileged ports
If you want to bind `--publicWeb` to a port <1024, you need to assign the CAP_NET_BIND_SERVICE capability.
This can be accomplished by either adding the capability to the binary (like in non-systemd environments):
sudo setcap cap_net_bind_service=+ep guardiand
...or by extending the capability set in `guardiand.service`:
AmbientCapabilities=CAP_IPC_LOCK CAP_NET_BIND_SERVICE
CapabilityBoundingSet=CAP_IPC_LOCK CAP_NET_BIND_SERVICE
2020-11-20 10:13:22 -08:00
## Key Management
You'll have to manage the following keys:
2022-08-26 09:35:22 -07:00
- The **guardian key**, which is the bridge consensus key. This key is very critical - your node uses it to certify
VAA messages. The public key's hash is stored in the guardian set on all connected chains. It does not accrue rewards.
It's your share of the multisig mechanism that protect the Wormhole network. The guardian set can be replaced
if a majority of the guardians agree to sign and publish a new guardian set.
- A **node key**, which identifies it on the gossip network, similar to Solana's node identity or a Tendermint
node key. It is used by the peer-to-peer network for routing and transport layer encryption.
An attacker could potentially use it to censor your messages on the network. Other than that, it's not very
critical and can be rotated. The node will automatically create a node key at the path you specify if it doesn't exist.
While the node key can be replaced, we recommend using a persistent node key. This will make it easier to identify your
node in monitoring data and improves p2p connectivity.
For production, we strongly recommend to either encrypt your disks, and/or take care to never have hot guardian keys touch the disk.
2020-11-20 10:13:22 -08:00
One way to accomplish is to store keys on an in-memory ramfs, which can't be swapped out, and restore it from cold
storage or an HSM/vault whenever the node is rebooted. You might want to disable swap altogether. None of that is
specific to Wormhole - this applies to any hot keys.
Our node software takes extra care to lock memory using mlock(2) to prevent keys from being swapped out to disk, which
2020-12-06 10:21:43 -08:00
is why it requires extra capabilities. Yes, other chains might want to do this too :-)
2020-11-20 10:13:22 -08:00
Storing keys on an HSM or using remote signers only partially mitigates the risk of server compromise - it means the key
can't get stolen, but an attacker could still cause the HSM to sign malicious payloads. Future iterations of Wormhole
may include support for remote signing.
## Bootstrap Peers
docs: Update operations docs (#3883) * docs: always pull latest guardian image to run a spy * doc: how to run the guardian node behind a NAT Shoutout to @0xshipthecode and the RockawayX Infra team for helping test and develop the patch for this in #3786. * docs: add section to the ops docs on telemetry This shows new guardians how to enable telemetry. * docs: update wording on bootstrap peers * docs: remove terra light client daemon comment The lcd was built directly into the terra binary a long time ago and no longer requires a separate service for the lcd. This happened more than a year ago. * docs: wh dashboard and the fly healthcheck * mention the wormhole-dashboard github hosted instance * mention how to run the fly healthcheck to verify a guardian * docs: evm node requirements for archive nodes * docs: section on cosmos / ibc connected chains So that guardians know which nodes they need to run and which they can rely on wormchain for. * docs: split out the per-chain bits for terra * Since wormhole supports 30+ chains now and not just 5 chains, the solana, eth, terra, bsc bits were removed * The solana and terra content had the urls updated to reflect reality and moved into their own sections. * Made a reference to docs.wormhole.com's constants reference for chains * docs: clarify guardiand wormchain URL and ports Also mention threshold signing via horcrux and using the sentry node architecture to protect the validator from volumetric attacks. * docs: adding wormchain useful commands * docs: minor updates and ntt accountant enablement * high level overview of how to enable the NTT Accountant * emphasize all guardians need to run wormchain validators * remove the reference to checking out a v2.x branch as the main branch is for wormholev2 now and has been for some time. * docs: add section on ccq * docs: cspell updates * docs: remove default ccq port from operations.md Review feedback from: @bruce-riley * docs: review feedback Co-authored-by: @evan-gray * docs: operations wording clarification * docs: update header in operations doc Try to make things consistent for @evan-gray. * docs: fix a small tyop
2024-04-30 20:14:01 -07:00
The list of supported bootstrap peers is defined in [node/pkg/p2p/network_consts.go](../node/pkg/p2p/network_consts.go).
That file also provides golang functions for obtaining the network parameters (network ID and bootstrap peers) based on
the environment (mainnet or testnet).
The common Wormhole applications (guardiand, spy and query proxy server) use those functions, so it is not necessary to specify
the actual bootstrap parameters in their configs. Developers of any new applications are strongly urged to do the same, and not
proliferate lists of bootstrap peers which might change over time.
## Run the Guardian Spy
The spy connects to the wormhole guardian peer to peer network and listens for new VAAs. It publishes those via a socket and websocket that applications can subscribe to. If you want to run the spy built from source, change `ghcr.io/wormhole-foundation/guardiand:latest` to `guardian` after building the `guardian` image.
Start the spy against the testnet wormhole guardian:
docs: quit the spelling spam typo fix PRs with cspell magic (#3845) * Add cspell configuration and custom dictionary The goal is to cut down on both incoming tyops, and well meaning but spammy tyop fix PRs. To run cspell locally install it and run: cspell '**/*.md' \ --config cspell.config.yaml \ --words-only \ --unique \ --quiet | sort --ignore-case * docs: cspell updates * wormchain: cspell updates * aptos: cspell updates * node: cspell updates * algorand: cspell updates * whitepapers: cspell updates * near: cspell updates * solana: cspell updates * terra: cspell updates * cosmwasm: cspell updates * ethereum: cspell updates * clients: cspell updates * cspell updates for DEVELOP document * github: run cspell github action * sdk: cspell updates * github: only run cspell on markdown files * algorand: EMMITTER --> EMITTER Suggested-by: @evan-gray * cspell: removed from dictionary Suggested-by: @evan-gray * aptos and node: cspell updates Suggested-by: @evan-gray * cosmowasm: doc updates for terra2 Suggested-by: @evan-gray * algorand: cspell updates Suggested-by: @evan-gray * algorand: cspell updates Suggested-by: @evan-gray * cspell: updated custom word dictionary This resorts the dictionary and adds a few new words from the algorand/MEMORY.md document around varints and integers. * cspell: sort the dictionary how vscode does it On macOS the sorting is locale dependent. To do this on macOS, you have to invert the case, do a character insensitive sort, and then invert the case again: LC_COLLATE="en_US.UTF-8" cspell '**/*.md' --config cspell.config.yaml \ --words-only \ --unique \ --no-progress \ --quiet \ | tr 'a-zA-Z' 'A-Za-z' \ | sort --ignore-case \ | tr 'a-zA-Z' 'A-Za-z' This requires the `LC_COLLATE` variable to be set to `en_US.UTF-8`, or it will not do the right thing. * docs: grammar clean up --------- Co-authored-by: Evan Gray <battledingo@gmail.com>
2024-03-20 12:40:02 -07:00
<!-- cspell:disable -->
```bash
docker run \
docs: Update operations docs (#3883) * docs: always pull latest guardian image to run a spy * doc: how to run the guardian node behind a NAT Shoutout to @0xshipthecode and the RockawayX Infra team for helping test and develop the patch for this in #3786. * docs: add section to the ops docs on telemetry This shows new guardians how to enable telemetry. * docs: update wording on bootstrap peers * docs: remove terra light client daemon comment The lcd was built directly into the terra binary a long time ago and no longer requires a separate service for the lcd. This happened more than a year ago. * docs: wh dashboard and the fly healthcheck * mention the wormhole-dashboard github hosted instance * mention how to run the fly healthcheck to verify a guardian * docs: evm node requirements for archive nodes * docs: section on cosmos / ibc connected chains So that guardians know which nodes they need to run and which they can rely on wormchain for. * docs: split out the per-chain bits for terra * Since wormhole supports 30+ chains now and not just 5 chains, the solana, eth, terra, bsc bits were removed * The solana and terra content had the urls updated to reflect reality and moved into their own sections. * Made a reference to docs.wormhole.com's constants reference for chains * docs: clarify guardiand wormchain URL and ports Also mention threshold signing via horcrux and using the sentry node architecture to protect the validator from volumetric attacks. * docs: adding wormchain useful commands * docs: minor updates and ntt accountant enablement * high level overview of how to enable the NTT Accountant * emphasize all guardians need to run wormchain validators * remove the reference to checking out a v2.x branch as the main branch is for wormholev2 now and has been for some time. * docs: add section on ccq * docs: cspell updates * docs: remove default ccq port from operations.md Review feedback from: @bruce-riley * docs: review feedback Co-authored-by: @evan-gray * docs: operations wording clarification * docs: update header in operations doc Try to make things consistent for @evan-gray. * docs: fix a small tyop
2024-04-30 20:14:01 -07:00
--pull=always \
--platform=linux/amd64 \
-p 7073:7073 \
--entrypoint /guardiand \
ghcr.io/wormhole-foundation/guardiand:latest \
spy --nodeKey /node.key --spyRPC "[::]:7073" --env testnet
```
docs: quit the spelling spam typo fix PRs with cspell magic (#3845) * Add cspell configuration and custom dictionary The goal is to cut down on both incoming tyops, and well meaning but spammy tyop fix PRs. To run cspell locally install it and run: cspell '**/*.md' \ --config cspell.config.yaml \ --words-only \ --unique \ --quiet | sort --ignore-case * docs: cspell updates * wormchain: cspell updates * aptos: cspell updates * node: cspell updates * algorand: cspell updates * whitepapers: cspell updates * near: cspell updates * solana: cspell updates * terra: cspell updates * cosmwasm: cspell updates * ethereum: cspell updates * clients: cspell updates * cspell updates for DEVELOP document * github: run cspell github action * sdk: cspell updates * github: only run cspell on markdown files * algorand: EMMITTER --> EMITTER Suggested-by: @evan-gray * cspell: removed from dictionary Suggested-by: @evan-gray * aptos and node: cspell updates Suggested-by: @evan-gray * cosmowasm: doc updates for terra2 Suggested-by: @evan-gray * algorand: cspell updates Suggested-by: @evan-gray * algorand: cspell updates Suggested-by: @evan-gray * cspell: updated custom word dictionary This resorts the dictionary and adds a few new words from the algorand/MEMORY.md document around varints and integers. * cspell: sort the dictionary how vscode does it On macOS the sorting is locale dependent. To do this on macOS, you have to invert the case, do a character insensitive sort, and then invert the case again: LC_COLLATE="en_US.UTF-8" cspell '**/*.md' --config cspell.config.yaml \ --words-only \ --unique \ --no-progress \ --quiet \ | tr 'a-zA-Z' 'A-Za-z' \ | sort --ignore-case \ | tr 'a-zA-Z' 'A-Za-z' This requires the `LC_COLLATE` variable to be set to `en_US.UTF-8`, or it will not do the right thing. * docs: grammar clean up --------- Co-authored-by: Evan Gray <battledingo@gmail.com>
2024-03-20 12:40:02 -07:00
<!-- cspell:enable -->
To run the spy against mainnet:
docs: quit the spelling spam typo fix PRs with cspell magic (#3845) * Add cspell configuration and custom dictionary The goal is to cut down on both incoming tyops, and well meaning but spammy tyop fix PRs. To run cspell locally install it and run: cspell '**/*.md' \ --config cspell.config.yaml \ --words-only \ --unique \ --quiet | sort --ignore-case * docs: cspell updates * wormchain: cspell updates * aptos: cspell updates * node: cspell updates * algorand: cspell updates * whitepapers: cspell updates * near: cspell updates * solana: cspell updates * terra: cspell updates * cosmwasm: cspell updates * ethereum: cspell updates * clients: cspell updates * cspell updates for DEVELOP document * github: run cspell github action * sdk: cspell updates * github: only run cspell on markdown files * algorand: EMMITTER --> EMITTER Suggested-by: @evan-gray * cspell: removed from dictionary Suggested-by: @evan-gray * aptos and node: cspell updates Suggested-by: @evan-gray * cosmowasm: doc updates for terra2 Suggested-by: @evan-gray * algorand: cspell updates Suggested-by: @evan-gray * algorand: cspell updates Suggested-by: @evan-gray * cspell: updated custom word dictionary This resorts the dictionary and adds a few new words from the algorand/MEMORY.md document around varints and integers. * cspell: sort the dictionary how vscode does it On macOS the sorting is locale dependent. To do this on macOS, you have to invert the case, do a character insensitive sort, and then invert the case again: LC_COLLATE="en_US.UTF-8" cspell '**/*.md' --config cspell.config.yaml \ --words-only \ --unique \ --no-progress \ --quiet \ | tr 'a-zA-Z' 'A-Za-z' \ | sort --ignore-case \ | tr 'a-zA-Z' 'A-Za-z' This requires the `LC_COLLATE` variable to be set to `en_US.UTF-8`, or it will not do the right thing. * docs: grammar clean up --------- Co-authored-by: Evan Gray <battledingo@gmail.com>
2024-03-20 12:40:02 -07:00
<!-- cspell:disable -->
```bash
docker run \
docs: Update operations docs (#3883) * docs: always pull latest guardian image to run a spy * doc: how to run the guardian node behind a NAT Shoutout to @0xshipthecode and the RockawayX Infra team for helping test and develop the patch for this in #3786. * docs: add section to the ops docs on telemetry This shows new guardians how to enable telemetry. * docs: update wording on bootstrap peers * docs: remove terra light client daemon comment The lcd was built directly into the terra binary a long time ago and no longer requires a separate service for the lcd. This happened more than a year ago. * docs: wh dashboard and the fly healthcheck * mention the wormhole-dashboard github hosted instance * mention how to run the fly healthcheck to verify a guardian * docs: evm node requirements for archive nodes * docs: section on cosmos / ibc connected chains So that guardians know which nodes they need to run and which they can rely on wormchain for. * docs: split out the per-chain bits for terra * Since wormhole supports 30+ chains now and not just 5 chains, the solana, eth, terra, bsc bits were removed * The solana and terra content had the urls updated to reflect reality and moved into their own sections. * Made a reference to docs.wormhole.com's constants reference for chains * docs: clarify guardiand wormchain URL and ports Also mention threshold signing via horcrux and using the sentry node architecture to protect the validator from volumetric attacks. * docs: adding wormchain useful commands * docs: minor updates and ntt accountant enablement * high level overview of how to enable the NTT Accountant * emphasize all guardians need to run wormchain validators * remove the reference to checking out a v2.x branch as the main branch is for wormholev2 now and has been for some time. * docs: add section on ccq * docs: cspell updates * docs: remove default ccq port from operations.md Review feedback from: @bruce-riley * docs: review feedback Co-authored-by: @evan-gray * docs: operations wording clarification * docs: update header in operations doc Try to make things consistent for @evan-gray. * docs: fix a small tyop
2024-04-30 20:14:01 -07:00
--pull=always \
--platform=linux/amd64 \
-p 7073:7073 \
--entrypoint /guardiand \
ghcr.io/wormhole-foundation/guardiand:latest \
spy --nodeKey /node.key --spyRPC "[::]:7073" --env mainnet
```
docs: quit the spelling spam typo fix PRs with cspell magic (#3845) * Add cspell configuration and custom dictionary The goal is to cut down on both incoming tyops, and well meaning but spammy tyop fix PRs. To run cspell locally install it and run: cspell '**/*.md' \ --config cspell.config.yaml \ --words-only \ --unique \ --quiet | sort --ignore-case * docs: cspell updates * wormchain: cspell updates * aptos: cspell updates * node: cspell updates * algorand: cspell updates * whitepapers: cspell updates * near: cspell updates * solana: cspell updates * terra: cspell updates * cosmwasm: cspell updates * ethereum: cspell updates * clients: cspell updates * cspell updates for DEVELOP document * github: run cspell github action * sdk: cspell updates * github: only run cspell on markdown files * algorand: EMMITTER --> EMITTER Suggested-by: @evan-gray * cspell: removed from dictionary Suggested-by: @evan-gray * aptos and node: cspell updates Suggested-by: @evan-gray * cosmowasm: doc updates for terra2 Suggested-by: @evan-gray * algorand: cspell updates Suggested-by: @evan-gray * algorand: cspell updates Suggested-by: @evan-gray * cspell: updated custom word dictionary This resorts the dictionary and adds a few new words from the algorand/MEMORY.md document around varints and integers. * cspell: sort the dictionary how vscode does it On macOS the sorting is locale dependent. To do this on macOS, you have to invert the case, do a character insensitive sort, and then invert the case again: LC_COLLATE="en_US.UTF-8" cspell '**/*.md' --config cspell.config.yaml \ --words-only \ --unique \ --no-progress \ --quiet \ | tr 'a-zA-Z' 'A-Za-z' \ | sort --ignore-case \ | tr 'a-zA-Z' 'A-Za-z' This requires the `LC_COLLATE` variable to be set to `en_US.UTF-8`, or it will not do the right thing. * docs: grammar clean up --------- Co-authored-by: Evan Gray <battledingo@gmail.com>
2024-03-20 12:40:02 -07:00
<!-- cspell:enable -->
node: Add config file support (#3710) * node: Add logic to read file config and bind flags Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> * node: add guardian node config to node.yaml Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> * node: fix path typo Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> * node: modularize initFileConfig Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> * node: update ethRPC to the correct url Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> * node: update config file path Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> * node: add initial config file testing data Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> * node: add test for flag precedence over config file Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> * node: add test cases for flag, env var and config file precedence Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> * node: use backticks as expected output Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> * node: update comments Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> * node: handle binding errors Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> * node: create separate test functions Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> * node: absolute filepath -> relative filepath Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> * docs: Add guardian config file usage Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> * node: update config file name and env var prefix Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> --------- Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com>
2024-01-19 10:05:23 -08:00
## Guardian Configurations
Configuration files, environment variables and flags are all supported.
### Config File
**Location/Naming**: By default, the config file is expected to be in the `node/config` directory. The standard name for the config file is `guardiand.yaml`. Currently there's no support for custom directory or filename yet.
**Format**: We support any format that is supported by [Viper](https://pkg.go.dev/github.com/dvln/viper#section-readme). But YAML format is generally preferred.
**Example**:
docs: quit the spelling spam typo fix PRs with cspell magic (#3845) * Add cspell configuration and custom dictionary The goal is to cut down on both incoming tyops, and well meaning but spammy tyop fix PRs. To run cspell locally install it and run: cspell '**/*.md' \ --config cspell.config.yaml \ --words-only \ --unique \ --quiet | sort --ignore-case * docs: cspell updates * wormchain: cspell updates * aptos: cspell updates * node: cspell updates * algorand: cspell updates * whitepapers: cspell updates * near: cspell updates * solana: cspell updates * terra: cspell updates * cosmwasm: cspell updates * ethereum: cspell updates * clients: cspell updates * cspell updates for DEVELOP document * github: run cspell github action * sdk: cspell updates * github: only run cspell on markdown files * algorand: EMMITTER --> EMITTER Suggested-by: @evan-gray * cspell: removed from dictionary Suggested-by: @evan-gray * aptos and node: cspell updates Suggested-by: @evan-gray * cosmowasm: doc updates for terra2 Suggested-by: @evan-gray * algorand: cspell updates Suggested-by: @evan-gray * algorand: cspell updates Suggested-by: @evan-gray * cspell: updated custom word dictionary This resorts the dictionary and adds a few new words from the algorand/MEMORY.md document around varints and integers. * cspell: sort the dictionary how vscode does it On macOS the sorting is locale dependent. To do this on macOS, you have to invert the case, do a character insensitive sort, and then invert the case again: LC_COLLATE="en_US.UTF-8" cspell '**/*.md' --config cspell.config.yaml \ --words-only \ --unique \ --no-progress \ --quiet \ | tr 'a-zA-Z' 'A-Za-z' \ | sort --ignore-case \ | tr 'a-zA-Z' 'A-Za-z' This requires the `LC_COLLATE` variable to be set to `en_US.UTF-8`, or it will not do the right thing. * docs: grammar clean up --------- Co-authored-by: Evan Gray <battledingo@gmail.com>
2024-03-20 12:40:02 -07:00
<!-- cspell:disable -->
node: Add config file support (#3710) * node: Add logic to read file config and bind flags Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> * node: add guardian node config to node.yaml Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> * node: fix path typo Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> * node: modularize initFileConfig Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> * node: update ethRPC to the correct url Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> * node: update config file path Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> * node: add initial config file testing data Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> * node: add test for flag precedence over config file Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> * node: add test cases for flag, env var and config file precedence Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> * node: use backticks as expected output Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> * node: update comments Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> * node: handle binding errors Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> * node: create separate test functions Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> * node: absolute filepath -> relative filepath Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> * docs: Add guardian config file usage Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> * node: update config file name and env var prefix Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> --------- Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com>
2024-01-19 10:05:23 -08:00
```yaml
ethRPC: "ws://eth-devnet:8545"
ethContract: "0xC89Ce4735882C9F0f0FE26686c53074E09B0D550"
solanaRPC: "http://solana-devnet:8899"
solanaContract: "Bridge1p5gheXUvJ6jGWGeCsgPKgnE3YgdGKRVCMY9o"
```
docs: quit the spelling spam typo fix PRs with cspell magic (#3845) * Add cspell configuration and custom dictionary The goal is to cut down on both incoming tyops, and well meaning but spammy tyop fix PRs. To run cspell locally install it and run: cspell '**/*.md' \ --config cspell.config.yaml \ --words-only \ --unique \ --quiet | sort --ignore-case * docs: cspell updates * wormchain: cspell updates * aptos: cspell updates * node: cspell updates * algorand: cspell updates * whitepapers: cspell updates * near: cspell updates * solana: cspell updates * terra: cspell updates * cosmwasm: cspell updates * ethereum: cspell updates * clients: cspell updates * cspell updates for DEVELOP document * github: run cspell github action * sdk: cspell updates * github: only run cspell on markdown files * algorand: EMMITTER --> EMITTER Suggested-by: @evan-gray * cspell: removed from dictionary Suggested-by: @evan-gray * aptos and node: cspell updates Suggested-by: @evan-gray * cosmowasm: doc updates for terra2 Suggested-by: @evan-gray * algorand: cspell updates Suggested-by: @evan-gray * algorand: cspell updates Suggested-by: @evan-gray * cspell: updated custom word dictionary This resorts the dictionary and adds a few new words from the algorand/MEMORY.md document around varints and integers. * cspell: sort the dictionary how vscode does it On macOS the sorting is locale dependent. To do this on macOS, you have to invert the case, do a character insensitive sort, and then invert the case again: LC_COLLATE="en_US.UTF-8" cspell '**/*.md' --config cspell.config.yaml \ --words-only \ --unique \ --no-progress \ --quiet \ | tr 'a-zA-Z' 'A-Za-z' \ | sort --ignore-case \ | tr 'a-zA-Z' 'A-Za-z' This requires the `LC_COLLATE` variable to be set to `en_US.UTF-8`, or it will not do the right thing. * docs: grammar clean up --------- Co-authored-by: Evan Gray <battledingo@gmail.com>
2024-03-20 12:40:02 -07:00
<!-- cspell:enable -->
node: Add config file support (#3710) * node: Add logic to read file config and bind flags Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> * node: add guardian node config to node.yaml Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> * node: fix path typo Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> * node: modularize initFileConfig Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> * node: update ethRPC to the correct url Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> * node: update config file path Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> * node: add initial config file testing data Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> * node: add test for flag precedence over config file Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> * node: add test cases for flag, env var and config file precedence Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> * node: use backticks as expected output Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> * node: update comments Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> * node: handle binding errors Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> * node: create separate test functions Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> * node: absolute filepath -> relative filepath Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> * docs: Add guardian config file usage Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> * node: update config file name and env var prefix Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> --------- Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com>
2024-01-19 10:05:23 -08:00
### Environment Variables
**Prefix**: All environment variables related to the Guardian node should be prefixed with `GUARDIAND_`.
**Usage**: Environment variables can be used to override settings in the config file. Particularly for sensitive data like API keys that should not be stored in config files.
**Example**:
node: Add config file support (#3710) * node: Add logic to read file config and bind flags Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> * node: add guardian node config to node.yaml Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> * node: fix path typo Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> * node: modularize initFileConfig Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> * node: update ethRPC to the correct url Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> * node: update config file path Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> * node: add initial config file testing data Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> * node: add test for flag precedence over config file Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> * node: add test cases for flag, env var and config file precedence Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> * node: use backticks as expected output Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> * node: update comments Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> * node: handle binding errors Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> * node: create separate test functions Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> * node: absolute filepath -> relative filepath Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> * docs: Add guardian config file usage Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> * node: update config file name and env var prefix Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> --------- Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com>
2024-01-19 10:05:23 -08:00
```bash
export GUARDIAND_ETHRPC=ws://eth-devnet:8545
```
### Command-Line Flags
**Usage**: Flags provide the highest precedence and can be used for temporary overrides or for settings that change frequently.
**Example**:
node: Add config file support (#3710) * node: Add logic to read file config and bind flags Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> * node: add guardian node config to node.yaml Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> * node: fix path typo Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> * node: modularize initFileConfig Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> * node: update ethRPC to the correct url Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> * node: update config file path Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> * node: add initial config file testing data Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> * node: add test for flag precedence over config file Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> * node: add test cases for flag, env var and config file precedence Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> * node: use backticks as expected output Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> * node: update comments Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> * node: handle binding errors Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> * node: create separate test functions Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> * node: absolute filepath -> relative filepath Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> * docs: Add guardian config file usage Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> * node: update config file name and env var prefix Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> --------- Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com>
2024-01-19 10:05:23 -08:00
```bash
./guardiand node --ethRPC=ws://eth-devnet:8545
```
### Precedence Order
node: Add config file support (#3710) * node: Add logic to read file config and bind flags Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> * node: add guardian node config to node.yaml Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> * node: fix path typo Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> * node: modularize initFileConfig Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> * node: update ethRPC to the correct url Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> * node: update config file path Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> * node: add initial config file testing data Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> * node: add test for flag precedence over config file Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> * node: add test cases for flag, env var and config file precedence Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> * node: use backticks as expected output Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> * node: update comments Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> * node: handle binding errors Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> * node: create separate test functions Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> * node: absolute filepath -> relative filepath Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> * docs: Add guardian config file usage Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> * node: update config file name and env var prefix Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com> --------- Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com>
2024-01-19 10:05:23 -08:00
The configuration settings are applied in the following order of precedence:
1. **Command-Line Flags**: Highest precedence, overrides any other settings.
2. **Environment Variables**: Overrides the config file settings but can be overridden by flags.
3. **Config File**: Lowest precedence.