Skip to content

Commit

Permalink
feat: allow deploying to a different defaultAdmin
Browse files Browse the repository at this point in the history
  • Loading branch information
arcoraven committed Mar 14, 2024
1 parent cbb7ff2 commit c31fa60
Show file tree
Hide file tree
Showing 51 changed files with 216 additions and 1,386 deletions.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
THIRDWEB_API_SECRET_KEY="<your-thirdweb-api-secret-key>"
# The connection url for your running postgres instance, defaults to localhost postgres
POSTGRES_CONNECTION_URL="postgresql://postgres:postgres@localhost:5432/postgres?sslmode=disable"
# The admin wallet that will be able to connect to engine from the dashboard
# The admin wallet that will be able to connect to Engine from the dashboard
ADMIN_WALLET_ADDRESS="<your-admin-wallet-address>"

# =====[ Optional Configuration ]=====
Expand Down
64 changes: 27 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,25 @@
<h1 align="center"><a href='https://thirdweb.com/'>thirdweb</a> Engine</h1>

<p align="center">
<a href="https://hub.docker.com/r/thirdweb/engine">
<img alt="Latest Docker version" src="https://img.shields.io/docker/v/thirdweb/engine?sort=semver&label=docker&logo=docker"/>
</a>
<a href="https://discord.gg/thirdweb">
<img alt="Join our Discord!" src="https://img.shields.io/discord/834227967404146718.svg?color=7289da&label=discord&logo=discord&style=flat"/>
<img alt="Join the thirdweb Discord" src="https://img.shields.io/discord/834227967404146718.svg?color=7289da&label=discord&logo=discord&style=flat"/>
</a>
</p>

Engine is a backend HTTP server that calls smart contracts with your managed backend wallets.
Engine is an open-source, backend HTTP server that provides a production-ready interface to read, write, and deploy contracts on the blockchain.

[**Read the documentation**](https://portal.thirdweb.com/engine) for features, setup, configuration, guides, and references.
<p align="center">
<img src="./docs/images/engine-overview.webp" alt="Overview" width="400">
</p>

<!-- Source: https://whimsical.com/engine-architecture-2G6rXEvUM2HFmVwKxPWyzS -->
<img src="./docs/images/overview.png" alt="Overview" width="820">
## Quick links

- [Documentation](https://portal.thirdweb.com/engine)
- [Self-host instructions](https://portal.thirdweb.com/engine/self-host)
- [Get Engine hosted by thirdweb](https://thirdweb.com/dashboard/engine?requestCloudHosted)

## Features

Expand All @@ -30,41 +38,23 @@ Engine is a backend HTTP server that calls smart contracts with your managed bac
- Wallet and contract webhooks
- And [much more!](https://portal.thirdweb.com/engine)

## Quickstart

1. Install [Docker](https://docs.docker.com/get-docker/).
1. Run Postgres.
```bash
docker run -p 5432:5432 -e POSTGRES_PASSWORD=postgres -d postgres
```
1. Run Engine.
```bash
docker run \
-e ENCRYPTION_PASSWORD="<encryption_password>" \
-e THIRDWEB_API_SECRET_KEY="<thirdweb_secret_key>" \
-e ADMIN_WALLET_ADDRESS="<admin_wallet_address>" \
-e POSTGRES_CONNECTION_URL="postgresql://postgres:[email protected]:5432/postgres?sslmode=disable" \
-e ENABLE_HTTPS=true \
-p 3005:3005 \
--pull=always \
--cpus="0.5" \
thirdweb/engine:latest
```
1. Navigate to the [Engine dashboard](https://thirdweb.com/dashboard/engine).
- CORS error? Load https://localhost:3005 in your browser first.
1. Create or import a [local wallet](https://portal.thirdweb.com/engine/backend-wallets).

Learn more: [Getting Started](https://portal.thirdweb.com/engine/getting-started)

> **Production:** Deploy Postgres and Engine to your cloud provider. Consider creating [KMS backend wallets](https://portal.thirdweb.com/engine/backend-wallets).
## Self Host

[![Deploy on Railway](https://railway.app/button.svg)](https://railway.app/template/EASlyJ)
## Get Engine

### Self-host

Host Engine on your own instructure for free. [View self-host instructions](https://portal.thirdweb.com/engine/self-host).

Other deployment options:

- [Deploy on Railway](https://railway.app/template/EASlyJ)

### Cloud-host

[Get Engine hosted and managed by thirdweb](https://thirdweb.com/dashboard/engine?requestCloudHosted).

## Contributing

We welcome external contributions! See [how to contribute to thirdweb repos]. Please try to follow the existing code style and conventions.
We welcome contributions! See [How to contribute](./contributing.md).

## Get in touch

Expand Down
34 changes: 34 additions & 0 deletions contributing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# How to contribute

The thirdweb team welcomes contributions!

## Workflow

For OSS contributions, we use a [Forking Workflow](https://www.atlassian.com/git/tutorials/comparing-workflows/forking-workflow). Develop locally on your own fork and submit a PR to the main repo when you're ready for your changes to be reviewed.

1. [Create a fork](https://github.com/thirdweb-dev/engine/fork) of this repository to your own GitHub account.
1. [Clone your fork](https://help.github.com/articles/cloning-a-repository/) to your local machine.
1. Create a new branch on your fork to start working on your changes:

```bash
git checkout -b MY_BRANCH_NAME
```

1. Install the dependencies:

```bash
yarn install
```

1. Make changes on your branch.
1. Make a pull request to the `thirdweb-dev/engine:main` branch.

## Test Your Changes

Please run Engine locally to test your changes.

```bash
yarn dev
```

You should be able to make requests to Engine locally and import it to the [thirdweb dashboard](https://thirdweb.com/dashboard/engine).
203 changes: 0 additions & 203 deletions docs/1-user-guide.md

This file was deleted.

53 changes: 0 additions & 53 deletions docs/2-smart-wallets.md

This file was deleted.

Loading

0 comments on commit c31fa60

Please sign in to comment.