mirror of
https://github.com/cerc-io/watcher-ts
synced 2026-09-08 00:44:06 +00:00
combine demo & readme, erc20-watcher
This commit is contained in:
+77
-1
@@ -1,3 +1,79 @@
|
||||
# Watcher Documentation
|
||||
|
||||
## Coming Soon
|
||||
## Setting up without Stack Orchestrator
|
||||
|
||||
- requries the three services
|
||||
- setup postgres (incl. PG crypto)
|
||||
- then demo each watcher
|
||||
|
||||
## Setup
|
||||
|
||||
* Create a postgres12 database for the watcher:
|
||||
|
||||
```bash
|
||||
sudo su - postgres
|
||||
|
||||
# If database already exists
|
||||
# dropdb erc20-watcher
|
||||
|
||||
createdb erc20-watcher
|
||||
```
|
||||
|
||||
Create a postgres12 database for the job queue:
|
||||
|
||||
```
|
||||
sudo su - postgres
|
||||
createdb erc20-watcher-job-queue
|
||||
```
|
||||
|
||||
Enable the `pgcrypto` extension on the job queue database (https://github.com/timgit/pg-boss/blob/master/docs/usage.md#intro).
|
||||
|
||||
Example:
|
||||
|
||||
```
|
||||
postgres@tesla:~$ psql -U postgres -h localhost erc20-watcher-job-queue
|
||||
Password for user postgres:
|
||||
psql (12.7 (Ubuntu 12.7-1.pgdg18.04+1))
|
||||
SSL connection (protocol: TLSv1.3, cipher: TLS_AES_256_GCM_SHA384, bits: 256, compression: off)
|
||||
Type "help" for help.
|
||||
|
||||
erc20-watcher-job-queue=# CREATE EXTENSION pgcrypto;
|
||||
CREATE EXTENSION
|
||||
erc20-watcher-job-queue=# exit
|
||||
```
|
||||
|
||||
Create a postgres12 database for the erc20 watcher:
|
||||
|
||||
```
|
||||
sudo su - postgres
|
||||
createdb erc20-watcher
|
||||
```
|
||||
|
||||
Update `environments/local.toml` with database connection settings for both the databases.
|
||||
```toml
|
||||
[database]
|
||||
type = "postgres"
|
||||
host = "localhost"
|
||||
port = 5432
|
||||
database = "erc20-watcher"
|
||||
username = "postgres"
|
||||
password = "postgres"
|
||||
|
||||
[jobQueue]
|
||||
dbConnectionString = "postgres://postgres:postgres@localhost/erc20-watcher-job-queue"
|
||||
```
|
||||
|
||||
Update the `upstream` config in `environments/local.toml`. Provide the `ipld-eth-server` GQL and RPC API endpoints.
|
||||
```toml
|
||||
[upstream]
|
||||
[upstream.ethServer]
|
||||
gqlApiEndpoint = "http://127.0.0.1:8082/graphql"
|
||||
rpcProviderEndpoint = "http://127.0.0.1:8081"
|
||||
```
|
||||
|
||||
Ensure that watcher is of active kind. Update the kind in `server` config to active.
|
||||
```toml
|
||||
[server]
|
||||
kind = "active"
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user