Skip to content

Commit 86c8303

Browse files
fix Hasura section in README, fix secrets.env.example (#22)
1 parent 1e4d14d commit 86c8303

File tree

4 files changed

+52
-11
lines changed

4 files changed

+52
-11
lines changed

README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -227,19 +227,21 @@ Template values mapping could be accessed from within handlers at `ctx.template_
227227

228228
### Optional: configure Hasura GraphQL Engine
229229

230-
`init` command generates Hasura metadata JSON in the package root. You can use `configure-graphql` command to apply it to the running GraphQL Engine instance:
230+
When using PostgreSQL as a storage solution you can use Hasura integration to get GraphQL API out-of-the-box. Add the following section to your config, Hasura will be configured automatically when you run your indexer.
231231

232-
```shell
233-
$ dipdup -c config.yml configure-graphql --url http://127.0.0.1:8080 --admin-secret changeme
232+
```yaml
233+
hasura:
234+
url: http://hasura:8080
235+
admin_secret: changeme
234236
```
235237

236-
Or if using included `docker-compose.yml` example:
238+
When using included docker-compose example make sure you run Hasura first:
237239

238240
```shell
239-
$ docker-compose up -d graphql-engine
240-
$ docker-compose up configure-graphql
241+
$ docker-compose up -d hasura
241242
```
242243

244+
Then run your indexer and navigate to `127.0.0.1:8080`.
243245

244246
### Optional: configure logging
245247

secrets.env.example

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
HEN_OBJKTS=KT1Hkg5qeNhfwpKW4fXvq7HGZB9z2EnmCCA9
2-
HEN_MINTER=KT1RJ6PbjHpwc3M5rw5s2Nbmefwbuwbdxton
3-
TZKT_URL=https://staging.api.tzkt.io
4-
51
POSTGRES_USER=dipdup
62
POSTGRES_DB=dipdup
73
POSTGRES_PASSWORD=changeme
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
spec_version: 0.0.1
2+
package: demo_registrydao
3+
4+
database:
5+
kind: postgres
6+
host: db
7+
port: 5432
8+
user: dipdup
9+
password: changeme
10+
database: dipdup
11+
schema_name: registrydao
12+
13+
hasura:
14+
url: http://hasura:8080
15+
admin_secret: changeme
16+
17+
contracts:
18+
registry:
19+
address: KT1QMdCTqzmY4QKHntV1nZEinLPU1GbxUFQu
20+
typename: registry
21+
22+
datasources:
23+
tzkt:
24+
kind: tzkt
25+
url: ${TZKT_URL:-https://staging.api.edo2net.tzkt.io}
26+
27+
templates:
28+
29+
registry_dao:
30+
kind: operation
31+
datasource: tzkt
32+
contract: <contract>
33+
handlers:
34+
- callback: on_propose
35+
pattern:
36+
- destination: <contract>
37+
entrypoint: propose
38+
39+
indexes:
40+
registry:
41+
template: registry_dao
42+
values:
43+
contract: registry

src/demo_registrydao/dipdup.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package: demo_registrydao
33

44
database:
55
kind: sqlite
6-
path: db.sqlite3
6+
path: registrydao.sqlite3
77

88
contracts:
99
registry:

0 commit comments

Comments
 (0)