# Juno Full Node

By [GLCstaked](https://paragraph.com/@glcstaked) · 2023-07-05

---

**Deploy a full node for Juno chain**

_(document last update: 13/09/23)_

Cosmos based L1 network for cross-chain smart contracts.

[

The incubator of the Interchain
-------------------------------

Juno is an interoperable smart contract network and a zone part of the Cosmos Network. Highly scalable, robust, secure and easy to deploy!

https://junonetwork.io

![](https://storage.googleapis.com/papyrus_images/ee20f7cd2aa3d41d44955e784b36f036948518eaf5ca2f3a48a1d724ae2f9a0c.png)

](https://junonetwork.io/)

**Hardware requirements**

4vCPU / 32 GB RAM (or equivalent swap file set up) / 1 TB of storage space (min)

**Setup device**

Install ubuntu 20.04 LTS

[

Ubuntu 20.04.6 LTS (Focal Fossa)
--------------------------------

CD images for Ubuntu 20.04.6 LTS (Focal Fossa)

https://www.releases.ubuntu.com



](https://www.releases.ubuntu.com/focal/)

Update packages and upgrade device

    sudo apt update && sudo apt upgrade -y
    

1\. Install Juno binary
-----------------------

### **Method 1: Install Script (easy)**

The script automates the install process

**Install script:**

[https://github.com/GLCNI/RPC-node-deployments/tree/main#juno](https://github.com/GLCNI/RPC-node-deployments/tree/main#juno)

This is my own version to automate the steps for Method 2: Manual build, the steps outlined in this guide.

### **Method 2: Manual build**

**Install dependencies**

    sudo apt-get install make build-essential gcc git jq chrony curl -y
    

**Install Go**

go 1.20.1 is needed for the current Juno (cosmos) version, to change this edit the version accordingly

    wget -q -O - https://git.io/vQhTU | bash -s -- --version 1.20.1
    

_This script is made by osmosis-labs and installs_ `PATH` _variables to_ `.bashrc` _and sets up in a way compatible with the rest of the build. Go binary installs to_ `$HOME/.go` and `$HOME/go/bin`

Run `source $HOME/.bashrc` to take effect, confirm installed with `go version` which should return the version installed

    #to remove installation 
    wget -q -O - https://git.io/vQhTU | bash -s -- --remove
    

**Install Juno Binary**

Find latest version [here](https://github.com/CosmosContracts/juno/releases): replace with correct version-tag example `git checkout v16.0.0`

    # from $HOME dir
    git clone https://github.com/CosmosContracts/juno
    cd juno
    git fetch
    git checkout <version-tag>
    

Make the binary

    make install
    

Confirm installed

2\. Juno CLI
------------

If not setting up as a full node and syncing the data, you can add a public rpc. This adds to the `client.toml`

    junod config node https://rpc-juno.itastakers.com:443
    

To interact with Juno chain via CLI, more information found [here](https://docs.junonetwork.io/cli/useful-cli-commands)

3\. Configure Juno Node
-----------------------

Configuration of `junod` to run as a full node, later setup with [cosmovisor](https://docs.cosmos.network/main/tooling/cosmovisor) to handle chain upgrades seamlessly.

**Initialize node**

Replace \`NODE\_NAME\` with a name of your choice

    junod init <NODE_NAME> --chain-id juno-1
    

![](https://storage.googleapis.com/papyrus_images/d11ffb79351c2515b1bc4b3b39f2f46894752a7acc0add9575ad3b66534e5e54.png)

This will generate the following files in `~/.juno/config/`

Files: `priv_validator_key.json` / `node_key.json` / `genesis.json`

**Download Genesis file**

    rm ~/.juno/config/genesis.json
    wget https://download.dimi.sh/juno-phoenix2-genesis.tar.gz
    tar -xvf juno-phoenix2-genesis.tar.gz
    mv juno-phoenix2-genesis.json $HOME/.juno/config/genesis.json
    

Alt source for genesis file here:

**Seeds and persistent Peers**

From docs: [seeds](https://docs.junonetwork.io/validators/joining-mainnet#set-seeds), adding seeds or persistent peers can help with starting the node syncing by finding other nodes to connect to from a known list.

Add to the `~/.juno/config/config.toml` a comma separated list of seeds like so

![errors may be from incorrect syntax in this file](https://storage.googleapis.com/papyrus_images/3fa54ed9de7bf8af7bc6eca3615830759b390931bfd163f94a67ce4ffe2e8cb4.png)

errors may be from incorrect syntax in this file

Can find sources for peers here on [Juno GitHub](https://github.com/CosmosContracts/mainnet/tree/main/juno-1): or a cosmos community registry [here](https://chain-registry.netlify.app/):

**Set pruning configurations**

The following pruning configurations are required to work with snapshot

in `app.toml`

    # Prune Type
    pruning = "custom"
    
    # Prune Strategy
    pruning-keep-recent = "100"
    pruning-keep-every = "0"
    pruning-interval = "10"
    

in `config.toml`

    indexer = "null"
    

**Set Minimum gas prices:**

_from v16 this needs to be set or you get an error running_

    sed -i.bak -e "s/^minimum-gas-prices *=.*/minimum-gas-prices = \"0.0025ujuno,0.001ibc\/C4CFF46FD6DE35CA4CF4CE031E643C8FDC9BA4B99AE598E9B0ED98FE3A2319F9\"/" ~/.juno/config/app.toml
    

4\. Cosmovisor
--------------

[Cosmovisor](https://docs.cosmos.network/main/tooling/cosmovisor): is a process management tool to handle cosmos based chain upgrades seamlessly, it looks for chain upgrades and downloads & installs at the correct block height.

**Create directories for Cosmovisor**

    cd
    mkdir -p ~/.juno/cosmovisor/genesis/bin
    mkdir -p ~/.juno/cosmovisor/upgrades 
    

create directory for corresponding binary version (change v16 accordingly)

    mkdir -p ~/.juno/cosmovisor/upgrades/v16/bin
    

**Install Cosmovisor binary**

    go install cosmossdk.io/tools/cosmovisor/cmd/cosmovisor@latest
    

this should install Cosmovisor binary to `$GOPATH/bin/cosmovisor`

**Copy binaries to Cosmovisor**

_Note on versions: if using snapshot (this guide) you are downloading the latest binary, with chain data manually downloaded and placed in the correct location, cosmovisor will look from the block height the node is currently on and the corresponding binary in the upgrades folder.  The binary_ also _needs to be placed in_ `~/.juno/cosmovisor/genesis/bin` for first start up or an error will occur.

    cp $GOPATH/bin/junod ~/.juno/cosmovisor/genesis/bin
    cp $GOPATH/bin/junod ~/.juno/cosmovisor/upgrades/v16/bin/
    

5\. Download chain data
-----------------------

Find the snapshot here and copy the download link:

[https://polkachu.com/tendermint\_snapshots/juno](https://polkachu.com/tendermint_snapshots/juno)

    #get packages required to unpack data
    sudo apt install snapd -y
    sudo snap install lz4 
    

**Download Snapshot**, Replace with the correct download link

    wget -O juno_8988038.tar.lz4 https://snapshots.polkachu.com/snapshots/juno/juno_8988038.tar.lz4 --inet4-only
    

Extract data into directory

    lz4 -c -d juno_8988038.tar.lz4  | tar -x -C $HOME/.juno
    # rm the compressed file
    rm -v juno_8988038.tar.lz4
    

6\. Set up SystemD for Cosmovisor
---------------------------------

More info [here](https://docs.junonetwork.io/validators/setting-up-cosmovisor):

    echo "[Unit]
    Description=Juno Daemon (cosmovisor)
    After=network-online.target
    
    [Service]
    User=$USER
    ExecStart=$HOME/go/bin/cosmovisor run start
    Restart=always
    RestartSec=3
    LimitNOFILE=4096
    Environment="DAEMON_NAME=junod"
    Environment="DAEMON_HOME=$HOME/.juno"
    Environment="DAEMON_ALLOW_DOWNLOAD_BINARIES=false"
    Environment="DAEMON_RESTART_AFTER_UPGRADE=true"
    Environment="DAEMON_LOG_BUFFER_SIZE=512"
    
    [Install]
    WantedBy=multi-user.target" | sudo tee /lib/systemd/system/cosmovisor.service > /dev/null
    

**Enable and Start service**

    sudo systemctl daemon-reload
    sudo systemctl enable cosmovisor
    sudo systemctl start cosmovisor
    

**Check status and logs**

    sudo systemctl status cosmovisor
    

    journalctl -u cosmovisor -f
    

![A synced working node should look similar](https://storage.googleapis.com/papyrus_images/d3961aa3f6432c0235313c0a1523c851e64a0ef944843f2327608a8f3187c229.png)

A synced working node should look similar

**Stop service**

    sudo systemctl stop cosmovisor
    

Make changes to service file

    sudo nano /lib/systemd/system/cosmovisor.service
    

**Check Node Sync status**

    # Query via the RPC (default port: 26657)
    curl http://localhost:26657/status | jq .result.sync_info.catching_up
    

Updating Juno
-------------

To allow Cosmovisor to auto download binaries, in the system service

    Environment="DAEMON_ALLOW_DOWNLOAD_BINARIES=true"
    

_The reason this is usually set to_ `false` _by default is its recommended to not use “auto” for mainnet deployments currently, this is likely because Cosmovisor is still early software, for Testnet deployments set to_ `true`

Option 2: Manual Upgrade To do this manually, it will look something like these steps: [here](https://github.com/Reecepbcups/juno-mainnet/blob/reece/v16/juno-1/2700_v16_UPGRADE.md)

*   Stop the service `sudo systemctl stop junod`
    
*   Git `checkout` and `make` the latest tag version:
    
*   Make folder in Cosmovisor for latest version.
    
*   Copy binary to folder
    
*   Restart node
    

Additional Settings to Open up node externally
----------------------------------------------

**Edit RPC/gRPC server configurations**

Edit Configurations to ensure APIs are open and reachable on all servers, to expose externally change to \`0.0.0.0\` which will listen for requests from any IP.

If configuring with a sub-domain process (setup locally) then \`localhost\` should be used, as these API ports would only need to be exposed to the host.

Ports can be changed, if need be but will need to be changed in any other services that connect.

**Open RPC**: in `config.toml`

    # TCP or UNIX socket address for the RPC server to listen on
    laddr = "tcp://0.0.0.0:26657"
    
    # TCP or UNIX socket address for the gRPC server to listen on
    # NOTE: This server only supports /broadcast_tx_commit
    grpc_laddr = ""
    

**Open REST API**: in `app.toml`

    [api]
    
    # Enable defines if the API server should be enabled.
    enable = true
    
    # Swagger defines if swagger documentation should automatically be registered.
    swagger = false
    
    # Address defines the API server to listen on.
    address = "tcp://0.0.0.0:1317"
    

**Open gRPC**: in `app.toml`

    [grpc]
    
    # Enable defines if the gRPC server should be enabled.
    enable = true
    
    # Address defines the gRPC server address to bind to.
    address = "tcp://0.0.0.0:9090"
    

**Add Open all Ports**

    sudo ufw allow 26657 # RPC
    sudo ufw allow 9090 # grpc
    sudo ufw allow 1317 # REST 
    

ensure do not get locked out, if on VPS

    sudo ufw allow shh
    sudo ufw enable
    

_to change ports edit the port in the configuration files above, this should not be needed when setting up with TLS domain routing as NGIX will manage routing through a specified port, this port is the one you need to make sure to avoid conflict and port forward/open as needed._

More on setting up TLS Certificates here: [sub-domains with NGINX](https://github.com/GLCNI/RPC-node-deployments/blob/main/additional/sub_domains_nginx.md)

---

*Originally published on [GLCstaked](https://paragraph.com/@glcstaked/juno-full-node)*
