-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docker: drop RPC flag and add REST API flags
Related to removal of RPC API support in: waku-org/nwaku#2416 Signed-off-by: Jakub Sokołowski <jakub@status.im>
- Loading branch information
Showing
8 changed files
with
65 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,38 @@ | ||
--- | ||
- name: 'Wait for RPC port to be available' | ||
- name: 'Wait for REST port to be available' | ||
wait_for: | ||
port: '{{ nim_waku_rpc_tcp_port }}' | ||
port: '{{ nim_waku_rest_port }}' | ||
delay: 5 | ||
|
||
- name: 'Extract address of the node for Consul' | ||
uri: | ||
url: 'http://localhost:{{ nim_waku_rpc_tcp_port }}/' | ||
method: POST | ||
body: | ||
method: 'get_waku_v2_debug_v1_info' | ||
params: [] | ||
jsonrpc: '2.0' | ||
id: 1 | ||
url: 'http://localhost:{{ nim_waku_rest_port }}/debug/v1/info' | ||
status_code: 200 | ||
body_format: json | ||
register: waku_info | ||
ignore_errors: true | ||
|
||
- name: Verify we got the node address | ||
assert: | ||
that: 'waku_info.json.result.listenAddresses is defined' | ||
that: 'waku_info.json.listenAddresses is defined' | ||
fail_msg: 'Did not receive Nim-Waku node address!' | ||
quiet: true | ||
|
||
- name: Extract LibP2P TCP address from list | ||
set_fact: | ||
nim_waku_libp2p_enr_uri: |- | ||
{{ waku_info.json.result.enrUri }} | ||
{{ waku_info.json.enrUri }} | ||
nim_waku_libp2p_multiaddr: |- | ||
{{ waku_info.json.result.listenAddresses | ||
{{ waku_info.json.listenAddresses | ||
| reject("contains", "/ws") | first }} | ||
- name: Extract LibP2P WS address from list | ||
when: nim_waku_websocket_enabled or nim_waku_websockify_enabled | ||
set_fact: | ||
nim_waku_libp2p_websocket: |- | ||
{{ waku_info.json.result.listenAddresses | ||
{{ waku_info.json.listenAddresses | ||
| select("contains", "/ws") | first }} | ||
- name: Extract peer ID from RPC response | ||
- name: Extract peer ID from API response | ||
set_fact: | ||
nim_waku_peer_id: '{{ nim_waku_libp2p_multiaddr.split("/") | last }}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/usr/bin/env bash | ||
# vim: set ft=sh: | ||
|
||
TIMEOUT="${TIMEOUT:-5}" | ||
URL="http://localhost:{{ nim_waku_rest_port }}/" | ||
|
||
# List known useful endpoints when called without arguments. | ||
read -r -d '' ENDPOINTS << EOF | ||
/debug/v1/info | ||
/debug/v1/version | ||
/admin/v1/peers | ||
/health | ||
EOF | ||
if [[ $# == 0 ]]; then | ||
echo "${ENDPOINTS}" | fzf \ | ||
--preview='{{ nim_waku_cont_vol }}/api.sh ${1}' \ | ||
--preview-window=bottom,22 | ||
exit 0 | ||
elif [[ $# > 1 ]]; then | ||
echo "Too many arguments!" >&2 | ||
exit 1 | ||
fi | ||
ENDPOINT="${1}" | ||
|
||
# The jq script checks if error exists and adjusts exit code. | ||
curl --silent --max-time "${TIMEOUT}" --show-error --fail-with-body \ | ||
"${URL}${ENDPOINT}" | jq |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.