---
# System prepended metadata

title: Celestia

---

# Celestia 


# Celestia Devnet
celes14e3q6n4muc8z9q6kezdeg44ryttqf5r4tgqcx3
mnemonic
acquire candy unhappy govern close bridge belt estate use obey pass husband pottery sketch copy clock trip detect arm shoot receive wagon carbon verify
- **celesvalcons is from priv_validator_key.json when you did ‘celestia-appd init’**
- each delegator needs to relegate themselves. if they don’t, their coins will be refunded to their address after the unbonding period (21 days, assume you shutdown your validator by undelegating self-bond)
- * consensus key / priv_validator_key.json / ed25519 / celesvalcons is used at the Tendermint level to form consensus

## Run a Node in the Celestia testnet
### 1. celestia-app

```
#https://github.com/celestiaorg/celestia-app
cd $HOME
git clone https://github.com/celestiaorg/celestia-app
cd $HOME/celestia-app
make && make install
$HOME/celestia-app

```

### 2. celestia-node
```
https://github.com/celestiaorg/celestia-node
cd $HOME
git clone https://github.com/celestiaorg/celestia-node.git
cd $HOME/celestia-node
make && make install

```

### 3. network 
[mamaki-testnet](https://docs.celestia.org/nodes/mamaki-testnet)

```
# https://docs.celestia.org/nodes/bridge-validator-node
# https://github.com/celestiaorg/networks


# initializing 
# celestia-appd init Validatus --chain-id devnet-2
celestia-appd init Validatus --chain-id mamaki

# initializing celestia bridge 
celestia bridge init --core.remote tcp://127.0.0.1:26657


#genesis
cd $HOME
sudo rm -rf networks
git clone https://github.com/celestiaorg/networks.git
cp $HOME/networks/devnet-2/genesis.json $HOME/.celestia-app/config

# set proper defaults  enable api
sed -i 's/timeout_commit = "5s"/timeout_commit = "15s"/g' ~/.celestia-app/config/config.toml
sed -i 's/index_all_keys = false/index_all_keys = true/g' ~/.celestia-app/config/config.toml
# Open up rest api
sed -i '/\[api\]/{:a;n;/enabled/s/false/true/;Ta};/\[api\]/{:a;n;/enable/s/false/true/;Ta;}' $HOME/.celestia-app/config/app.toml

#SEEDS=""  
#PEERS="72b34325513863152269e781d9866d1ec4d6a93a@65.108.194.40:26676,
322542cec82814d8903de2259b1d4d97026bcb75@51.178.133.224:26666"  
#sed -i.bak -e "s/^seeds *=.*/seeds = \"$SEEDS\"/; s/^persistent_peers *=.*/persistent_peers = \"$PEERS\"/" $HOME/.celestia-app/config/config.toml

BOOTSTRAP_PEERS=$(curl -sL https://raw.githubusercontent.com/celestiaorg/networks/master/mamaki/bootstrap-peers.txt | tr -d '\n')
echo $BOOTSTRAP_PEERS
sed -i.bak -e "s/^bootstrap-peers *=.*/bootstrap-peers = \"$BOOTSTRAP_PEERS\"/" $HOME/.celestia-app/config/config.toml


# pruning / delete data from the database 
pruning="custom"
pruning_keep_recent="10000"  
pruning_keep_every="0"  
pruning_interval="89"  
  
sed -i -e "s/^pruning *=.*/pruning = \"$pruning\"/" $HOME/.celestia-app/config/app.toml  
sed -i -e "s/^pruning-keep-recent *=.*/pruning-keep-recent = \"$pruning_keep_recent\"/" $HOME/.celestia-app/config/app.toml  
sed -i -e "s/^pruning-keep-every *=.*/pruning-keep-every = \"$pruning_keep_every\"/" $HOME/.celestia-app/config/app.toml  
sed -i -e "s/^pruning-interval *=.*/pruning-interval = \"$pruning_interval\"/" $HOME/.celestia-app/config/app.toml


```
## firewalld 
```

# [p2p]26656:26656 [rpc]26657:26657
IPv4=$(hostname -I | cut -d' ' -f1)
# laddr | be careful - a couple matches in config.toml
# external-address 
sed -i.bak -e "s/^external-address *=.*/external-address = \"$IPv4:26656\"/" $HOME/.celestia-app/config/config.toml

# laddr 
# $HOME/.celestia-app/config/config.toml
vim $HOME/.celestia-app/config/config.toml
1. ###       Priv Validator Configuration              ###
# TCP or UNIX socket address for Tendermint to listen on for
# connections from an external PrivValidator process
# when the listenAddr is prefixed with grpc instead of tcp it will use the gRPC Client
laddr = ""
2. ###       Priv Validator Configuration              ###
# TCP or UNIX socket address for the RPC server to listen on
laddr = "$IP4-of-node:26657"
3. ###           P2P Configuration Options             ###
# Address to listen for incoming connections
laddr = "tcp://$IP4-of-node:26656"

# check
grep laddr $HOME/.celestia-app/config/config.toml
grep external-address $HOME/.celestia-app/config/config.toml


sudo firewall-cmd --zone=public --permanent --add-port 26656/tcp
sudo firewall-cmd --zone=public --permanent --add-port 26657/tcp
sudo firewall-cmd --reload
sudo systemctl restart firewalld 
```

## backup Keys
```
#double_sign_check_height
sed -i.bak -E 's#^(double_sign_check_height[[:space:]]+=[[:space:]]+).*$#\15#' ~/.celestia-app/config/config.toml

#backup
mkdir -p $HOME/validator/celestia/
cp ~/.celestia-app/data/priv_validator_state.json $HOME/validator/celestia/
cp ~/.celestia-app/config/priv_validator_key.json $HOME/validator/celestia/
cp ~/.celestia-app/config/node_key.json $HOME/validator/celestia/
cp ~/.celestia-app/config/config.toml $HOME/validator/celestia/
ls -la $HOME/validator/celestia/

```

## state-sync (Quick-Sync) with Snapshot
```
cd $HOME  
rm -rf ~/.celestia-app/data; \  
mkdir -p ~/.celestia-app/data;  
SNAP_NAME=$(curl -s https://snaps.qubelabs.io/celestia/ | egrep -o ">mamaki.*tar" | tr -d ">"); wget -O - https://snaps.qubelabs.io/celestia/${SNAP_NAME} | tar xf - -C ~/.celestia-app/data/

```

## systemd 

```
sudo tee /etc/systemd/system/celestia-appd.service << END
[Unit] 
Description=celestia-appd Cosmos daemon  
ConditionPathExists=$HOME/go/bin/
After=network.target

[Service]
Type=simple
User=$USER

Restart=always
#RuntimeMaxSec=36000
#LimitNOFILE=4096
LimitNOFILE=8192

WorkingDirectory=$HOME/go/
StandardOutput=journal
SyslogIdentifier=celestia-appd

ExecStart=/bin/bash -c '$HOME/go/bin/celestia-appd start'
ExecStop=/bin/kill -2 \$MAINPID
ExecReload=/bin/kill -HUP \$MAINPID
RestartSec=30
TimeoutStopSec=10
KillMode=control-group


[Install]
WantedBy=multi-user.target
END

sudo systemctl enable celestia-appd
# check daemon logs in real time
#sudo journalctl -u celestia-appd.service -f

```

```

#vim $HOME/.celestia-bridge/config.toml
sed -i 's/PeerExchange *=.*/PeerExchange = true/g' $HOME/.celestia-bridge/config.toml

sudo tee /etc/systemd/system/celestia-bridge.service << END
[Unit] 
Description=celestia-bridge Cosmos daemon 
ConditionPathExists=$HOME/go/bin/
After=network.target

[Service]
Type=simple
User=$USER

Restart=always
#RuntimeMaxSec=36000
#LimitNOFILE=4096
LimitNOFILE=8192

WorkingDirectory=$HOME/go/
StandardOutput=journal
SyslogIdentifier=celestia-bridge

ExecStart=/bin/bash -c '$HOME/go/bin/celestia bridge start'
ExecStop=/bin/kill -2 \$MAINPID
ExecReload=/bin/kill -HUP \$MAINPID
RestartSec=30
TimeoutStopSec=10
KillMode=control-group


[Install]
WantedBy=multi-user.target
END

cat /etc/systemd/system/celestia-bridge.service
sudo systemctl enable celestia-bridge.service

```


## celestia-appd start / celestia bridge start 

```

# If you are not passing it, the Bridge Node will just sync from the beginning, which is also the preferred option of how to run it

# version check
celestia version

# Testing in a screen session 
screen 

# check if faiure appears following configs
# vim $HOME/.celestia-app/config/config.toml
# vim $HOME/.celestia-app/config/app.toml

# start celestia-appd | celestia bridge start
celestia-appd start 

# celestia bridge start
celestia bridge start
curl -s http://localhost:26657/block?height=1 | grep -A1 block_id | grep hash
```



## start celestia-appd serviced 
```
#start
#celestia-appd start
sudo systemctl start celestia-bridge.service
sudo systemctl start celestia-appd


#Make sure that you have `"catching_up": false` otherwise leave it running until it is in sync
curl -s localhost:26657/status | jq .result | jq .sync_info
curl -s localhost:26657/status 
```


