Skip to content

Commit

Permalink
build(deps): upgrade to cheqd v2 and cosmos-sdk v0.47.x
Browse files Browse the repository at this point in the history
  • Loading branch information
dadamu committed Apr 9, 2024
1 parent 39e7987 commit 42dec2e
Show file tree
Hide file tree
Showing 203 changed files with 2,903 additions and 1,868 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set BDJuno chain name 🔧
- name: Set Callisto chain name 🔧
shell: bash
run: echo "CHAIN_NAME=$(echo ${GITHUB_REF#refs/heads/} | sed 's/\//_/g')" >> $GITHUB_ENV

- name: Set BDJuno version 🔧
- name: Set Callisto version 🔧
shell: bash
run: echo "GITHUB_VERSION=$(git describe --tags)" >> $GITHUB_ENV

- name: Prepare tags 🏷️
id: prep
run: |
DOCKER_IMAGE=${{ secrets.DOCKERHUB_BDJUNO_REPO }}
DOCKER_IMAGE=${{ secrets.DOCKERHUB_CALLISTO_REPO }}
CHAIN_NAME="${{env.CHAIN_NAME}}"
VERSION="${{env.GITHUB_VERSION}}"
TAGS="${DOCKER_IMAGE}:${CHAIN_NAME}-${VERSION}"
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ name: Lint
on:
pull_request:
push:
branches:
- chains/*
- cosmos/*

jobs:
GolangCI:
Expand All @@ -18,7 +21,7 @@ jobs:
- name: Setup Go 🧰
uses: actions/setup-go@v5
with:
go-version: 1.19
go-version: "1.20"

- name: Compute diff 📜
uses: technote-space/[email protected]
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ name: Tests
on:
pull_request:
push:
branches:
- chains/*
- cosmos/*

jobs:
Cleanup-runs:
Expand All @@ -24,7 +27,7 @@ jobs:
- name: Setup Go 🧰
uses: actions/setup-go@v5
with:
go-version: 1.19
go-version: "1.20"

- name: Compute diff 📜
uses: technote-space/[email protected]
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.idea/
build/
vendor/

# Configuration
*.toml
Expand Down
116 changes: 62 additions & 54 deletions CHANGELOG.md

Large diffs are not rendered by default.

20 changes: 20 additions & 0 deletions Dockerfile.cosmwasm
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FROM golang:1.20-alpine AS builder
RUN apk update && apk add --no-cache make git
WORKDIR /go/src/github.com/forbole/callisto
COPY . ./

RUN apk update && apk add --no-cache ca-certificates build-base git
ADD https://github.com/CosmWasm/wasmvm/releases/download/v1.1.1/libwasmvm_muslc.aarch64.a /lib/libwasmvm_muslc.aarch64.a
ADD https://github.com/CosmWasm/wasmvm/releases/download/v1.1.1/libwasmvm_muslc.x86_64.a /lib/libwasmvm_muslc.x86_64.a
RUN sha256sum /lib/libwasmvm_muslc.aarch64.a | grep 9ecb037336bd56076573dc18c26631a9d2099a7f2b40dc04b6cae31ffb4c8f9a
RUN sha256sum /lib/libwasmvm_muslc.x86_64.a | grep 6e4de7ba9bad4ae9679c7f9ecf7e283dd0160e71567c6a7be6ae47c81ebe7f32
## Copy the library you want to the final location that will be found by the linker flag `-lwasmvm_muslc`
RUN cp /lib/libwasmvm_muslc.$(uname -m).a /lib/libwasmvm_muslc.a
RUN go mod download
RUN LINK_STATICALLY=true BUILD_TAGS="muslc" make build

FROM alpine:latest
RUN apk update && apk add --no-cache ca-certificates build-base
WORKDIR /callisto
COPY --from=builder /go/src/github.com/forbole/callisto/build/callisto /usr/bin/callisto
CMD [ "callisto" ]
10 changes: 5 additions & 5 deletions Dockerfile.default
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
FROM golang:1.19-alpine AS builder
FROM golang:1.20-alpine AS builder
RUN apk update && apk add --no-cache make git
WORKDIR /go/src/github.com/forbole/bdjuno
WORKDIR /go/src/github.com/forbole/callisto
COPY . ./
RUN go mod download
RUN make build

FROM alpine:latest
WORKDIR /bdjuno
COPY --from=builder /go/src/github.com/forbole/bdjuno/build/bdjuno /usr/bin/bdjuno
CMD [ "bdjuno" ]
WORKDIR /callisto
COPY --from=builder /go/src/github.com/forbole/callisto/build/callisto /usr/bin/callisto
CMD [ "callisto" ]
24 changes: 12 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ all: lint build test-unit
### Build flags ###
###############################################################################

LD_FLAGS = -X github.com/forbole/juno/v4/cmd.Version=$(VERSION) \
-X github.com/forbole/juno/v4/cmd.Commit=$(COMMIT)
LD_FLAGS = -X github.com/forbole/juno/v5/cmd.Version=$(VERSION) \
-X github.com/forbole/juno/v5/cmd.Commit=$(COMMIT)
BUILD_FLAGS := -ldflags '$(LD_FLAGS)'

ifeq ($(LINK_STATICALLY),true)
Expand All @@ -32,11 +32,11 @@ BUILD_FLAGS := -ldflags '$(LD_FLAGS)' -tags "$(build_tags)"

build: go.sum
ifeq ($(OS),Windows_NT)
@echo "building bdjuno binary..."
@go build -mod=readonly $(BUILD_FLAGS) -o build/bdjuno.exe ./cmd/bdjuno
@echo "building callisto binary..."
@go build -mod=readonly $(BUILD_FLAGS) -o build/callisto.exe ./cmd/callisto
else
@echo "building bdjuno binary..."
@go build -mod=readonly $(BUILD_FLAGS) -o build/bdjuno ./cmd/bdjuno
@echo "building callisto binary..."
@go build -mod=readonly $(BUILD_FLAGS) -o build/callisto ./cmd/callisto
endif
.PHONY: build

Expand All @@ -45,8 +45,8 @@ endif
###############################################################################

install: go.sum
@echo "installing bdjuno binary..."
@go install -mod=readonly $(BUILD_FLAGS) ./cmd/bdjuno
@echo "installing callisto binary..."
@go install -mod=readonly $(BUILD_FLAGS) ./cmd/callisto
.PHONY: install

###############################################################################
Expand All @@ -55,12 +55,12 @@ install: go.sum

stop-docker-test:
@echo "Stopping Docker container..."
@docker stop bdjuno-test-db || true && docker rm bdjuno-test-db || true
@docker stop callisto-test-db || true && docker rm callisto-test-db || true
.PHONY: stop-docker-test

start-docker-test: stop-docker-test
@echo "Starting Docker container..."
@docker run --name bdjuno-test-db -e POSTGRES_USER=bdjuno -e POSTGRES_PASSWORD=password -e POSTGRES_DB=bdjuno -d -p 6433:5432 postgres
@docker run --name callisto-test-db -e POSTGRES_USER=callisto -e POSTGRES_PASSWORD=password -e POSTGRES_DB=callisto -d -p 6433:5432 postgres
.PHONY: start-docker-test

test-unit: start-docker-test
Expand All @@ -71,7 +71,7 @@ test-unit: start-docker-test
###############################################################################
### Linting ###
###############################################################################
golangci_lint_cmd=github.com/golangci/golangci-lint/cmd/golangci-lint
golangci_lint_cmd=github.com/golangci/golangci-lint/cmd/golangci-lint@v1.55.1

lint:
@echo "--> Running linter"
Expand All @@ -86,7 +86,7 @@ lint-fix:
format:
find . -name '*.go' -type f -not -path "*.git*" -not -name '*.pb.go' -not -name '*_mocks.go' | xargs gofmt -w -s
find . -name '*.go' -type f -not -path "*.git*" -not -name '*.pb.go' -not -name '*_mocks.go' | xargs misspell -w
find . -name '*.go' -type f -not -path "*.git*" -not -name '*.pb.go' -not -name '*_mocks.go' | xargs goimports -w -local github.com/forbole/bdjuno
find . -name '*.go' -type f -not -path "*.git*" -not -name '*.pb.go' -not -name '*_mocks.go' | xargs goimports -w -local github.com/forbole/callisto
.PHONY: format

clean:
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
# BDJuno
[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/forbole/bdjuno/Tests)](https://github.com/forbole/bdjuno/actions?query=workflow%3ATests)
[![Go Report Card](https://goreportcard.com/badge/github.com/forbole/bdjuno)](https://goreportcard.com/report/github.com/forbole/bdjuno)
![Codecov branch](https://img.shields.io/codecov/c/github/forbole/bdjuno/cosmos/v0.40.x)
# Callisto
[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/forbole/callisto/Tests)](https://github.com/forbole/callisto/actions?query=workflow%3ATests)
[![Go Report Card](https://goreportcard.com/badge/github.com/forbole/callisto)](https://goreportcard.com/report/github.com/forbole/callisto)
![Codecov branch](https://img.shields.io/codecov/c/github/forbole/callisto/cosmos/v0.40.x)

BDJuno (shorthand for BigDipper Juno) is the [Juno](https://github.com/forbole/juno) implementation
for [BigDipper](https://github.com/forbole/big-dipper).
Callisto (shorthand for BigDipper Juno) is the [Juno](https://github.com/forbole/juno) implementation
for [Big Dipper](https://github.com/forbole/big-dipper).

It extends the custom Juno behavior by adding different handlers and custom operations to make it easier for BigDipper
It extends the custom Juno behavior by adding different handlers and custom operations to make it easier for Big Dipper
showing the data inside the UI.

All the chains' data that are queried from the RPC and gRPC endpoints are stored inside
a [PostgreSQL](https://www.postgresql.org/) database on top of which [GraphQL](https://graphql.org/) APIs can then be
created using [Hasura](https://hasura.io/).

## Usage
To know how to setup and run BDJuno, please refer to
To know how to setup and run Callisto, please refer to
the [docs website](https://docs.bigdipper.live/cosmos-based/parser/overview/).

## Testing
Expand Down
6 changes: 3 additions & 3 deletions Requirements.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Requirements of BDjuno
The BDjuno is working as a backend for Big Dipper. The followings are the features currently supported in Big Dipper in the backend which BDjuno should adapt.
# Requirements of Callisto
The Callisto is working as a backend for Big Dipper. The followings are the features currently supported in Big Dipper in the backend which Callisto should adapt.

## On every block
### Done by Juno by default
- [x] Parsing all blocks
- [x] Parsing all transactions
- [x] Store validator set of the block

### Custom BDJuno implementations
### Custom Callisto implementations
- [x] Update missed block records
- [x] Read the latest consensus state
- [x] [x/auth] Store vesting accounts and vesting periods details
Expand Down
22 changes: 11 additions & 11 deletions cmd/bdjuno/main.go → cmd/callisto/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@ import (
"github.com/cheqd/cheqd-node/app"

"github.com/cosmos/cosmos-sdk/types/module"
"github.com/forbole/juno/v4/cmd"
initcmd "github.com/forbole/juno/v4/cmd/init"
parsetypes "github.com/forbole/juno/v4/cmd/parse/types"
startcmd "github.com/forbole/juno/v4/cmd/start"
"github.com/forbole/juno/v4/modules/messages"
"github.com/forbole/juno/v5/cmd"
initcmd "github.com/forbole/juno/v5/cmd/init"
parsetypes "github.com/forbole/juno/v5/cmd/parse/types"
startcmd "github.com/forbole/juno/v5/cmd/start"
"github.com/forbole/juno/v5/modules/messages"

migratecmd "github.com/forbole/bdjuno/v4/cmd/migrate"
parsecmd "github.com/forbole/bdjuno/v4/cmd/parse"
migratecmd "github.com/forbole/callisto/v4/cmd/migrate"
parsecmd "github.com/forbole/callisto/v4/cmd/parse"

"github.com/forbole/bdjuno/v4/types/config"
"github.com/forbole/callisto/v4/types/config"

"github.com/forbole/bdjuno/v4/database"
"github.com/forbole/bdjuno/v4/modules"
"github.com/forbole/callisto/v4/database"
"github.com/forbole/callisto/v4/modules"
)

func main() {
Expand All @@ -28,7 +28,7 @@ func main() {
WithEncodingConfigBuilder(config.MakeEncodingConfig(getBasicManagers())).
WithRegistrar(modules.NewRegistrar(getAddressesParser()))

cfg := cmd.NewConfig("bdjuno").
cfg := cmd.NewConfig("callisto").
WithInitConfig(initCfg).
WithParseConfig(parseCfg)

Expand Down
6 changes: 3 additions & 3 deletions cmd/migrate/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import (
"fmt"
"os"

parsecmdtypes "github.com/forbole/juno/v4/cmd/parse/types"
parsecmdtypes "github.com/forbole/juno/v5/cmd/parse/types"
"github.com/spf13/cobra"

v3 "github.com/forbole/bdjuno/v4/cmd/migrate/v3"
v5 "github.com/forbole/bdjuno/v4/cmd/migrate/v5"
v3 "github.com/forbole/callisto/v4/cmd/migrate/v3"
v5 "github.com/forbole/callisto/v4/cmd/migrate/v5"
)

type Migrator func(parseCfg *parsecmdtypes.Config) error
Expand Down
8 changes: 4 additions & 4 deletions cmd/migrate/v3/migrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ import (
"fmt"
"os"

"github.com/forbole/bdjuno/v4/modules/actions"
"github.com/forbole/callisto/v4/modules/actions"

parsecmdtypes "github.com/forbole/juno/v4/cmd/parse/types"
parsecmdtypes "github.com/forbole/juno/v5/cmd/parse/types"

"gopkg.in/yaml.v3"

junov4 "github.com/forbole/juno/v4/cmd/migrate/v4"
"github.com/forbole/juno/v4/types/config"
junov4 "github.com/forbole/juno/v5/cmd/migrate/v4"
"github.com/forbole/juno/v5/types/config"
)

// RunMigration runs the migrations from v2 to v3
Expand Down
4 changes: 2 additions & 2 deletions cmd/migrate/v3/types.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package v3

import (
v3 "github.com/forbole/juno/v4/cmd/migrate/v3"
v3 "github.com/forbole/juno/v5/cmd/migrate/v3"

"github.com/forbole/bdjuno/v4/modules/actions"
"github.com/forbole/callisto/v4/modules/actions"
)

type Config struct {
Expand Down
2 changes: 1 addition & 1 deletion cmd/migrate/v3/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"os"
"path"

"github.com/forbole/juno/v4/types/config"
"github.com/forbole/juno/v5/types/config"
"gopkg.in/yaml.v3"
)

Expand Down
12 changes: 6 additions & 6 deletions cmd/migrate/v5/migrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ package v5
import (
"fmt"

v5db "github.com/forbole/bdjuno/v4/database/migrate/v5"
parse "github.com/forbole/juno/v4/cmd/parse/types"
"github.com/forbole/juno/v4/database"
"github.com/forbole/juno/v4/database/postgresql"
"github.com/forbole/juno/v4/types/config"
v5db "github.com/forbole/callisto/v4/database/migrate/v5"
parse "github.com/forbole/juno/v5/cmd/parse/types"
"github.com/forbole/juno/v5/database"
"github.com/forbole/juno/v5/database/postgresql"
"github.com/forbole/juno/v5/types/config"
)

// RunMigration runs the migrations to v5
Expand All @@ -31,7 +31,7 @@ func migrateDb(cfg config.Config, parseConfig *parse.Config) error {
encodingConfig := parseConfig.GetEncodingConfigBuilder()()

// Get the db
databaseCtx := database.NewContext(cfg.Database, &encodingConfig, parseConfig.GetLogger())
databaseCtx := database.NewContext(cfg.Database, encodingConfig, parseConfig.GetLogger())
db, err := postgresql.Builder(databaseCtx)
if err != nil {
return fmt.Errorf("error while building the db: %s", err)
Expand Down
2 changes: 1 addition & 1 deletion cmd/migrate/v5/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"os"
"path"

"github.com/forbole/juno/v4/types/config"
"github.com/forbole/juno/v5/types/config"
"gopkg.in/yaml.v3"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/parse/auth/cmd.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package auth

import (
parsecmdtypes "github.com/forbole/juno/v4/cmd/parse/types"
parsecmdtypes "github.com/forbole/juno/v5/cmd/parse/types"
"github.com/spf13/cobra"
)

Expand Down
10 changes: 5 additions & 5 deletions cmd/parse/auth/vesting.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import (
"encoding/json"
"fmt"

parsecmdtypes "github.com/forbole/juno/v4/cmd/parse/types"
"github.com/forbole/juno/v4/types/config"
parsecmdtypes "github.com/forbole/juno/v5/cmd/parse/types"
"github.com/forbole/juno/v5/types/config"
"github.com/spf13/cobra"

"github.com/forbole/bdjuno/v4/database"
authutils "github.com/forbole/bdjuno/v4/modules/auth"
"github.com/forbole/bdjuno/v4/utils"
"github.com/forbole/callisto/v4/database"
authutils "github.com/forbole/callisto/v4/modules/auth"
"github.com/forbole/callisto/v4/utils"
)

// vestingCmd returns a Cobra command that allows to fix the vesting data for the accounts
Expand Down
2 changes: 1 addition & 1 deletion cmd/parse/bank/cmd.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package bank

import (
parsecmdtypes "github.com/forbole/juno/v4/cmd/parse/types"
parsecmdtypes "github.com/forbole/juno/v5/cmd/parse/types"
"github.com/spf13/cobra"
)

Expand Down
Loading

0 comments on commit 42dec2e

Please sign in to comment.