Skip to content
All services

Mainnet

Althea

Chain ID
Version
Go

For Ubuntu 22.04 or later. The node listens on ports starting with your port prefix (e.g. 26657 becomes 16657), so several nodes can share a server.

  1. 01Install tools

    sudo apt update && sudo apt upgrade -y
    sudo apt install -y curl git wget jq make gcc build-essential lz4 zstd tmux htop unzip
  2. 02Install Go

    cd $HOME
    VER="<go-version>"
    wget "https://golang.org/dl/go$VER.linux-amd64.tar.gz"
    sudo rm -rf /usr/local/go
    sudo tar -C /usr/local -xzf "go$VER.linux-amd64.tar.gz"
    rm "go$VER.linux-amd64.tar.gz"
    [ ! -f $HOME/.bash_profile ] && touch $HOME/.bash_profile
    echo 'export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin' >> $HOME/.bash_profile
    source $HOME/.bash_profile
    mkdir -p $HOME/go/bin
    go version
  3. 03Build the binary

    cd $HOME
    rm -rf althea-L1
    git clone https://github.com/AltheaFoundation/althea-L1.git althea-L1
    cd althea-L1
    git checkout <version>
    make install
    althea version --long | grep -E '^(version|commit):'
  4. 04Install Cosmovisor

    go install cosmossdk.io/tools/cosmovisor/cmd/cosmovisor@latest
    DAEMON_HOME=$HOME/.althea DAEMON_NAME=althea cosmovisor init $HOME/go/bin/althea
  5. 05Create the service

    sudo tee /etc/systemd/system/althea.service > /dev/null << EOF
    [Unit]
    Description=Althea node
    After=network-online.target
    
    [Service]
    User=$USER
    ExecStart=$(which cosmovisor) run start
    WorkingDirectory=$HOME/.althea
    Restart=on-failure
    RestartSec=10
    LimitNOFILE=65535
    Environment="DAEMON_HOME=$HOME/.althea"
    Environment="DAEMON_NAME=althea"
    Environment="DAEMON_ALLOW_DOWNLOAD_BINARIES=true"
    Environment="DAEMON_RESTART_AFTER_UPGRADE=true"
    Environment="UNSAFE_SKIP_BACKUP=true"
    Environment="PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$HOME/.althea/cosmovisor/current/bin"
    
    [Install]
    WantedBy=multi-user.target
    EOF
    sudo systemctl daemon-reload
    sudo systemctl enable althea
  6. 06Set variables

    echo 'export WALLET="wallet"' >> $HOME/.bash_profile
    echo 'export MONIKER="Your-Moniker"' >> $HOME/.bash_profile
    echo 'export ALTHEA_CHAIN_ID="<chain-id>"' >> $HOME/.bash_profile
    echo 'export ALTHEA_PORT="16"' >> $HOME/.bash_profile
    source $HOME/.bash_profile
  7. 07Initialize the node

    althea init "$MONIKER" --chain-id $ALTHEA_CHAIN_ID --home $HOME/.althea
    althea config set client chain-id $ALTHEA_CHAIN_ID
    althea config set client keyring-backend os
    althea config set client node tcp://localhost:$ALTHEA_PORT657
  8. 08Custom ports

    sed -i.bak -e "s%:1317%:$ALTHEA_PORT317%g;
    s%:8080%:$ALTHEA_PORT080%g;
    s%:9090%:$ALTHEA_PORT090%g;
    s%:9091%:$ALTHEA_PORT091%g;
    s%:8545%:$ALTHEA_PORT545%g;
    s%:8546%:$ALTHEA_PORT546%g" $HOME/.althea/config/app.toml
    sed -i.bak -e "s%:26658%:$ALTHEA_PORT658%g;
    s%:26657%:$ALTHEA_PORT657%g;
    s%:6060%:$ALTHEA_PORT060%g;
    s%:26656%:$ALTHEA_PORT656%g;
    s%^external_address = \"\"%external_address = \"$(wget -qO- eth0.me):$ALTHEA_PORT656\"%;
    s%:26660%:$ALTHEA_PORT660%g" $HOME/.althea/config/config.toml
  9. 09Genesis and addrbook

    curl -Ls https://althea-mainnet-services.luckystar.asia/althea/genesis.json > $HOME/.althea/config/genesis.json
    curl -Ls https://althea-mainnet-services.luckystar.asia/althea/addrbook.json > $HOME/.althea/config/addrbook.json
  10. 10Minimum gas price

    sed -i -e "s|^minimum-gas-prices *=.*|minimum-gas-prices = \"100000000000aalthea\"|" $HOME/.althea/config/app.toml
  11. 11Pruning

    sed -i -e "s/^pruning *=.*/pruning = \"custom\"/" $HOME/.althea/config/app.toml
    sed -i -e "s/^pruning-keep-recent *=.*/pruning-keep-recent = \"100\"/" $HOME/.althea/config/app.toml
    sed -i -e "s/^pruning-interval *=.*/pruning-interval = \"19\"/" $HOME/.althea/config/app.toml
  12. 12Disable the indexer

    sed -i -e "s/^indexer *=.*/indexer = \"null\"/" $HOME/.althea/config/config.toml
  13. 13Download the snapshot

    curl -L https://althea-mainnet-services.luckystar.asia/althea/althea_258432-1_latest.tar.lz4 | lz4 -dc | tar -xf - -C $HOME/.althea/data
  14. 14Start the node

    sudo systemctl restart althea && sudo journalctl -fu althea -o cat
  15. 15Check sync

    curl -s localhost:$ALTHEA_PORT657/status | jq .result.sync_info
Original guide (GitBook)