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

feature/refactor ui #1205

Merged
merged 27 commits into from
Dec 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
a8a73c1
fix: correct HTTP error handling in gateway
prnk28 Dec 20, 2024
53be11b
refactor: migrate database and ORM to internal modules
prnk28 Dec 21, 2024
1b34222
feat: introduce taskfile build system for improved workflow management
prnk28 Dec 21, 2024
a4dc60b
refactor: update taskfiles to use relative paths
prnk28 Dec 21, 2024
bd24d2d
feat: add profile status field
prnk28 Dec 21, 2024
a493e85
refactor: move rendering logic to context package
prnk28 Dec 21, 2024
3c3599c
fix: improve error handling in credentials retrieval
prnk28 Dec 21, 2024
8beddc1
refactor: optimize HTTP request handling in Wasm environment
prnk28 Dec 21, 2024
d86af22
refactor: refactor config loading in motr command
prnk28 Dec 21, 2024
95243a8
chore: add process-compose for service management
prnk28 Dec 21, 2024
a19715c
chore: remove default task and update gum format command
prnk28 Dec 21, 2024
6b4a8c8
fix: update project dependencies
prnk28 Dec 21, 2024
358d9ce
refactor: improve code readability and maintainability
prnk28 Dec 21, 2024
e3aff36
refactor: consolidate error handling components
prnk28 Dec 21, 2024
a93a292
refactor: update index handler to use new context package
prnk28 Dec 22, 2024
e7590b0
refactor: consolidate database scripts and move to deploy directory
prnk28 Dec 22, 2024
c14bc36
feat: Update flake.nix with development tools and environment configu…
prnk28 Dec 22, 2024
98d1213
fix: ignore flake.lock file
prnk28 Dec 22, 2024
1397c28
refactor: migrate build process to use taskfiles for improved modular…
prnk28 Dec 22, 2024
cb312bf
refactor: improve GatewayContext and reorganize handlers
prnk28 Dec 22, 2024
8da8d1d
refactor: Remove unused profile creation functions
prnk28 Dec 22, 2024
0181878
(chore): templ generation
prnk28 Dec 22, 2024
d13bb10
test: add test file for vaults.go
prnk28 Dec 22, 2024
deae534
maintenance: remove defunct Discord server link
prnk28 Dec 22, 2024
c2028d7
docs: update checks workflow documentation
prnk28 Dec 22, 2024
d5e46fa
test: remove obsolete vaults test file
prnk28 Dec 22, 2024
51be29f
refactor: move version bumping logic to release workflow
prnk28 Dec 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 0 additions & 19 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ name: Run All Checks

on:
pull_request:
types: [opened, edited]
merge_group:

jobs:
Expand Down Expand Up @@ -132,21 +131,3 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

bump-version:
if: github.event_name == 'merge_group'
runs-on: ubuntu-latest
name: Bump Current Version
needs: [validate-release, test-cover, test-race]
outputs:
new_tag: ${{ steps.bump.outputs.new_tag }}
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0
- name: Create bump and changelog
id: bump
uses: commitizen-tools/commitizen-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
increment: "PATCH"
5 changes: 2 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
name: Publish Versioned Assets
on:
push:
branches:
- develop
- main
tags:
- v*
paths:
- "docs/**"
- "proto/**"
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: Versioned Release

on:
pull_request:
types: [closed]
push:
tags:
- v*
Expand All @@ -9,6 +11,25 @@ permissions:
contents: write

jobs:
bump-version:
if: github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'develop'
runs-on: ubuntu-latest
name: Bump Current Version
needs: [validate-release, test-cover, test-race]
outputs:
new_tag: ${{ steps.bump.outputs.new_tag }}
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0
- name: Create bump and changelog
id: bump
uses: commitizen-tools/commitizen-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
increment: "PATCH"

new-release:
name: Run GoReleaser on New Tag
if: startsWith(github.ref, 'refs/tags/')
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ override.tf.json

.terraformrc
terraform.rc

flake.lock

# Misc
.DS_Store
Expand Down Expand Up @@ -100,6 +100,7 @@ mprocs.yaml
mprocs.log
tools-stamp
sonr.log
deploy/conf

interchaintest-downloader
.haptic
25 changes: 25 additions & 0 deletions .taskfiles/Hway.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
version: "3"

vars:
GOPATH:
sh: go env GOPATH
BIN_DIR: "{{.GOPATH}}/bin"
BINARY: "{{.BIN_DIR}}/hway"
OS:
sh: uname -s
ARCH:
sh: uname -m

tasks:
build:
desc: Build the hway binary
silent: true
cmds:
- gum spin --spinner dot --title "Build Hway Single Target ({{.OS}}/{{.ARCH}})..." -- goreleaser build --snapshot --clean --single-target --id hway -o {{.BIN_DIR}}/hway

start:
desc: Start the hway daemon
silent: true
deps: [build]
cmds:
- "{{.BINARY}}"
37 changes: 37 additions & 0 deletions .taskfiles/IPFS.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
version: "3"

vars:
ROOT:
sh: git rev-parse --show-toplevel
tasks:
init:
desc: Setup ipfs with Cloudflare
silent: true
vars:
PEERS: |
'[
{"ID": "QmcFf2FH3CEgTNHeMRGhN7HNHU1EXAxoEk6EFuSyXCsvRE", "Addrs": ["/dnsaddr/node-1.ingress.cloudflare-ipfs.com"]},
{"ID": "QmcFmLd5ySfk2WZuJ1mfSWLDjdmHZq7rSAua4GoeSQfs1z", "Addrs": ["/dnsaddr/node-2.ingress.cloudflare-ipfs.com"]},
{"ID": "QmcfFmzSDVbwexQ9Au2pt5YEXHK5xajwgaU6PpkbLWerMa", "Addrs": ["/dnsaddr/node-3.ingress.cloudflare-ipfs.com"]},
{"ID": "QmcfJeB3Js1FG7T8YaZATEiaHqNKVdQfybYYkbT1knUswx", "Addrs": ["/dnsaddr/node-4.ingress.cloudflare-ipfs.com"]},
{"ID": "QmcfVvzK4tMdFmpJjEKDUoqRgP4W9FnmJoziYX5GXJJ8eZ", "Addrs": ["/dnsaddr/node-5.ingress.cloudflare-ipfs.com"]},
{"ID": "QmcfZD3VKrUxyP9BbyUnZDpbqDnT7cQ4WjPP8TRLXaoE7G", "Addrs": ["/dnsaddr/node-6.ingress.cloudflare-ipfs.com"]},
{"ID": "QmcfZP2LuW4jxviTeG8fi28qjnZScACb8PEgHAc17ZEri3", "Addrs": ["/dnsaddr/node-7.ingress.cloudflare-ipfs.com"]},
{"ID": "QmcfgsJsMtx6qJb74akCw1M24X1zFwgGo11h1cuhwQjtJP", "Addrs": ["/dnsaddr/node-8.ingress.cloudflare-ipfs.com"]},
{"ID": "Qmcfr2FC7pFzJbTSDfYaSy1J8Uuy8ccGLeLyqJCKJvTHMi", "Addrs": ["/dnsaddr/node-9.ingress.cloudflare-ipfs.com"]},
{"ID": "QmcfR3V5YAtHBzxVACWCzXTt26SyEkxdwhGJ6875A8BuWx", "Addrs": ["/dnsaddr/node-10.ingress.cloudflare-ipfs.com"]},
{"ID": "Qmcfuo1TM9uUiJp6dTbm915Rf1aTqm3a3dnmCdDQLHgvL5", "Addrs": ["/dnsaddr/node-11.ingress.cloudflare-ipfs.com"]},
{"ID": "QmcfV2sg9zaq7UUHVCGuSvT2M2rnLBAPsiE79vVyK3Cuev", "Addrs": ["/dnsaddr/node-12.ingress.cloudflare-ipfs.com"]}
]'
cmds:
- rm -rf ~/.ipfs
- ipfs init
- ipfs config --json Peering.Peers {{.PEERS}}
- ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '["*"]'

start:
desc: Start the ipfs daemon
silent: true
deps: [init]
cmds:
- ipfs daemon
23 changes: 23 additions & 0 deletions .taskfiles/Postgres.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
version: "3"

vars:
GOPATH:
sh: go env GOPATH
BIN_DIR: "{{.GOPATH}}/bin"
OS:
sh: uname -s
ARCH:
sh: uname -m

tasks:
init:
desc: Initialize postgresql
silent: true
dir: deploy
cmds:
- cmd: sudo -u postgres psql -f deploy/apps/chainindex/seed.sql
platforms:
- linux
- cmd: sudo -u postgres psql -d chainindex -f deploy/apps/chainindex/schema.sql
platforms:
- linux
48 changes: 48 additions & 0 deletions .taskfiles/Sonrd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
version: "3"

vars:
BINARY: sonrd
BUILD_FLAGS: -mod=readonly -trimpath
BUILD_TAGS: netgo,ledger
COMMIT:
sh: git rev-parse HEAD
VERSION:
sh: git describe --tags --always
DOPPLER_TOKEN:
sh: skate get DOPPLER_NETWORK

tasks:
build:
desc: Build the sonrd binary
cmds:
- >
go build
{{.BUILD_FLAGS}}
-tags "{{.BUILD_TAGS}}"
-ldflags "
-X github.com/cosmos/cosmos-sdk/version.Name=sonr
-X github.com/cosmos/cosmos-sdk/version.AppName=sonrd
-X github.com/cosmos/cosmos-sdk/version.Version={{.VERSION}}
-X github.com/cosmos/cosmos-sdk/version.Commit={{.COMMIT}}
-X github.com/cosmos/cosmos-sdk/version.BuildTags={{.BUILD_TAGS}}
"
-o ./build/{{.BINARY}}
./cmd/sonrd
env:
CGO_ENABLED: 1
GOARCH:
sh: go env GOARCH
GOOS:
sh: go env GOOS

install:
desc: Install sonrd
silent: true
cmds:
- gum spin --spinner dot --title "Installing sonr daemon..." -- make install

start:
desc: Start the sonr node
cmds:
- sh scripts/test_dop_node.sh

23 changes: 23 additions & 0 deletions .taskfiles/Synapse.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
version: "3"

vars:
ROOT:
sh: git rev-parse --show-toplevel

tasks:
init:
desc: Configure synapse homeserver with PKL
silent: true
cmds:
- pkl eval pkl/matrix.net/Homeserver.pkl -f yaml -o deploy/conf/synapse/homeserver.yaml
env:
MATRIX_CLIENT_NAME: sonr.id
MATRIX_SERVER_NAME: sonr.id
MATRIX_SERVER_URL: http://localhost:8008
MATRIX_SLIDING_SYNC_PROXY: http://localhost:8008
MATRIX_PSQL_CONN: postgresql://matrixhs_user:matrixhs_password123@localhost:5432/sonr
MATRIX_REGISTRATION_SHARED_SECRET: secret
MATRIX_ENABLE_RECATCHA: false
MATRIX_RECATCHA_PUBLIC_KEY: ""
MATRIX_RECATCHA_PRIVATE_KEY: ""
MATRIX_RECATCHA_BYPASS_SECRET: ""
12 changes: 12 additions & 0 deletions .taskfiles/TigerBeetle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: "3"

vars:
ROOT:
sh: git rev-parse --show-toplevel

tasks:
init:
desc: Configure tigerbeetle database
silent: true
cmds:
- pkl eval pkl/matrix.net/Homeserver.pkl -f yaml -o deploy/conf/synapse/homeserver.yaml
37 changes: 0 additions & 37 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,40 +1,3 @@
FROM jetpackio/devbox:latest AS sonrvm

# Installing your devbox project
WORKDIR /code
USER root:root

RUN mkdir -p /code && chown ${DEVBOX_USER}:${DEVBOX_USER} /code

USER ${DEVBOX_USER}:${DEVBOX_USER}

COPY --chown=${DEVBOX_USER}:${DEVBOX_USER} devbox.json devbox.json
COPY --chown=${DEVBOX_USER}:${DEVBOX_USER} process-compose.yaml process-compose.yaml

RUN devbox run -- echo "Installed Packages."

ENTRYPOINT ["devbox", "run"]

# --------------------------------------------------------
FROM jetpackio/devbox:latest AS sonr-runner

WORKDIR /code
USER root:root

RUN mkdir -p /code && chown ${DEVBOX_USER}:${DEVBOX_USER} /code

USER ${DEVBOX_USER}:${DEVBOX_USER}

COPY --chown=${DEVBOX_USER}:${DEVBOX_USER} devbox.json devbox.json
COPY --chown=${DEVBOX_USER}:${DEVBOX_USER} process-compose.yaml process-compose.yaml
COPY --chown=${DEVBOX_USER}:${DEVBOX_USER} . .

RUN devbox run -- echo "Installed Packages."

RUN git config --global --add safe.directory /code
ENTRYPOINT ["devbox", "run", "testnet"]

# --------------------------------------------------------
FROM golang:1.22-alpine AS go-builder

SHELL ["/bin/sh", "-ecuxo", "pipefail"]
Expand Down
Loading
Loading