Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ All APIs (external, internal and state channels websocket) are exposed to the do
- external/internal API - http://$DOCKER_HOST_ADDRESS:8080/nodeX
- channels API - ws://$DOCKER_HOST_ADDRESS:8080/nodeX/channel

For example if one wants to use `node1` API on local docker host the address is: http://localhost:8080/node1/v2/status
For example if one wants to use `node1` API on local docker host the address is: http://localhost:8080/node1/v3/status

Also the node1 is always available without URL path suffix, for example:

http://localhost:8080/v2/status
http://localhost:8080/v3/status

Also node1 have the standard port bindings as well:

Expand All @@ -51,7 +51,7 @@ docker-compose up -d
Check if the node is running:

```bash
curl http://localhost:8080/v2/status
curl http://localhost:8080/v3/status
```

To destroy the network:
Expand Down Expand Up @@ -84,7 +84,7 @@ Node names:
For example to access `node2` API (status), assuming docker host address is `localhost`:

```bash
curl http://localhost:8080/node2/v2/status
curl http://localhost:8080/node2/v3/status
```

### Full infrastructure configuration
Expand Down
12 changes: 6 additions & 6 deletions nginx/default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ server {
proxy_pass http://node1:3013/;
}

location /v2/debug {
location /v3/debug {
include cors.conf;
proxy_pass http://node1:3113;
}

location = /v2/key-blocks {
location = /v3/key-blocks {
include cors.conf;
proxy_pass http://node1:3113;
}
Expand All @@ -39,14 +39,14 @@ server {
# http://nginx.org/en/docs/http/ngx_http_core_module.html#location

# Internal API
location ~ ^/(node[0-9]+)/v2/debug/(.*)$ {
location ~ ^/(node[0-9]+)/v3/debug/(.*)$ {
include cors.conf;
proxy_pass http://$1:3113/v2/debug/$2;
proxy_pass http://$1:3113/v3/debug/$2;
}

location ~ ^/(node[0-9]+)/v2/key-blocks$ {
location ~ ^/(node[0-9]+)/v3/key-blocks$ {
include cors.conf;
proxy_pass http://$1:3113/v2/key-blocks;
proxy_pass http://$1:3113/v3/key-blocks;
}

location ~ ^/(node[0-9]+)/v3/debug/(.*)$ {
Expand Down
4 changes: 2 additions & 2 deletions test/healthcheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ WEBSOCKET_ADDR=${WEBSOCKET_ADDR:-localhost:3014}
MIN_PEERS=${MIN_PEERS:-2}

echo "Testing external API: ${EXTERNAL_ADDR}"
curl -sSf -o /dev/null --retry 6 http://${EXTERNAL_ADDR}/v2/status || exit 2
curl -sSf -o /dev/null --retry 6 http://${EXTERNAL_ADDR}/v3/status || exit 2

echo "Testing internal API: ${INTERNAL_ADDR}"
PEERS_COUNT=$(curl -sS ${INTERNAL_ADDR}/v2/debug/peers | grep -o aenode | wc -l)
PEERS_COUNT=$(curl -sS ${INTERNAL_ADDR}/v3/debug/peers | grep -o aenode | wc -l)

echo "Testing internal API: $PEERS_COUNT peers"
test $PEERS_COUNT -ge $MIN_PEERS || exit 3
Expand Down