LogoLogo
  • Persistence Hub
    • 👓Overview
    • 🌐Persistence Ecosystem
  • Begin & Explore
    • 🔏Wallet Setup
    • 📓Getting Your Persistence Address
    • 💰Acquiring $XPRT Tokens
  • Products
    • 🦾Persistence DEX (V1)
      • 📘Introduction
      • 📖Guides
        • 👨‍💼Managing Assets
        • 💱Trading Assets
        • 🚰Providing Liquidity
        • ⛓️Bonding/Unbonding Tokens
        • 🎉Claiming Rewards
        • 🏗️Creating New Pool
          • 🌀Metastable Pool
          • ⚖️Weighted Pool
          • 🧊Stable Swap Pool
      • 🏊‍♂️Pools
      • ⚡Instant LP Unbonding
      • 🎁Tradooor Rebate Program
      • 💰Fees
      • 🏆Rewards
      • ⚙️Technical Architecture
    • Bitcoin Cross-Chain Swaps (V2)
      • 🌟Introduction
      • 📚Fundamentals
        • 💱BTCfi
        • 🌉Bitcoin Layer 2s
        • Interoperability for BTCfi
        • 💡Intents for Blockchain Interoperability
      • 🔀Traditional Bridges vs. Intent-Based Swaps
      • ⚙️Product Mechanism
  • 💂Security
    • 📖Audits
  • Participate & Explore
    • $XPRT Token
      • 🛒Acquire
      • 📈Stake
      • 🏛️Governance
    • 🖥️Alternative Frontends
      • 🔃Hosting IPFS Versions with Pinata
      • 🤖IPFS Automation
    • 💼Wallets
    • 🔍Explorers
    • 💸Grants
  • Persistence Core-1 Chain
    • 🟢Running Nodes
      • Run a Local Node
      • Run a Testnet Node
      • Run a Mainnet Node
      • Node operations
        • State Sync
        • Run in the background
        • Cosmovisor upgrades
        • Manual upgrades
      • Seed & Peers
    • Public Infrastructure
      • Persistence Testnet
      • Endpoints
      • Snapshots & Archival Nodes
      • Faucets
      • Chain Registry
    • 🛡️Validators
      • Validate on Testnet
      • Validate on Mainnet
      • Validator Communication
    • 📡Relayers
      • IBC Channels
      • IBC Relayers
      • Relay on Mainnet
      • Relay on Testnet
    • 🫗Liquid Staking Module
      • For Validators
    • 📄Smart Contracts
      • Overview
      • Uploading a Contract
    • 👨‍💻Developer Tools
      • Persistence JS
      • Persistence SDK
    • ⚒️Community Tools
  • Community & Support
    • 🇹🇰Foundation Delegations
      • ➡️Round 1 - Closed
      • ➡️Round 2 - Closed
      • ⭐Bonus Delegation
      • ➡️Round 3 - Delegation Period Over
    • ⭕Coin-type Migration from 750 to 118
      • Persistence Wallet
      • Keplr Wallet
      • Ledger Hardware Wallet
      • Cosmostation Wallet
      • Coin98 Super Wallet
      • Math Wallet
      • Leap Wallet
      • Citadel Wallet
    • 🌎Geofencing on Persistence
    • 😍Connect & Follow
Powered by GitBook
On this page

Was this helpful?

Edit on GitHub
  1. Persistence Core-1 Chain
  2. Running Nodes
  3. Node operations

Run in the background

Run the Node in the Background

While you've probably used the persistenceCore start command in a terminal, you might question yourself what happens if you exit the window, stop the node by mistake, or need to restart your server. The answer is services. Imagine a service as a container for processes. It allows the Persistence Core-1 node to run in the background while providing us with access to logs. Not to mention it's starting automatically on system (re)boot. In this section we will cover systemd.

Running a service using systemd is straightforward. While systemd itself provides many configuration options, we only need a few to run the Persistence Core-1 node. Let's get started.

  1. Since systemd is installed by default, there are no installation steps.

  2. First, we need to create a service file in /etc/systemd/system. Let's name it core-1.service.

    touch /etc/systemd/system/core-1.service # create the file
    nano /etc/systemd/system/core-1.service # open the file (to edit it)
  3. Now, with the file created and open, we need to populate it with the correct options to run the Persistence Core-1 Node.

    [Unit]
    Description=Persistence Mainnet Node # description of the process running inside the service
    After=network-online.target # wait for internet connection before starting the process
    
    [Service]
    User=$USER # your system user name
    ExecStart=$(which persistenceCore) start # command to execute (this will run the node)
    Restart=always # always maintain the service running by restarting it in case it crashes
    RestartSec=3 # seconds to wait before restarting
    LimitNOFILE=4096 # maximum number of processes allowed to run in parallel
    
    [Install]
    WantedBy=multi-user.target # a special target unit for setting up a multi-user system
  4. Next, we need to reload systemd and enable the service.

    systemctl daemon-reload
    systemctl enable core-1.service
    # output: Created symlink /etc/systemd/system/multi-user.target.wants/core-1.service → /etc/systemd/system/core-1.service
  5. All that's left to do is to start it.

    systemctl start core-1.service
  6. Although you may think nothing has happened, the service is running in the background. To access its logs and see if it's running as it should use the following command:

    journalctl -u core-1.service -f
  7. To check the status of the service, you can run:

    service core-1.service status

Additional commands:

systemctl stop core-1.service
systemctl restart core-1.service
PreviousState SyncNextCosmovisor upgrades

Last updated 1 year ago

Was this helpful?

🟢