Skip to content

Commit

Permalink
Merge pull request #9967 from hicommonwealth/rotorsoft/upgrade-to-nod…
Browse files Browse the repository at this point in the history
…e22-pnpm-too
  • Loading branch information
timolegros authored Nov 22, 2024
2 parents 17c72ef + e34bfba commit 33da3dc
Show file tree
Hide file tree
Showing 17 changed files with 106 additions and 217 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
timeout-minutes: 20
strategy:
matrix:
node: [ 20 ]
node: [ 22 ]

services:
postgres:
Expand Down Expand Up @@ -91,7 +91,7 @@ jobs:
timeout-minutes: 30
strategy:
matrix:
node: [ 20 ]
node: [ 22 ]

services:
postgres:
Expand Down Expand Up @@ -150,7 +150,7 @@ jobs:
timeout-minutes: 10
strategy:
matrix:
node: [ 20 ]
node: [ 22 ]

services:
postgres:
Expand Down Expand Up @@ -203,7 +203,7 @@ jobs:
timeout-minutes: 10
strategy:
matrix:
node: [ 20 ]
node: [ 22 ]

steps:
- uses: actions/checkout@v4
Expand All @@ -223,7 +223,7 @@ jobs:
timeout-minutes: 10
strategy:
matrix:
node: [ 20 ]
node: [ 22 ]

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -266,7 +266,7 @@ jobs:
timeout-minutes: 10
strategy:
matrix:
node: [ 20 ]
node: [ 22 ]

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -296,7 +296,7 @@ jobs:
timeout-minutes: 20
strategy:
matrix:
node: [ 20 ]
node: [ 22 ]

services:
postgres:
Expand Down Expand Up @@ -344,7 +344,7 @@ jobs:
timeout-minutes: 20
strategy:
matrix:
node: [ 20 ]
node: [ 22 ]

services:
postgres:
Expand Down Expand Up @@ -403,7 +403,7 @@ jobs:
timeout-minutes: 10
strategy:
matrix:
node: [ 20 ]
node: [ 22 ]

services:
postgres:
Expand Down Expand Up @@ -445,7 +445,7 @@ jobs:
if: always()
strategy:
matrix:
node: [ 20 ]
node: [ 22 ]

steps:
- name: Coveralls Finished
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v20
v22
2 changes: 1 addition & 1 deletion Dockerfile.datadog
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:20-slim AS datadog-base
FROM node:22-slim AS datadog-base

# Install Datadog dependencies
RUN apt-get update && apt-get install -y gnupg apt-transport-https gpg-agent curl ca-certificates
Expand Down
28 changes: 22 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,66 +6,83 @@

### Prerequisites

- Node.js (version 20.X)
- Node.js (version 22.x)
- PNPM
- Docker

### Steps

1. Clone the repository:

```bash
git clone https://github.com/hicommonwealth/commonwealth.git
```

2. Navigate to the project directory:

```bash
cd commonwealth
```

3. Install dependencies:

```bash
pnpm install
```

4. Set up environment variables:

```bash
cp .env.example .env
```

5. Run external services (postgresql, redis, rabbitmq):

```bash
docker-compose up -d
```

6. Run the database migrations:

```bash
pnpm migrate-db
```

7. Start the server:

```bash
pnpm run start
```

The API server runs on http://localhost:3000/ and you can test it by making a request to
http://localhost:3000/api/health. It should respond with
The API server runs on <http://localhost:3000/> and you can test it by making a request to
<http://localhost:3000/api/health>. It should respond with

```json
{
"status": "ok"
}
```

The client is served from http://localhost:8080/.
The client is served from <http://localhost:8080/>.

### Side Notes

Some features of the application require additional API keys.
While the app will still function without them, certain functionalities may be limited.

Required for openAI image generation:

- OPENAI_ORGANIZATION
- OPENAI_API_KEY

Required for chain features on EVM chains (groups, stake, contests):

- ETH_ALCHEMY_API_KEY

Ensure these keys are set up in your environment variables to fully utilize all features of the application.

# Scripts

- `pnpm start-all`
- Starts ALL the microservices in different processes. Requires a RabbitMQ instance/connection to function properly.
- `pnpm start-apps`
Expand All @@ -75,9 +92,8 @@ Ensure these keys are set up in your environment variables to fully utilize all
- Starts a local RabbitMQ instance using Docker.
- Run this in a separate terminal and pair it with the `pnpm start-all` command to get a fully functional app.
- `pnpm start-redis`
- make sure to have `REDIS_URL=redis://localhost:6379` in your .env file
- make sure to have `REDIS_URL=redis://localhost:6379` in your .env file
- Starts a local redis instance using Docker, it will start redis on its default port 6379
- `pnpm load-db [optional-dump-name]`
- Loads the default `latest.dump` or the `optional-dump-name` into the database
- Only available in the `commonwealth` and `chain-events` packages

5 changes: 3 additions & 2 deletions libs/adapters/src/trpc/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ export const toExpress = (router: OpenApiRouter) =>
req,
res,
}),
onError: ({ path, error }) => logError(path, error),
onError: ({ path, error }: { path?: string; error: TRPCError }) =>
logError(path, error),
});

// used for REST like routes (External)
Expand All @@ -47,7 +48,7 @@ const toOpenApiExpress = (router: OpenApiRouter) =>
req,
res,
}),
onError: ({ path, error }: { path: string; error: TRPCError }) =>
onError: ({ path, error }: { path?: string; error: TRPCError }) =>
logError(path, error),
responseMeta: undefined,
maxBodySize: undefined,
Expand Down
Loading

0 comments on commit 33da3dc

Please sign in to comment.