Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
38 changes: 38 additions & 0 deletions src/spv-gateway-populator/.github/workflows/actions.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
on:
workflow_dispatch:
push:
branches:
- 'master'
- 'main'

env:
CI_JOB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
converge:
name: Converge
runs-on: ubuntu-latest
steps:

- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Install werf
uses: werf/actions/install@v1.2

- name: Log in to registry
# This is where you will update the personal access token to GITHUB_TOKEN
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin

- name: Run echo
run: |
werf version
docker version
echo $GITHUB_REPOSITORY
echo $GITHUB_SHA
- name: Run Build
run: |
. $(werf ci-env github --as-file)
werf export service --tag ghcr.io/$GITHUB_REPOSITORY:$GITHUB_SHA
22 changes: 22 additions & 0 deletions src/spv-gateway-populator/.github/workflows/code-review.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
on:
pull_request:

permissions:
checks: write
contents: read
pull-requests: write

jobs:
lint:
name: code-review
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

# - name: golangci-lint
# uses: reviewdog/action-golangci-lint@v2
# with:
# reporter: github-pr-review
# cache: false
37 changes: 37 additions & 0 deletions src/spv-gateway-populator/.github/workflows/tag.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
on:
workflow_dispatch:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'

env:
CI_JOB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
converge:
name: Converge
runs-on: ubuntu-latest
steps:

- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Install werf
uses: werf/actions/install@v1.2

- name: Log in to registry
# This is where you will update the personal access token to GITHUB_TOKEN
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin

- name: Run echo
run: |
werf version
docker version
echo $GITHUB_REPOSITORY
echo $GITHUB_REF_NAME
- name: Run Build
run: |
. $(werf ci-env github --as-file)
werf export service --tag ghcr.io/$GITHUB_REPOSITORY:$GITHUB_REF_NAME
6 changes: 6 additions & 0 deletions src/spv-gateway-populator/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.vscode/
.idea/
config.*.yaml
docs/node_modules
docs/web_deploy
vendor/
17 changes: 17 additions & 0 deletions src/spv-gateway-populator/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM golang:1.20-alpine as buildbase

RUN apk add git build-base

WORKDIR /go/src/github.com/distributed-lab/spv-contract-populator
COPY vendor .
COPY . .

RUN GOOS=linux go build -o /usr/local/bin/blocks-sync-svc /go/src/github.com/distributed-lab/spv-contract-populator


FROM alpine:3.9

COPY --from=buildbase /usr/local/bin/blocks-sync-svc /usr/local/bin/blocks-sync-svc
RUN apk add --no-cache ca-certificates

ENTRYPOINT ["blocks-sync-svc"]
22 changes: 22 additions & 0 deletions src/spv-gateway-populator/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# SPV Gateway Populator

This service automatically fetches new Bitcoin blocks and adds them to the contract at a set time interval.

## Usage

### 1. Build the service

```bash
go build main.go
```

### 2. Set the configuration file (see example in ../example.config.yaml)

```bash
export KV_VIPER_FILE=./config.yaml
```

### 3. Run the service
```bash
./main run service
```
9 changes: 9 additions & 0 deletions src/spv-gateway-populator/docs/.redoclyrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

apiTitle: blocks-sync-svc
splitSpec: true
codeSamples: false
swaggerUI: true
travis: true
repo: tokend/notifications/notifications-router-svc
oasVersion: 1.0.0

21 changes: 21 additions & 0 deletions src/spv-gateway-populator/docs/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2025 Distributed Lab

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading