Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenAPI for application management #184

Open
wants to merge 34 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
3200cec
refactor: remove unnecessary Rust code
gligneul Apr 4, 2024
6f072cf
refactor: simplify CI workflows
gligneul Apr 9, 2024
6f5024f
chore: remove server-manager
gligneul Apr 10, 2024
36e13a8
feat: bump contracts to 2.0-rc.2
gligneul Apr 10, 2024
0be530f
fix(claimer): parse iconsensus address
gligneul May 9, 2024
819d854
fix(test): remove config for host mode
marcelstanley Apr 12, 2024
c8239bf
chore(test): run end-to-end tests via make
marcelstanley Apr 12, 2024
ab0dc62
chore: Bump Rust to 1.78.0
fmoura May 3, 2024
a9d9a87
feat: Add CI Custom Image
fmoura May 9, 2024
c719311
feat: Add --no-mining opt to Devnet
fmoura May 20, 2024
60765d9
feat(graphql): add postraphile to supervisor
GMKrieger May 3, 2024
b0929b1
refactor: extract linewriter to package
renan061 May 21, 2024
b6cb7b0
chore: fix typos
marcelstanley May 20, 2024
9a26ce6
feat: normalize bool config parameters
marcelstanley Jun 12, 2024
be7d307
fix: stop end-to-end testing
renan061 Jun 3, 2024
42b4747
chore: update machine version and devnet addresses
renan061 Jun 6, 2024
86d196d
feat: update the Dockerfile with emulator dependencies
renan061 Jun 6, 2024
acd8c26
fix: update postgraphile command and lock version
GMKrieger Jun 14, 2024
d60173a
fix: adjust boolean env vars after normalization
marcelstanley Jun 13, 2024
e81cd08
chore: fix file format
marcelstanley Jul 11, 2024
00d84ea
feat(data): add base repository migrations
GMKrieger Jul 8, 2024
fbbce1b
feat(node): update node models
GMKrieger Jul 8, 2024
e6b03ec
feat(data): add base repository functions
GMKrieger Jul 9, 2024
58903f4
feat(data): add base repository tests
GMKrieger Jul 9, 2024
6406487
feat(data): add validator repository functions
GMKrieger Jul 9, 2024
0d22e9c
feat(data): add validator repository tests
GMKrieger Jul 9, 2024
ae90381
feat(data): add input reader repository functions
GMKrieger Jul 9, 2024
66ed1db
feat(data): add input reader repository tests
GMKrieger Jul 9, 2024
aa762a3
feat(node): add run migrations to node startup
GMKrieger Jul 9, 2024
1b24a6e
feat(data): add postgraphile views
GMKrieger Jul 9, 2024
6510ffe
fix(tests): update port usage for testcontainers
fmoura Jul 11, 2024
841a401
ci: disable reaper to avoid failure on testcontainers
fmoura Jul 11, 2024
eddf0a0
fix(tests): mine blocks while adding inputs
fmoura Jul 11, 2024
0f9100b
feat: openapi for application management
tuler Dec 6, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 2 additions & 4 deletions .github/license-check/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@
{
"include": ["**/*.go", "**/*.rs"],
"exclude": [
"offchain/grpc-interfaces/**",
"offchain/target/**",
"offchain/data/src/schema.rs",
"pkg/contracts/*.go",
"cmd/authority-claimer/target/**",
"pkg/contracts/**",
"pkg/readerclient/generated.go",
"pkg/inspectclient/generated.go",
"rollups-contracts/**"
Expand Down
154 changes: 130 additions & 24 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,44 @@ permissions:
contents: write

jobs:
test:
do-basic-checks:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}

- name: Check conventional commit
uses: cocogitto/cocogitto-action@v3
id: conventional_commit_check
with:
check-latest-tag-only: true

- name: Check license header
uses: viperproject/check-license-header@v2
with:
path: ./
config: .github/license-check/config.json

- name: Check auto generated files
run: make check-generate

- name: Lint Markdown docs
uses: DavidAnson/markdownlint-cli2-action@v16
with:
globs: |
*.md
docs/*.md

test-rust:
runs-on: ubuntu-22.04
env:
RUSTFLAGS: -D warnings -C debuginfo=0
defaults:
run:
working-directory: offchain
working-directory: cmd/authority-claimer
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -40,26 +71,25 @@ jobs:
./docker-bake.override.hcl
./docker-bake.platforms.hcl
targets: |
rollups-node-devnet
rollups-node-snapshot
project: ${{ vars.DEPOT_PROJECT }}
workdir: build
load: true

- name: 📦 Install protoc
run: sudo apt update && sudo apt install -y protobuf-compiler libprotobuf-dev

- uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
offchain/target/
./cmd/authority-claimer/target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-

- name: Update Rust
run: rustup update

- name: Install cargo sweep
run: cargo install cargo-sweep
continue-on-error: true
Expand All @@ -68,9 +98,22 @@ jobs:
run: cargo install cargo-cache
continue-on-error: true

- name: Install cargo-machete
run: cargo install cargo-machete
continue-on-error: true

- name: Set sweep timestamp
run: cargo sweep -s

- name: Analyze dependencies
run: cargo machete .

- name: Check code format
run: cargo fmt --all -- --check

- name: Run linter
run: cargo clippy -- -A clippy::module_inception -A clippy::mixed_attributes_style

- name: Build binaries and tests
run: cargo build --all-targets

Expand All @@ -83,34 +126,101 @@ jobs:
- name: Run tests
run: cargo test

- name: Generate GraphQL schema
run: ./target/debug/generate-schema
build-ci-base:
runs-on: ubuntu-22.04
outputs:
output: ${{ steps.export_tag.outputs.image_tag }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Docker meta
id: docker_meta
uses: docker/metadata-action@v5
with:
images: |
name=ghcr.io/cartesi/rollups-node-ci
tags: |
type=semver,pattern={{version}}
type=ref,event=branch
type=ref,event=pr

- name: Upload GraphQL schema
uses: actions/upload-artifact@v4
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
name: graphql-schema
path: offchain/schema.graphql
if-no-files-found: error
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- uses: depot/setup-action@v1
- name: Build and push docker image
id: docker_build
uses: depot/bake-action@v1
with:
files: |
./docker-bake.hcl
${{ steps.docker_meta.outputs.bake-file }}
./docker-bake.platforms.hcl
targets: rollups-node-ci
push: true
project: ${{ vars.DEPOT_PROJECT }}
workdir: build

- name: Export Image Tag
id : export_tag
run : echo "image_tag=${{steps.docker_meta.outputs.version}}" >> "$GITHUB_OUTPUT"

test-go:
runs-on: ubuntu-22.04
container:
image: ghcr.io/cartesi/rollups-node-ci:${{needs.build-ci-base.outputs.output}}
needs:
- build-ci-base
steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- uses: depot/setup-action@v1
- name: Build dependency images
uses: depot/bake-action@v1
with:
files: |
./docker-bake.hcl
./docker-bake.override.hcl
./docker-bake.platforms.hcl
targets: |
rollups-node-devnet
rollups-node-snapshot
project: ${{ vars.DEPOT_PROJECT }}
workdir: build
load: true

- name: Install Go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'

- name: Fix VCS Go Linter Issue
run : git config --global --add safe.directory /__w/rollups-node/rollups-node

- name: Run Go Linter
uses: golangci/golangci-lint-action@v6
with:
version: v1.58.2

- name: Run Go tests
working-directory: ${{ github.workspace }}
env:
TESTCONTAINERS_RYUK_DISABLED: true
run: go test ./...

build_docker:
build-docker:
runs-on: ubuntu-22.04
needs:
- test
- do-basic-checks
- test-rust
- test-go
steps:
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -158,8 +268,9 @@ jobs:
workdir: build

release:
needs: [test, build_docker]
runs-on: ubuntu-22.04
needs:
- build-docker
if: startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/checkout@v4
Expand All @@ -169,14 +280,9 @@ jobs:
- name: Trim CHANGELOG.md
run: sed -e '0,/^##[^#]/d' -e '/^##[^#]/,$d' -i CHANGELOG.md

- name: Download GraphQL schema
uses: actions/download-artifact@v4
with:
name: graphql-schema

- name: Publish Github release
uses: softprops/action-gh-release@v2
with:
prerelease: true
body_path: CHANGELOG.md
files: schema.graphql
files: api/graphql/reader.graphql
1 change: 1 addition & 0 deletions .github/workflows/clean-up-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
matrix:
image:
- rollups-node
- rollups-node-ci
steps:
- uses: vlaurin/[email protected]
with:
Expand Down
44 changes: 0 additions & 44 deletions .github/workflows/code-quality.yml

This file was deleted.

46 changes: 0 additions & 46 deletions .github/workflows/rust-code-quality.yml

This file was deleted.

3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[submodule "grpc-interfaces"]
path = offchain/grpc-interfaces/grpc-interfaces
url = ../grpc-interfaces.git
[submodule "rollups-contracts"]
path = rollups-contracts
url = https://github.com/cartesi/rollups-contracts
Expand Down
21 changes: 19 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,23 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Added

- Added PostGraphile service

### Changed

- Bumped Rollups Contracts to 2.0
- Normalized boolean configuration parameters (`CARTESI_LEGACY_BLOCKCHAIN_ENABLED`, `CARTESI_FEATURE_CLAIMER_ENABLED`, `CARTESI_FEATURE_MACHINE_HASH_CHECK_ENABLED`, `CARTESI_EXPERIMENTAL_SERVER_MANAGER_LOG_BYPASS_ENABLED` and `CARTESI_LOG_PRETTY_ENABLED`) and adjusted their logic accordingly

### Removed

- Removed `advance-runner`, `dispatcher`, `graphql-server`, `host-runner`, `indexer`, `inspect-server`, and `state-server` Rust services
- Removed `server-manager` from rollups-node Docker image
- Removed support to host mode

## [1.5.0] 2024-07-08

### Added
Expand All @@ -32,13 +49,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Added verification to ensure `CARTESI_BLOCKCHAIN_ID` matches the id returned from the Ethereum node
- Added verification to ensure the Cartesi Machine snapshot hash matches the template hash from the CartesiDApp contract
- Added support for `CARTESI_AUTH_PRIVATE_KEY` and `CARTESI_AUTH_PRIVATE_KEY_FILE`
- Added `CARTESI_AUTH_KIND` environment variable to select the blockchain authetication method
- Added `CARTESI_AUTH_KIND` environment variable to select the blockchain authentication method
- Added structured logging with slog. Colored logs can now be enabled with `CARTESI_LOG_PRETTY` environment variable

### Changed

- Changed `CARTESI_BLOCKCHAIN_ID` type from int to uint64
- Changed `CARTESI_CONTRACTS_APPLICATION_DEPLOYMENT_BLOCK_NUMBER` type from string to int64.
- Changed `CARTESI_CONTRACTS_APPLICATION_DEPLOYMENT_BLOCK_NUMBER` type from string to int64
- Changed `CARTESI_LOG_LEVEL` option `warning` to `warn`
- Bumped Cartesi Emulator SDK to 0.17.1
- Bumped Server Manager to 0.9.1
Expand Down
Loading
Loading