Skip to content

Commit c7f6a01

Browse files
authored
Eth 61 streamregistry thegraph chainlink (#134)
* chainlink, thegraph firest draft for docker-compose * chainlink node is configured and starts up successfully, also the first time and restarts when postgres is not redy yet * chainlink keys, nodeconfig and postgresql folder * recreate chainlink node config * chainlink config update in postgres * removed postgres data, updated chainlink node data * update postgres image name * chainlink config update * exported chainlink and graph data from postgres, added as initscript, some dockercompse changes for volumes for postgres * ignore logfile * update Readme * change test password for chainlink node login * update chainlink initdata and link address, using custom sidechainimage from dockerhub * update tag for external chainlink adapter * updated postgres initdata for theGraph * added container that deploys streamregistry subgraph on first run * rebased smartcontracts-init repo -> updated Link token addresses for chainlink node here * added placeholder healthchecks for chainlink for now
1 parent af249d1 commit c7f6a01

10 files changed

+4181
-1
lines changed

README.md

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,29 @@ streamr-docker-dev start --wait
214214
- The Data Union Server manages the state of the
215215
- The Data Union Server will be retired when Data Unions 2.0 is launched in Q1 of 2021
216216
- 1 x [ethereum-watcher](https://github.com/streamr-dev/streamr-ethereum-watcher)
217-
217+
- 1 x [Chainlink node](https://github.com/streamr-dev/network-contracts)
218+
- accessible at http://localhost:6688, user:a@a.com, password:testpass
219+
- 1 x [TheGraph node](https://github.com/streamr-dev/network-contracts)
220+
- GraphQL queries at http://localhost:8000/subgraphs/name/githubname/subgraphname
221+
- GUI to past GraphQL queries: http://192.168.0.8:8000/subgraphs/name/githubname/subgraphname/graphql
222+
- An example query is:
223+
```
224+
{
225+
streams {
226+
id,
227+
metadata,
228+
permissions {
229+
id,
230+
user,
231+
edit,
232+
canDelete,
233+
publish,
234+
subscribed,
235+
share,
236+
}
237+
}
238+
}
239+
```
218240
### Supporting services
219241
- 1 x MySQL instance with databases `core_dev` and `core_test`
220242
- 1 x Redis instance
@@ -223,6 +245,9 @@ streamr-docker-dev start --wait
223245
- 1 x [Ethereum Parity node ("mainchain")](https://github.com/streamr-dev/open-ethereum-poa)
224246
- 1 x [Ethereum Parity node ("sidechain")](https://github.com/streamr-dev/open-ethereum-poa)
225247
- 1 x nginx
248+
- 1 x Postgres DB for TheGraph and Chainlink
249+
- 1 x ipfs for TheGraph
250+
- 1 x external adapter for ENSqueries from chainlink to mainchain
226251

227252
## Troubleshooting
228253

chainlink_config/.api

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2+
testpass
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
ROOT=/chainlink
2+
LOG_LEVEL=debug
3+
ETH_CHAIN_ID=8997
4+
MIN_OUTGOING_CONFIRMATIONS=2
5+
LINK_CONTRACT_ADDRESS=0x3387F44140ea19100232873a5aAf9E46608c791E
6+
CHAINLINK_TLS_PORT=0
7+
SECURE_COOKIES=false
8+
GAS_UPDATER_ENABLED=true
9+
ALLOW_ORIGINS=*
10+
ETH_URL=ws://streamr-dev-parity-sidechain-node0:8450
11+
DATABASE_URL=postgresql://streamr:let-me-in@streamr-dev-postgres:5432/streamr?sslmode=disable

chainlink_config/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/log.jsonl

chainlink_config/.password

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
AugustinerQW123!"§

chainlink_config/secret

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
rrFLy5P2HqF/LG6K+xrsNMqgZJqCIm8SYVIuAgU+WhY=
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"address":"7b5f1610920d5baf00d684929272213baf962efe","crypto":{"cipher":"aes-128-ctr","ciphertext":"85271a6da2f5310a3b7120d3a2401565b03b83fc8c40e3d6fac0e4343eef33cf","cipherparams":{"iv":"43e3915ee0e323a0b47e37ac17a63ccd"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":262144,"p":1,"r":8,"salt":"5c6f877db46bec876ca303abc4a1ba12bfbbc52903fb081ab1e92a4a3a14de6f"},"mac":"bd84013d0ba6dde0a848674ee2871ccd6061d571234f2e119b2230df56312e3e"},"id":"c90a93de-913a-42ba-830c-80761e4b2873","version":3}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"address":"1dcaf21e385bbfafa02b0cc936eb2df7da155e64","crypto":{"cipher":"aes-128-ctr","ciphertext":"a02212a07c826d75db11c82dbfe250a5d4e02a2b9c06eeb720c7794a9d739392","cipherparams":{"iv":"9e0dfb63c4a5ff5f9ba6e6e1af3b00bd"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":262144,"p":1,"r":8,"salt":"87504cff6c33dec55616c2953bf8373494ab2e1e43235dfb33665bac4b1e221b"},"mac":"fb64389116c49254e91e647a464b8830edc6f0834d99d74fc4fb18ef1d22a50e"},"id":"8363bfd3-6d24-4af6-84f6-821fec3312bf","version":3}

docker-compose.yml

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,107 @@ services:
396396
- bridge-rabbitmq
397397
- bridge-redis
398398
- bridge-request
399+
graph-node:
400+
container_name: streamr-dev-thegraph-node
401+
image: graphprotocol/graph-node
402+
ports:
403+
- '8000:8000'
404+
- '8001:8001'
405+
- '8020:8020'
406+
- '8030:8030'
407+
- '8040:8040'
408+
depends_on:
409+
- ipfs
410+
- postgres
411+
- parity-sidechain-node0
412+
environment:
413+
postgres_host: postgres
414+
postgres_user: streamr
415+
postgres_pass: let-me-in
416+
postgres_db: streamr
417+
ipfs: 'streamr-dev-ipfs:5001'
418+
ethereum: 'xDai:http://streamr-dev-parity-sidechain-node0:8540'
419+
RUST_LOG: info
420+
healthcheck:
421+
test: ["CMD", "echo"] # TODO: health check
422+
interval: 10s
423+
timeout: 10s
424+
retries: 60
425+
graph-deploy-streamregistry-subgraph:
426+
container_name: streamr-dev-graph-deploy-streamreg-subgraph
427+
image: streamr/graph-deploy-streamregistry-subgraph:dev
428+
depends_on:
429+
- graph-node
430+
volumes:
431+
- data-graph-deploy:/firstrun
432+
ipfs:
433+
container_name: streamr-dev-ipfs
434+
image: ipfs/go-ipfs:v0.4.23
435+
ports:
436+
- '5001:5001'
437+
volumes:
438+
- data-ipfs:/data/ipfs
439+
healthcheck:
440+
test: ["CMD", "echo"] # TODO: health check
441+
interval: 10s
442+
timeout: 10s
443+
retries: 60
444+
postgres:
445+
container_name: streamr-dev-postgres
446+
image: postgres
447+
ports:
448+
- '5432:5432'
449+
command: ["postgres", "-cshared_preload_libraries=pg_stat_statements"]
450+
environment:
451+
POSTGRES_USER: streamr
452+
POSTGRES_PASSWORD: let-me-in
453+
POSTGRES_DB: streamr
454+
volumes:
455+
- data-postgres:/var/lib/postgresql/data
456+
- ./postgres_init_scripts:/docker-entrypoint-initdb.d
457+
healthcheck:
458+
test: ["CMD", "echo"] # TODO: health check
459+
interval: 10s
460+
timeout: 10s
461+
retries: 60
462+
chainlink:
463+
container_name: streamr-dev-chainlink-node
464+
image: smartcontract/chainlink:0.10.5
465+
ports:
466+
- '6688:6688'
467+
command: ["local", "n", "-p", "/chainlink/.password", "-a", "/chainlink/.api"]
468+
env_file:
469+
- ./chainlink_config/.env_streamr_sidechain
470+
volumes:
471+
- ./chainlink_config:/chainlink
472+
user: ${CURRENT_UID}
473+
depends_on:
474+
- parity-sidechain-node0
475+
- postgres
476+
- chainlink-external-adapter
477+
deploy:
478+
restart_policy:
479+
condition: on-failure
480+
delay: 3s
481+
max_attempts: 5
482+
window: 60s
483+
healthcheck:
484+
test: ["CMD", "echo"] # TODO: health check
485+
interval: 10s
486+
timeout: 10s
487+
retries: 60
488+
chainlink-external-adapter:
489+
container_name: streamr-dev-chainlink-adapter
490+
image: streamr/chainlink-external-adapter:dev
491+
ports:
492+
- 6691:8080
493+
depends_on:
494+
- parity-node0
495+
healthcheck:
496+
test: ["CMD", "echo"] # TODO: health check
497+
interval: 10s
498+
timeout: 10s
499+
retries: 60
399500

400501
networks:
401502
net-db-bridge-request:
@@ -426,3 +527,6 @@ volumes:
426527
data-parity-node0:
427528
data-parity-sidechain-node0:
428529
data-ethereum-watcher:
530+
data-ipfs:
531+
data-postgres:
532+
data-graph-deploy:

0 commit comments

Comments
 (0)