From ef6b7487036e32715508cf700f5aef880e49c134 Mon Sep 17 00:00:00 2001 From: elliothllm <143621200+elliothllm@users.noreply.github.com> Date: Thu, 21 Mar 2024 15:18:20 +0000 Subject: [PATCH] CDU (#23) --- .github/workflows/CI-API.yml | 14 +++++----- Makefile | 8 +++--- README.md | 26 +++++++++---------- api/chains.yaml | 22 ---------------- {api => cdu}/.gitignore | 0 {api => cdu}/Dockerfile | 10 +++---- .../chains.example.yaml | 0 {api => cdu}/cmd/api/main.go | 2 +- {api => cdu}/cmd/root.go | 4 +-- {api => cdu}/cmd/serve.go | 2 +- {api => cdu}/config/config.go | 0 {api => cdu}/config/init.go | 0 {api => cdu}/config/scheme.go | 8 +++--- {api => cdu}/go.mod | 4 +-- {api => cdu}/go.sum | 6 ++--- {api => cdu}/internal/buckets/config.go | 0 {api => cdu}/internal/buckets/db/bolt/bolt.go | 2 +- .../internal/buckets/db/level/level.go | 2 +- {api => cdu}/internal/buckets/db/mdbx/mdbx.go | 4 +-- {api => cdu}/internal/buckets/handler.go | 4 +-- {api => cdu}/internal/buckets/service.go | 4 +-- {api => cdu}/internal/buckets/types.go | 0 .../chains/chain_services/block_service.go | 2 +- .../chains/chain_services/logs_service.go | 6 ++--- .../chains/chain_services/registry.go | 0 .../internal/chains/chain_services/runtime.go | 0 .../chains/chain_services/runtime_test.go | 0 .../chains/chain_services/zkevm_service.go | 4 +-- {api => cdu}/internal/chains/chains.go | 4 +-- {api => cdu}/internal/chains/handler.go | 2 +- {api => cdu}/internal/chains/service.go | 4 +-- {api => cdu}/internal/chains/types.go | 0 .../datastream/datastream/client/commands.go | 0 .../datastream/client/stream_client.go | 2 +- .../datastream/client/stream_client_test.go | 2 +- .../datastream/datastream/client/utils.go | 0 .../datastream/client/utils_test.go | 0 .../datastream/datastream/download.go | 4 +-- .../test_datastream_compare.go | 6 ++--- .../datastream/datastream/test/test.go | 8 +++--- .../datastream/datastream/test/utils/utils.go | 0 .../datastream/datastream/types/block.go | 0 .../datastream/datastream/types/block_test.go | 0 .../datastream/datastream/types/bookmark.go | 0 .../datastream/datastream/types/file.go | 0 .../datastream/datastream/types/file_test.go | 0 .../datastream/datastream/types/ger_update.go | 0 .../datastream/types/ger_update_test.go | 0 .../datastream/datastream/types/header.go | 0 .../datastream/types/header_test.go | 0 .../datastream/datastream/types/result.go | 0 .../datastream/types/result_test.go | 0 .../datastream/datastream/types/tx.go | 0 .../datastream/datastream/types/tx_test.go | 0 {api => cdu}/internal/datastream/handler.go | 2 +- {api => cdu}/internal/datastream/service.go | 0 {api => cdu}/internal/health/handler.go | 2 +- {api => cdu}/internal/jsonrpc/client.go | 0 {api => cdu}/internal/jsonrpc/config.go | 0 {api => cdu}/internal/jsonrpc/eth.go | 0 {api => cdu}/internal/jsonrpc/types.go | 0 {api => cdu}/internal/jsonrpc/zkevm.go | 0 {api => cdu}/internal/server/server.go | 6 ++--- {api => cdu}/internal/server/setup.go | 16 ++++++------ {api => cdu}/internal/tx/config.go | 0 {api => cdu}/internal/tx/handler.go | 2 +- {api => cdu}/internal/tx/models.go | 0 {api => cdu}/internal/tx/service.go | 0 {api => cdu}/internal/tx/tx.go | 0 {api => cdu}/internal/types/types.go | 2 +- {api => cdu}/internal/ws/handler.go | 0 {api => cdu}/internal/ws/service.go | 2 +- {api => cdu}/internal/ws/types.go | 0 {api => cdu}/pkg/atomics/bool.go | 0 {api => cdu}/pkg/hexadecimal/hexadecimal.go | 0 {api => cdu}/pkg/hexadecimal/hexdec_test.go | 0 {api => cdu}/pkg/utils/read-write.go | 0 {api => cdu}/pkg/utils/utils.go | 0 {api => cdu}/tests/rpc_eth__test.go | 2 +- {api => cdu}/tests/rpc_zkevm_test.go | 2 +- {api => cdu}/tests/tx_test.go | 2 +- docker-compose.yml | 8 +++--- frontend/nginx.conf | 4 +-- frontend/public/gateway-logo.svg | 4 --- .../src/app/{datacryp => dataview}/layout.tsx | 0 .../src/app/{datacryp => dataview}/page.tsx | 0 frontend/src/app/layout.tsx | 4 +-- frontend/src/components/nav.tsx | 17 ++++-------- frontend/src/components/sidebar.tsx | 22 +++++++++------- 89 files changed, 116 insertions(+), 147 deletions(-) delete mode 100644 api/chains.yaml rename {api => cdu}/.gitignore (100%) rename {api => cdu}/Dockerfile (73%) rename chains.example.yaml => cdu/chains.example.yaml (100%) rename {api => cdu}/cmd/api/main.go (51%) rename {api => cdu}/cmd/root.go (88%) rename {api => cdu}/cmd/serve.go (84%) rename {api => cdu}/config/config.go (100%) rename {api => cdu}/config/init.go (100%) rename {api => cdu}/config/scheme.go (76%) rename {api => cdu}/go.mod (97%) rename {api => cdu}/go.sum (98%) rename {api => cdu}/internal/buckets/config.go (100%) rename {api => cdu}/internal/buckets/db/bolt/bolt.go (97%) rename {api => cdu}/internal/buckets/db/level/level.go (95%) rename {api => cdu}/internal/buckets/db/mdbx/mdbx.go (97%) rename {api => cdu}/internal/buckets/handler.go (97%) rename {api => cdu}/internal/buckets/service.go (96%) rename {api => cdu}/internal/buckets/types.go (100%) rename {api => cdu}/internal/chains/chain_services/block_service.go (92%) rename {api => cdu}/internal/chains/chain_services/logs_service.go (96%) rename {api => cdu}/internal/chains/chain_services/registry.go (100%) rename {api => cdu}/internal/chains/chain_services/runtime.go (100%) rename {api => cdu}/internal/chains/chain_services/runtime_test.go (100%) rename {api => cdu}/internal/chains/chain_services/zkevm_service.go (94%) rename {api => cdu}/internal/chains/chains.go (92%) rename {api => cdu}/internal/chains/handler.go (96%) rename {api => cdu}/internal/chains/service.go (90%) rename {api => cdu}/internal/chains/types.go (100%) rename {api => cdu}/internal/datastream/datastream/client/commands.go (100%) rename {api => cdu}/internal/datastream/datastream/client/stream_client.go (99%) rename {api => cdu}/internal/datastream/datastream/client/stream_client_test.go (99%) rename {api => cdu}/internal/datastream/datastream/client/utils.go (100%) rename {api => cdu}/internal/datastream/datastream/client/utils_test.go (100%) rename {api => cdu}/internal/datastream/datastream/download.go (82%) rename {api => cdu}/internal/datastream/datastream/test/data_stream_compare/test_datastream_compare.go (91%) rename {api => cdu}/internal/datastream/datastream/test/test.go (93%) rename {api => cdu}/internal/datastream/datastream/test/utils/utils.go (100%) rename {api => cdu}/internal/datastream/datastream/types/block.go (100%) rename {api => cdu}/internal/datastream/datastream/types/block_test.go (100%) rename {api => cdu}/internal/datastream/datastream/types/bookmark.go (100%) rename {api => cdu}/internal/datastream/datastream/types/file.go (100%) rename {api => cdu}/internal/datastream/datastream/types/file_test.go (100%) rename {api => cdu}/internal/datastream/datastream/types/ger_update.go (100%) rename {api => cdu}/internal/datastream/datastream/types/ger_update_test.go (100%) rename {api => cdu}/internal/datastream/datastream/types/header.go (100%) rename {api => cdu}/internal/datastream/datastream/types/header_test.go (100%) rename {api => cdu}/internal/datastream/datastream/types/result.go (100%) rename {api => cdu}/internal/datastream/datastream/types/result_test.go (100%) rename {api => cdu}/internal/datastream/datastream/types/tx.go (100%) rename {api => cdu}/internal/datastream/datastream/types/tx_test.go (100%) rename {api => cdu}/internal/datastream/handler.go (91%) rename {api => cdu}/internal/datastream/service.go (100%) rename {api => cdu}/internal/health/handler.go (92%) rename {api => cdu}/internal/jsonrpc/client.go (100%) rename {api => cdu}/internal/jsonrpc/config.go (100%) rename {api => cdu}/internal/jsonrpc/eth.go (100%) rename {api => cdu}/internal/jsonrpc/types.go (100%) rename {api => cdu}/internal/jsonrpc/zkevm.go (100%) rename {api => cdu}/internal/server/server.go (90%) rename {api => cdu}/internal/server/setup.go (79%) rename {api => cdu}/internal/tx/config.go (100%) rename {api => cdu}/internal/tx/handler.go (93%) rename {api => cdu}/internal/tx/models.go (100%) rename {api => cdu}/internal/tx/service.go (100%) rename {api => cdu}/internal/tx/tx.go (100%) rename {api => cdu}/internal/types/types.go (94%) rename {api => cdu}/internal/ws/handler.go (100%) rename {api => cdu}/internal/ws/service.go (92%) rename {api => cdu}/internal/ws/types.go (100%) rename {api => cdu}/pkg/atomics/bool.go (100%) rename {api => cdu}/pkg/hexadecimal/hexadecimal.go (100%) rename {api => cdu}/pkg/hexadecimal/hexdec_test.go (100%) rename {api => cdu}/pkg/utils/read-write.go (100%) rename {api => cdu}/pkg/utils/utils.go (100%) rename {api => cdu}/tests/rpc_eth__test.go (94%) rename {api => cdu}/tests/rpc_zkevm_test.go (83%) rename {api => cdu}/tests/tx_test.go (89%) delete mode 100644 frontend/public/gateway-logo.svg rename frontend/src/app/{datacryp => dataview}/layout.tsx (100%) rename frontend/src/app/{datacryp => dataview}/page.tsx (100%) diff --git a/.github/workflows/CI-API.yml b/.github/workflows/CI-API.yml index 137ac7e..4393471 100644 --- a/.github/workflows/CI-API.yml +++ b/.github/workflows/CI-API.yml @@ -1,16 +1,16 @@ -name: CI-API +name: CI-CDU on: pull_request: branches: [ main ] paths: - - '.github/workflows/CI-API.yml' - - 'api/**' + - '.github/workflows/CI-CDU.yml' + - 'cdu/**' push: branches: [ main ] paths: - - '.github/workflows/CI-API.yml' - - 'api/**' + - '.github/workflows/CI-CDU.yml' + - 'cdu/**' workflow_dispatch: concurrency: @@ -23,7 +23,7 @@ jobs: runs-on: ubuntu-latest defaults: run: - working-directory: api + working-directory: cdu steps: - name: Checkout code @@ -39,7 +39,7 @@ jobs: with: version: latest args: --issues-exit-code=1 --timeout=10m - working-directory: api + working-directory: cdu - name: Build run: go build ./... diff --git a/Makefile b/Makefile index 1695c56..9428ae1 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,9 @@ default: all -all: cdk-envs +all: cdu -.PHONY: cdk-envs -cdk-envs: - @echo "Building APP" +.PHONY: cdu +cdu: + @echo "Building Chain Dev Utils..." @export DATA_DIR_HOST=$(data) ; \ docker compose build && docker compose up -d \ No newline at end of file diff --git a/README.md b/README.md index 8a18108..f5fb154 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,16 @@ -# cdk-envs +# Chain Development Utilities -![CI-API](https://github.com/RevittConsulting/cdk-envs/actions/workflows/CI-API.yml/badge.svg) -![CI-Frontend](https://github.com/RevittConsulting/cdk-envs/actions/workflows/CI-Frontend.yml/badge.svg) +![CI-CDU](https://github.com/RevittConsulting/chain-dev-utils/actions/workflows/CI-CDU.yml/badge.svg) +![CI-Frontend](https://github.com/RevittConsulting/chain-dev-utils/actions/workflows/CI-Frontend.yml/badge.svg) -cdk-envs is a dockerized Polygon CDK app with a set of tools for developers. +Chain dev utils is a dockerized app with a set of tools for developers working in the crypto ecosystem. The app currently has these services: - Chains RPC API - This takes all the chains in the chains.yaml file and displays them as a card on the front end. You can then run RPC calls to the chains, and it will update via websockets. -- Datacryp - - This is a DB viewer for the MDBX database files that are stored in the `/data` directory. You can view the data and search through it. +- MDBX Viewer + - This is a DB viewer for the MDBX database files that are stored in your mounted data directory. You can view the data and search through it. - TxSender [WIP] - This is a tool that will send a transaction on a chain. It will then display the transaction hash and the receipt. - Datastreamer [WIP] @@ -30,7 +30,7 @@ The app currently has these services: ## Config for chains -Set up a config file in the `/api` directory of the project called chains.yaml. There is an example of this config in the root. This must be put in the api folder. Add any amount of chains to this file. +Set up a config file in the `/cdu` directory of the project called chains.yaml. There is an example of this config in the root. This must be put in the cdu folder. Add any amount of chains to this file. ```yaml Chains: @@ -59,24 +59,24 @@ Chains: *** -## Datacryp +## MDBX Viewer -Datacryp is a frontend tool that allows you to perform various operations on the MDBX database files that are stored in the `/data` directory. You can view the data and search through it. +MDBX viewer is a frontend tool that allows you to perform various operations on the MDBX database files that are stored in your data directory that you can mount through the argument `data`. You can view the data and search through it. -To set up your data, you must create a `/data` directory in the root of the project. You can then add your MDBX files to this directory. The files must be named in the format `mdbx.dat`. You can create folders within that for the chain name for example `cardona/mdbx.dat`, then the frontend will display `cardona/mdbx.dat`. +To set up your data, you must build CDU with the argument `data=/Path/to/your/data`. *** ## Run the app ```bash -git clone https://github.com/RevittConsulting/cdk-envs +git clone https://github.com/RevittConsulting/chain-dev-utils ``` -To build and run the containers: +To build and run the containers with a path to your data directory: ```bash -make cdk-envs +make cdu data=/Path/to/your/data ``` *** \ No newline at end of file diff --git a/api/chains.yaml b/api/chains.yaml deleted file mode 100644 index 02208e8..0000000 --- a/api/chains.yaml +++ /dev/null @@ -1,22 +0,0 @@ -Chains: - Cardona: - NetworkName: "Polygon zkEVM Cardona Testnet" - - Etherscan: "https://sepolia.etherscan.io" - Blockscout: "https://eth-sepolia.blockscout.com" - Polygonscan: "https://cardona-zkevm.polygonscan.com" - CurrencySymbol: "ETH" - - L1ChainId: 11155111 - L1RpcUrl: "https://rpc.sepolia.org" - - L2ChainId: 2442 - L2RpcUrl: "https://rpc.cardona.zkevm-rpc.com" - L2DataStreamUrl: "datastream.cardona.zkevm-rpc.com:6900" - - RollupManagerAddress: "0x32d33D5137a7cFFb54c5Bf8371172bcEc5f310ff" - RollupAddress: "0xA13Ddb14437A8F34897131367ad3ca78416d6bCa" - - TopicsVerification: "0x9c72852172521097ba7e1482e6b44b351323df0155f97f4ea18fcec28e1f5966" - TopicsSequence: "0x3e54d0825ed78523037d00a81759237eb436ce774bd546993ee67a1b67b6e766" - diff --git a/api/.gitignore b/cdu/.gitignore similarity index 100% rename from api/.gitignore rename to cdu/.gitignore diff --git a/api/Dockerfile b/cdu/Dockerfile similarity index 73% rename from api/Dockerfile rename to cdu/Dockerfile index 54aa809..7b4fd73 100644 --- a/api/Dockerfile +++ b/cdu/Dockerfile @@ -3,8 +3,8 @@ FROM docker.io/library/golang:1.22.0-alpine3.19 AS base RUN apk --no-cache add build-base linux-headers git bash ca-certificates libstdc++ -RUN mkdir /api -WORKDIR /api +RUN mkdir /cdu +WORKDIR /cdu ADD go.mod . ADD go.sum . @@ -13,7 +13,7 @@ RUN go mod download FROM base as builder -WORKDIR /api +WORKDIR /cdu RUN ls @@ -26,8 +26,8 @@ RUN go build -o apiexecutable ./cmd/api FROM docker.io/library/alpine:3.19 -COPY --from=builder /api/apiexecutable /apiexecutable -COPY --from=builder /api/chains.yaml /chains.yaml +COPY --from=builder /cdu/apiexecutable /apiexecutable +COPY --from=builder /cdu/chains.yaml /chains.yaml EXPOSE 8080 diff --git a/chains.example.yaml b/cdu/chains.example.yaml similarity index 100% rename from chains.example.yaml rename to cdu/chains.example.yaml diff --git a/api/cmd/api/main.go b/cdu/cmd/api/main.go similarity index 51% rename from api/cmd/api/main.go rename to cdu/cmd/api/main.go index 70401b3..f39268d 100644 --- a/api/cmd/api/main.go +++ b/cdu/cmd/api/main.go @@ -1,7 +1,7 @@ package main import ( - "github.com/RevittConsulting/cdk-envs/cmd" + "github.com/RevittConsulting/chain-dev-utils/cmd" ) func main() { diff --git a/api/cmd/root.go b/cdu/cmd/root.go similarity index 88% rename from api/cmd/root.go rename to cdu/cmd/root.go index 7dffc5f..312720e 100644 --- a/api/cmd/root.go +++ b/cdu/cmd/root.go @@ -3,8 +3,8 @@ package cmd import ( "context" "fmt" - "github.com/RevittConsulting/cdk-envs/config" - "github.com/RevittConsulting/cdk-envs/internal/server" + "github.com/RevittConsulting/chain-dev-utils/config" + "github.com/RevittConsulting/chain-dev-utils/internal/server" "github.com/spf13/cobra" "os" "os/signal" diff --git a/api/cmd/serve.go b/cdu/cmd/serve.go similarity index 84% rename from api/cmd/serve.go rename to cdu/cmd/serve.go index af6bce9..affea8e 100644 --- a/api/cmd/serve.go +++ b/cdu/cmd/serve.go @@ -1,7 +1,7 @@ package cmd import ( - "github.com/RevittConsulting/cdk-envs/internal/server" + "github.com/RevittConsulting/chain-dev-utils/internal/server" "github.com/spf13/cobra" ) diff --git a/api/config/config.go b/cdu/config/config.go similarity index 100% rename from api/config/config.go rename to cdu/config/config.go diff --git a/api/config/init.go b/cdu/config/init.go similarity index 100% rename from api/config/init.go rename to cdu/config/init.go diff --git a/api/config/scheme.go b/cdu/config/scheme.go similarity index 76% rename from api/config/scheme.go rename to cdu/config/scheme.go index 98c37ba..4a2ce4c 100644 --- a/api/config/scheme.go +++ b/cdu/config/scheme.go @@ -1,10 +1,10 @@ package config import ( - "github.com/RevittConsulting/cdk-envs/internal/buckets" - "github.com/RevittConsulting/cdk-envs/internal/jsonrpc" - "github.com/RevittConsulting/cdk-envs/internal/tx" - "github.com/RevittConsulting/cdk-envs/internal/datastream" + "github.com/RevittConsulting/chain-dev-utils/internal/buckets" + "github.com/RevittConsulting/chain-dev-utils/internal/jsonrpc" + "github.com/RevittConsulting/chain-dev-utils/internal/tx" + "github.com/RevittConsulting/chain-dev-utils/internal/datastream" ) type Config struct { diff --git a/api/go.mod b/cdu/go.mod similarity index 97% rename from api/go.mod rename to cdu/go.mod index 6bf5044..a80f290 100644 --- a/api/go.mod +++ b/cdu/go.mod @@ -1,9 +1,10 @@ -module github.com/RevittConsulting/cdk-envs +module github.com/RevittConsulting/chain-dev-utils go 1.22.0 require ( github.com/0xPolygonHermez/zkevm-data-streamer v0.2.0 + github.com/RevittConsulting/logger v1.0.0 github.com/boltdb/bolt v1.3.1 github.com/erigontech/mdbx-go v0.37.1 github.com/ethereum/go-ethereum v1.13.14 @@ -27,7 +28,6 @@ require ( require ( github.com/Microsoft/go-winio v0.6.1 // indirect - github.com/RevittConsulting/logger v1.0.0 // indirect github.com/StackExchange/wmi v1.2.1 // indirect github.com/bits-and-blooms/bitset v1.10.0 // indirect github.com/btcsuite/btcd/btcec/v2 v2.2.0 // indirect diff --git a/api/go.sum b/cdu/go.sum similarity index 98% rename from api/go.sum rename to cdu/go.sum index c49c9c6..22ba6e7 100644 --- a/api/go.sum +++ b/cdu/go.sum @@ -243,12 +243,10 @@ github.com/urfave/cli/v2 v2.25.7 h1:VAzn5oq403l5pHjc4OhD54+XGO9cdKVL/7lDjF+iKUs= github.com/urfave/cli/v2 v2.25.7/go.mod h1:8qnjx1vcq5s2/wpsqoZFndg2CE5tNFyrTvS6SinrnYQ= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8= -go.uber.org/goleak v1.2.0 h1:xqgm/S+aQvhWFTtR0XK3Jvg7z8kGV8P4X14IzwN3Eqk= -go.uber.org/goleak v1.2.0/go.mod h1:XJYK+MuIchqpmGmUSAzotztawfKvYLUIgg7guXrwVUo= +go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= +go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.10.0 h1:S0h4aNzvfcFsC3dRF1jLoaov7oRaKqRGC/pUEJ2yvPQ= go.uber.org/multierr v1.10.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= diff --git a/api/internal/buckets/config.go b/cdu/internal/buckets/config.go similarity index 100% rename from api/internal/buckets/config.go rename to cdu/internal/buckets/config.go diff --git a/api/internal/buckets/db/bolt/bolt.go b/cdu/internal/buckets/db/bolt/bolt.go similarity index 97% rename from api/internal/buckets/db/bolt/bolt.go rename to cdu/internal/buckets/db/bolt/bolt.go index 7074ded..4007df4 100644 --- a/api/internal/buckets/db/bolt/bolt.go +++ b/cdu/internal/buckets/db/bolt/bolt.go @@ -2,7 +2,7 @@ package bolt import ( "fmt" - "github.com/RevittConsulting/cdk-envs/internal/types" + "github.com/RevittConsulting/chain-dev-utils/internal/types" "github.com/boltdb/bolt" "log" ) diff --git a/api/internal/buckets/db/level/level.go b/cdu/internal/buckets/db/level/level.go similarity index 95% rename from api/internal/buckets/db/level/level.go rename to cdu/internal/buckets/db/level/level.go index f01f78d..e8dbc33 100644 --- a/api/internal/buckets/db/level/level.go +++ b/cdu/internal/buckets/db/level/level.go @@ -1,7 +1,7 @@ package level import ( - "github.com/RevittConsulting/cdk-envs/internal/types" + "github.com/RevittConsulting/chain-dev-utils/internal/types" "github.com/syndtr/goleveldb/leveldb" "github.com/syndtr/goleveldb/leveldb/util" "log" diff --git a/api/internal/buckets/db/mdbx/mdbx.go b/cdu/internal/buckets/db/mdbx/mdbx.go similarity index 97% rename from api/internal/buckets/db/mdbx/mdbx.go rename to cdu/internal/buckets/db/mdbx/mdbx.go index 3f1d323..c1eaab9 100644 --- a/api/internal/buckets/db/mdbx/mdbx.go +++ b/cdu/internal/buckets/db/mdbx/mdbx.go @@ -3,8 +3,8 @@ package mdbx import ( "encoding/hex" "errors" - "github.com/RevittConsulting/cdk-envs/internal/types" - "github.com/RevittConsulting/cdk-envs/pkg/utils" + "github.com/RevittConsulting/chain-dev-utils/internal/types" + "github.com/RevittConsulting/chain-dev-utils/pkg/utils" "github.com/erigontech/mdbx-go/mdbx" "log" ) diff --git a/api/internal/buckets/handler.go b/cdu/internal/buckets/handler.go similarity index 97% rename from api/internal/buckets/handler.go rename to cdu/internal/buckets/handler.go index 1f949d6..aaacd63 100644 --- a/api/internal/buckets/handler.go +++ b/cdu/internal/buckets/handler.go @@ -1,8 +1,8 @@ package buckets import ( - "github.com/RevittConsulting/cdk-envs/internal/types" - "github.com/RevittConsulting/cdk-envs/pkg/utils" + "github.com/RevittConsulting/chain-dev-utils/internal/types" + "github.com/RevittConsulting/chain-dev-utils/pkg/utils" "github.com/RevittConsulting/logger" "github.com/go-chi/chi/v5" "net/http" diff --git a/api/internal/buckets/service.go b/cdu/internal/buckets/service.go similarity index 96% rename from api/internal/buckets/service.go rename to cdu/internal/buckets/service.go index f8922df..3efbb21 100644 --- a/api/internal/buckets/service.go +++ b/cdu/internal/buckets/service.go @@ -3,8 +3,8 @@ package buckets import ( "encoding/hex" "fmt" - "github.com/RevittConsulting/cdk-envs/internal/buckets/db/mdbx" - "github.com/RevittConsulting/cdk-envs/internal/types" + "github.com/RevittConsulting/chain-dev-utils/internal/buckets/db/mdbx" + "github.com/RevittConsulting/chain-dev-utils/internal/types" "io/fs" "math/big" "os" diff --git a/api/internal/buckets/types.go b/cdu/internal/buckets/types.go similarity index 100% rename from api/internal/buckets/types.go rename to cdu/internal/buckets/types.go diff --git a/api/internal/chains/chain_services/block_service.go b/cdu/internal/chains/chain_services/block_service.go similarity index 92% rename from api/internal/chains/chain_services/block_service.go rename to cdu/internal/chains/chain_services/block_service.go index 0be665d..78ec0c1 100644 --- a/api/internal/chains/chain_services/block_service.go +++ b/cdu/internal/chains/chain_services/block_service.go @@ -2,7 +2,7 @@ package chain_services import ( "fmt" - "github.com/RevittConsulting/cdk-envs/internal/jsonrpc" + "github.com/RevittConsulting/chain-dev-utils/internal/jsonrpc" "time" ) diff --git a/api/internal/chains/chain_services/logs_service.go b/cdu/internal/chains/chain_services/logs_service.go similarity index 96% rename from api/internal/chains/chain_services/logs_service.go rename to cdu/internal/chains/chain_services/logs_service.go index 662fa93..94dcf88 100644 --- a/api/internal/chains/chain_services/logs_service.go +++ b/cdu/internal/chains/chain_services/logs_service.go @@ -2,9 +2,9 @@ package chain_services import ( "fmt" - "github.com/RevittConsulting/cdk-envs/config" - "github.com/RevittConsulting/cdk-envs/internal/jsonrpc" - "github.com/RevittConsulting/cdk-envs/pkg/hexadecimal" + "github.com/RevittConsulting/chain-dev-utils/config" + "github.com/RevittConsulting/chain-dev-utils/internal/jsonrpc" + "github.com/RevittConsulting/chain-dev-utils/pkg/hexadecimal" "log" "math/big" "time" diff --git a/api/internal/chains/chain_services/registry.go b/cdu/internal/chains/chain_services/registry.go similarity index 100% rename from api/internal/chains/chain_services/registry.go rename to cdu/internal/chains/chain_services/registry.go diff --git a/api/internal/chains/chain_services/runtime.go b/cdu/internal/chains/chain_services/runtime.go similarity index 100% rename from api/internal/chains/chain_services/runtime.go rename to cdu/internal/chains/chain_services/runtime.go diff --git a/api/internal/chains/chain_services/runtime_test.go b/cdu/internal/chains/chain_services/runtime_test.go similarity index 100% rename from api/internal/chains/chain_services/runtime_test.go rename to cdu/internal/chains/chain_services/runtime_test.go diff --git a/api/internal/chains/chain_services/zkevm_service.go b/cdu/internal/chains/chain_services/zkevm_service.go similarity index 94% rename from api/internal/chains/chain_services/zkevm_service.go rename to cdu/internal/chains/chain_services/zkevm_service.go index e25a027..57b0f09 100644 --- a/api/internal/chains/chain_services/zkevm_service.go +++ b/cdu/internal/chains/chain_services/zkevm_service.go @@ -1,8 +1,8 @@ package chain_services import ( - "github.com/RevittConsulting/cdk-envs/config" - "github.com/RevittConsulting/cdk-envs/internal/jsonrpc" + "github.com/RevittConsulting/chain-dev-utils/config" + "github.com/RevittConsulting/chain-dev-utils/internal/jsonrpc" "log" "net" "time" diff --git a/api/internal/chains/chains.go b/cdu/internal/chains/chains.go similarity index 92% rename from api/internal/chains/chains.go rename to cdu/internal/chains/chains.go index ce79de7..216c6f8 100644 --- a/api/internal/chains/chains.go +++ b/cdu/internal/chains/chains.go @@ -1,8 +1,8 @@ package chains import ( - "github.com/RevittConsulting/cdk-envs/config" - "github.com/RevittConsulting/cdk-envs/internal/chains/chain_services" + "github.com/RevittConsulting/chain-dev-utils/config" + "github.com/RevittConsulting/chain-dev-utils/internal/chains/chain_services" "strconv" "time" ) diff --git a/api/internal/chains/handler.go b/cdu/internal/chains/handler.go similarity index 96% rename from api/internal/chains/handler.go rename to cdu/internal/chains/handler.go index 4336c7f..007e8ae 100644 --- a/api/internal/chains/handler.go +++ b/cdu/internal/chains/handler.go @@ -1,7 +1,7 @@ package chains import ( - "github.com/RevittConsulting/cdk-envs/pkg/utils" + "github.com/RevittConsulting/chain-dev-utils/pkg/utils" "github.com/RevittConsulting/logger" "github.com/go-chi/chi/v5" "net/http" diff --git a/api/internal/chains/service.go b/cdu/internal/chains/service.go similarity index 90% rename from api/internal/chains/service.go rename to cdu/internal/chains/service.go index 6df75e1..d9067fe 100644 --- a/api/internal/chains/service.go +++ b/cdu/internal/chains/service.go @@ -2,8 +2,8 @@ package chains import ( "context" - "github.com/RevittConsulting/cdk-envs/config" - "github.com/RevittConsulting/cdk-envs/internal/chains/chain_services" + "github.com/RevittConsulting/chain-dev-utils/config" + "github.com/RevittConsulting/chain-dev-utils/internal/chains/chain_services" ) type HttpService struct { diff --git a/api/internal/chains/types.go b/cdu/internal/chains/types.go similarity index 100% rename from api/internal/chains/types.go rename to cdu/internal/chains/types.go diff --git a/api/internal/datastream/datastream/client/commands.go b/cdu/internal/datastream/datastream/client/commands.go similarity index 100% rename from api/internal/datastream/datastream/client/commands.go rename to cdu/internal/datastream/datastream/client/commands.go diff --git a/api/internal/datastream/datastream/client/stream_client.go b/cdu/internal/datastream/datastream/client/stream_client.go similarity index 99% rename from api/internal/datastream/datastream/client/stream_client.go rename to cdu/internal/datastream/datastream/client/stream_client.go index 0cab908..2dc65d9 100644 --- a/api/internal/datastream/datastream/client/stream_client.go +++ b/cdu/internal/datastream/datastream/client/stream_client.go @@ -4,7 +4,7 @@ import ( "encoding/binary" "errors" "fmt" - "github.com/RevittConsulting/cdk-envs/internal/datastream/datastream/types" + "github.com/RevittConsulting/chain-dev-utils/internal/datastream/datastream/types" "net" "reflect" "sync/atomic" diff --git a/api/internal/datastream/datastream/client/stream_client_test.go b/cdu/internal/datastream/datastream/client/stream_client_test.go similarity index 99% rename from api/internal/datastream/datastream/client/stream_client_test.go rename to cdu/internal/datastream/datastream/client/stream_client_test.go index fa13553..d33b44f 100644 --- a/api/internal/datastream/datastream/client/stream_client_test.go +++ b/cdu/internal/datastream/datastream/client/stream_client_test.go @@ -7,7 +7,7 @@ import ( "net" "testing" - "github.com/RevittConsulting/cdk-envs/internal/datastream/datastream/types" + "github.com/RevittConsulting/chain-dev-utils/internal/datastream/datastream/types" "github.com/ledgerwatch/erigon-lib/common" "github.com/stretchr/testify/require" "gotest.tools/v3/assert" diff --git a/api/internal/datastream/datastream/client/utils.go b/cdu/internal/datastream/datastream/client/utils.go similarity index 100% rename from api/internal/datastream/datastream/client/utils.go rename to cdu/internal/datastream/datastream/client/utils.go diff --git a/api/internal/datastream/datastream/client/utils_test.go b/cdu/internal/datastream/datastream/client/utils_test.go similarity index 100% rename from api/internal/datastream/datastream/client/utils_test.go rename to cdu/internal/datastream/datastream/client/utils_test.go diff --git a/api/internal/datastream/datastream/download.go b/cdu/internal/datastream/datastream/download.go similarity index 82% rename from api/internal/datastream/datastream/download.go rename to cdu/internal/datastream/datastream/download.go index 5f7713b..11cedbe 100644 --- a/api/internal/datastream/datastream/download.go +++ b/cdu/internal/datastream/datastream/download.go @@ -1,9 +1,9 @@ package datastream import ( + "github.com/RevittConsulting/chain-dev-utils/internal/datastream/datastream/client" + "github.com/RevittConsulting/chain-dev-utils/internal/datastream/datastream/types" "github.com/pkg/errors" - "github.com/RevittConsulting/cdk-envs/internal/datastream/datastream/types" - "github.com/RevittConsulting/cdk-envs/internal/datastream/datastream/client" ) // Download a set amount of blocks from datastream server to channel diff --git a/api/internal/datastream/datastream/test/data_stream_compare/test_datastream_compare.go b/cdu/internal/datastream/datastream/test/data_stream_compare/test_datastream_compare.go similarity index 91% rename from api/internal/datastream/datastream/test/data_stream_compare/test_datastream_compare.go rename to cdu/internal/datastream/datastream/test/data_stream_compare/test_datastream_compare.go index 2473222..38b18e0 100644 --- a/api/internal/datastream/datastream/test/data_stream_compare/test_datastream_compare.go +++ b/cdu/internal/datastream/datastream/test/data_stream_compare/test_datastream_compare.go @@ -4,10 +4,10 @@ import ( "encoding/json" "flag" "fmt" - "reflect" - "github.com/RevittConsulting/cdk-envs/internal/datastream/datastream/client" - "github.com/RevittConsulting/cdk-envs/internal/datastream/datastream/types" + "github.com/RevittConsulting/chain-dev-utils/internal/datastream/datastream/client" + "github.com/RevittConsulting/chain-dev-utils/internal/datastream/datastream/types" "github.com/nsf/jsondiff" + "reflect" ) var ( diff --git a/api/internal/datastream/datastream/test/test.go b/cdu/internal/datastream/datastream/test/test.go similarity index 93% rename from api/internal/datastream/datastream/test/test.go rename to cdu/internal/datastream/datastream/test/test.go index 8154656..9b8f163 100644 --- a/api/internal/datastream/datastream/test/test.go +++ b/cdu/internal/datastream/datastream/test/test.go @@ -4,11 +4,11 @@ import ( "fmt" "strconv" - "github.com/ledgerwatch/erigon-lib/common" - "github.com/RevittConsulting/cdk-envs/internal/datastream/datastream/client" - "github.com/RevittConsulting/cdk-envs/internal/datastream/datastream/types" - "github.com/RevittConsulting/cdk-envs/internal/datastream/datastream/test/utils" "github.com/0xPolygonHermez/zkevm-data-streamer/log" + "github.com/RevittConsulting/chain-dev-utils/internal/datastream/datastream/client" + "github.com/RevittConsulting/chain-dev-utils/internal/datastream/datastream/test/utils" + "github.com/RevittConsulting/chain-dev-utils/internal/datastream/datastream/types" + "github.com/ledgerwatch/erigon-lib/common" ) const dataStreamUrl = "stream.zkevm-rpc.com:6900" diff --git a/api/internal/datastream/datastream/test/utils/utils.go b/cdu/internal/datastream/datastream/test/utils/utils.go similarity index 100% rename from api/internal/datastream/datastream/test/utils/utils.go rename to cdu/internal/datastream/datastream/test/utils/utils.go diff --git a/api/internal/datastream/datastream/types/block.go b/cdu/internal/datastream/datastream/types/block.go similarity index 100% rename from api/internal/datastream/datastream/types/block.go rename to cdu/internal/datastream/datastream/types/block.go diff --git a/api/internal/datastream/datastream/types/block_test.go b/cdu/internal/datastream/datastream/types/block_test.go similarity index 100% rename from api/internal/datastream/datastream/types/block_test.go rename to cdu/internal/datastream/datastream/types/block_test.go diff --git a/api/internal/datastream/datastream/types/bookmark.go b/cdu/internal/datastream/datastream/types/bookmark.go similarity index 100% rename from api/internal/datastream/datastream/types/bookmark.go rename to cdu/internal/datastream/datastream/types/bookmark.go diff --git a/api/internal/datastream/datastream/types/file.go b/cdu/internal/datastream/datastream/types/file.go similarity index 100% rename from api/internal/datastream/datastream/types/file.go rename to cdu/internal/datastream/datastream/types/file.go diff --git a/api/internal/datastream/datastream/types/file_test.go b/cdu/internal/datastream/datastream/types/file_test.go similarity index 100% rename from api/internal/datastream/datastream/types/file_test.go rename to cdu/internal/datastream/datastream/types/file_test.go diff --git a/api/internal/datastream/datastream/types/ger_update.go b/cdu/internal/datastream/datastream/types/ger_update.go similarity index 100% rename from api/internal/datastream/datastream/types/ger_update.go rename to cdu/internal/datastream/datastream/types/ger_update.go diff --git a/api/internal/datastream/datastream/types/ger_update_test.go b/cdu/internal/datastream/datastream/types/ger_update_test.go similarity index 100% rename from api/internal/datastream/datastream/types/ger_update_test.go rename to cdu/internal/datastream/datastream/types/ger_update_test.go diff --git a/api/internal/datastream/datastream/types/header.go b/cdu/internal/datastream/datastream/types/header.go similarity index 100% rename from api/internal/datastream/datastream/types/header.go rename to cdu/internal/datastream/datastream/types/header.go diff --git a/api/internal/datastream/datastream/types/header_test.go b/cdu/internal/datastream/datastream/types/header_test.go similarity index 100% rename from api/internal/datastream/datastream/types/header_test.go rename to cdu/internal/datastream/datastream/types/header_test.go diff --git a/api/internal/datastream/datastream/types/result.go b/cdu/internal/datastream/datastream/types/result.go similarity index 100% rename from api/internal/datastream/datastream/types/result.go rename to cdu/internal/datastream/datastream/types/result.go diff --git a/api/internal/datastream/datastream/types/result_test.go b/cdu/internal/datastream/datastream/types/result_test.go similarity index 100% rename from api/internal/datastream/datastream/types/result_test.go rename to cdu/internal/datastream/datastream/types/result_test.go diff --git a/api/internal/datastream/datastream/types/tx.go b/cdu/internal/datastream/datastream/types/tx.go similarity index 100% rename from api/internal/datastream/datastream/types/tx.go rename to cdu/internal/datastream/datastream/types/tx.go diff --git a/api/internal/datastream/datastream/types/tx_test.go b/cdu/internal/datastream/datastream/types/tx_test.go similarity index 100% rename from api/internal/datastream/datastream/types/tx_test.go rename to cdu/internal/datastream/datastream/types/tx_test.go diff --git a/api/internal/datastream/handler.go b/cdu/internal/datastream/handler.go similarity index 91% rename from api/internal/datastream/handler.go rename to cdu/internal/datastream/handler.go index 7c26f99..be7bde1 100644 --- a/api/internal/datastream/handler.go +++ b/cdu/internal/datastream/handler.go @@ -1,7 +1,7 @@ package datastream import ( - "github.com/RevittConsulting/cdk-envs/pkg/utils" + "github.com/RevittConsulting/chain-dev-utils/pkg/utils" "github.com/RevittConsulting/logger" "github.com/go-chi/chi/v5" "net/http" diff --git a/api/internal/datastream/service.go b/cdu/internal/datastream/service.go similarity index 100% rename from api/internal/datastream/service.go rename to cdu/internal/datastream/service.go diff --git a/api/internal/health/handler.go b/cdu/internal/health/handler.go similarity index 92% rename from api/internal/health/handler.go rename to cdu/internal/health/handler.go index 57b7bb8..d538667 100644 --- a/api/internal/health/handler.go +++ b/cdu/internal/health/handler.go @@ -2,7 +2,7 @@ package health import ( "fmt" - "github.com/RevittConsulting/cdk-envs/pkg/atomics" + "github.com/RevittConsulting/chain-dev-utils/pkg/atomics" "github.com/RevittConsulting/logger" "github.com/go-chi/chi/v5" "net/http" diff --git a/api/internal/jsonrpc/client.go b/cdu/internal/jsonrpc/client.go similarity index 100% rename from api/internal/jsonrpc/client.go rename to cdu/internal/jsonrpc/client.go diff --git a/api/internal/jsonrpc/config.go b/cdu/internal/jsonrpc/config.go similarity index 100% rename from api/internal/jsonrpc/config.go rename to cdu/internal/jsonrpc/config.go diff --git a/api/internal/jsonrpc/eth.go b/cdu/internal/jsonrpc/eth.go similarity index 100% rename from api/internal/jsonrpc/eth.go rename to cdu/internal/jsonrpc/eth.go diff --git a/api/internal/jsonrpc/types.go b/cdu/internal/jsonrpc/types.go similarity index 100% rename from api/internal/jsonrpc/types.go rename to cdu/internal/jsonrpc/types.go diff --git a/api/internal/jsonrpc/zkevm.go b/cdu/internal/jsonrpc/zkevm.go similarity index 100% rename from api/internal/jsonrpc/zkevm.go rename to cdu/internal/jsonrpc/zkevm.go diff --git a/api/internal/server/server.go b/cdu/internal/server/server.go similarity index 90% rename from api/internal/server/server.go rename to cdu/internal/server/server.go index 3f33bb1..8e4b391 100644 --- a/api/internal/server/server.go +++ b/cdu/internal/server/server.go @@ -4,9 +4,9 @@ import ( "context" "errors" "fmt" - "github.com/RevittConsulting/cdk-envs/config" - "github.com/RevittConsulting/cdk-envs/internal/chains/chain_services" - "github.com/RevittConsulting/cdk-envs/pkg/atomics" + "github.com/RevittConsulting/chain-dev-utils/config" + "github.com/RevittConsulting/chain-dev-utils/internal/chains/chain_services" + "github.com/RevittConsulting/chain-dev-utils/pkg/atomics" "github.com/go-chi/chi/v5" "golang.org/x/sync/errgroup" "net/http" diff --git a/api/internal/server/setup.go b/cdu/internal/server/setup.go similarity index 79% rename from api/internal/server/setup.go rename to cdu/internal/server/setup.go index 53bb971..d0530e3 100644 --- a/api/internal/server/setup.go +++ b/cdu/internal/server/setup.go @@ -1,16 +1,16 @@ package server import ( - "github.com/RevittConsulting/cdk-envs/internal/buckets" - "github.com/RevittConsulting/cdk-envs/internal/buckets/db/mdbx" - "github.com/RevittConsulting/cdk-envs/internal/chains" - "github.com/RevittConsulting/cdk-envs/internal/chains/chain_services" - "github.com/RevittConsulting/cdk-envs/internal/health" - "github.com/RevittConsulting/cdk-envs/internal/tx" - "github.com/RevittConsulting/cdk-envs/internal/ws" + "github.com/RevittConsulting/chain-dev-utils/internal/buckets" + "github.com/RevittConsulting/chain-dev-utils/internal/buckets/db/mdbx" + "github.com/RevittConsulting/chain-dev-utils/internal/chains" + "github.com/RevittConsulting/chain-dev-utils/internal/chains/chain_services" + "github.com/RevittConsulting/chain-dev-utils/internal/datastream" + "github.com/RevittConsulting/chain-dev-utils/internal/health" + "github.com/RevittConsulting/chain-dev-utils/internal/tx" + "github.com/RevittConsulting/chain-dev-utils/internal/ws" "github.com/go-chi/chi/v5" "github.com/go-chi/cors" - "github.com/RevittConsulting/cdk-envs/internal/datastream" ) type dependencies struct { diff --git a/api/internal/tx/config.go b/cdu/internal/tx/config.go similarity index 100% rename from api/internal/tx/config.go rename to cdu/internal/tx/config.go diff --git a/api/internal/tx/handler.go b/cdu/internal/tx/handler.go similarity index 93% rename from api/internal/tx/handler.go rename to cdu/internal/tx/handler.go index cf2cc82..3e67dc9 100644 --- a/api/internal/tx/handler.go +++ b/cdu/internal/tx/handler.go @@ -1,7 +1,7 @@ package tx import ( - "github.com/RevittConsulting/cdk-envs/pkg/utils" + "github.com/RevittConsulting/chain-dev-utils/pkg/utils" "github.com/RevittConsulting/logger" "github.com/go-chi/chi/v5" "net/http" diff --git a/api/internal/tx/models.go b/cdu/internal/tx/models.go similarity index 100% rename from api/internal/tx/models.go rename to cdu/internal/tx/models.go diff --git a/api/internal/tx/service.go b/cdu/internal/tx/service.go similarity index 100% rename from api/internal/tx/service.go rename to cdu/internal/tx/service.go diff --git a/api/internal/tx/tx.go b/cdu/internal/tx/tx.go similarity index 100% rename from api/internal/tx/tx.go rename to cdu/internal/tx/tx.go diff --git a/api/internal/types/types.go b/cdu/internal/types/types.go similarity index 94% rename from api/internal/types/types.go rename to cdu/internal/types/types.go index cc526df..4dc84ee 100644 --- a/api/internal/types/types.go +++ b/cdu/internal/types/types.go @@ -2,7 +2,7 @@ package types import ( "fmt" - "github.com/RevittConsulting/cdk-envs/pkg/utils" + "github.com/RevittConsulting/chain-dev-utils/pkg/utils" ) type Value []byte diff --git a/api/internal/ws/handler.go b/cdu/internal/ws/handler.go similarity index 100% rename from api/internal/ws/handler.go rename to cdu/internal/ws/handler.go diff --git a/api/internal/ws/service.go b/cdu/internal/ws/service.go similarity index 92% rename from api/internal/ws/service.go rename to cdu/internal/ws/service.go index 55bab3d..342f57d 100644 --- a/api/internal/ws/service.go +++ b/cdu/internal/ws/service.go @@ -1,7 +1,7 @@ package ws import ( - "github.com/RevittConsulting/cdk-envs/internal/chains/chain_services" + "github.com/RevittConsulting/chain-dev-utils/internal/chains/chain_services" ) type Service struct { diff --git a/api/internal/ws/types.go b/cdu/internal/ws/types.go similarity index 100% rename from api/internal/ws/types.go rename to cdu/internal/ws/types.go diff --git a/api/pkg/atomics/bool.go b/cdu/pkg/atomics/bool.go similarity index 100% rename from api/pkg/atomics/bool.go rename to cdu/pkg/atomics/bool.go diff --git a/api/pkg/hexadecimal/hexadecimal.go b/cdu/pkg/hexadecimal/hexadecimal.go similarity index 100% rename from api/pkg/hexadecimal/hexadecimal.go rename to cdu/pkg/hexadecimal/hexadecimal.go diff --git a/api/pkg/hexadecimal/hexdec_test.go b/cdu/pkg/hexadecimal/hexdec_test.go similarity index 100% rename from api/pkg/hexadecimal/hexdec_test.go rename to cdu/pkg/hexadecimal/hexdec_test.go diff --git a/api/pkg/utils/read-write.go b/cdu/pkg/utils/read-write.go similarity index 100% rename from api/pkg/utils/read-write.go rename to cdu/pkg/utils/read-write.go diff --git a/api/pkg/utils/utils.go b/cdu/pkg/utils/utils.go similarity index 100% rename from api/pkg/utils/utils.go rename to cdu/pkg/utils/utils.go diff --git a/api/tests/rpc_eth__test.go b/cdu/tests/rpc_eth__test.go similarity index 94% rename from api/tests/rpc_eth__test.go rename to cdu/tests/rpc_eth__test.go index 203d74b..a08decb 100644 --- a/api/tests/rpc_eth__test.go +++ b/cdu/tests/rpc_eth__test.go @@ -2,7 +2,7 @@ package tests import ( "fmt" - "github.com/RevittConsulting/cdk-envs/internal/jsonrpc" + "github.com/RevittConsulting/chain-dev-utils/internal/jsonrpc" "github.com/magiconair/properties/assert" "math/big" "testing" diff --git a/api/tests/rpc_zkevm_test.go b/cdu/tests/rpc_zkevm_test.go similarity index 83% rename from api/tests/rpc_zkevm_test.go rename to cdu/tests/rpc_zkevm_test.go index cb50709..0942559 100644 --- a/api/tests/rpc_zkevm_test.go +++ b/cdu/tests/rpc_zkevm_test.go @@ -1,7 +1,7 @@ package tests import ( - "github.com/RevittConsulting/cdk-envs/internal/jsonrpc" + "github.com/RevittConsulting/chain-dev-utils/internal/jsonrpc" "github.com/stretchr/testify/assert" "testing" ) diff --git a/api/tests/tx_test.go b/cdu/tests/tx_test.go similarity index 89% rename from api/tests/tx_test.go rename to cdu/tests/tx_test.go index 285e127..c320588 100644 --- a/api/tests/tx_test.go +++ b/cdu/tests/tx_test.go @@ -2,7 +2,7 @@ package tests import ( "context" - "github.com/RevittConsulting/cdk-envs/internal/tx" + "github.com/RevittConsulting/chain-dev-utils/internal/tx" "testing" ) diff --git a/docker-compose.yml b/docker-compose.yml index c6095d9..e67f879 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,12 +1,12 @@ version: "3" services: - api: - build: api + cdu: + build: cdu ports: - "8080:8080" volumes: - - ./data:/data + - ${DATA_DIR_HOST}:/data environment: - DATA_DIR=/data @@ -15,4 +15,4 @@ services: ports: - "3000:3000" depends_on: - - api \ No newline at end of file + - cdu \ No newline at end of file diff --git a/frontend/nginx.conf b/frontend/nginx.conf index 891d228..99c2d21 100644 --- a/frontend/nginx.conf +++ b/frontend/nginx.conf @@ -9,8 +9,8 @@ server { try_files /tx.html =404; } - location /datacryp { - try_files /datacryp.html =404; + location /dataview { + try_files /dataview.html =404; } location / { diff --git a/frontend/public/gateway-logo.svg b/frontend/public/gateway-logo.svg deleted file mode 100644 index 788174c..0000000 --- a/frontend/public/gateway-logo.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/frontend/src/app/datacryp/layout.tsx b/frontend/src/app/dataview/layout.tsx similarity index 100% rename from frontend/src/app/datacryp/layout.tsx rename to frontend/src/app/dataview/layout.tsx diff --git a/frontend/src/app/datacryp/page.tsx b/frontend/src/app/dataview/page.tsx similarity index 100% rename from frontend/src/app/datacryp/page.tsx rename to frontend/src/app/dataview/page.tsx diff --git a/frontend/src/app/layout.tsx b/frontend/src/app/layout.tsx index 0c70115..b94d397 100644 --- a/frontend/src/app/layout.tsx +++ b/frontend/src/app/layout.tsx @@ -11,8 +11,8 @@ import { TooltipProvider } from "@/components/ui/tooltip"; const inter = Inter({ subsets: ["latin"] }); export const metadata: Metadata = { - title: "cdk-envs", - description: "cdk-envs", + title: "Chain Dev Utils", + description: "Chain Development Utilities", }; export default function RootLayout({ diff --git a/frontend/src/components/nav.tsx b/frontend/src/components/nav.tsx index 737d141..cb04a61 100644 --- a/frontend/src/components/nav.tsx +++ b/frontend/src/components/nav.tsx @@ -1,15 +1,14 @@ "use client"; import Link from "next/link"; -import Image from "next/image"; import { ModeToggle } from "@/components/mode-toggle"; import { Button } from "@/components/ui/button"; import { useRouter } from "next/navigation"; const Nav = () => { const router = useRouter(); - const visitDatacryp = () => { - router.push("/datacryp"); + const visitDataview = () => { + router.push("/dataview"); }; const visitDatastream = () => { router.push("/datastream"); @@ -21,16 +20,10 @@ const Nav = () => { - + CDU - {visitDatacryp()}}> - Datacryp + {visitDataview()}}> + Dataview {visitDatastream()}}> Datastream diff --git a/frontend/src/components/sidebar.tsx b/frontend/src/components/sidebar.tsx index 30d1342..7b5cb6c 100644 --- a/frontend/src/components/sidebar.tsx +++ b/frontend/src/components/sidebar.tsx @@ -28,6 +28,7 @@ export default function Sidebar() { } } + useEffect(() => { fetchDbFiles(); }, []); @@ -38,25 +39,28 @@ export default function Sidebar() { Data - - + + {files.map((file, index) => ( setDbSource(file)} - className={ - selectedFile === file + className={` + ${selectedFile === file ? "bg-primary text-primary-foreground hover:bg-primary/90" - : "" - } + : ""} w-full break-words flex flex-wrap h-full + `} > - - {file.split("/").slice(-2).join("/")} + + {file.split("/").slice(-3, -1).join(" ")} + {file.split("/").pop()} + ))} - ); +); + }
{file.split("/").slice(-3, -1).join(" ")}
{file.split("/").pop()}