Skip to content

Commit

Permalink
Merge pull request #210
Browse files Browse the repository at this point in the history
Release v0.11.1
  • Loading branch information
bsrinivas8687 committed Aug 15, 2023
2 parents 843d90d + c0d4401 commit b48aef9
Show file tree
Hide file tree
Showing 74 changed files with 4,016 additions and 1,675 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: "Release"

on:
release:
types:
- created

jobs:
artifacts:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Build Docker image
run: docker build --compress --file Dockerfile --force-rm --tag sentinel-official/sentinelhub .

- name: Copy binary file
run: |
docker create --name container sentinel-official/sentinelhub && \
docker cp container:/usr/local/bin/sentinelhub ./sentinelhub && \
docker rm container
- name: Save SHA256 sum
run: sha256sum ./sentinelhub > ./sentinelhub_sha256.txt

- name: Upload release artifacts
uses: softprops/action-gh-release@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
files: |
sentinelhub
sentinelhub_sha256.txt
16 changes: 16 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM golang:1.20-alpine3.18 as build

COPY . /root/

RUN apk add build-base ca-certificates git linux-headers wget && \
cd /root/ && \
ARCH=$(uname -m) && \
WASM_VERSION=$(go list -m all | grep github.com/CosmWasm/wasmvm | awk '{print $NF}') && \
wget -q -O /usr/local/lib/libwasmvm_muslc.a https://github.com/CosmWasm/wasmvm/releases/download/${WASM_VERSION}/libwasmvm_muslc.${ARCH}.a && \
STATIC=true make --jobs=$(nproc) build

FROM alpine:3.18

COPY --from=build /root/build/sentinelhub /usr/local/bin/sentinelhub

ENTRYPOINT ["sentinelhub"]
18 changes: 14 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,17 +1,27 @@
.DEFAULT_GOAL := default
VERSION := $(shell git describe --tags | sed 's/^v//' | rev | cut -d - -f 2- | rev)
VERSION := $(shell git describe --tags | sed 's/^v//')
COMMIT := $(shell git log -1 --format='%H')
TENDERMINT_VERSION := $(shell go list -m github.com/tendermint/tendermint | sed 's/.* //')

BUILD_TAGS := $(strip netgo,ledger)
LD_FLAGS := -s -w \
comma := ,
whitespace := $() $()

build_tags := $(strip netgo ledger)
ld_flags := -s -w \
-X github.com/cosmos/cosmos-sdk/version.Name=sentinel \
-X github.com/cosmos/cosmos-sdk/version.AppName=sentinelhub \
-X github.com/cosmos/cosmos-sdk/version.Version=${VERSION} \
-X github.com/cosmos/cosmos-sdk/version.Commit=${COMMIT} \
-X github.com/cosmos/cosmos-sdk/version.BuildTags=${BUILD_TAGS} \
-X github.com/tendermint/tendermint/version.TMCoreSemVer=$(TENDERMINT_VERSION)

ifeq ($(STATIC),true)
build_tags += muslc
ld_flags += -linkmode=external -extldflags '-Wl,-z,muldefs -static'
endif

BUILD_TAGS = $(subst $(whitespace),$(comma),$(build_tags))
LD_FLAGS = ${ld_flags} -X github.com/cosmos/cosmos-sdk/version.BuildTags=${BUILD_TAGS}

.PHONY: benchmark
benchmark:
@go test -mod=readonly -v -bench ./...
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
[![GoReport](https://goreportcard.com/badge/github.com/sentinel-official/hub)](https://goreportcard.com/report/github.com/sentinel-official/hub)
[![Licence](https://img.shields.io/github/license/sentinel-official/hub.svg)](https://github.com/sentinel-official/hub/blob/development/LICENSE)
[![Tag](https://img.shields.io/github/tag/sentinel-official/hub.svg)](https://github.com/sentinel-official/hub/releases/latest)
![TotalLines](https://img.shields.io/tokei/lines/github/sentinel-official/hub)
![TotalLines](https://tokei.rs/b1/github/sentinel-official/hub)

For documentation click [here](https://docs.sentinel.co/sentinelhub/setup)
13 changes: 2 additions & 11 deletions proto/sentinel/deposit/v1/events.proto
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
syntax = "proto3";
package sentinel.deposit.v1;

import "cosmos/base/v1beta1/coin.proto";
import "gogoproto/gogo.proto";

option go_package = "github.com/sentinel-official/hub/x/deposit/types";
Expand All @@ -10,18 +9,10 @@ option (gogoproto.goproto_getters_all) = false;

message EventAdd {
string address = 1 [ (gogoproto.moretags) = "yaml:\"address\"" ];
repeated cosmos.base.v1beta1.Coin coins = 2 [
(gogoproto.nullable) = false,
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins",
(gogoproto.moretags) = "yaml:\"coins\""
];
string coins = 2 [ (gogoproto.moretags) = "yaml:\"coins\"" ];
}

message EventSubtract {
string address = 1 [ (gogoproto.moretags) = "yaml:\"address\"" ];
repeated cosmos.base.v1beta1.Coin coins = 2 [
(gogoproto.nullable) = false,
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins",
(gogoproto.moretags) = "yaml:\"coins\""
];
string coins = 2 [ (gogoproto.moretags) = "yaml:\"coins\"" ];
}
9 changes: 5 additions & 4 deletions proto/sentinel/node/v2/events.proto
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@ message EventUpdateDetails {
}

message EventUpdateStatus {
string address = 1 [ (gogoproto.moretags) = "yaml:\"address\"" ];
sentinel.types.v1.Status status = 2
sentinel.types.v1.Status status = 1
[ (gogoproto.moretags) = "yaml:\"status\"" ];
string address = 2 [ (gogoproto.moretags) = "yaml:\"address\"" ];
}

message EventCreateSubscription {
uint64 id = 1
[ (gogoproto.customname) = "ID", (gogoproto.moretags) = "yaml:\"id\"" ];
string address = 1 [ (gogoproto.moretags) = "yaml:\"address\"" ];
string node_address = 2 [ (gogoproto.moretags) = "yaml:\"node_address\"" ];
uint64 id = 3
[ (gogoproto.customname) = "ID", (gogoproto.moretags) = "yaml:\"id\"" ];
}
27 changes: 17 additions & 10 deletions proto/sentinel/plan/v2/events.proto
Original file line number Diff line number Diff line change
Expand Up @@ -9,33 +9,40 @@ option (gogoproto.equal_all) = false;
option (gogoproto.goproto_getters_all) = false;

message EventCreate {
uint64 id = 1
string address = 1 [ (gogoproto.moretags) = "yaml:\"address\"" ];
uint64 id = 2
[ (gogoproto.customname) = "ID", (gogoproto.moretags) = "yaml:\"id\"" ];
}

message EventUpdateStatus {
uint64 id = 1
[ (gogoproto.customname) = "ID", (gogoproto.moretags) = "yaml:\"id\"" ];
sentinel.types.v1.Status status = 3
sentinel.types.v1.Status status = 1
[ (gogoproto.moretags) = "yaml:\"status\"" ];
string address = 2 [ (gogoproto.moretags) = "yaml:\"address\"" ];
uint64 id = 3
[ (gogoproto.customname) = "ID", (gogoproto.moretags) = "yaml:\"id\"" ];
}

message EventLinkNode {
uint64 id = 1
string address = 1 [ (gogoproto.moretags) = "yaml:\"address\"" ];
string node_address = 2 [ (gogoproto.moretags) = "yaml:\"node_address\"" ];
uint64 id = 3
[ (gogoproto.customname) = "ID", (gogoproto.moretags) = "yaml:\"id\"" ];
string address = 2 [ (gogoproto.moretags) = "yaml:\"address\"" ];
}

message EventUnlinkNode {
uint64 id = 1
string address = 1 [ (gogoproto.moretags) = "yaml:\"address\"" ];
string node_address = 2 [ (gogoproto.moretags) = "yaml:\"node_address\"" ];
uint64 id = 3
[ (gogoproto.customname) = "ID", (gogoproto.moretags) = "yaml:\"id\"" ];
string address = 2 [ (gogoproto.moretags) = "yaml:\"address\"" ];
}

message EventCreateSubscription {
uint64 id = 1
string address = 1 [ (gogoproto.moretags) = "yaml:\"address\"" ];
string provider_address = 2
[ (gogoproto.moretags) = "yaml:\"provider_address\"" ];
uint64 id = 3
[ (gogoproto.customname) = "ID", (gogoproto.moretags) = "yaml:\"id\"" ];
uint64 plan_id = 2 [
uint64 plan_id = 4 [
(gogoproto.customname) = "PlanID",
(gogoproto.moretags) = "yaml:\"plan_id\""
];
Expand Down
37 changes: 26 additions & 11 deletions proto/sentinel/session/v2/events.proto
Original file line number Diff line number Diff line change
Expand Up @@ -9,33 +9,48 @@ option (gogoproto.equal_all) = false;
option (gogoproto.goproto_getters_all) = false;

message EventStart {
uint64 id = 1
string address = 1 [ (gogoproto.moretags) = "yaml:\"address\"" ];
string node_address = 2 [ (gogoproto.moretags) = "yaml:\"node_address\"" ];
uint64 id = 3
[ (gogoproto.customname) = "ID", (gogoproto.moretags) = "yaml:\"id\"" ];
uint64 subscription_id = 2 [
uint64 plan_id = 4 [
(gogoproto.customname) = "PlanID",
(gogoproto.moretags) = "yaml:\"plan_id\""
];
uint64 subscription_id = 5 [
(gogoproto.customname) = "SubscriptionID",
(gogoproto.moretags) = "yaml:\"subscription_id\""
];
string node_address = 3 [ (gogoproto.moretags) = "yaml:\"node_address\"" ];
}

message EventUpdateDetails {
uint64 id = 1
string address = 1 [ (gogoproto.moretags) = "yaml:\"address\"" ];
string node_address = 2 [ (gogoproto.moretags) = "yaml:\"node_address\"" ];
uint64 id = 3
[ (gogoproto.customname) = "ID", (gogoproto.moretags) = "yaml:\"id\"" ];
uint64 subscription_id = 2 [
uint64 plan_id = 4 [
(gogoproto.customname) = "PlanID",
(gogoproto.moretags) = "yaml:\"plan_id\""
];
uint64 subscription_id = 5 [
(gogoproto.customname) = "SubscriptionID",
(gogoproto.moretags) = "yaml:\"subscription_id\""
];
string node_address = 3 [ (gogoproto.moretags) = "yaml:\"node_address\"" ];
}

message EventUpdateStatus {
uint64 id = 1
sentinel.types.v1.Status status = 1
[ (gogoproto.moretags) = "yaml:\"status\"" ];
string address = 2 [ (gogoproto.moretags) = "yaml:\"address\"" ];
string node_address = 3 [ (gogoproto.moretags) = "yaml:\"node_address\"" ];
uint64 id = 4
[ (gogoproto.customname) = "ID", (gogoproto.moretags) = "yaml:\"id\"" ];
uint64 subscription_id = 2 [
uint64 plan_id = 5 [
(gogoproto.customname) = "PlanID",
(gogoproto.moretags) = "yaml:\"plan_id\""
];
uint64 subscription_id = 6 [
(gogoproto.customname) = "SubscriptionID",
(gogoproto.moretags) = "yaml:\"subscription_id\""
];
string node_address = 3 [ (gogoproto.moretags) = "yaml:\"node_address\"" ];
sentinel.types.v1.Status status = 4
[ (gogoproto.moretags) = "yaml:\"status\"" ];
}
75 changes: 64 additions & 11 deletions proto/sentinel/subscription/v2/events.proto
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,78 @@ option (gogoproto.equal_all) = false;
option (gogoproto.goproto_getters_all) = false;

message EventUpdateStatus {
uint64 id = 1
[ (gogoproto.customname) = "ID", (gogoproto.moretags) = "yaml:\"id\"" ];
sentinel.types.v1.Status status = 2
sentinel.types.v1.Status status = 1
[ (gogoproto.moretags) = "yaml:\"status\"" ];
string address = 2 [ (gogoproto.moretags) = "yaml:\"address\"" ];
uint64 id = 3
[ (gogoproto.customname) = "ID", (gogoproto.moretags) = "yaml:\"id\"" ];
uint64 plan_id = 4 [
(gogoproto.customname) = "PlanID",
(gogoproto.moretags) = "yaml:\"plan_id\""
];
}

message EventAllocate {
uint64 id = 1
[ (gogoproto.customname) = "ID", (gogoproto.moretags) = "yaml:\"id\"" ];
string address = 2 [ (gogoproto.moretags) = "yaml:\"address\"" ];
string bytes = 3 [
string address = 1 [ (gogoproto.moretags) = "yaml:\"address\"" ];
string granted_bytes = 2 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
(gogoproto.nullable) = false
];
string utilised_bytes = 3 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
(gogoproto.nullable) = false
];
uint64 id = 4
[ (gogoproto.customname) = "ID", (gogoproto.moretags) = "yaml:\"id\"" ];
}

message EventCreatePayout {
string address = 1 [ (gogoproto.moretags) = "yaml:\"address\"" ];
string node_address = 2 [ (gogoproto.moretags) = "yaml:\"node_address\"" ];
uint64 id = 3
[ (gogoproto.customname) = "ID", (gogoproto.moretags) = "yaml:\"id\"" ];
}

message EventPayForPayout {
string address = 1 [ (gogoproto.moretags) = "yaml:\"address\"" ];
string node_address = 2 [ (gogoproto.moretags) = "yaml:\"node_address\"" ];
string payment = 3 [ (gogoproto.moretags) = "yaml:\"payment\"" ];
string staking_reward = 4
[ (gogoproto.moretags) = "yaml:\"staking_reward\"" ];
uint64 id = 5
[ (gogoproto.customname) = "ID", (gogoproto.moretags) = "yaml:\"id\"" ];
}

message EventPayout {
uint64 id = 1
message EventPayForPlan {
string address = 1 [ (gogoproto.moretags) = "yaml:\"address\"" ];
string payment = 2 [ (gogoproto.moretags) = "yaml:\"payment\"" ];
string provider_address = 3
[ (gogoproto.moretags) = "yaml:\"provider_address\"" ];
string staking_reward = 4
[ (gogoproto.moretags) = "yaml:\"staking_reward\"" ];
uint64 id = 5
[ (gogoproto.customname) = "ID", (gogoproto.moretags) = "yaml:\"id\"" ];
string address = 2 [ (gogoproto.moretags) = "yaml:\"address\"" ];
string node_address = 3 [ (gogoproto.moretags) = "yaml:\"node_address\"" ];
}

message EventPayForSession {
string address = 1 [ (gogoproto.moretags) = "yaml:\"address\"" ];
string node_address = 2 [ (gogoproto.moretags) = "yaml:\"node_address\"" ];
string payment = 3 [ (gogoproto.moretags) = "yaml:\"payment\"" ];
string staking_reward = 4
[ (gogoproto.moretags) = "yaml:\"staking_reward\"" ];
uint64 session_id = 5 [
(gogoproto.customname) = "SessionID",
(gogoproto.moretags) = "yaml:\"session_id\""
];
uint64 subscription_id = 6 [
(gogoproto.customname) = "SubscriptionID",
(gogoproto.moretags) = "yaml:\"subscription_id\""
];
}

message EventRefund {
string address = 1 [ (gogoproto.moretags) = "yaml:\"address\"" ];
string amount = 2 [ (gogoproto.moretags) = "yaml:\"amount\"" ];
uint64 id = 3
[ (gogoproto.customname) = "ID", (gogoproto.moretags) = "yaml:\"id\"" ];
}
13 changes: 7 additions & 6 deletions types/test_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ var (
TestDenomEmpty = ""
TestDenomInvalid = "i"
TestDenomOne = "one"
TestDenomTwo = "two"

TestIntEmpty = sdk.Int{}
TestIntNegative = sdk.NewInt(-1000)
Expand All @@ -45,10 +46,10 @@ var (

TestCoinsNil sdk.Coins = nil
TestCoinsEmpty = sdk.Coins{}
TestCoinsEmptyDenom = sdk.Coins{sdk.Coin{Denom: TestDenomEmpty, Amount: TestIntPositive}}
TestCoinsInvalidDenom = sdk.Coins{sdk.Coin{Denom: TestDenomInvalid, Amount: TestIntPositive}}
TestCoinsEmptyAmount = sdk.Coins{sdk.Coin{Denom: TestDenomOne, Amount: TestIntEmpty}}
TestCoinsNegativeAmount = sdk.Coins{sdk.Coin{Denom: TestDenomOne, Amount: TestIntNegative}}
TestCoinsZeroAmount = sdk.Coins{sdk.Coin{Denom: TestDenomOne, Amount: TestIntZero}}
TestCoinsPositiveAmount = sdk.Coins{sdk.Coin{Denom: TestDenomOne, Amount: TestIntPositive}}
TestCoinsEmptyDenom = sdk.Coins{TestCoinEmptyDenom}
TestCoinsInvalidDenom = sdk.Coins{TestCoinInvalidDenom}
TestCoinsEmptyAmount = sdk.Coins{TestCoinEmptyAmount}
TestCoinsNegativeAmount = sdk.Coins{TestCoinNegativeAmount}
TestCoinsZeroAmount = sdk.Coins{TestCoinZeroAmount}
TestCoinsPositiveAmount = sdk.Coins{TestCoinPositiveAmount}
)
2 changes: 1 addition & 1 deletion x/deposit/client/cli/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (

func queryDeposit() *cobra.Command {
cmd := &cobra.Command{
Use: "deposit [address]",
Use: "deposit [account-addr]",
Short: "Query a deposit",
Args: cobra.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
Expand Down

0 comments on commit b48aef9

Please sign in to comment.