Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
8c72277
the first version: base data flow
MarkCherepovskyi Feb 8, 2026
41491b6
update autoresharing task flow
MarkCherepovskyi Feb 8, 2026
6d52cac
parse list of events from config
MarkCherepovskyi Feb 8, 2026
277f124
store tasks into DB and implement thee recovery flow
MarkCherepovskyi Feb 8, 2026
7288ed7
update config manager
MarkCherepovskyi Feb 18, 2026
62522a0
update gitignore
MarkCherepovskyi Feb 18, 2026
3826c02
set core connection to resharing task
MarkCherepovskyi Feb 18, 2026
e5592b4
code style and update task flow
MarkCherepovskyi Feb 19, 2026
7ca53b8
Fixed CI issue with skaffold (#1)
nikitastepuraighorovych-lgtm Feb 19, 2026
d0b2910
Fix/ci 0.1.1 (#3)
nikitastepuraighorovych-lgtm Feb 19, 2026
ef554db
fixed `sql: no rows in result set` err
slbmax Feb 25, 2026
e20173e
updated actions.yaml
Feb 26, 2026
655ddd0
update resharing task
MarkCherepovskyi Feb 26, 2026
6cb677e
updated actions.yaml
Feb 26, 2026
0f17133
updated actions.yaml changed repository name tss-wrapper-svc -> tss-w…
Feb 26, 2026
da5be08
Merge pull request #5 from Bridgeless-Project/fix/ci_0.1.2
nikitastepuraighorovych-lgtm Feb 27, 2026
e12176c
small fixes
slbmax Mar 2, 2026
8475011
update isNew function
MarkCherepovskyi Mar 3, 2026
dea5059
config fixes
slbmax Mar 3, 2026
cd9d09b
Tss api (#6)
MarkCherepovskyi Mar 9, 2026
f21d09f
hack: ignore process kill error
MarkCherepovskyi Mar 10, 2026
505ea23
more logs
MarkCherepovskyi Mar 10, 2026
0ef3c24
hack updates
MarkCherepovskyi Mar 11, 2026
286909c
handle new parties flow
MarkCherepovskyi Mar 12, 2026
ada438f
update config and default mode
MarkCherepovskyi Mar 12, 2026
7cf4f92
fix wallet path on the config
MarkCherepovskyi Mar 13, 2026
52efedb
Implemented API and added an endpoint to retrieve a task by status wi…
Ajeszny Mar 19, 2026
15333ae
Create and implement an endpoint for changing resharing time (#9)
Ajeszny Mar 23, 2026
6dc2987
Feature/pre start tasks (#10)
MarkCherepovskyi Apr 3, 2026
f2e20bd
fix epoch issue while autoresharing
MarkCherepovskyi Apr 6, 2026
9d46839
save the threshold into the DB
MarkCherepovskyi Apr 9, 2026
b7be606
small fix: do not start the default mode for revoked party
MarkCherepovskyi Apr 9, 2026
4664d83
more logs
MarkCherepovskyi Apr 9, 2026
7fc36b7
do not load expired auto-resharing tasks
MarkCherepovskyi Apr 9, 2026
bd55330
update retries config
MarkCherepovskyi Apr 10, 2026
87c1c7c
more logs
MarkCherepovskyi Apr 10, 2026
578d7e0
fix task init
MarkCherepovskyi Apr 10, 2026
7228277
small fix: do not end the Orchestrator after on case not startDefault…
MarkCherepovskyi Apr 10, 2026
2b3bde8
remove block log
MarkCherepovskyi Apr 14, 2026
8d1c3f2
set config path to migrate up
MarkCherepovskyi Apr 14, 2026
480b1ed
fixes after review
slbmax Apr 23, 2026
e5e9490
set up logs for tss API
MarkCherepovskyi Apr 30, 2026
79e8c2b
removed process state check
slbmax Apr 30, 2026
8b57e6f
pump comsos verion and kill api before start default mode
MarkCherepovskyi Apr 30, 2026
9a02229
Feature/resharing migration (#12)
slbmax May 19, 2026
90eca31
Feature/update binary (#13)
Myrtilli Sep 11, 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
Binary file added .DS_Store
Binary file not shown.
43 changes: 43 additions & 0 deletions .github/workflows/actions.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Build tss-wrapper-svc docker image
on:
push:
branches:
- "main"
- "dev"
- "**"

env:
CI_ACCESS_TOKEN: ${{ secrets.CI_ACCESS_TOKEN }}
GITHUB_REPOSITORY: ghcr.io/bridgeless-project/tss-wrapper

jobs:
converge-github:
name: Build To Github
runs-on: ubuntu-24.04
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Log in to registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin

- name: Build and Push Image
env:
IMAGE: ${{ env.GITHUB_REPOSITORY }}:${{ github.sha }}
CACHE_REPO: ${{ env.GITHUB_REPOSITORY }}/cache
run: |
buildah build \
-f build/Dockerfile \
--layers \
--cache-from $CACHE_REPO \
--cache-to $CACHE_REPO \
-t $IMAGE \
--build-arg CI_ACCESS_TOKEN=$CI_ACCESS_TOKEN \
.

- name: Push Image
env:
IMAGE: ${{ env.GITHUB_REPOSITORY }}:${{ github.sha }}
run: buildah push $IMAGE
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
config.yaml
.idea
binary
vendor
.DS_Store
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.PHONY: install

gen-proto:
cd proto && buf generate

docker-up:
@echo "Starting Docker Compose..."
docker-compose up
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
# TSS wrapper


The service is responsible for managing the TSS daemon:
- starting the TSS daemon
- listen for update events from the Bridgeless-core
- schedule the TSS update when we need it
8 changes: 8 additions & 0 deletions assets/assets.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package assets

import (
"embed"
)

//go:embed migrations/*.sql
var Migrations embed.FS
34 changes: 34 additions & 0 deletions assets/migrations/00_initial.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
-- +migrate Up
CREATE TABLE epochs(
id serial primary key,
start_time timestamp not null,
end_time timestamp not null -- update when new epoch started
);

CREATE TABLE IF NOT EXISTS latest_block
(
id INT NOT NULL UNIQUE,
latest_block_id INT NOT NULL
);

CREATE TABLE IF NOT EXISTS tasks
(
id SERIAL PRIMARY KEY,
task_type VARCHAR(64) NOT NULL,
status INT NOT NULL,
data TEXT NOT NULL,
error TEXT,
created_at TIMESTAMP NOT NULL DEFAULT NOW(),
updated_at TIMESTAMP NOT NULL DEFAULT NOW()
);

CREATE INDEX idx_tasks_status ON tasks(status);
CREATE INDEX idx_tasks_created_at ON tasks(created_at);

-- +migrate Down
DROP TABLE IF EXISTS tasks;
DROP TABLE IF EXISTS latest_block;
DROP TABLE IF EXISTS epochs;

DROP INDEX IF EXISTS idx_tasks_status;
DROP INDEX IF EXISTS idx_tasks_created_at;
28 changes: 28 additions & 0 deletions build/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
FROM golang:1.25-alpine as buildbase

RUN apk add git build-base

WORKDIR /go/src/github.com/Bridgeless-Project/tss-wrapper-svc

ENV GO111MODULE="on"
ENV CGO_ENABLED=1
ENV GOOS="linux"
ENV GOPRIVATE=github.com/*
ENV GONOSUMDB=github.com/*
ENV GONOPROXY=github.com/*

COPY ./go.mod ./go.sum ./
RUN go mod download

COPY . .

RUN go build -o /usr/local/bin/tss-wrapper-svc /go/src/github.com/Bridgeless-Project/tss-wrapper-svc


FROM alpine:3.9

COPY --from=buildbase /usr/local/bin/tss-wrapper-svc /usr/local/bin/tss-wrapper-svc

RUN apk add --no-cache ca-certificates

ENTRYPOINT ["tss-wrapper-svc"]
37 changes: 37 additions & 0 deletions build/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
services:
db:
container_name: db
image: postgres
restart: unless-stopped
ports:
- "5435:5432"
environment:
- POSTGRES_USER=tss-wrapper
- POSTGRES_PASSWORD=tss-wrapper
- POSTGRES_DB=db
- PGDATA=/pgdata
volumes:
- pg-data:/pgdata
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U tss-wrapper -d db" ]
interval: 5s
timeout: 5s
retries: 5
start_period: 5s

# tss-wrapper-svc:
# build:
# context: ../
# dockerfile: build/Dockerfile
# ports:
# - "8080:8080"
# container_name: tss-wrapper-svc
# entrypoint: sh -c "tss-wrapper-svc service migrate up && tss-wrapper-svc service run"
# depends_on:
# db:
# condition: service_healthy
# volumes:
# - ./configs/config.local.yaml:/config.yaml

volumes:
pg-data:
21 changes: 21 additions & 0 deletions cmd/root.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package cmd

import (
"os"

"github.com/Bridgeless-Project/tss-wrapper-svc/cmd/service"
"github.com/spf13/cobra"
)

func Execute() {
root := &cobra.Command{
Use: "tss-wrapper-svc",
Short: "TSS wrapper service",
}

root.AddCommand(service.Cmd)

if err := root.Execute(); err != nil {
os.Exit(1)
}
}
21 changes: 21 additions & 0 deletions cmd/service/migrate/down.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package migrate

import (
"github.com/Bridgeless-Project/tss-wrapper-svc/cmd/utils"
"github.com/pkg/errors"
migrate "github.com/rubenv/sql-migrate"
"github.com/spf13/cobra"
)

var downCmd = &cobra.Command{
Use: "down",
Short: "Downgrades the database migrations",
RunE: func(cmd *cobra.Command, args []string) error {
cfg, err := utils.ConfigFromFlags(cmd)
if err != nil {
return errors.Wrap(err, "failed to get config from flags")
}

return execute(cfg, migrate.Down)
},
}
40 changes: 40 additions & 0 deletions cmd/service/migrate/migrate.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package migrate

import (
"github.com/Bridgeless-Project/tss-wrapper-svc/assets"
"github.com/Bridgeless-Project/tss-wrapper-svc/internal/config"

"github.com/pkg/errors"
migrate "github.com/rubenv/sql-migrate"
"github.com/spf13/cobra"
)

func init() {
registerCommands(Cmd)
}

var Cmd = &cobra.Command{
Use: "migrate",
Short: "Command for running database migrations",
}

func registerCommands(cmd *cobra.Command) {
cmd.AddCommand(upCmd)
cmd.AddCommand(downCmd)
}

func execute(cfg config.Config, direction migrate.MigrationDirection) error {
migrationsFs := &migrate.EmbedFileSystemMigrationSource{
FileSystem: assets.Migrations,
Root: "migrations",
}

applied, err := migrate.Exec(cfg.DB().RawDB(), "postgres", migrationsFs, direction)
if err != nil {
return errors.Wrap(err, "failed to apply migrations")
}

cfg.Log().WithField("applied", applied).Debug("migrations applied")

return nil
}
21 changes: 21 additions & 0 deletions cmd/service/migrate/up.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package migrate

import (
"github.com/Bridgeless-Project/tss-wrapper-svc/cmd/utils"
"github.com/pkg/errors"
migrate "github.com/rubenv/sql-migrate"
"github.com/spf13/cobra"
)

var upCmd = &cobra.Command{
Use: "up",
Short: "Upgrades the database with migrations",
RunE: func(cmd *cobra.Command, args []string) error {
cfg, err := utils.ConfigFromFlags(cmd)
if err != nil {
return errors.Wrap(err, "failed to get config from flags")
}

return execute(cfg, migrate.Up)
},
}
Loading
Loading