forked from ajna-finance/subgraph
-
Notifications
You must be signed in to change notification settings - Fork 2
/
set-ports.sh
executable file
·30 lines (25 loc) · 965 Bytes
/
set-ports.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash
graphql_http=8000
graphql_wss=8001
graphql_admin=8020
graphql_indexer=8030
graphql_metrics=8040
graphql_ipfs=5001
offset=${1:-0}
export GRAPHQL_HTTP=$(($graphql_http+offset))
export GRAPHQL_WSS=$(($graphql_wss+offset))
export GRAPHQL_ADMIN=$(($graphql_admin+offset))
export GRAPHQL_INDEXER=$(($graphql_indexer+offset))
export GRAPHQL_METRICS=$(($graphql_metrics+offset))
export GRAPHQL_IPFS=$(($graphql_ipfs+offset))
# adjust package.json using sed
git checkout package.json
sed -i 's|http://localhost:'${graphql_admin}'|http://localhost:'${GRAPHQL_ADMIN}'|g' package.json
sed -i 's|http://localhost:'${graphql_ipfs}'|http://localhost:'${GRAPHQL_IPFS}'|g' package.json
echo "Set environment to use the following ports:"
echo "GRAPHQL_HTTP $GRAPHQL_HTTP"
echo "GRAPHQL_WSS $GRAPHQL_WSS"
echo "GRAPHQL_ADMIN $GRAPHQL_ADMIN"
echo "GRAPHQL_INDEXER $GRAPHQL_INDEXER"
echo "GRAPHQL_METRICS $GRAPHQL_METRICS"
echo "GRAPHQL_IPFS $GRAPHQL_IPFS"