# Juno Full Node **Published by:** [GLCstaked](https://paragraph.com/@glcstaked/) **Published on:** 2023-07-05 **URL:** https://paragraph.com/@glcstaked/juno-full-node ## Content 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 InterchainJuno is an interoperable smart contract network and a zone part of the Cosmos Network. Highly scalable, robust, secure and easy to deploy!https://junonetwork.ioHardware requirements 4vCPU / 32 GB RAM (or equivalent swap file set up) / 1 TB of storage space (min) Setup device Install ubuntu 20.04 LTSUbuntu 20.04.6 LTS (Focal Fossa)CD images for Ubuntu 20.04.6 LTS (Focal Fossa)https://www.releases.ubuntu.comUpdate packages and upgrade devicesudo apt update && sudo apt upgrade -y 1. Install Juno binaryMethod 1: Install Script (easy)The script automates the install process Install script: 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 buildInstall dependenciessudo 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 accordinglywget -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: 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 binarymake install Confirm installed2. Juno CLIIf not setting up as a full node and syncing the data, you can add a public rpc. This adds to the client.tomljunod config node https://rpc-juno.itastakers.com:443 To interact with Juno chain via CLI, more information found here3. Configure Juno NodeConfiguration of junod to run as a full node, later setup with cosmovisor to handle chain upgrades seamlessly. Initialize node Replace `NODE_NAME` with a name of your choicejunod init <NODE_NAME> --chain-id juno-1 This will generate the following files in ~/.juno/config/ Files: priv_validator_key.json / node_key.json / genesis.json Download Genesis filerm ~/.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, 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 soerrors may be from incorrect syntax in this fileCan find sources for peers here on Juno GitHub: or a cosmos community registry here: 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.tomlindexer = "null" Set Minimum gas prices: from v16 this needs to be set or you get an error runningsed -i.bak -e "s/^minimum-gas-prices *=.*/minimum-gas-prices = \"0.0025ujuno,0.001ibc\/C4CFF46FD6DE35CA4CF4CE031E643C8FDC9BA4B99AE598E9B0ED98FE3A2319F9\"/" ~/.juno/config/app.toml 4. CosmovisorCosmovisor: 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 Cosmovisorcd 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 binarygo 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 dataFind the snapshot here and copy the download link: 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 linkwget -O juno_8988038.tar.lz4 https://snapshots.polkachu.com/snapshots/juno/juno_8988038.tar.lz4 --inet4-only Extract data into directorylz4 -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 CosmovisorMore info here: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 servicesudo systemctl daemon-reload sudo systemctl enable cosmovisor sudo systemctl start cosmovisor Check status and logssudo systemctl status cosmovisor journalctl -u cosmovisor -f A synced working node should look similarStop servicesudo systemctl stop cosmovisor Make changes to service filesudo 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 JunoTo allow Cosmovisor to auto download binaries, in the system serviceEnvironment="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: hereStop the service sudo systemctl stop junodGit checkout and make the latest tag version:Make folder in Cosmovisor for latest version.Copy binary to folderRestart nodeAdditional Settings to Open up node externallyEdit 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 Portssudo ufw allow 26657 # RPC sudo ufw allow 9090 # grpc sudo ufw allow 1317 # REST ensure do not get locked out, if on VPSsudo 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 ## Publication Information - [GLCstaked](https://paragraph.com/@glcstaked/): Publication homepage - [All Posts](https://paragraph.com/@glcstaked/): More posts from this publication - [RSS Feed](https://api.paragraph.com/blogs/rss/@glcstaked): Subscribe to updates