-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5097b46
commit 763fbf3
Showing
96 changed files
with
15,196 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--- | ||
name: Report a bug | ||
about: Something with greenfield-relayer is not working as expected | ||
title: '' | ||
labels: 'type:bug' | ||
assignees: '' | ||
--- | ||
|
||
#### System information | ||
|
||
Relayer version: (if getting from release page) | ||
OS & Version: Windows/Linux/OSX | ||
Commit hash : (if `develop`) | ||
|
||
#### Expected behaviour | ||
|
||
|
||
#### Actual behaviour | ||
|
||
|
||
#### Steps to reproduce the behaviour | ||
|
||
|
||
#### Backtrace | ||
|
||
```` | ||
[backtrace] | ||
```` | ||
|
||
When submitting logs: please submit them as text and not screenshots. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
name: Request a feature | ||
about: Report a missing feature - e.g. as a step before submitting a PR | ||
title: '' | ||
labels: 'type:feature' | ||
assignees: '' | ||
--- | ||
|
||
# Rationale | ||
|
||
Why should this feature exist? | ||
What are the use-cases? | ||
|
||
# Implementation | ||
|
||
Do you have ideas regarding the implementation of this feature? | ||
Are you willing to implement this feature? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
name: Ask a question | ||
about: Something is unclear | ||
title: '' | ||
labels: 'type:docs' | ||
assignees: '' | ||
--- | ||
|
||
This should only be used in very rare cases e.g. if you are not 100% sure if something is a bug or asking a question that leads to improving the documentation. For general questions please use [discord](https://discord.gg/bnbchain). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
### Description | ||
|
||
add a description of your changes here... | ||
|
||
### Rationale | ||
|
||
tell us why we need these changes... | ||
|
||
### Example | ||
|
||
add an example CLI or API response... | ||
|
||
### Changes | ||
|
||
Notable changes: | ||
* add each change in a bullet point here | ||
* ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: Build Test | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- develop | ||
|
||
pull_request: | ||
branches: | ||
- master | ||
- develop | ||
|
||
jobs: | ||
build-test: | ||
strategy: | ||
matrix: | ||
go-version: [1.20.x] | ||
os: [ubuntu-latest] | ||
runs-on: ${{ matrix.os }} | ||
env: | ||
GOPRIVATE: github.com/bnb-chain | ||
GH_ACCESS_TOKEN: ${{ secrets.GH_TOKEN }} | ||
steps: | ||
- name: Install Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- uses: actions/cache@v3 | ||
with: | ||
# In order: | ||
# * Module download cache | ||
# * Build cache (Linux) | ||
# * Build cache (Mac) | ||
# * Build cache (Windows) | ||
path: | | ||
~/go/pkg/mod | ||
~/.cache/go-build | ||
~/Library/Caches/go-build | ||
%LocalAppData%\go-build | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go- | ||
- name: Setup GitHub Token | ||
run: git config --global url.https://[email protected]/.insteadOf https://github.com/ | ||
|
||
- name: Test Build | ||
run: | | ||
make build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: Docker | ||
|
||
on: | ||
push: | ||
# Publish `v1.2.3` tags as releases. | ||
tags: | ||
- v* | ||
|
||
env: | ||
IMAGE_NAME: ghcr.io/${{ github.repository }} | ||
IMAGE_SOURCE: https://github.com/${{ github.repository }} | ||
|
||
jobs: | ||
# Push image to GitHub Packages. | ||
push: | ||
runs-on: ubuntu-latest | ||
if: github.event_name == 'push' | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Build image | ||
run: | | ||
docker build . \ | ||
--label "org.opencontainers.image.source=${IMAGE_SOURCE}" \ | ||
--label "org.opencontainers.image.revision=$(git rev-parse HEAD)" \ | ||
--label "org.opencontainers.image.version=$(git describe --tags --abbrev=0)" \ | ||
-f ./server-distroless.dockerfile -t "${IMAGE_NAME}:server-distroless" | ||
docker build . \ | ||
--label "org.opencontainers.image.source=${IMAGE_SOURCE}" \ | ||
--label "org.opencontainers.image.revision=$(git rev-parse HEAD)" \ | ||
--label "org.opencontainers.image.version=$(git describe --tags --abbrev=0)" \ | ||
-f ./monitor-distroless.dockerfile -t "${IMAGE_NAME}:monitor-distroless" | ||
- name: Login to GHCR | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Push image | ||
run: | | ||
# Strip git ref prefix from version | ||
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') | ||
# Strip "v" prefix from tag name | ||
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') | ||
# Use Docker `latest` tag convention | ||
[ "$VERSION" == "master" ] && VERSION=latest | ||
echo IMAGE_NAME=$IMAGE_NAME | ||
echo VERSION=$VERSION | ||
docker tag ${IMAGE_NAME}:server-distroless $IMAGE_NAME:$VERSION-server-distroless | ||
docker tag ${IMAGE_NAME}:monitor-distroless $IMAGE_NAME:$VERSION-monitor-distroless | ||
docker push $IMAGE_NAME:$VERSION-server-distroless | ||
docker push $IMAGE_NAME:$VERSION-monitor-distroless |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: gosec | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- develop | ||
pull_request: | ||
branches: | ||
- master | ||
- develop | ||
jobs: | ||
gosec: | ||
name: gosec | ||
strategy: | ||
matrix: | ||
go-version: [1.20.x] | ||
os: [ubuntu-latest] | ||
runs-on: ${{ matrix.os }} | ||
env: | ||
GOPRIVATE: github.com/bnb-chain | ||
GH_ACCESS_TOKEN: ${{ secrets.GH_TOKEN }} | ||
steps: | ||
- uses: actions/setup-go@v3 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
- uses: actions/checkout@v3 | ||
- name: Setup GitHub Token | ||
run: git config --global url.https://[email protected]/.insteadOf https://github.com/ | ||
- uses: actions/cache@v3 | ||
with: | ||
# In order: | ||
# * Module download cache | ||
# * Build cache (Linux) | ||
# * Build cache (Mac) | ||
# * Build cache (Windows) | ||
path: | | ||
~/go/pkg/mod | ||
~/.cache/go-build | ||
~/Library/Caches/go-build | ||
%LocalAppData%\go-build | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go- | ||
- run: | | ||
go mod tidy | ||
go mod download | ||
- name: Run Gosec Security Scanner | ||
uses: securego/gosec@master | ||
with: | ||
args: -quiet -confidence high -severity high ./... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: "Lint PR" | ||
|
||
on: | ||
pull_request_target: | ||
types: | ||
- opened | ||
- edited | ||
- synchronize | ||
|
||
jobs: | ||
main: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: amannn/action-semantic-pull-request@v5 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | ||
with: | ||
types: | | ||
feat | ||
fix | ||
docs | ||
style | ||
refactor | ||
perf | ||
test | ||
build | ||
ci | ||
chore | ||
revert | ||
release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: Lint | ||
on: | ||
push: | ||
branches: | ||
- master | ||
- develop | ||
pull_request: | ||
permissions: | ||
contents: read | ||
# Optional: allow read access to pull request. Use with `only-new-issues` option. | ||
# pull-requests: read | ||
jobs: | ||
golangci: | ||
name: golangci-lint | ||
strategy: | ||
matrix: | ||
go-version: [1.20.x] | ||
os: [ubuntu-latest] | ||
runs-on: ${{ matrix.os }} | ||
env: | ||
GOPRIVATE: github.com/bnb-chain | ||
steps: | ||
- uses: actions/setup-go@v3 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
- uses: actions/checkout@v3 | ||
|
||
- run: go env -w GOPRIVATE="github.com/bnb-chain/*" | ||
- run: git config --global url."https://${{ secrets.GH_TOKEN }}@github.com".insteadOf "https://github.com" | ||
|
||
- uses: actions/cache@v3 | ||
with: | ||
# In order: | ||
# * Module download cache | ||
# * Build cache (Linux) | ||
# * Build cache (Mac) | ||
# * Build cache (Windows) | ||
path: | | ||
~/go/pkg/mod | ||
~/.cache/go-build | ||
~/Library/Caches/go-build | ||
%LocalAppData%\go-build | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go- | ||
- run: | | ||
go mod tidy | ||
go mod download | ||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v3 | ||
with: | ||
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version | ||
version: latest | ||
skip-pkg-cache: true | ||
args: --timeout=99m |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,3 +19,10 @@ | |
|
||
# Go workspace file | ||
go.work | ||
|
||
.idea | ||
|
||
# Local configrations | ||
config | ||
|
||
build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
BUILD_TAGS = netgo | ||
PACKAGES=$(shell go list ./dao ./service ./monitor/.) | ||
|
||
build_monitor: | ||
ifeq ($(OS),Windows_NT) | ||
go build $(BUILD_FLAGS) -o build/monitor.exe cmd/greenfield-data-marketplace-monitor/main.go | ||
else | ||
go build $(BUILD_FLAGS) -o build/monitor cmd/greenfield-data-marketplace-monitor/main.go | ||
endif | ||
|
||
#build_monitor_docker: | ||
# docker build --build-arg GITHUB_TOKEN=${GITHUB_TOKEN} -f monitor.dockerfile -t monitor . | ||
|
||
build_server: | ||
ifeq ($(OS),Windows_NT) | ||
go build $(BUILD_FLAGS) -o build/server.exe cmd/greenfield-data-marketplace-server/main.go | ||
else | ||
go build $(BUILD_FLAGS) -o build/server cmd/greenfield-data-marketplace-server/main.go | ||
endif | ||
|
||
#build_server_docker: | ||
# docker build --build-arg GITHUB_TOKEN=${GITHUB_TOKEN} -f server.dockerfile -t server . | ||
|
||
build: build_server build_monitor | ||
|
||
#build_docker: build_server_docker build_monitor_docker | ||
|
||
test: | ||
go test -race -v $(PACKAGES) | ||
|
||
lint: | ||
golangci-lint cache clean | ||
golangci-lint run | ||
|
||
genswagger: | ||
swagger generate server -f ./swagger.yaml -A greenfield-data-marketplace --default-scheme=http | ||
|
||
genabi: | ||
./script/abigen --abi ./monitor/contracts/marketplace.abi --pkg contracts --out ./monitor/contracts/marketplace.go --type Marketplace | ||
|
||
|
||
.PHONY: build build_docker test lint genswagger genabi |
Oops, something went wrong.