Skip to content

Commit 708b36a

Browse files
authored
Merge pull request #185 from UniqueNetwork/feature/docker-info
add some samples with docker images
2 parents c5c0039 + bbf2331 commit 708b36a

1 file changed

Lines changed: 94 additions & 3 deletions

File tree

docs/build/sdk/v2/quick-start.md

Lines changed: 94 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,21 +72,112 @@ The Unique SDK currently supports the following modules:
7272

7373
Instead of using public SDK endpoints, you can easily run your own HTTP proxy. Create a docker-compose.yml with the following content, and run `docker compose up`.
7474

75-
```yml:no-line-numbers
76-
version: "3.8"
7775

76+
### Sample HTTP proxy configuration for Unique Network mainnet
77+
78+
```yml:no-line-numbers
7879
services:
7980
substrate-proxy:
8081
image: uniquenetwork/substrate-proxy-http-proxy:master
8182
ports:
8283
- "3000:3000"
8384
environment:
8485
- PORT=3000
85-
- CHAIN=unique
86+
- CHAIN=unique # or wss://ws.unique.network
8687
- MIN_LOG_LEVEL=info
8788
- EXTRINSIC_MORTAL_BLOCK_LENGTH=32
8889
- OPENAPI_SERVER_URL=http://localhost:3000
8990
- OPENAPI_SERVER_DESCRIPTION="Local development server"
9091
- EXTRINSICS_STORAGE_MAX_BLOCKS_COUNT=100
9192
```
9293

94+
## Full development stack
95+
96+
Or you even can run all services including dev blockchain node, indexer, and HTTP proxy with a single command.
97+
98+
This is the recommended way for local development and testing.
99+
100+
List of services:
101+
- `scan-crawler`: Indexer that syncs data from the chain to the database.
102+
- `scan-api`: Indexer API that provides read-only access to the indexed data.
103+
- `http-proxy`: HTTP proxy that provides access to the chain and indexer via REST API.
104+
- `postgres`: PostgreSQL database for the indexer.
105+
- `chain`: Unique Network node in dev mode.
106+
107+
108+
Create a docker-compose.yml with the following content, and run `docker compose up`.
109+
110+
```yml:no-line-numbers
111+
services:
112+
113+
scan-crawler:
114+
image: uniquenetwork/substrate-proxy-scan-crawler:master
115+
environment:
116+
- DB_URL=postgres://db_user:db_password@postgres:5432/scan_db
117+
- CHAIN=ws://chain:9833
118+
command: "yarn workspace scan-crawler start"
119+
120+
scan-api:
121+
image: uniquenetwork/substrate-proxy-scan-api:master
122+
ports:
123+
- 3001:3001
124+
environment:
125+
- DB_URL=postgres://db_user:db_password@postgres:5432/scan_db
126+
- PORT=3001
127+
- OPENAPI_SERVER_URL=http://localhost:3001/
128+
- OPENAPI_SERVER_DESCRIPTION="This server"
129+
- OPENAPI_SERVER_PUBLIC_PATH=/
130+
131+
http-proxy:
132+
image: uniquenetwork/substrate-proxy-http-proxy:master
133+
ports:
134+
- 3000:3000
135+
environment:
136+
- PORT=3000
137+
- CHAIN=ws://chain:9833
138+
- MIN_LOG_LEVEL=info
139+
- EXTRINSIC_MORTAL_BLOCK_LENGTH=64
140+
- OPENAPI_SERVER_URL=http://localhost:3000/
141+
- OPENAPI_SERVER_DESCRIPTION="This server"
142+
- OPENAPI_SERVER_PUBLIC_PATH=/
143+
144+
postgres:
145+
image: postgres:17
146+
environment:
147+
POSTGRES_USER: db_user
148+
POSTGRES_PASSWORD: db_password
149+
POSTGRES_DB: scan_db
150+
ports:
151+
- "5432:5432"
152+
volumes:
153+
- scan-postgres:/var/lib/postgresql/data
154+
155+
chain:
156+
image: uniquenetwork/unique-node-public:latest
157+
command: >
158+
--dev
159+
--idle-autoseal-interval 2000
160+
--disable-autoseal-on-tx
161+
--autoseal-finalization-delay 2000
162+
--state-pruning archive
163+
--blocks-pruning archive
164+
--base-path /unique/data
165+
--port 30333
166+
--rpc-port 9833
167+
--no-prometheus
168+
--no-mdns
169+
--no-telemetry
170+
--unsafe-rpc-external
171+
--rpc-cors=all
172+
ports:
173+
- 9833:9833
174+
- 40333:40333
175+
- 30333:30333
176+
volumes:
177+
- chain-data:/chain/data
178+
179+
volumes:
180+
chain-data:
181+
scan-postgres:
182+
183+
```

0 commit comments

Comments
 (0)