Skip to content
Open
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
a5385df
fix: make all plugins start automatically
pablocampogo Jan 24, 2026
a570c37
fix: docker runs of plugins
pablocampogo Jan 24, 2026
f49a824
feat: first version of auto update for plugins
pablocampogo Jan 25, 2026
4d54fb9
chore: code just for testing DO NOT MERGE
pablocampogo Jan 27, 2026
15a9fb7
chore: setup venv in plugin sh for python
pablocampogo Jan 27, 2026
7888adf
chore: fix venv setup if needed
pablocampogo Jan 27, 2026
982b86c
chore: fix venv setup if needed 2
pablocampogo Jan 27, 2026
60338e9
chore: change python script to always install deps if extraction happ…
pablocampogo Jan 28, 2026
20e4acc
chore: reduce time for testing
pablocampogo Jan 28, 2026
10927f4
chore: clean up code and fix release actions
pablocampogo Jan 28, 2026
aaec88f
chore: update c sharp script
pablocampogo Jan 28, 2026
c2789a3
chore: more fixes to c sharp
pablocampogo Jan 28, 2026
ef21a68
chore: delete interesting logs
pablocampogo Jan 28, 2026
f2a2552
chore: simplify c sharp docker
pablocampogo Jan 28, 2026
f6c835f
chore: refactor to reduce repeated code
pablocampogo Jan 28, 2026
a9d71e0
chore: refactor kill plugin
pablocampogo Jan 29, 2026
3a87c6a
feat: various fixes and make plugin hard coded values to be all hard …
pablocampogo Jan 31, 2026
55e407d
feat: ensure plugin is ready before starting
pablocampogo Jan 31, 2026
0f83231
fix: make c sharp take into account musl
pablocampogo Jan 31, 2026
f871cc1
chore: change updater to releaser
pablocampogo Jan 31, 2026
9fb9961
chore: make makefiles in plugin dir and root equal
pablocampogo Jan 31, 2026
e7f48a6
fix: comments and delete just for testing code
pablocampogo Feb 2, 2026
406b16b
chore: add back deleted comments
pablocampogo Feb 3, 2026
9279706
chore: delete go tutorial binary from versioning
pablocampogo Feb 3, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
.docker
cmd/tps/data
# Python virtual environments
**/.venv
**/__pycache__
**/*.pyc
**/node_modules
81 changes: 81 additions & 0 deletions .github/workflows/release-plugin-csharp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: Release C# Plugin

on:
workflow_dispatch:
inputs:
tag:
description: "Tag for the plugin release (e.g. plugin-csharp-v1.0.0)"
required: true

permissions:
contents: write

jobs:
release:
name: Build and Release C# Plugin
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: "8.0.x"

- name: Restore dependencies
working-directory: plugin/csharp
run: dotnet restore

- name: Build and publish
working-directory: plugin/csharp
run: |
mkdir -p release
# Linux glibc x64 (Ubuntu, Debian, etc.)
dotnet publish CanopyPlugin.csproj -c Release -r linux-x64 --self-contained true -o release/linux-glibc-x64
# Linux glibc ARM64
dotnet publish CanopyPlugin.csproj -c Release -r linux-arm64 --self-contained true -o release/linux-glibc-arm64
# Linux musl x64 (Alpine Docker)
dotnet publish CanopyPlugin.csproj -c Release -r linux-musl-x64 --self-contained true -o release/linux-musl-x64
# Linux musl ARM64 (Alpine Docker)
dotnet publish CanopyPlugin.csproj -c Release -r linux-musl-arm64 --self-contained true -o release/linux-musl-arm64

- name: Create tarballs
working-directory: plugin/csharp
run: |
cd release
# glibc versions (standard Linux)
tar -czf csharp-plugin-linux-x64.tar.gz -C linux-glibc-x64 .
tar -czf csharp-plugin-linux-arm64.tar.gz -C linux-glibc-arm64 .
# musl versions (Alpine Docker)
tar -czf csharp-plugin-linux-musl-x64.tar.gz -C linux-musl-x64 .
tar -czf csharp-plugin-linux-musl-arm64.tar.gz -C linux-musl-arm64 .

- name: Create GitHub release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.event.inputs.tag }}
name: "C# Plugin ${{ github.event.inputs.tag }}"
body: |
C# Plugin Release ${{ github.event.inputs.tag }}

## Installation
1. Extract the appropriate tarball to `plugin/csharp/bin/`
2. The plugin is self-contained (no .NET runtime required)

## Assets
### Standard Linux (glibc) - Ubuntu, Debian, RHEL, etc.
- `csharp-plugin-linux-x64.tar.gz` - Linux x86_64
- `csharp-plugin-linux-arm64.tar.gz` - Linux ARM64

### Alpine Linux (musl) - Docker containers
- `csharp-plugin-linux-musl-x64.tar.gz` - Alpine x86_64
- `csharp-plugin-linux-musl-arm64.tar.gz` - Alpine ARM64
files: |
plugin/csharp/release/csharp-plugin-linux-x64.tar.gz
plugin/csharp/release/csharp-plugin-linux-arm64.tar.gz
plugin/csharp/release/csharp-plugin-linux-musl-x64.tar.gz
plugin/csharp/release/csharp-plugin-linux-musl-arm64.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
55 changes: 55 additions & 0 deletions .github/workflows/release-plugin-go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Release Go Plugin

on:
workflow_dispatch:
inputs:
tag:
description: "Tag for the plugin release (e.g. plugin-go-v1.0.0)"
required: true

permissions:
contents: write

jobs:
release:
name: Build and Release Go Plugin
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.24"

- name: Build binaries
working-directory: plugin/go
run: |
mkdir -p dist
# Linux AMD64
GOARCH=amd64 CGO_ENABLED=0 GOOS=linux go build -a -o dist/go-plugin .
tar -czf dist/go-plugin-linux-amd64.tar.gz -C dist go-plugin
rm dist/go-plugin
# Linux ARM64
GOARCH=arm64 CGO_ENABLED=0 GOOS=linux go build -a -o dist/go-plugin .
tar -czf dist/go-plugin-linux-arm64.tar.gz -C dist go-plugin
rm dist/go-plugin

- name: Create GitHub release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.event.inputs.tag }}
name: "Go Plugin ${{ github.event.inputs.tag }}"
body: |
Go Plugin Release ${{ github.event.inputs.tag }}

## Assets
- `go-plugin-linux-amd64.tar.gz` - Linux x86_64
- `go-plugin-linux-arm64.tar.gz` - Linux ARM64
files: |
plugin/go/dist/go-plugin-linux-amd64.tar.gz
plugin/go/dist/go-plugin-linux-arm64.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
62 changes: 62 additions & 0 deletions .github/workflows/release-plugin-kotlin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Release Kotlin Plugin

on:
workflow_dispatch:
inputs:
tag:
description: "Tag for the plugin release (e.g. plugin-kotlin-v1.0.0)"
required: true

permissions:
contents: write

jobs:
release:
name: Build and Release Kotlin Plugin
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: "21"
distribution: "temurin"

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3

- name: Build fat JAR
working-directory: plugin/kotlin
run: ./gradlew fatJar --no-daemon

- name: Prepare release artifacts
working-directory: plugin/kotlin
run: |
mkdir -p release
cp build/libs/canopy-plugin-kotlin-*-all.jar release/kotlin-plugin.jar
cd release && tar -czf kotlin-plugin.tar.gz kotlin-plugin.jar

- name: Create GitHub release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.event.inputs.tag }}
name: "Kotlin Plugin ${{ github.event.inputs.tag }}"
body: |
Kotlin Plugin Release ${{ github.event.inputs.tag }}

## Requirements
- Java Runtime Environment (JRE) 21 or later

## Installation
1. Download `kotlin-plugin.tar.gz` to `plugin/kotlin/`
2. The plugin will auto-extract on first start

## Assets
- `kotlin-plugin.tar.gz` - Fat JAR with all dependencies included
files: |
plugin/kotlin/release/kotlin-plugin.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
62 changes: 62 additions & 0 deletions .github/workflows/release-plugin-python.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Release Python Plugin

on:
workflow_dispatch:
inputs:
tag:
description: "Tag for the plugin release (e.g. plugin-python-v1.0.0)"
required: true

permissions:
contents: write

jobs:
release:
name: Build and Release Python Plugin
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Create distribution tarball
working-directory: plugin/python
run: |
mkdir -p release
# Create tarball with source code (venv is created on first run by pluginctl.sh)
# Note: pluginctl.sh is NOT included - it's copied separately by Dockerfile
# and we don't want old releases to overwrite newer pluginctl.sh versions
tar --exclude='*.pyc' \
--exclude='__pycache__' \
-czf release/python-plugin.tar.gz \
main.py \
contract/ \
pyproject.toml \
Makefile

- name: Create GitHub release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.event.inputs.tag }}
name: "Python Plugin ${{ github.event.inputs.tag }}"
body: |
Python Plugin Release ${{ github.event.inputs.tag }}

## Requirements
- Python 3.9 or later

## Installation
1. Extract `python-plugin.tar.gz` to `plugin/python/`
2. The plugin will create a virtual environment on first run

## Assets
- `python-plugin.tar.gz` - Source code with pyproject.toml
files: |
plugin/python/release/python-plugin.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
67 changes: 67 additions & 0 deletions .github/workflows/release-plugin-typescript.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Release TypeScript Plugin

on:
workflow_dispatch:
inputs:
tag:
description: "Tag for the plugin release (e.g. plugin-typescript-v1.0.0)"
required: true

permissions:
contents: write

jobs:
release:
name: Build and Release TypeScript Plugin
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "20"

- name: Install dependencies
working-directory: plugin/typescript
run: npm ci

- name: Build plugin
working-directory: plugin/typescript
run: npm run build:all

- name: Install production dependencies only
working-directory: plugin/typescript
run: |
rm -rf node_modules
npm ci --production

- name: Create distribution tarball
working-directory: plugin/typescript
run: |
mkdir -p release
# Create tarball with dist/, node_modules, package.json (for "type": "module")
# Note: pluginctl.sh is NOT included - it's copied separately by Dockerfile
# and we don't want old releases to overwrite newer pluginctl.sh versions
tar -czf release/typescript-plugin.tar.gz dist/ node_modules/ package.json

- name: Create GitHub release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.event.inputs.tag }}
name: "TypeScript Plugin ${{ github.event.inputs.tag }}"
body: |
TypeScript Plugin Release ${{ github.event.inputs.tag }}

## Installation
1. Extract `typescript-plugin.tar.gz` to `plugin/typescript/`
2. The plugin is ready to run (node_modules included)

## Assets
- `typescript-plugin.tar.gz` - Compiled plugin with dependencies
files: |
plugin/typescript/release/typescript-plugin.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28 changes: 23 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Variables
GO_BIN_DIR := ~/go/bin
CLI_DIR := ./cmd/main/...
AUTO_UPDATE_DIR := ./cmd/auto-update/...
WALLET_DIR := ./cmd/rpc/web/wallet
EXPLORER_DIR := ./cmd/rpc/web/explorer
DOCKER_DIR := ./.docker/compose.yaml
Expand All @@ -16,7 +17,7 @@ help:
@sed -n 's/^##//p' ${MAKEFILE_LIST} | column -t -s ':' | sed -e 's/^/ /'

# Targets, this is a list of all available commands which can be executed using the make command.
.PHONY: build/canopy build/canopy-full build/wallet build/explorer test/all dev/deps docker/up \
.PHONY: build/canopy build/canopy-full build/wallet build/explorer build/auto-update build/auto-update-local run/auto-update run/auto-update-build run/auto-update-test test/all dev/deps docker/up \
docker/down docker/build docker/up-fast docker/down docker/logs \
build/plugin build/kotlin-plugin build/go-plugin build/all-plugins docker/plugin \
docker/run docker/run-kotlin docker/run-go docker/run-typescript docker/run-python docker/run-csharp
Expand All @@ -40,6 +41,23 @@ build/wallet:
build/explorer:
npm install --prefix $(EXPLORER_DIR) && npm run build --prefix $(EXPLORER_DIR)

## build/auto-update: build the canopy auto-update binary into the GO_BIN_DIR
build/auto-update:
go build -o $(GO_BIN_DIR)/canopy-auto-update $(AUTO_UPDATE_DIR)

## build/auto-update-local: build canopy CLI to ./cli and auto-update binary for local development
build/auto-update-local:
go build -o ./cli $(CLI_DIR)
go build -o $(GO_BIN_DIR)/canopy-auto-update $(AUTO_UPDATE_DIR)

## run/auto-update: run the canopy auto-update binary with 'start' command (requires ./cli to exist)
run/auto-update:
BIN_PATH=./cli go run $(AUTO_UPDATE_DIR) start

## run/auto-update-build: build canopy CLI to ./cli and then run auto-update
run/auto-update-build: build/auto-update-local
BIN_PATH=./cli go run $(AUTO_UPDATE_DIR) start

# ==================================================================================== #
# TESTING
# ==================================================================================== #
Expand Down Expand Up @@ -105,13 +123,13 @@ build/plugin:
ifeq ($(PLUGIN),kotlin)
cd plugin/kotlin && ./gradlew fatJar --no-daemon
else ifeq ($(PLUGIN),go)
$(MAKE) -C plugin/go build
cd plugin/go && go build -o go-plugin .
else ifeq ($(PLUGIN),typescript)
cd plugin/typescript && npm ci && npm run build
cd plugin/typescript && npm ci && npm run build:all
else ifeq ($(PLUGIN),python)
cd plugin/python && pip install -e ".[dev]" 2>/dev/null || true
cd plugin/python && make dev
else ifeq ($(PLUGIN),csharp)
cd plugin/csharp && dotnet publish -c Release -o out
cd plugin/csharp && rm -rf bin && dotnet publish -c Release -r linux-x64 --self-contained true -o bin
else ifeq ($(PLUGIN),all)
$(MAKE) build/plugin PLUGIN=go
$(MAKE) build/plugin PLUGIN=kotlin
Expand Down
Loading
Loading