testnet-laconicd-stack/stack-orchestrator/stacks/laconic-console
Prathamesh Musale 0d8628d7c3 Add steps to update testnet2 deployments (#38)
Part of [Create a public laconicd testnet](https://www.notion.so/Create-a-public-laconicd-testnet-896a11bdd8094eff8f1b49c0be0ca3b8)

Added steps to update deployments:
- stage2 laconicd
- laconic-console-testnet2
- laconic-shopify
- fixturenet-eth
- Nitro bridge
- Nitro nodes
- Snowball backend
- Snowball frontend

Co-authored-by: Adw8 <adwaitgharpure@gmail.com>
Reviewed-on: #38
Co-authored-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
Co-committed-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
2024-10-30 13:59:56 +00:00
..
README.md Add instructions for service providers (#37) 2024-10-30 13:06:51 +00:00
stack.yml Add steps to update testnet2 deployments (#38) 2024-10-30 13:59:56 +00:00

laconic-console

Instructions for running laconic registry CLI and console

Prerequisites

  • laconicd RPC and GQL endpoints

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/laconic-console setup-repositories --pull
    
  • Build the container images:

    laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/laconic-console build-containers --force-rebuild
    

    This should create the following docker images locally:

    • cerc/laconic-registry-cli
    • cerc/webapp-base
    • cerc/laconic-console-host

Create a deployment

  • Create a spec file for the deployment:

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

    ...
    network:
      ports:
        laconic-console:
          - '8080:80'
    
  • Create a deployment from the spec file:

    laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/laconic-console deploy create --spec-file laconic-console-spec.yml --deployment-dir laconic-console-deployment
    

Configuration

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

    # All optional
    
    # CLI configuration
    
    # laconicd RPC endpoint (default: http://laconicd:26657)
    CERC_LACONICD_RPC_ENDPOINT=
    
    # laconicd GQL endpoint (default: http://laconicd:9473/api)
    CERC_LACONICD_GQL_ENDPOINT=
    
    # laconicd chain id (default: laconic_9000-1)
    CERC_LACONICD_CHAIN_ID=
    
    # laconicd user private key for txs
    CERC_LACONICD_USER_KEY=
    
    # laconicd bond id for txs
    CERC_LACONICD_BOND_ID=
    
    # Gas limit for txs (default: 200000)
    CERC_LACONICD_GAS=
    
    # Max fees for txs (default: 200alnt)
    CERC_LACONICD_FEES=
    
    # Gas price to use for txs (default: 0.001alnt)
    # Use for auto fees calculation, gas and fees not required to be set in that case
    # Reference: https://git.vdb.to/cerc-io/laconic-registry-cli#gas-and-fees
    CERC_LACONICD_GASPRICE=
    
    # Console configuration
    
    # Laconicd (hosted) GQL endpoint (default: http://localhost:9473)
    LACONIC_HOSTED_ENDPOINT=
    

Run

  • Start the deployment:

    laconic-so deployment --dir laconic-console-deployment start
    
  • View the laconic console at http://localhost:8080

  • Use the cli service for registry CLI operations:

    # Example
    laconic-so deployment --dir laconic-console-deployment exec cli "laconic registry status"
    

Check status

  • To list down and monitor the running containers:

    # With status
    docker ps -a
    
    # Follow logs for console container
    laconic-so deployment --dir laconic-console-deployment logs console -f
    

Clean up

  • Stop all services running in the background:

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

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