Skip to content

Commit

Permalink
Merge pull request #31 from CudoVentures/cudos-dev
Browse files Browse the repository at this point in the history
Merge cudos-dev branch with master
  • Loading branch information
mlukanova authored Jun 2, 2022
2 parents fa96be5 + ee59464 commit 0776c75
Show file tree
Hide file tree
Showing 221 changed files with 16,252 additions and 24,069 deletions.
15 changes: 15 additions & 0 deletions .env.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# This is a sample .env file for use in local development.
# Duplicate this file as .env in the root of the project
# and update the environment variables to match your
# desired config
#
# See the README for full descriptions of each of the
# available configurations.

NEXT_PUBLIC_GRAPHQL_URL=http://localhost:8080/v1/graphql
NEXT_PUBLIC_GRAPHQL_WS=ws://localhost:8080/v1/graphql
NODE_ENV=development
PORT=3000
NEXT_PUBLIC_URL=http://localhost:3000
NEXT_PUBLIC_RPC_WEBSOCKET=http://localhost:26657/websocket
NEXT_PUBLIC_CHAIN_TYPE=testnet
90 changes: 90 additions & 0 deletions .github/workflows/docker_production.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: Docker-Production

on:
push:
tags:
- desmos-morpheus-apollo-1-v*

jobs:
Build-and-Publish:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Prepare tags
id: prep
run: |
DOCKER_IMAGE=forbole/big-dipper-2.0-cosmos
VERSION=edge
if [[ $GITHUB_REF == refs/tags/* ]]; then
VERSION=${GITHUB_REF#refs/tags/}
fi
TAGS="${DOCKER_IMAGE}:${VERSION}"
echo ::set-output name=version::${VERSION}
echo ::set-output name=tags::${TAGS}
echo ::set-output name=created::$(date -u +'%Y-%m-%dT%H:%M:%SZ')
- name: Prepare docker build env
id: dockerPrep
run: |
NEXT_PUBLIC_GRAPHQL_URL=
NEXT_PUBLIC_GRAPHQL_WS=
NEXT_PUBLIC_URL=
NEXT_PUBLIC_RPC_WEBSOCKET=
NEXT_PUBLIC_CHAIN_TYPE=
NODE_ENV="production"
PORT=3000
if [[ $GITHUB_REF == refs/tags/desmos-morpheus-apollo-1* ]]; then
NEXT_PUBLIC_GRAPHQL_URL="https://gql.morpheus.desmos.network/v1/graphql"
NEXT_PUBLIC_GRAPHQL_WS="wss://gql.morpheus.desmos.network/v1/graphql"
NEXT_PUBLIC_URL="https://morpheus.desmos.network"
NEXT_PUBLIC_RPC_WEBSOCKET="wss://rpc.morpheus.desmos.network/websocket"
NEXT_PUBLIC_CHAIN_TYPE="testnet"
fi
echo ::set-output name=NEXT_PUBLIC_GRAPHQL_URL::${NEXT_PUBLIC_GRAPHQL_URL}
echo ::set-output name=NEXT_PUBLIC_GRAPHQL_WS::${NEXT_PUBLIC_GRAPHQL_WS}
echo ::set-output name=NEXT_PUBLIC_URL::${NEXT_PUBLIC_URL}
echo ::set-output name=NEXT_PUBLIC_RPC_WEBSOCKET::${NEXT_PUBLIC_RPC_WEBSOCKET}
echo ::set-output name=NEXT_PUBLIC_CHAIN_TYPE::${NEXT_PUBLIC_CHAIN_TYPE}
echo ::set-output name=NODE_ENV::${NODE_ENV}
echo ::set-output name=PORT::${PORT}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ steps.prep.outputs.tags }}
build-args: |
"NEXT_PUBLIC_GRAPHQL_URL=${{ steps.dockerPrep.outputs.NEXT_PUBLIC_GRAPHQL_URL }}"
"NEXT_PUBLIC_GRAPHQL_WS=${{ steps.dockerPrep.outputs.NEXT_PUBLIC_GRAPHQL_WS }}"
"NEXT_PUBLIC_URL=${{ steps.dockerPrep.outputs.NEXT_PUBLIC_URL }}"
"NEXT_PUBLIC_RPC_WEBSOCKET=${{ steps.dockerPrep.outputs.NEXT_PUBLIC_RPC_WEBSOCKET }}"
"NEXT_PUBLIC_CHAIN_TYPE=${{ steps.dockerPrep.outputs.NEXT_PUBLIC_CHAIN_TYPE }}"
"NODE_ENV=${{ steps.dockerPrep.outputs.NODE_ENV }}"
"PORT=${{ steps.dockerPrep.outputs.PORT }}"
labels: |
org.opencontainers.image.source=${{ github.event.repository.html_url }}
org.opencontainers.image.created=${{ steps.prep.outputs.created }}
org.opencontainers.image.revision=${{ github.sha }}
- name: Deploy to Akash 🌐
env:
DESMOS_AKASH_WEBHOOK_URL: ${{ secrets.DESMOS_AKASH_WEBHOOK_URL }}
AKASH_WEBHOOK_SECRET: ${{ secrets.AKASH_WEBHOOK_SECRET }}
run: |
BRANCH=${GITHUB_REF}
WEBHOOK_URL=''
if [[ $GITHUB_REF == refs/tags/desmos-morpheus-apollo-1* ]]; then
echo 'Deploying to Desmos morpheus-apollo-1'
WEBHOOK_URL=$DESMOS_AKASH_WEBHOOK_URL
fi
curl -i -X POST -H "Content-Type: application/json" -d '{"parameters":{"tag": "${{ steps.prep.outputs.version }}"}}' -k $WEBHOOK_URL -u "deploy:$AKASH_WEBHOOK_SECRET"
69 changes: 69 additions & 0 deletions .github/workflows/docker_staging.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Docker-Staging

on:
pull_request:
push:
branches:
- chains/desmos

jobs:
Build-and-Publish:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Prepare tags
id: prep
run: |
BRANCH=${GITHUB_REF#refs/heads/}
if [[ $GITHUB_REF == refs/heads/chains/desmos ]]; then
BRANCH="desmos"
elif [[ $GITHUB_REF == refs/pull/* ]]; then
BRANCH="build-test"
fi
echo ::set-output name=created::$(date -u +'%Y-%m-%dT%H:%M:%SZ')
echo ::set-output name=branch::${BRANCH}
- name: Prepare docker build env
id: dockerPrep
run: |
NEXT_PUBLIC_GRAPHQL_URL="https://gql.morpheus.desmos.network/v1/graphql"
NEXT_PUBLIC_GRAPHQL_WS="wss://gql.morpheus.desmos.network/v1/graphql"
NEXT_PUBLIC_URL="https://morpheus.desmos.network"
NEXT_PUBLIC_RPC_WEBSOCKET="wss://rpc.morpheus.desmos.network/websocket"
NEXT_PUBLIC_CHAIN_TYPE="mainnet"
NODE_ENV="production"
PORT=3000
echo ::set-output name=NEXT_PUBLIC_GRAPHQL_URL::${NEXT_PUBLIC_GRAPHQL_URL}
echo ::set-output name=NEXT_PUBLIC_GRAPHQL_WS::${NEXT_PUBLIC_GRAPHQL_WS}
echo ::set-output name=NEXT_PUBLIC_URL::${NEXT_PUBLIC_URL}
echo ::set-output name=NEXT_PUBLIC_RPC_WEBSOCKET::${NEXT_PUBLIC_RPC_WEBSOCKET}
echo ::set-output name=NEXT_PUBLIC_CHAIN_TYPE::${NEXT_PUBLIC_CHAIN_TYPE}
echo ::set-output name=NODE_ENV::${NODE_ENV}
echo ::set-output name=PORT::${PORT}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
push: ${{ github.event_name != 'pull_request' }}
build-args: |
"NEXT_PUBLIC_GRAPHQL_URL=${{ steps.dockerPrep.outputs.NEXT_PUBLIC_GRAPHQL_URL }}"
"NEXT_PUBLIC_GRAPHQL_WS=${{ steps.dockerPrep.outputs.NEXT_PUBLIC_GRAPHQL_WS }}"
"NEXT_PUBLIC_URL=${{ steps.dockerPrep.outputs.NEXT_PUBLIC_URL }}"
"NEXT_PUBLIC_RPC_WEBSOCKET=${{ steps.dockerPrep.outputs.NEXT_PUBLIC_RPC_WEBSOCKET }}"
"NEXT_PUBLIC_CHAIN_TYPE=${{ steps.dockerPrep.outputs.NEXT_PUBLIC_CHAIN_TYPE }}"
"NODE_ENV=${{ steps.dockerPrep.outputs.NODE_ENV }}"
"PORT=${{ steps.dockerPrep.outputs.PORT }}"
tags: "forbole/big-dipper-2.0-cosmos:${{ steps.prep.outputs.branch }}-staging"
labels: |
org.opencontainers.image.source=${{ github.event.repository.html_url }}
org.opencontainers.image.created=${{ steps.prep.outputs.created }}
org.opencontainers.image.revision=${{ github.sha }}
2 changes: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,5 @@ jobs:
run: npm ci
- name: Run build check
run: npm run build
env:
NODE_OPTIONS: "--max-old-space-size=8192"
61 changes: 60 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,69 @@
# Unreleased
# base-v2.0.1 - 2021-03-17

## Bug fixes
- Fixed online voting power total ([\#800](https://github.com/forbole/big-dipper-2.0-cosmos/issues/800))
# base-v2.0.0 - 2021-03-10

## Changes
- Changed online voting power to be a query instead of a subscription ([\#638](https://github.com/forbole/big-dipper-2.0-cosmos/issues/638))
- Optimised rendering of Proposal Details page ([\#763](https://github.com/forbole/big-dipper-2.0-cosmos/issues/763))
- Update online voting power display ([\#776](https://github.com/forbole/big-dipper-2.0-cosmos/issues/776))
- Improved initial loading speed by asyncing top level functions ([\#773](https://github.com/forbole/big-dipper-2.0-cosmos/issues/773))
## Bug fixes
- Fixed Apr error if bonded tokens is 0 ([\#758](https://github.com/forbole/big-dipper-2.0-cosmos/issues/758))

# base-v2.0.0-rc3 - 2021-02-25

## Changes
- Changed `NEXT_PUBLIC_WS_CHAIN_URL` to `NEXT_PUBLIC_RPC_WEBSOCKET` for clarification
- Changed `NEXT_PUBLIC_CHAIN_STATUS` to `NEXT_PUBLIC_CHAIN_TYPE` for clarification

## Migration
- Change env `NEXT_PUBLIC_WS_CHAIN_URL` to `NEXT_PUBLIC_RPC_WEBSOCKET` or don't. It's backwards compatible
- Change env `NEXT_PUBLIC_CHAIN_STATUS` to `NEXT_PUBLIC_CHAIN_TYPE` or don't. It's backwards compatible

## Breaking

- [Bdjuno](https://github.com/forbole/bdjuno) must be on `v1.1.0+`

# base-v2.0.0-rc2 - 2021-02-24

## Changes
- Updated market cap display ([\#698](https://github.com/forbole/big-dipper-2.0-cosmos/issues/698))
- Optimised validator details and account details to prevent random polling behavior ([\#703](https://github.com/forbole/big-dipper-2.0-cosmos/issues/703))
- Add hasura actions error handling in account details ([\#713](https://github.com/forbole/big-dipper-2.0-cosmos/issues/713))
- Display accounts even if balance is 0 and does not exist ([\#692](https://github.com/forbole/big-dipper-2.0-cosmos/issues/692))
- Update handling of 18 decimal places denoms ([\#724](https://github.com/forbole/big-dipper-2.0-cosmos/issues/724))

## Bug fixes
- Add better handling of get denom return types ([\#735](https://github.com/forbole/big-dipper-2.0-cosmos/issues/735))
- Update ui to match the improved hasura actions return types

# base-v2.0.0-rc1 - 2021-02-07

## Changes
- Updated Hasura Actions

## Breaking

- [Bdjuno](https://github.com/forbole/bdjuno) must be on `v1.0.0`

# base-v1.10.0 - 2021-01-25

## Changes
- Optimized initial loading by setting basic details first then profiles after ([\#629](https://github.com/forbole/big-dipper-2.0-cosmos/issues/629))
- Add vp token unit in config ([\#645](https://github.com/forbole/big-dipper-2.0-cosmos/issues/645))

## Bug fixes
- Fix home page validator image url not displaying correctly ([\#632](https://github.com/forbole/big-dipper-2.0-cosmos/issues/632))
- Fix validator anc account details possible infinite load due to dayjs in hook
- Add description sanitization to proposals list ([\#666](https://github.com/forbole/big-dipper-2.0-cosmos/issues/666))
- Fix pagination hook page callback ([\#667](https://github.com/forbole/big-dipper-2.0-cosmos/issues/667))
- Show address if name or moniker is empty ([\#668](https://github.com/forbole/big-dipper-2.0-cosmos/issues/668))

## Migration

- [v1.9.0 to v1.10.0](https://docs.bigdipper.live/cosmos-based/frontend/migrations/v1.9.0-to-v1.10.0)

# base-v1.9.0 - 2021-01-10

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile-dev
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ ENV PORT ${PORT}

#
# Update schema
RUN npm run graphql:codegen
# RUN npm run graphql:codegen

# Building app
EXPOSE 3000
Expand Down
6 changes: 5 additions & 1 deletion Dockerfile-prod
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ ARG NEXT_PUBLIC_GRAPHQL_URL
ARG NEXT_PUBLIC_GRAPHQL_WS
ARG NEXT_PUBLIC_URL
ARG NEXT_PUBLIC_WS_CHAIN_URL
ARG NEXT_PUBLIC_RPC_WEBSOCKET
ARG NEXT_PUBLIC_CHAIN_STATUS
ARG NEXT_PUBLIC_CHAIN_TYPE
ARG NODE_ENV
ARG PORT=3000

Expand All @@ -33,12 +35,14 @@ ENV NEXT_PUBLIC_GRAPHQL_URL ${NEXT_PUBLIC_GRAPHQL_URL}
ENV NEXT_PUBLIC_GRAPHQL_WS ${NEXT_PUBLIC_GRAPHQL_WS}
ENV NEXT_PUBLIC_URL ${NEXT_PUBLIC_URL}
ENV NEXT_PUBLIC_WS_CHAIN_URL ${NEXT_PUBLIC_WS_CHAIN_URL}
ENV NEXT_PUBLIC_RPC_WEBSOCKET ${NEXT_PUBLIC_RPC_WEBSOCKET}
ENV NEXT_PUBLIC_CHAIN_STATUS ${NEXT_PUBLIC_CHAIN_STATUS}
ENV NEXT_PUBLIC_CHAIN_TYPE ${NEXT_PUBLIC_CHAIN_TYPE}
ENV NODE_ENV ${NODE_ENV}
ENV PORT ${PORT}

# Update schema
RUN npm run graphql:codegen
# RUN npm run graphql:codegen

# Building app
RUN npm run build
Expand Down
5 changes: 3 additions & 2 deletions codegen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@ generates:
./src/graphql/types.tsx:
documents:
- './src/**/*.graphql'
- './src/**/*_actions.ts'
- '!./src/**/desmos_profile.graphql'
schema: https://gql.mainnet.desmos.network/v1/graphql
schema: https://gql.desmos.forbole.com/v1/graphql
plugins:
- "typescript"
- "typescript-operations"
- "typescript-react-apollo" # To generate custom hooks per query
./src/graphql/desmos_profile.ts:
schema: https://gql.morpheus.desmos.network/v1/graphql
schema: https://gql.mainnet.desmos.network/v1/graphql
documents:
- 'src/graphql/desmos_profile_graphql.ts'
plugins:
Expand Down
8 changes: 8 additions & 0 deletions declarations.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,11 @@ type MsgCoin = {
denom: string;
amount: string;
}

type ContractMessage = {
method: string;
success: boolean;
transaction_hash: string;
timestamp: string;
height: number;
}
1 change: 0 additions & 1 deletion next-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/// <reference types="next" />
/// <reference types="next/types/global" />
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
Expand Down
Loading

0 comments on commit 0776c75

Please sign in to comment.