Skip to content

Commit a1b78d3

Browse files
authored
Testjam error fixes (#124)
* fixed Jorge worker error * readme update for swagger UI for Docker Image * added examples for end-points
1 parent b6fa3d4 commit a1b78d3

File tree

4 files changed

+51
-6
lines changed

4 files changed

+51
-6
lines changed

docs/UserGuide.md

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
1. Create a `.env` file based off `.env.example` with all the variables filled in.
2323
2. Update the `THIRDWEB_API_SECRET_KEY` value on the `.env` file
24+
3. Update the `POSTGRES_CONNECTION_URL` value on the `.env` file
2425

2526
### PostgreSQL DB
2627

@@ -79,9 +80,18 @@ For updates on your requests, you can either poll using the `get` (`/tranasction
7980
3. Run the below command
8081
<br />
8182
```
82-
docker run -e .env -p 3005:3005 thirdweb/web3-api:latest
83+
docker run -e .env -p 3005:3005 thirdweb/web3-api:nightly
84+
# check other images at https://hub.docker.com/r/thirdweb/web3-api/tags
8385
```
8486

87+
### Note:
88+
89+
To access the Swagger UI locally on `http://localhost:3005/` when using the docker image, you need to update add the following to the `.env` file:
90+
91+
```
92+
NODE_ENV=development
93+
```
94+
8595
<details>
8696
<summary>Run on a Server (EC2 Instance/Google Compute/VM) </summary>
8797

@@ -134,9 +144,8 @@ We use `docker-compose-infra.yml` to spin up the supporting infra services, a po
134144

135145
1. Clone the Repo
136146
2. Check [Setup Instruction section](#setup-instructions) to update the `.env` file
137-
3. Check [Advance Setup : PostgreSQL DB](#advance-setup--postgresql-db) section to update the `.env` file
138-
4. Run: `yarn install`
139-
5. Run: `yarn dev:server & yarn dev:worker`
147+
3. Run: `yarn install`
148+
4. Run: `yarn dev:server & yarn dev:worker`
140149

141150
The API defaults to `http://localhost:3005`
142151

@@ -161,4 +170,14 @@ We use `docker-compose.yml` to spin up the API Server & Worker along with suppor
161170

162171
The API defaults to `http://localhost:3005`
163172

173+
To access the Swagger UI locally on `http://localhost:3005/` when using the docker image, you need to update add the following to the `.env` file:
174+
175+
### Note:
176+
177+
To access the Swagger UI locally on `http://localhost:3005/` when using the docker image, you need to update add the following to the `.env` file:
178+
179+
```
180+
NODE_ENV=development
181+
```
182+
164183
</details>

server/api/wallet/addWallet.ts

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import { WalletConfigType } from "../../schemas/wallet";
1616
const requestBodySchema = Type.Object({
1717
walletType: Type.String({
1818
description: "Wallet Type",
19-
examples: ["aws_kms", "gcp_kms"],
19+
examples: ["aws_kms", "gcp_kms", "local"],
2020
}),
2121
awsKMS: Type.Optional(
2222
Type.Object({
@@ -46,6 +46,23 @@ const requestBodySchema = Type.Object({
4646
),
4747
});
4848

49+
requestBodySchema.examples = [
50+
{
51+
walletTye: "aws_kms",
52+
awsKMS: {
53+
keyId: "12345678-1234-1234-1234-123456789012",
54+
arn: "arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012",
55+
},
56+
},
57+
{
58+
walletTye: "gcp_kms",
59+
gcpKMS: {
60+
keyId: "12345678-1234-1234-1234-123456789012",
61+
versionId: "1",
62+
},
63+
},
64+
];
65+
4966
// OUTPUT
5067
const responseSchema = Type.Object({
5168
result: Type.Object({

server/api/wallet/createEOAWallet.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,15 @@ const requestBodySchema = Type.Object({
2424
}),
2525
});
2626

27+
requestBodySchema.examples = [
28+
{
29+
walletType: "aws_kms",
30+
},
31+
{
32+
walletType: "gcp_kms",
33+
},
34+
];
35+
2736
// OUTPUT
2837
const responseSchema = Type.Object({
2938
result: Type.Object({

worker/controller/processTransaction.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ export const processTransaction = async (
111111
"errored",
112112
trx,
113113
undefined,
114-
error.message,
114+
{ errorMessage: error.message },
115115
);
116116
await trx.commit();
117117
await trx.destroy();

0 commit comments

Comments
 (0)