-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #27 from tonlabs/feature/console
Added node console
- Loading branch information
Showing
10 changed files
with
126 additions
and
8 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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"config": null, | ||
"wallet_id": null, | ||
"max_factor": 3 | ||
} |
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
File renamed without changes.
48 changes: 48 additions & 0 deletions
48
docker-compose/ton-node/scripts/generate_console_config.sh
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,48 @@ | ||
#!/bin/bash -eEx | ||
|
||
if [ "$DEBUG" = "yes" ]; then | ||
set -x | ||
fi | ||
|
||
export TON_NODE_ROOT_DIR="/ton-node" | ||
export TON_NODE_CONFIGS_DIR="${TON_NODE_ROOT_DIR}/configs" | ||
export TON_NODE_TOOLS_DIR="${TON_NODE_ROOT_DIR}/tools" | ||
export TON_NODE_LOGS_DIR="${TON_NODE_ROOT_DIR}/logs" | ||
export RNODE_CONSOLE_SERVER_PORT="3031" | ||
|
||
HOSTNAME=$(hostname -f) | ||
TMP_DIR="/tmp/$(basename "$0" .sh)_$$" | ||
rm -rf "${TMP_DIR}" | ||
mkdir -p "${TMP_DIR}" | ||
|
||
"${TON_NODE_TOOLS_DIR}/keygen" >"${TON_NODE_CONFIGS_DIR}/${HOSTNAME}_console_client_keys.json" | ||
cat "${TON_NODE_CONFIGS_DIR}/${HOSTNAME}_console_client_keys.json" | ||
jq -c .public "${TON_NODE_CONFIGS_DIR}/${HOSTNAME}_console_client_keys.json" >"${TON_NODE_CONFIGS_DIR}/console_client_public.json" | ||
|
||
jq ".control_server_port = ${RNODE_CONSOLE_SERVER_PORT}" "${TON_NODE_CONFIGS_DIR}/default_config.json" >"${TMP_DIR}/default_config.json.tmp" | ||
cp "${TMP_DIR}/default_config.json.tmp" "${TON_NODE_CONFIGS_DIR}/default_config.json" | ||
|
||
# Generate initial config.json | ||
cd "${TON_NODE_ROOT_DIR}" && "${TON_NODE_ROOT_DIR}/ton_node" --configs "${TON_NODE_CONFIGS_DIR}" --ckey "$(cat "${TON_NODE_CONFIGS_DIR}/console_client_public.json")" & | ||
|
||
sleep 10 | ||
|
||
if [ ! -f "${TON_NODE_CONFIGS_DIR}/config.json" ]; then | ||
echo "ERROR: ${TON_NODE_CONFIGS_DIR}/config.json does not exist" | ||
exit 1 | ||
fi | ||
|
||
cat "${TON_NODE_CONFIGS_DIR}/config.json" | ||
|
||
if [ ! -f "${TON_NODE_CONFIGS_DIR}/console_config.json" ]; then | ||
echo "ERROR: ${TON_NODE_CONFIGS_DIR}/console_config.json does not exist" | ||
exit 1 | ||
fi | ||
|
||
cat "${TON_NODE_CONFIGS_DIR}/console_config.json" | ||
|
||
jq ".client_key = $(jq .private "${TON_NODE_CONFIGS_DIR}/${HOSTNAME}_console_client_keys.json")" "${TON_NODE_CONFIGS_DIR}/console_config.json" >"${TMP_DIR}/console_config.json.tmp" | ||
jq ".config = $(cat "${TMP_DIR}/console_config.json.tmp")" "${TON_NODE_CONFIGS_DIR}/console_template.json" >"${TON_NODE_CONFIGS_DIR}/console.json" | ||
rm -f "${TON_NODE_CONFIGS_DIR}/console_config.json" | ||
|
||
rm -rf "${TMP_DIR}" |
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