Skip to content

Commit

Permalink
update module path, adding licence, adding ci
Browse files Browse the repository at this point in the history
  • Loading branch information
olegfomenko committed Oct 5, 2023
1 parent 3b80e40 commit 1b0f579
Show file tree
Hide file tree
Showing 21 changed files with 320 additions and 143 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Build Rarimo TSS service docker image
on:
workflow_dispatch:

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/[email protected]

- 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
37 changes: 37 additions & 0 deletions .github/workflows/actions_onlymain.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Build Rarimo TSS service docker image
on:
push:
branches:
- 'main'
- 'master'
- 'chains/mainnet'
- 'chains/mainnet-beta'

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/[email protected]

- 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
34 changes: 34 additions & 0 deletions .github/workflows/tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Build Rarimo TSS service docker image tag
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'

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/[email protected]

- 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
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
FROM golang:1.18-alpine as buildbase

WORKDIR /go/src/gitlab.com/rarimo/savers/sol-saver-svc
WORKDIR /go/src/github.com/rarimo/sol-saver-svc
COPY vendor .
COPY . .

ENV GO111MODULE="on"
ENV CGO_ENABLED=0
ENV GOOS="linux"

RUN go build -o /usr/local/bin/sol-saver-svc gitlab.com/rarimo/savers/sol-saver-svc
RUN go build -o /usr/local/bin/sol-saver-svc github.com/rarimo/sol-saver-svc


###
Expand Down
19 changes: 19 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Copyright 2023 Zero Block Global Foundation

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.
63 changes: 62 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,64 @@
# sol-saver-svc

Run service
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

Saver service (oracle) to observe Solana bridge program deposit events.

## Configuration

To run that service you need a configuration file `config.yaml` with the following structure:

```yaml
log:
disable_sentry: true
level: debug
listener:
addr: :8000
rpc:
url: "" # solana node address
ws:
url: "" # solana node address

listen:
chain: Solana
from_tx: ""
program_id: ""
broadcaster:
addr: "ip:8000" # broadcaster service address
sender_account: "" # account used in the broadcaster service
core:
addr: tcp://ip:26657 # your rarimo node address
cosmos:
addr: "ip:9090" # your rarimo node address
subscriber:
min_retry_period: 1s
max_retry_period: 10s
```
Also, some environment variables is required to run:
```yaml
- name: KV_VIPER_FILE
value: /config/config.yaml is the path to your config file
```
## Run
* Vote mode:
```shell
sol-saver-svc run voter
```

* Saver mode
```shell
sol-saver-svc run saver
```

* Full mode (saver + voter)
```shell
sol-saver-svc run service
```

* Catchup old transactions from Solana
```shell
sol-saver-svc run saver-catchup
```
34 changes: 17 additions & 17 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module gitlab.com/rarimo/savers/sol-saver-svc
module github.com/rarimo/sol-saver-svc

go 1.18

Expand All @@ -8,17 +8,17 @@ require (
github.com/gagliardetto/binary v0.7.1
github.com/gogo/protobuf v1.3.3
github.com/near/borsh-go v0.3.1
github.com/olegfomenko/solana-go v1.4.2-0.20220825130821-a1f0ac7c5b0a
github.com/olegfomenko/solana-go v1.4.2-0.20221104112355-eb3546bb0e15
github.com/rarimo/rarimo-core v1.0.6
github.com/rarimo/saver-grpc-lib v1.0.0
github.com/rarimo/solana-program-go v1.0.0
github.com/spf13/cast v1.5.1
github.com/tendermint/tendermint v0.34.27
gitlab.com/distributed_lab/figure v2.1.0+incompatible
gitlab.com/distributed_lab/kit v1.11.1
gitlab.com/distributed_lab/logan v3.8.1+incompatible
gitlab.com/distributed_lab/running v0.0.0-20200706131153-4af0e83eb96c
gitlab.com/rarimo/rarimo-core v0.0.0-20230709130226-0707c00fa5cd
gitlab.com/rarimo/savers/saver-grpc-lib v0.0.0-20230621141315-a8a8ba3ce626
gitlab.com/rarimo/solana-program-go v0.0.0-20230201224757-533c0edcb066
google.golang.org/grpc v1.55.0
google.golang.org/grpc v1.58.0
)

require (
Expand Down Expand Up @@ -115,6 +115,7 @@ require (
github.com/prometheus/client_model v0.3.0 // indirect
github.com/prometheus/common v0.39.0 // indirect
github.com/prometheus/procfs v0.9.0 // indirect
github.com/rarimo/broadcaster-svc v1.0.2 // indirect
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
github.com/sasha-s/go-deadlock v0.3.1 // indirect
github.com/sirupsen/logrus v1.9.0 // indirect
Expand All @@ -136,23 +137,22 @@ require (
github.com/tidwall/pretty v1.2.0 // indirect
github.com/zondax/hid v0.9.1 // indirect
github.com/zondax/ledger-go v0.14.1 // indirect
gitlab.com/rarimo/broadcaster-svc v0.0.0-20221130133449-dfacd1486515 // indirect
go.etcd.io/bbolt v1.3.6 // indirect
go.opencensus.io v0.24.0 // indirect
go.uber.org/atomic v1.10.0 // indirect
go.uber.org/multierr v1.8.0 // indirect
go.uber.org/ratelimit v0.2.0 // indirect
go.uber.org/zap v1.23.0 // indirect
golang.org/x/crypto v0.9.0 // indirect
golang.org/x/crypto v0.13.0 // indirect
golang.org/x/exp v0.0.0-20230206171751-46f607a40771 // indirect
golang.org/x/net v0.10.0 // indirect
golang.org/x/sys v0.8.0 // indirect
golang.org/x/term v0.8.0 // indirect
golang.org/x/text v0.9.0 // indirect
google.golang.org/genproto v0.0.0-20230526203410-71b5a4ffd15e // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20230530153820-e85fd2cbaebc // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc // indirect
google.golang.org/protobuf v1.30.0 // indirect
golang.org/x/net v0.15.0 // indirect
golang.org/x/sys v0.12.0 // indirect
golang.org/x/term v0.12.0 // indirect
golang.org/x/text v0.13.0 // indirect
google.golang.org/genproto v0.0.0-20230803162519-f966b187b2e5 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20230822172742-b8732ec3820d // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d // indirect
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand All @@ -163,7 +163,7 @@ replace (
github.com/agl/ed25519 => github.com/bnb-chain/edwards25519 v0.0.0-20200305024217-f36fc4b53d43
github.com/btcsuite/btcd => github.com/btcsuite/btcd v0.22.0-beta
github.com/confio/ics23/go => github.com/cosmos/cosmos-sdk/ics23/go v0.8.0
github.com/cosmos/cosmos-sdk => gitlab.com/rarimo/cosmos-sdk v0.46.7-rc.6
github.com/cosmos/cosmos-sdk => github.com/rarimo/cosmos-sdk v0.46.7
github.com/cosmos/iavl => github.com/cosmos/iavl v0.19.4
github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1
github.com/tendermint/tendermint => github.com/tendermint/tendermint v0.34.24
Expand Down
Loading

0 comments on commit 1b0f579

Please sign in to comment.