-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* updated webhook docs & cleanup * docs Table of contents udpate. New guides folder * image path update
- Loading branch information
Showing
7 changed files
with
84 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#### Zeet Deployment Guide: | ||
|
||
1. Goto https://zeet.co/ and create an account | ||
2. Create a new project | ||
3. Select `Docker Image` as the deployment method | ||
4. Under `Docker Image`, search for `thirdweb/engine` and select it | ||
5. Under `Docker Image Tag`, select either `latest` or `nightly` | ||
![Alt text](../../images/Zeet-Docker-Source-Setting.png) | ||
6. Select the Target cluster you want the above image to be deployed to | ||
7. Choose your `Compute` settings | ||
8. Update the `port` under `Networking` Tab to `3005` | ||
9. Under `Environment Vriables` add the below vars with values: | ||
|
||
``` | ||
POSTGRES_CONNECTION_URL | ||
THIRDWEB_API_SECRET_KEY | ||
``` | ||
|
||
10. Under `Organize` Tab, | ||
|
||
- you can select an existing `group`` or create a new one | ||
- you can select an existing `sub-group` or create a new one | ||
- Add a Project Name | ||
|
||
11. Click on `Deploy` button | ||
12. Once the deployment is complete, you can click on the URL given by zeet to access the API & Swagger UI |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { getTxById } from "../../src/db/transactions/getTxById"; | ||
import { env } from "../../src/utils/env"; | ||
import { logger } from "../../src/utils/logger"; | ||
|
||
export const sendWebhook = async (data: any): Promise<void> => { | ||
try { | ||
const txData = await getTxById({ queueId: data.id }); | ||
const headers: { | ||
Accept: string; | ||
"Content-Type": string; | ||
Authorization?: string; | ||
} = { | ||
Accept: "application/json", | ||
"Content-Type": "application/json", | ||
}; | ||
|
||
if (process.env.WEBHOOK_AUTH_BEARER_TOKEN) { | ||
headers[ | ||
"Authorization" | ||
] = `Bearer ${process.env.WEBHOOK_AUTH_BEARER_TOKEN}`; | ||
} | ||
|
||
const response = await fetch(env.WEBHOOK_URL, { | ||
method: "POST", | ||
headers, | ||
body: JSON.stringify(txData), | ||
}); | ||
|
||
if (!response.ok) { | ||
logger.server.error( | ||
`[sendWebhook] Webhook Request error: ${response.status} ${response.statusText}`, | ||
); | ||
} | ||
} catch (error) { | ||
logger.server.error(`[sendWebhook] error: ${error}`); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters