CLV Documentations
CLV DOC
CLV DOC
  • Intro to CLV
    • About CLV πŸ€
    • Clover Finance Rebrands to CLV
    • What is CLV Chain?
    • What is CLV Wallet?
    • What is $CLV Token?
    • πŸ“£ CLV Official Channels
    • 🏘 CLV Community Channels
  • Use CLV Chain
    • πŸ“š Beginner’s Guide
      • Setup CLV Wallet
      • Setup Metamask Wallet
      • How to Get $CLV
      • Bridge Other Assets to CLV P-Chain (Parachain)
    • 🌐 Network Details
    • 🏦 Economics
      • Tokenomics
      • Inflation Design
    • πŸ—³οΈGovernance
    • πŸ™‹πŸ» CLV Chain FAQ
    • CLV P-Chain EVM Explorer
    • $CLV Cross-Chain Explorer
    • $CLV Cross-Chain Transfer
  • CLV Validator & Staking
    • What are Nominator & Validator?
    • Stake as a Nominator
    • Running a Validator or RPC Node
    • Staking FAQ
  • Use CLV Wallet
    • πŸ’° Download CLV Wallet
      • Browser Extension (Google Chrome & Brave)
      • Apple iOS (Mobile)
      • Android (Mobile)
      • Web Wallet (Universal)
    • πŸ“± CLV Mobile Wallet
    • πŸ–₯ CLV Extension Wallet
    • πŸ•ΈοΈ CLV Web Wallet
  • CLV Chain Developer Guide
    • Getting Started
    • Using Local Node
      • Using MetaMask
      • Using Remix
      • Using Web3.js
    • Using Testnet
      • Create an account
      • Faucet
      • Run a Testnet Node
      • Connect to Testnet
    • dApp Example
      • Setup dApp project
      • Setup truffle
      • The Counter Contract
      • Deploy Contract
      • Counter Webapp
    • Test Cases
    • Technical Documentations
      • CLV EVM
      • Developers Incentive
      • CLV Accounts Binding
      • Virtual Ethereum Address Binding
      • Query Balance
      • Transaction Finality
      • Web3 Compatibility
        • eth_protocolVersion
        • eth_syncing
        • eth_hashrate
        • eth_coinbase
        • eth_mining
        • eth_chainId
        • eth_gasPrice
        • eth_accounts
        • eth_blockNumber
        • eth_getBalance
        • eth_getStorageAt
        • eth_getBlock
        • eth_getTransactionCount
        • eth_getBlockTransactionCount
        • eth_getBlockUncleCount
        • eth_getCode
        • eth_sendTransaction
        • eth_sendSignedTransaction
        • eth_call
        • eth_estimateGas
        • eth_getTransaction
        • eth_getTransactionByBlockHashAndIndex
        • eth_getTransactionByBlockNumberAndIndex
        • eth_getTransactionReceipt
        • eth_getUncle
        • eth_getLogs
        • eth_getWork
        • eth_submitWork
        • eth_submitHashrate
        • eth_subscribe
        • eth_unsubscribe
        • net_version
        • net_peerCount
        • net_listening
        • web3_clientVersion
        • web3_sha3
      • CLV P-Chain Integration
  • CLV Wallet Developer Guide
    • EVM dApp Integration
    • Substrate dApp Integration
    • Solana dApp Integration
    • Kadena dApp Integration
    • Aptos dApp Integration
    • Web Wallet dApp Integration
    • dApp Interaction Protocol
    • Wallet Integration QA
  • CLV Ecosystem
    • 🏞️ Ecosystem Partners
      • CLV Chain
      • CLV Wallet
    • 🌱 Incentive Programs
      • CLV Ecosystem Grant
      • CLV Wallet Integration Grant
      • CLV Bug Bounty Program
    • Whitelist Assets on Clover P-Chain
    • Bridge assets into CLV P-Chain
  • Assets
    • πŸ”€ Glossary
      • Blockchain (in General)
      • Polkadot
      • Wallet
    • 🎟️ CLV - Polkadot Parachain Auction 2021
      • Parachain Auction Rule Announcement
      • Parachain Winning Reward Announcement
    • πŸ›οΈ Brand Pack
    • πŸ“„ Whitepaper
Powered by GitBook
On this page
  • Using Docker and Docker Compose
  • Get Substrate
  • Clone and Build
  • Run
  • Running an Archive Node
  • Using Docker
  1. CLV Chain Developer Guide
  2. Using Testnet

Run a Testnet Node

PreviousFaucetNextConnect to Testnet

Last updated 2 years ago

If you're building dapps or products on a Substrate-based chain like CLV or a custom Substrate implementation, you probably want the ability to run a node-as-a-back-end. After all, it's always better to rely on your own infrastructure than on a third-party-hosted one in this brave new decentralized world.

This guide will show you how to connect to CLV network, but the same process applies to any other -based chain. First, let's clarify the term full node.

Using Docker and Docker Compose

Make sure you have docker and docker-compose installed using below command:

curl -fsSL https://get.docker.com -o get-docker.sh
sh get-docker.sh

To run a CLV full node, create a docker-compose.yaml file with below content:

version: "3.8"
services:
  clover-node:
    image: "cloverio/clover-iris:0.1.15"
    restart: always
    environment:
        ARGS: "--base-path /opt/chaindata --chain /opt/specs/clover-preview-iris.json --port 30333 --ws-port 9944 --rpc-port 9933 --name "clover-node" --rpc-cors=all --validator --unsafe-ws-external --unsafe-rpc-external --rpc-methods=Unsafe"
    ports:
      - "9933:9933"
      - "9944:9944"
      - "30333:30333"
      - "9615:9615"
    volumes:
      - /opt/data/dev:/opt/chaindata

You're free to edit the name of this node in the ARGS field.

Now launch the node with below command:

docker-compose up -d 

You should get CLV node runs and syncing data from the test net now. You can monitor the logs with:

docker-compose logs -f --tail 10 clover-node

Get Substrate

Test if the installation was successful by running cargo --version.

Ξ» cargo --version
cargo 1.41.0 (626f0f40e 2019-12-03)

Clone and Build

git clone https://github.com/clover-network/clover
cd clover
./scripts/init.sh
cargo build --release

Alternatively, if you wish to use a specific release, you can check out a specific tag (v0.8.3 in the example below):

git clone https://github.com/clover-network/clover
cd clover
git checkout tags/v0.8.3
./scripts/init.sh
cargo build --release

Run

The built binary will be in the target/release folder, called clover.

./target/release/clover --name "My node's name" --chain specs/clover-cc1-raw.json

The syncing process will take a while depending on your bandwidth, processing power, disk speed and RAM. On a $10 DigitalOcean droplet, the process can complete in some 36 hours.

Congratulations, you're now syncing with Clover. Keep in mind that the process is identical when using any other Substrate chain.

Running an Archive Node

When running as a simple sync node (above), only the state of the past 256 blocks will be kept. When validating, it defaults to archive mode. To keep the full state use the --pruning flag:

./target/release/clover --name "My node's name" --pruning archive

It is possible to almost quadruple synchronization speed by using an additional flag: --wasm-execution Compiled. Note that this uses much more CPU and RAM, so it should be turned off after the node is in sync.

Using Docker

Finally, you can use Docker to run your node in a container. Doing this is a bit more advanced so it's best left up to those that either already have familiarity with docker, or have completed the other set-up instructions in this guide. If you would like to connect to your node's WebSockets ensure that you run you node with the --rpc-external and --ws-external commands.

docker run -p 9944:9944 clover-network/clover-iris:0.1.15 --name "calling_home_from_a_docker_container" --rpc-external --ws-external

Follow instructions as outlined - note that Windows users will have their work cut out for them. It's better to use a virtual machine instead.

The repo's master branch contains the latest CLV code.

Use the --help flag to find out which flags you can use when running the node. For example, if , you'll probably want to use --ws-external and --rpc-cors all.

Substrate
here
clover-network/clover
connecting to your node remotely