fetch-logo
ConceptsConceptsGuidesGuidesExamplesExamplesReferencesReferencesAPIsAPIs
GitHub (opens in a new tab)
  • Guides
      • Quickstart
        • What's an Agent?
        • uAgents Framework installation
        • Create your first agent
        • Agents address
        • Communicating with other agents
        • Agent Handlers (on_...)
        • Agents storage functions
        • Public and private Agents
        • Send tokens with Agents
        • Agents Mailboxes
        • Agent Functions
        • Make agents AI Engine compatible
        • Multi-file agent pipeline for AI Engine: Hugging face API to create a multi agent pipeline
        • Options for running local agents
        • Hosted agent
        • Introducing dialogues
        • Almanac Contract
        • Verify messages with Agents
        • Multi-file agent pipeline for AI Engine: Network of Primary and Secondary functions in Agentverse
        • Localwallet
        • Agentverse: Hosted Agents
        • Agentverse: Dice Roll agent
        • Agentverse: Allowed Imports
        • Agentverse: Mailbox
        • Register Agentverse Functions
        • Agentverse Functions: coin toss agent
        • Field descriptions for DeltaV
        • Agentverse Command Line Interface (AVCTL)
        • AVCTL Hosting commands
      • Agents and Functions creation APIs
      • Secret Management APIs
      • How to convert native FET to and from ERC-20 FET
      • How to stake FET tokens
      • Different ways of staking FET
      • Re-delegating staked FET token
      • Reconciliation service
      • How to setup a Multisig Wallet
        • Getting started
        • How to use the Fetch wallet
        • How to stake and claim rewards
        • Address book
        • Connections
        • Fetch Wallet Hardware Connection Guide
        • Installation
        • Connecting to a blockchain
        • Querying balances
        • Wallets and private keys
        • Sending funds
        • Staking
        • Smart contracts
          • Stake auto-compounder
          • Stake optimizer
          • Oracles
          • Wallet top-up
          • Liquidity pool
          • Swap automation
        • Installation️
        • Getting started
        • Keys
          • How to add profiles
          • How to add contract templates
          • How to compile contracts
          • How to deploy contracts
          • Contract interaction
        • Installation
        • How to use chain state snapshots
        • State-synchronization (state-sync)
        • How to set up a validator node
        • How to join a testnet
        • How to run a single node test network
        • Governance
        • How to get testnet tokens via the Token Faucet
          • CLI - Introduction
          • CLI - Managing keys
          • CLI - Managing tokens
          • CLI - Multisig keys
          • CLI - Delegation
          • Governance proposals
      • Agents 101
      • Agents 101 for AI Engine
  • Guides
      • Quickstart
        • What's an Agent?
        • uAgents Framework installation
        • Create your first agent
        • Agents address
        • Communicating with other agents
        • Agent Handlers (on_...)
        • Agents storage functions
        • Public and private Agents
        • Send tokens with Agents
        • Agents Mailboxes
        • Agent Functions
        • Make agents AI Engine compatible
        • Multi-file agent pipeline for AI Engine: Hugging face API to create a multi agent pipeline
        • Options for running local agents
        • Hosted agent
        • Introducing dialogues
        • Almanac Contract
        • Verify messages with Agents
        • Multi-file agent pipeline for AI Engine: Network of Primary and Secondary functions in Agentverse
        • Localwallet
        • Agentverse: Hosted Agents
        • Agentverse: Dice Roll agent
        • Agentverse: Allowed Imports
        • Agentverse: Mailbox
        • Register Agentverse Functions
        • Agentverse Functions: coin toss agent
        • Field descriptions for DeltaV
        • Agentverse Command Line Interface (AVCTL)
        • AVCTL Hosting commands
      • Agents and Functions creation APIs
      • Secret Management APIs
      • How to convert native FET to and from ERC-20 FET
      • How to stake FET tokens
      • Different ways of staking FET
      • Re-delegating staked FET token
      • Reconciliation service
      • How to setup a Multisig Wallet
        • Getting started
        • How to use the Fetch wallet
        • How to stake and claim rewards
        • Address book
        • Connections
        • Fetch Wallet Hardware Connection Guide
        • Installation
        • Connecting to a blockchain
        • Querying balances
        • Wallets and private keys
        • Sending funds
        • Staking
        • Smart contracts
          • Stake auto-compounder
          • Stake optimizer
          • Oracles
          • Wallet top-up
          • Liquidity pool
          • Swap automation
        • Installation️
        • Getting started
        • Keys
          • How to add profiles
          • How to add contract templates
          • How to compile contracts
          • How to deploy contracts
          • Contract interaction
        • Installation
        • How to use chain state snapshots
        • State-synchronization (state-sync)
        • How to set up a validator node
        • How to join a testnet
        • How to run a single node test network
          • Network setup
          • Running the local node
          • Resetting the network
        • Governance
        • How to get testnet tokens via the Token Faucet
          • CLI - Introduction
          • CLI - Managing keys
          • CLI - Managing tokens
          • CLI - Multisig keys
          • CLI - Delegation
          • Governance proposals
      • Agents 101
      • Agents 101 for AI Engine
Guides
Fetch Network
Ledger
How to run a single node test network

How to run a single node test network

It can be very useful to be able to run a single node network for testing purposes when undergoing contract development. This document outlines the steps required in order to configure a fetchd network of 1 node (i.e. single node network).

Network setup

ℹ️

These steps only need to be carried out once to setup the local network correctly.

  1. Build the ledger from source: follow the installation ↗️ instructions in order to compile the latest version of the Ledger.

  2. Remove any existing networks: since we are starting a new network, we need to remove any local files that we have in our system from a previous network. You can do so by running:

    rm -Rf ~/.fetchd

  3. Create an initial genesis: let's now create the initial genesis file (~/.fetchd/config/genesis.json) with the following command:

    fetchd init --chain-id localnet-1 my-local-node-name

    ℹ️
    • localnet-1 is the chain id
    • my-local-node-name is the moniker for the node

    If you want to make any updates to the genesis, it is a good time to make these updates now.

  4. Create a validator key: let's now create a validator key which will be used as the public/private keypair for our node. Let's create a new key called validator using the following command:

    fetchd keys add validator

    ℹ️

    validator is the name of the key in the keyring.

    For more information, checkout the complete keys ↗️ documentation.

  5. Add the validator to the network: let's now set the initial state for the network, allocating 100000000000000000000 stake tokens to the validator which can be bonded. This is performed with the following command:

    fetchd add-genesis-account validator 100000000000000000000stake

    ℹ️

    stake is the default test token denomination in the cosmos ecosystem, but you could use afet, BTC, and so on.

  6. Generate a transaction: now, let's generate a validator transaction. You can get your validator to sign the genesis block, and to agree that this is the correct genesis starting point, using the following command:

    fetchd gentx validator 100000000000000000000stake --chain-id localnet-1

    ℹ️

    validator is the name that you have given to the key.

  7. Build final genesis configuration: finally, we would need to build the complete and final genesis configuration for the network by running the following command:

    fetchd collect-gentxs

After running this command, the network will be successfully configured and you have computed the final genesis configuration for the network.

Running the local node

Let's now run the network. We need to use the following command:

fetchd start

Resetting the network

It may happen that you may want to clear out all the data from the network and start it again. You can do this in a local network, by simply running the following command:

fetchd tendermint unsafe-reset-all

This will reset the chain back to genesis configuration.

⚠️

You DO NOT need to perform the network setup steps again. After running this command, you can simply run the fetchd start command again.

Was this page helpful?

How to join a testnetGovernance
footer-logo

Main website

Integrations

Events

We’re hiring!

Twitter (opens in a new tab)Telegram (opens in a new tab)Discord (opens in a new tab)GitHub (opens in a new tab)Youtube (opens in a new tab)LinkedIn (opens in a new tab)Reddit (opens in a new tab)
Sign up for developer updates