Skip to main content

Getting Started Overview

canoLiq runs as a Go plugin for the Canopy Network. A single binary serves both the send tutorial contract and the canoLiq protocol, selected via the CANOPY_PLUGIN_MODE environment variable.

Prerequisites

  • Go 1.21+ for building the plugin
  • Canopy Network node running locally or in Docker
  • Docker (optional, for containerized localnet)

Architecture

canoLiq is implemented as a sibling of plugin/go/contract/. It reuses the proto types from the contract package and runs its own FSM connection.

Key Components

FilePurpose
canoliq.goMain contract logic, CheckTx/DeliverTx handlers
plugin.goFSM socket communication and plugin lifecycle
state.goState key definitions and read/write helpers
deliver.goTransaction delivery routing
genesis.goGenesis initialization and CPLQ distribution
fee.goProtocol fee splitting (40/30/15/15)
reward.goReward sweep and distribution
governance.goProposal creation, voting, tallying
buyback.goBuyback execution (burn or distribute)
treasury.goTreasury spend with multisig + timelock
vesting.goVesting schedule tracking and claim
stake.goCPLQ staking and unstaking
rpc.goRead-only HTTP query server (Phase 3)
query.goQuery helpers for RPC endpoints

Environment Variables

VariableDescriptionDefault
CANOPY_PLUGIN_MODESelects plugin mode: contract or canoliqcontract
CANOLIQ_CONFIGPath to JSON config file
CANOLIQCTL_RPC_URLNode query RPC URLhttp://localhost:50002
CANOLIQCTL_ADMIN_URLAdmin RPC URL (keystore)http://localhost:50003
CANOLIQCTL_NETWORK_IDCanopy network ID1
CANOLIQCTL_CHAIN_IDcanoLiq committee chain ID2
CANOLIQCTL_PASSWORDKeystore password
CANOLIQ_RPC_ADDRPlugin RPC listen address (Phase 3)— (disabled)