bitpro가 원문에서 글자만 모은 내용이에요. 표·그림·수식은 빠지거나 깨질 수 있어요. 전체 20쪽 중 12쪽
our installation
preferences.
You will see an output with the menu for `celestia-appd`. Learn more
on the [helpful CLI commands page](/operate/consensus-validators/cli-reference)
View [the script](https://github.com/celestiaorg/docs/blob/main/public/celestia-app.sh)
to learn more about what it is doing.
## Ports
When interacting with a consensus node,
you may need to open ports on your machine to allow
communication between nodes, such as bridge nodes. It is essential that
specific ports are accessible. Make sure that your firewall allows
connections to the correct ports.
If you run a node on a cloud server, make sure that the ports are open
on the server's firewall. If you run a node at home, make sure that your
router allows connections to the correct ports.
For example, validator ports 9090
and 26657 need to be accessible by the bridge, and port 2121 is
required for P2P connections for all node types.
The following ports are used by Celestia app nodes:
| Port | Protocol | Address | Description | Enabled by default on node | Flag |
| ----- | -------- | --------- | ----------- | ------------------------------ | ----------------------- |
| 2121 | TCP/UDP | 127.0.0.1 | P2P | true | N/A |
| 9090 | HTTP | 0.0.0.0 | gRPC | true | `--grpc.address string` |
| 26657 | TCP | 127.0.0.1 | RPC | false (only open to localhost) | `--rpc.laddr string` |
## Next steps
Now that you've installed `celestia-appd`, learn how to run a [consensus](/operate/consensus-validators/consensus-node) and [validator](/operate/consensus-validators/validator-node) node.
---
Title: Metrics
URL: https://docs.celestia.org/operate/consensus-validators/metrics.md
Source: app/operate/consensus-validators/metrics/page.mdx
---
# Metrics
Metrics are a powerful tool for monitoring the health
and performance of a system. Celestia provides support
for metrics to make sure, as an operator, your system
continues to remain up and running. Metrics can also
provide critical insight into how Celestia is used and
how it can be improved.
## Setup
Celestia uses [Prometheus](https://prometheus.io/) to
publish metrics. It can be enabled through the `config.toml` file.
```bash
#######################################################
### Instrumentation Configuration Options ###
#######################################################
[instrumentation]
# When true, Prometheus metrics are served under /metrics on
# PrometheusListenAddr.
# Check out the documentation for the list of available metrics.
prometheus = true
# Address to listen for Prometheus collector(s) connections
prometheus_listen_addr = ":26660"
# Maximum number of simultaneous connections.
# If you want to accept a larger number than the default, make sure
# you increase your OS limits.
# 0 - unlimited.
max_open_connections = 3
# Instrumentation namespace
namespace = "celestia"
```
If you restart your node, you can check to see it's working
by running:
```bash
curl localhost:26660/metrics
```
## Visualization
Now your nodes are publishing metrics, we need something to
scrape it and a visualizer to create a dashboard. Commonly,
Prometheus is paired with Grafana.
First, you will need to install Prometheus either from their
[downloads page](https://prometheus.io/download/) or through
a package manager like `brew`.
Next, create a config file `$HOME/.celestia-app/config/prometheus.yml`
and fill out some basic settings as follows:
```yml
global:
scrape_interval: 15s # By default, scrape targets every 15 seconds.
# Attach these labels to any time series or alerts when communicating
# with external systems (federation, remote storage, Alertmanager).
external_labels:
monitor: "codelab-monitor"
# A scrape configuration containing exactly one endpoint to scrape:
# Here it's Prometheus itself.
scrape_configs:
# The job name is added as a label `job=<job_name>` to any timeseries
# scraped from this config.
- job_name: "prometheus"
# Override the global default and scrape targets from this job every
# 5 seconds.
scrape_interval: 5s
static_configs:
# Point to the same endpoint that Celestia is publishing on
- targets: ["localhost:26660"]
```
Note, that Prometheus by default runs its server on `:9090`.
If you are running this on the same machine as your consensus
node, it will collide with gRPC which runs on the same port.
To avoid this, change the gRPC port in `app.toml`, or run Prometheus on a
different port, _e.g._ `--web.listen-address="0.0.0.0:8000"`.
When `[api]` has `enable = true` in `app.toml`, `[grpc]` must also
have `enable = true` because the REST API uses Cosmos SDK gRPC.
To run the prometheus server:
```bash
prometheus --config.file="$HOME/.celestia-app/config/prometheus.yml"
```
A prometheus server can scrape metrics from multiple nodes at once;
a good way of bringing together information from many machines to one place.
To visualize the information, you can use [Grafana](https://grafana.com/):
either with their cloud option or run the [open source code](https://grafana.com/grafana/download?pg=graf&platform=linux&plcmt=deploy-box-1)
yourself.
Once setup, run:
```bash
grafana server
```
which will begin a server on `localhost:3000`.
If you open the url on your browser you will
see the Grafana login page. Use `admin` for both
the user and password to log in.
You will need to link the prometheus server as a
data source. To do that go to "Configuration" in
the sidebar and then "Data Sources". Add a new data
source specifying the URL of the Prometheus instance
(default at `localhost:9090`). Click "Save & test" to confirm.
Lastly, you will need to setup a dashboard. You can
choose to do this yourself, handpicking the metrics
that are important or you can simply export an existing
design. Fortunately the cosmos ecosystem has conjured a
"Cosmos Dashboard". On the sidebar, click "Dashboards"
and then "import". Enter the following dashboard ID: 11036
and then link it to the "Prometheus" data source you just set up.
Finally click the "Import" button and the "Cosmos Dashboard" should appear.
## Node exporter
Celestia's metrics include a plethora of application specific
trackers but it's also important to keep an eye on system level
metrics such as memory usage and disk space. This can be best
achieved by running [Node Exporter](https://prometheus.io/docs/guides/node-exporter/).
Follow the guide in the link to get set up, adding the port
number to the `prometheus.yml` file.
## Alerts
The final cherry on the cake is to integrate your monitoring
system with a mechanism for producing alerts to warn you if
your node has crashed or is no longer able to stay at the head
of the chain.
Since we're already using Grafana, we can install the
[Grafana OnCall](https://grafana.com/grafana/plugins/grafana-oncall-app/)
plugin. OnCall allows you to setup integrations. It could be a
webhook or a direct integration into Telegram or Slack.
You can find more information on Grafana's [Docs Page](https://grafana.com/docs/oncall/latest/integrations/).
---
Title: Jailing and slashing on Celestia
URL: https://docs.celestia.org/operate/consensus-validators/slashing.md
Source: app/operate/consensus-validators/slashing/page.mdx
---
# Jailing and slashing on Celestia
Slashing is a mechanism employed in proof of stake blockchains
that is used to deter and punish malicious behavior.
It functions by removing a percentage of a validator's stake
each time they act harmfully towards the network.
Celestia is built with the Cosmos SDK and uses the `x/slashing` module.
If a validator gets slashed, delegators bonded to that validator will also
have the same percentage of their delegated funds slashed.
The following are the conditions for a validator to get jailed or slashed:
1. **Downtime**: If a validator is offline for more than 25% of a rolling window
of the last 5,000 blocks, they will be jailed for 1 minute.
During this period, the validator is removed from the validator set
temporarily, and will be unable to propose new blocks or earn rewards.
After the jail period, the validator can send an unjail request to
rejoin the validator set.
2. **Double signing**: This is a more severe offense and results in getting slashed.
If a validator engages in double signing, the validator
will lose 2% of their stake and the remainder of their stake
will be returned to them. The validator will be permanently removed
from the validator set and will not have the ability to unjail.
Delegators bonded to that validator will automatically enter the unbonding
period for 21 days, and can delegate to another validator after
they have been unbonded.
For more details on the jailing and slashing parameters, refer to the
[celestia-app specifications](https://celestiaorg.github.io/celestia-app/parameters_v6.html)
page.
---
Title: Upgrade Monitor
URL: https://docs.celestia.org/operate/consensus-validators/upgrade-monitor.md
Source: app/operate/consensus-validators/upgrade-monitor/page.mdx
---
# Upgrade Monitor
Upgrade monitor is a binary that monitors that status of upgrades on a Celestia
network. See the [README](https://github.com/celestiaorg/upgrade-monitor) for
instructions on how to install and use the binary.
---
Title: Setting up a Celestia validator node
URL: https://docs.celestia.org/operate/consensus-validators/validator-node.md
Source: app/operate/consensus-validators/validator-node/page.mdx
---
# Setting up a Celestia validator node
This tutorial will guide you through setting up a validator node on Celestia.
Validator nodes allow you to participate in consensus in the Celestia network.

## Hardware requirements
See [hardware requirements](/operate/getting-started/hardware-requirements).
## Setting up a validator node
The following tutorial is done on an Ubuntu Linux 24.04 (LTS) x64
instance machine.
First, follow the instructions on
[setting up a consensus node](/operate/consensus-validators/consensus-node#set-up-a-consensus-node).
### Wallet
Follow [the tutorial on creating a wallet](/operate/keys-wallets/celestia-app-wallet).
That page also covers the available keyring backends. Pick one before you
create the wallet: a Mainnet Beta validator should not use the `test` backend,
which stores the key unencrypted on disk.
## Optional: Deploy the celestia-node
Running a bridge node is critical to the Celestia network as it enables
the data availability and consensus nodes to communicate with one
another. It is recommended to support the data availability network,
but is not required.
If you are not running a bridge node, you can skip to
[run a validator node](#run-the-validator-node).
This section describes part 2 of Celestia validator node setup: running a
Celestia bridge node daemon.
### Install celestia-node
You can [follow the tutorial for installing `celestia-node`](/operate/data-availability/install-celestia-node)
### Initialize the bridge node
Run the following:
```bash
celestia bridge init --core.ip <URI> --core.port <port>
```
Refer to [the ports section of the celestia-node troubleshooting page](/operate/maintenance/troubleshooting#ports) for information on which ports are required to be open on your machine.
When connecting your bridge node to a localhost consensus node, ensure that gRPC
is properly configured in your consensus node's `app.toml` file. The `[grpc]`
section should have `enable = true` and the appropriate address setting for the
bridge node to connect successfully.
Using an RPC of your own, or one listed for
[Mainnet Beta](/operate/networks/mainnet-beta#integrations) or
[Mocha testnet](/operate/networks/mocha-testnet#community-consensus-endpoints),
initialize your node.
### Run the bridge node
Run the following:
```bash
celestia bridge start
```
#### Optional: start the bridge node with SystemD
Follow
[the tutorial on setting up the bridge node as a background process with SystemD](/operate/maintenance/systemd).
You have successfully set up a bridge node that is syncing with the network.
## Run the validator node
> **Fibre signer compatibility:** Before starting an upgraded celestia-app build
> that includes
> [celestia-core #3379](https://github.com/celestiaorg/celestia-core/pull/3379),
> check `priv_validator_grpc_laddr` in `config/config.toml` if you use the signing
> service. The hostname `localhost` no longer counts as loopback. For local
> plaintext signing, replace `localhost:26669` with `127.0.0.1:26669` or
> `[::1]:26669`, preserving your port, and update Fibre's signer address to match.
> Without mutual TLS or an explicit insecure override, a hostname or non-loopback
> address prevents the node from starting. Follow the
> [Fibre signing connection guide](/operate/consensus-validators/fibre#configure-the-signing-connection)
> for configuration and restart instructions. This check applies to the
> priv-validator signing service, not application gRPC in `app.toml`.
In order to create a validator on-chain, follow the steps below.
1. Start the consensus node
```sh
celestia-appd start
```
1. Export an environment variable for the chain ID you want to run on:
1. Export more environment variables.
```bash
# Pick a moniker name of your choice.
export MONIKER="your_moniker"
# Set VALIDATOR_WALLET to the same you defined previously.
export VALIDATOR_WALLET="validator"
# Set KEYRING_BACKEND to the backend you chose when creating the wallet.
# `test` stores the key unencrypted on disk: it is a reasonable choice on
# Mocha, but do not use it on Mainnet Beta.
export KEYRING_BACKEND="file"
# Set VALIDATOR_PUBKEY to the pubkey of your validator wallet.
export VALIDATOR_PUBKEY=$(celestia-appd tendermint show-validator)
```
1. Create a validator
You should see output like:
```console
code: 0
codespace: ""
data: ""
gas_used: "0"
gas_wanted: "0"
height: "0"
info: ""
logs: []
raw_log: '[]'
timestamp: ""
tx: null
txhash: <tx-hash>
```
> **Note:** The options `--identity`, `--website`, `--security-contact` and `--details` are optional. The `--identity` value is used to verify identity with systems like [Keybase](https://keybase.io/) or UPort. If you need to add or update the values of these descriptive fields when your validator is already created, you can use the following command (remove the options that you don't want to change the values for):
```bash
celestia-appd tx staking edit-validator \
--new-moniker=<new_validator_name> \
--identity=<identity_signature> \
--website="<validator_website>" \
--security-contact="<email_address_for_security_contact>" \
--details="New description of the validator." \
--from=$VALIDATOR_WALLET \
--keyring-backend=$KEYRING_BACKEND \
--fees=21000utia \
--gas=220000
```
You should now be able to see your validator from a [block explorer](/operate/networks/mocha-testnet#explorers).
## Submit your validator information
After starting your node, please submit your node as a seed and peer to the
[networks repository](https://github.com/celestiaorg/networks).
## Optional: Delegate stake to a validator
Create an environment variable for the address:
```bash
VALIDATOR_WALLET=<validator-wallet-name>
```
If you want to delegate more stake to any validator, including your own you
will need the `celestiavaloper` address of the validator in question. You can run
the command below to get the `celestiavaloper` of your local validator wallet in
case you want to delegate more to it:
```bash
celestia-appd keys show $VALIDATOR_WALLET --bech val -a \
--keyring-backend=$KEYRING_BACKEND
```
After entering the wallet passphrase you should see a similar output:
```bash
Enter keyring passphrase:
celestiavaloper1q3v5cugc8cdpud87u4zwy0a74uxkk6u43cv6hd
```
To delegate tokens to the `celestiavaloper` validator, as an
example you can run:
```bash
celestia-appd tx staking delegate \
<the_valoper_address_starts_with_celestiavaloper1...> 1000000utia \
--from=$VALIDATOR_WALLET --chain-id=mocha-5 \
--keyring-backend=$KEYRING_BACKEND \
--fees=21000utia
```
If successful, you should see a similar output as:
```console
code: 0
codespace: ""
data: ""
gas_used: "0"
gas_wanted: "0"
height: "0"
info: ""
logs: []
raw_log: '[]'
timestamp: ""
tx: null
txhash: <tx-hash>
```
You can check if the TX hash went through using the block explorer by
inputting the `txhash` ID that was returned.
## Optional: Transaction indexer configuration options
Follow the instructions under
[transaction indexer configuration options](/operate/consensus-validators/consensus-node#optional-transaction-indexer-configuration-options)
to configure your `config.toml` file to select which transactions to index.
## Migrating a validator to another machine
> **Warning:** Moving a validator to a new machine is a sensitive process that needs to be done carefully. If the transfer isn’t handled properly, it could result in double signing, which will permanently slash your validator, wipe out delegated tokens, and remove you from the active validator set. To avoid this, make sure to follow the steps closely and stop the old node completely before starting the migration.
### Step 1: Set up a new full consensus node
First, set up a new [consensus node](/operate/consensus-validators/consensus-node) on the new server and make sure the node is fully synced with the chain. To check whether your node is synced, you can check the `catching_up` status using:
```bash
celestia-appd status | jq '{ "catching_up": .SyncInfo.catching_up }'
```
If the node is synced, the output will look like this:
```json
{
"catching_up": false
}
```
### Step 2: Stop the old validator
After your new consensus node is synced, proceed to stop the current validator on the old machine. If you’re running it with [SystemD](/operate/maintenance/systemd), use the following command:
```bash
sudo systemctl stop <SERVICE_NAME>
```
Additionally, it’s recommended to disable the service to prevent it from restarting automatically after a system reboot. You can do this with:
```bash
sudo systemctl disable <SERVICE_NAME>
```
For extra safety, you may also delete the service file from the server:
```bash
sudo rm -rf /etc/systemd/system/<SERVICE_NAME>.service
```
### Step 3: Backup and transfer `priv_validator_key.json`
Once the old validator is stopped and the new node is synced, you’ll need to back up the `priv_validator_key.json` file from the old server (if it has not been backed up earlier). This file is located at:
```plaintext
~/.celestia-app/config/priv_validator_key.json
```
Copy this file to the same location on the new server. To verify that the file has been transferred correctly, compare its contents on both servers using:
```bash
cat ~/.celestia-app/config/priv_validator_key.json
```
### Step 4: Start the new validator
If everything checks out, you can now restart the new node with the updated validator key:
```bash
sudo systemctl restart <SERVICE_NAME>
```
After this, your validator will resume signing blocks on the new server, and the migration is complete. Validators operate within a 10,000 signed block window, and missing more than 2,500 blocks in this window will result in downtime jail. The faster you complete the transfer, the fewer blocks your validator will miss.
## Additional resources
For additional resources, refer to
[the extra resources for consensus nodessection of the consensus node page](/operate/consensus-validators/consensus-node#extra-resources-for-consensus-nodes).
## FAQ
### `+2/3 committed an invalid block: wrong Block.Header.Version`
If you encounter an error like:
```bash
2024-04-25 14:48:24 6:48PM ERR CONSENSUS FAILURE!!! err="+2/3 committed an invalid block: wrong Block.Header.Version. Expected {11 1}, got {11 2}" module=consensus stack="goroutine 214 [running]:\nruntime/debug.Stack()\n\t/usr/local/go/src/runtime/debug/stack.go:24 +0x64\ngithub.com/tendermint/tendermint/consensus.(*State).receiveRoutine.func2()\n\t/go/pkg/mod/github.com/celestiaorg/celestia-core@v1.35.0-tm-v0.34.29/프로젝트로 돌아가기