Skip to content

Commit

Permalink
Merge pull request #10039 from hicommonwealth/release/v1.7.5-x
Browse files Browse the repository at this point in the history
Release/v1.7.5 x
  • Loading branch information
ilijabojanovic authored Nov 26, 2024
2 parents 001e96f + 7aabeeb commit 5e3fca9
Show file tree
Hide file tree
Showing 308 changed files with 8,401 additions and 4,423 deletions.
22 changes: 11 additions & 11 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ env:
NODE_ENV: 'test'
ROLLBAR_ENV: 'GitHubCI'
TEST_WITHOUT_LOGS: 'true'
PRIVATE_KEY: 'web3-pk'
PRIVATE_KEY: '0x83c65f24efbc8f4bc54ad425e897fc3ea01f760d5e71671a30eacb075ebe2313'
USES_DOCKER_PGSQL: true
PORT: 8080
REDIS_URL: redis://localhost:6379
Expand All @@ -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

14 changes: 9 additions & 5 deletions common_knowledge/Farcaster-Contests.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,15 @@ Add these env vars to your .env file. Fill in the API key (ask a dev) and your o

```
FLAG_FARCASTER_CONTEST=true
NEYNAR_API_KEY=
NEYNAR_API_KEY=<Get from Neynar dashboard>
NEYNAR_CAST_CREATED_WEBHOOK_SECRET=<Get from Neynar dashboard>
NEYNAR_REPLY_WEBHOOK_URL=https://YOUR_NGROK_DOMAIN/api/integration/farcaster/ReplyCastCreated
FARCASTER_ACTION_URL=https://YOUR_NGROK_DOMAIN/api/integration/farcaster/CastUpvoteAction
FARCASTER_NGROK_DOMAIN=https://YOUR_NGROK_DOMAIN
```

Note: `FARCASTER_NGROK_DOMAIN` should only be used locally– not on QA or production.

## Run local services

Run services required for testing contests:
Expand All @@ -57,10 +61,10 @@ Farcaster allows users to add a custom “action” to their account, which can
- Paste URL into browser, you’ll see the Warpcast page, then click `Add Action`

## How to test the Farcaster/Contests integration
- For testing, you can use any contest that has an associated Topic.
- First, post a farcaster contest URL on Warpcast. It has this format: `https://YOUR_DOMAIN/api/integration/farcaster/contests/CONTEST_ADDRESS/contestCard`
- Fill in your ngrok domain and contest address
- Upon posting, it should trigger the `CastCreated` webhook and associate the Cast (message) with the contest. It’ll also create a new programatic webhook for `CastReplyCreated`.
- Create a Farcaster Contest with a funding token (e.g. CMN on Base Sepolia `0x429ae85883f82203D736e8fc203A455990745ca1`)
- Copy the Farcaster Contest URL. It should have this format: `https://YOUR_DOMAIN/api/integration/farcaster/contests/CONTEST_ADDRESS/contestCard`
- Post a the URL to WarpCast
- it should trigger the `CastCreated` webhook and associate the Cast (message) with the contest. It’ll also create a new programatic webhook for `CastReplyCreated`.
- Then, add a reply message to the contest cast.
- This should trigger the `CastReplyCreated` webhook, which will create onchain content.
- Finally, perform the custom Upvote action on your reply message (icon with 4 squares).
Expand Down
12 changes: 6 additions & 6 deletions common_knowledge/Package-Scripts.md
Original file line number Diff line number Diff line change
Expand Up @@ -299,31 +299,31 @@ See `test-unit`.

### test-api

Definition: `INIT_TEST_DB=true NODE_ENV=test vitest --config ../../vite.config.ts --fileParallelism=false run ./test/integration/api`
Definition: `NODE_ENV=test vitest --config ../../vite.config.ts run ./test/integration/api`

Description: Runs all tests in the /api subfolder of the /integration directory.

### test-integration

Definition: `INIT_TEST_DB=true NODE_ENV=test vitest --config ../../vite.config.ts --fileParallelism=false run ./test/integration`
Definition: `NODE_ENV=test vitest --config ../../vite.config.ts run ./test/integration`

Description: Runs all tests in the /test/integration folder (includes API tests).

### test-devnet:evm

Definition: `INIT_TEST_DB=true NODE_ENV=test vitest --config ../../vite.config.ts --fileParallelism=false run ./test/devnet/evm`
Definition: `NODE_ENV=test vitest --config ../../vite.config.ts run ./test/devnet/evm`

Description: Runs all tests in our `/devnet/evm` folder.

### test-devnet:cosmos

Definition: `INIT_TEST_DB=true NODE_ENV=test vitest --config ../../vite.config.ts --fileParallelism=false run ./test/devnet/cosmos`
Definition: `NODE_ENV=test vitest --config ../../vite.config.ts run ./test/devnet/cosmos`

Description: Runs all tests in our `/devnet/cosmos` folder.

### test-select

Definition: `INIT_TEST_DB=true NODE_ENV=test vitest --config ../../vite.config.ts --fileParallelism=false run`
Definition: `NODE_ENV=test vitest --config ../../vite.config.ts run`

Description: Append a path to run specific test files or folders.

Expand All @@ -335,7 +335,7 @@ Description: Tests all .spec files within the `./test/unit` sub-directory of tes

### test-select:watch

Definition: `INIT_TEST_DB=true NODE_ENV=test vitest --config ../../vite.config.ts --fileParallelism=false`
Definition: `NODE_ENV=test vitest --config ../../vite.config.ts`

Description: Watches for changes to any .spec files within the given path and automatically runs test when they are updated.

Expand Down
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
1 change: 1 addition & 0 deletions libs/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
},
"dependencies": {
"@hicommonwealth/schemas": "workspace:*",
"@hicommonwealth/evm-protocols": "workspace:*",
"dotenv": "^16.0.3",
"ethers": "5.7.2",
"lodash": "^4.17.21",
Expand Down
Loading

0 comments on commit 5e3fca9

Please sign in to comment.