Skip to content

Commit

Permalink
First commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Charles Dusek committed Apr 3, 2024
0 parents commit 8cd1761
Show file tree
Hide file tree
Showing 432 changed files with 432,911 additions and 0 deletions.
64 changes: 64 additions & 0 deletions .github/workflows/automated-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
on:
push:
tags:
- "v*"

name: Automated release build

jobs:
build:
name: Build and upload release assets
runs-on: ubuntu-latest

steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.19
id: go

- name: Checkout code
uses: actions/checkout@v2

- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: false
prerelease: true

# build & upload marketd

- name: Build marketd
run: make build

- name: Upload marketd
id: upload-marketd-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: marketd
asset_name: marketd
asset_content_type: application/bin

# build & upload marketd arm64

- name: Build marketd arm64
run: GOARCH=arm64 make build

- name: Upload marketd arm64
id: upload-marketd-release-asset-arm
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: marketd
asset_name: marketd-arm
asset_content_type: application/bin
27 changes: 27 additions & 0 deletions .github/workflows/docker-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Docker Build & Push

on:
push:
branches:
- 'dev'

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Publish to Docker Hub
uses: docker/build-push-action@v2
with:
context: .
file: Dockerfile
push: true
tags: onomy/market-dev:latest
27 changes: 27 additions & 0 deletions .github/workflows/docker-main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Docker Build & Push

on:
push:
branches:
- 'main'

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Publish to Docker Hub
uses: docker/build-push-action@v2
with:
context: .
file: Dockerfile
push: true
tags: onomy/market-main:latest
28 changes: 28 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Go Unit Tests

on:
push:
branches: [ main, dev ]
pull_request:
branches: [ main, dev ]

jobs:
build:
name: Build and Test
runs-on: ubuntu-latest

steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.16
id: go

- name: Checkout code
uses: actions/checkout@v2

- name: Build market
run: go build -v ./...

- name: Test
run: go test -v ./... -coverprofile=cover.out && go tool cover -html=cover.out
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
vue/node_modules
vue/dist
release/
.idea/
.vscode/
.DS_Store
app/state.json
app/stats.json
/vendor
/target
/Cargo.lock
/marketd
/market_standaloned
49 changes: 49 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Simple usage with a mounted data directory:
# > docker build -t market .
# > docker run -it -v ~/.market:/market/.market onomy/market-dev init market --home /market/.market
# Copy genesis.json from dev/config to ~/.market/config and Dealer and Validator keys are in dev/config
# > docker run -it -v ~/.market:/market/.market onomy/market-dev keys add dealer --recover --home /market/.market
# > docker run -it -v ~/.market:/market/.market onomy/market-dev keys add validator --recover --home /market/.market
# > docker run -it -v ~/.market:/market/.market onomy/market-dev gentx validator 10000000000000000000stake --chain-id market --home /market/.market
# > docker run -it -v ~/.market:/market/.market onomy/market-dev collect-gentxs --home /market/.market
# > docker run -it -p 26656:26656 -p 26657:26657 -p 1317:1317 -p 9090:9090 -p 9091:9091 -d -v ~/.market:/market/.market onomy/market-dev start --home /market/.market
FROM golang:1.19-alpine AS build-env

# Set up dependencies
ENV PACKAGES curl make git libc-dev bash gcc linux-headers eudev-dev python3

# Set working directory for the build
WORKDIR /go/src/github.com/pendulum-labs/market

# Add source files
COPY . .
RUN pwd
RUN ls

RUN go version

# Install minimum necessary dependencies, build Cosmos SDK, remove packages
RUN apk add --no-cache $PACKAGES
RUN make install

# Final image
FROM alpine:edge

ENV MARKET /market

# Install ca-certificates
RUN apk add --update ca-certificates

WORKDIR $MARKET

# Copy over binaries from the build-env
COPY --from=build-env /go/bin/marketd /usr/bin/marketd

EXPOSE 26656
EXPOSE 26657
EXPOSE 1317
EXPOSE 9090
EXPOSE 9091

# Run marketd by default, omit entrypoint to ease using container with marketcli
ENTRYPOINT ["marketd"]
Loading

0 comments on commit 8cd1761

Please sign in to comment.