testnet-laconicd-stack/stack-orchestrator/stacks/laconicd-full-node
2024-06-18 16:23:59 +05:30
..
README.md Add steps to participate as a validator 2024-06-18 16:23:59 +05:30
stack.yml Remove unused files 2024-06-18 13:09:21 +05:30

laconicd-full-node

Instructions for running a laconicd testnet full node and joining as a validator

Prerequisites

  • Minimum hardware requirements:

    RAM: 8-16GB
    Disk space: 200GB
    CPU: 2 cores
    
  • Testnet genesis file (file or an URL) and peer node addresses

Setup

  • Clone the stack repo:

    laconic-so fetch-stack git.vdb.to/cerc-io/testnet-laconicd-stack
    
  • Clone required repositories:

    laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/laconicd-full-node setup-repositories
    
  • Build the container images:

    laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/laconicd-full-node build-containers
    

    This should create the following docker images locally:

    • cerc/laconic2d

Create a deployment

  • Create a spec file for the deployment:

    laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/laconicd-full-node deploy init --output laconic-full-node-spec.yml
    
  • Edit network in the spec file to map container ports to host ports as required:

    ...
    network:
      ports:
        laconicd:
          - '6060:6060'
          - '26657:26657'
          - '26656:26656'
          - '9473:9473'
          - '9090:9090'
          - '1317:1317'
    
  • Create a deployment from the spec file:

    laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/laconicd-full-node deploy create --spec-file  laconic-full-node-spec.yml --deployment-dir laconic-full-node-deployment
    
  • Copy over the published testnet genesis file (.json) to data directory in deployment (laconic-full-node-deployment/data/laconicd-data/tmp):

    # Example
    mkdir -p laconic-full-node-deployment/data/laconicd-data/tmp
    cp genesis.json laconic-full-node-deployment/data/laconicd-data/tmp/genesis.json
    

Configuration

  • Inside the deployment directory, open config.env file and set following env variables:

    # Comma separated list of nodes to keep persistent connections to
    # Example: "node-1-id@node-1-host:26656,node-2-id@node-2-host:26656"
    CERC_PEERS=""
    
    # Optional
    
    # A custom human readable name for this node (default: TestnetNode)
    CERC_MONIKER=
    
    # Network chain ID (default: laconic_9000-1)
    CERC_CHAIN_ID=
    
    # Output log level (default: info)
    CERC_LOGLEVEL=
    

Start the deployment

laconic-so deployment --dir laconic-full-node-deployment start

Check status

  • To list down and monitor the running containers:

    # With status
    docker ps -a
    
    # Get laconicd container id in a variable
    LACONICD_CONTAINER_ID=$(docker ps --filter "name=laconicd" -q)
    
    # Check logs for laconicd container
    docker logs -f $LACONICD_CONTAINER_ID
    
  • Check the sync status of your node:

    docker exec -it $LACONICD_CONTAINER_ID bash -c "laconicd status | jq .sync_info"
    

Join as testnet validator

  • Create / import a new key pair:

    # Create new keypair
    docker exec -it $LACONICD_CONTAINER_ID bash -c "laconicd keys add <key-name>"
    
    # OR
    # Restore existing key with mnemonic seed phrase
    # You will be prompted to enter mnemonic seed
    docker exec -it $LACONICD_CONTAINER_ID bash -c "laconicd keys add <key-name> --recover"
    
    # Query the keystore for your account's address
    docker exec -it $LACONICD_CONTAINER_ID bash -c "laconicd keys show <key-name> -a"
    
  • Request tokens from the testnet faucet for your account if required

  • Check balance for your account:

    docker exec -it $LACONICD_CONTAINER_ID bash -c "laconicd query bank balances <key-name>"
    
  • Create required validator configuration:

    # Edit the staking amount and other fields as required
    docker exec -it $LACONICD_CONTAINER_ID bash -c 'cat <<EOF > <your-node-moniker>-validator.json
    {
      "pubkey": $(laconicd cometbft show-validator),
      "amount": "900000000photon",
      "moniker": "<your-node-moniker>",
      "commission-rate": "0.1",
      "commission-max-rate": "0.2",
      "commission-max-change-rate": "0.01",
      "min-self-delegation": "1"
    }
    EOF'
    
  • Create a validator:

    docker exec -it $LACONICD_CONTAINER_ID bash -c 'laconicd tx staking create-validator <your-node-moniker>-validator.json \
    --fees 50photon \
    --chain-id=laconic_9000-1 \
    --from <key-name>'
    
  • View staking validator details:

    docker exec -it $LACONICD_CONTAINER_ID bash -c "laconicd query staking validator <key-name>"
    

Clean up

  • Stop all services running in the background:

    # Stop the docker containers
    laconic-so deployment --dir laconic-full-node-deployment stop
    
  • To stop all services and also delete data:

    # Stop the docker containers
    laconic-so deployment --dir laconic-full-node-deployment stop --delete-volumes
    
    # Remove deployment directory (deployment will have to be recreated for a re-run)
    rm -r laconic-full-node-deployment