Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ jobs:
scripts/build.sh ${{ needs.create_release.outputs.version }} ${{ needs.create_release.outputs.branch }} ${{ matrix.build_type }}
echo "Contents of dist directory:"
ls -altr ${{ github.workspace }}/dist/
docker rm -f $(docker ps -aq)
docker rm -f $(docker ps -aq) || true

- name: Save sha512sum for ${{ steps.asset_details.outputs.FINAL_ASSET_NAME }}
run: |
Expand Down
34 changes: 17 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,26 @@ SKALE Node CLI, part of the SKALE suite of validator tools, is the command line
## Table of Contents

1. [Installation](#installation)
1.1 [Standard Node Binary](#standard-node-binary)
1.2 [Sync Node Binary](#sync-node-binary)
1.3 [Mirage Node Binary](#mirage-node-binary)
1.4 [Permissions and Testing](#permissions-and-testing)
1. [Standard Node Binary](#standard-node-binary)
2. [Sync Node Binary](#sync-node-binary)
3. [Mirage Node Binary](#mirage-node-binary)
4. [Permissions and Testing](#permissions-and-testing)
2. [Standard Node Usage (`skale` - Normal Build)](#standard-node-usage-skale---normal-build)
2.1 [Top level commands (Standard)](#top-level-commands-standard)
2.2 [Node commands (Standard)](#node-commands-standard)
2.3 [Wallet commands (Standard)](#wallet-commands-standard)
2.4 [sChain commands (Standard)](#schain-commands-standard)
2.5 [Health commands (Standard)](#health-commands-standard)
2.6 [SSL commands (Standard)](#ssl-commands-standard)
2.7 [Logs commands (Standard)](#logs-commands-standard)
2.8 [Resources allocation commands (Standard)](#resources-allocation-commands-standard)
1. [Top level commands (Standard)](#top-level-commands-standard)
2. [Node commands (Standard)](#node-commands-standard)
3. [Wallet commands (Standard)](#wallet-commands-standard)
4. [sChain commands (Standard)](#schain-commands-standard)
5. [Health commands (Standard)](#health-commands-standard)
6. [SSL commands (Standard)](#ssl-commands-standard)
7. [Logs commands (Standard)](#logs-commands-standard)
8. [Resources allocation commands (Standard)](#resources-allocation-commands-standard)
3. [Sync Node Usage (`skale` - Sync Build)](#sync-node-usage-skale---sync-build)
3.1 [Top level commands (Sync)](#top-level-commands-sync)
3.2 [Sync node commands](#sync-node-commands)
1. [Top level commands (Sync)](#top-level-commands-sync)
2. [Sync node commands](#sync-node-commands)
4. [Mirage Node Usage (`mirage`)](#mirage-node-usage-mirage)
4.1 [Top level commands (Mirage)](#top-level-commands-mirage)
4.2 [Mirage Boot commands](#mirage-boot-commands)
4.3 [Mirage Node commands](#mirage-node-commands)
1. [Top level commands (Mirage)](#top-level-commands-mirage)
2. [Mirage Boot commands](#mirage-boot-commands)
3. [Mirage Node commands](#mirage-node-commands)
5. [Exit codes](#exit-codes)
6. [Development](#development)

Expand Down
4 changes: 2 additions & 2 deletions node_cli/cli/exit.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
from node_cli.utils.print_formatters import print_exit_status
from node_cli.utils.helper import error_exit, get_request, post_request, abort_if_false
from node_cli.utils.exit_codes import CLIExitCodes
from node_cli.utils.texts import Texts
from node_cli.utils.texts import safe_load_texts

logger = logging.getLogger(__name__)
TEXTS = Texts()
TEXTS = safe_load_texts()
BLUEPRINT_NAME = 'node'


Expand Down
4 changes: 2 additions & 2 deletions node_cli/cli/health.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>.

import click
from node_cli.utils.texts import Texts
from node_cli.utils.texts import safe_load_texts

from node_cli.core.health import get_containers, get_schains_checks, get_sgx_info


G_TEXTS = Texts()
G_TEXTS = safe_load_texts()
TEXTS = G_TEXTS['health']


Expand Down
4 changes: 2 additions & 2 deletions node_cli/cli/lvmpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
import click

from node_cli.utils.helper import abort_if_false
from node_cli.utils.texts import Texts
from node_cli.utils.texts import safe_load_texts
from lvmpy.src.app import run as run_lvmpy
from lvmpy.src.health import heal_service

G_TEXTS = Texts()
G_TEXTS = safe_load_texts()
TEXTS = G_TEXTS['lvmpy']


Expand Down
3 changes: 2 additions & 1 deletion node_cli/cli/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@
from node_cli.configs import DEFAULT_NODE_BASE_PORT
from node_cli.configs.env import ALLOWED_ENV_TYPES
from node_cli.utils.decorators import check_inited
from node_cli.utils.helper import abort_if_false, safe_load_texts, streamed_cmd, IP_TYPE
from node_cli.utils.helper import abort_if_false, streamed_cmd, IP_TYPE
from node_cli.utils.texts import safe_load_texts
from node_cli.utils.meta import get_meta_info
from node_cli.utils.print_formatters import print_meta_info

Expand Down
3 changes: 2 additions & 1 deletion node_cli/cli/resources_allocation.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
get_resource_allocation_info,
generate_resource_allocation_config,
)
from node_cli.utils.helper import abort_if_false, safe_load_texts
from node_cli.utils.helper import abort_if_false
from node_cli.utils.texts import safe_load_texts
from node_cli.utils.node_type import NodeType

TEXTS = safe_load_texts()
Expand Down
3 changes: 2 additions & 1 deletion node_cli/cli/ssl.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
from terminaltables import SingleTable

from node_cli.utils.exit_codes import CLIExitCodes
from node_cli.utils.helper import safe_load_texts, error_exit
from node_cli.utils.helper import error_exit
from node_cli.utils.texts import safe_load_texts
from node_cli.configs.ssl import DEFAULT_SSL_CHECK_PORT, SSL_CERT_FILEPATH, SSL_KEY_FILEPATH
from node_cli.core.ssl import check_cert, upload_cert, cert_status

Expand Down
2 changes: 1 addition & 1 deletion node_cli/cli/sync_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
from node_cli.utils.helper import (
abort_if_false,
error_exit,
safe_load_texts,
streamed_cmd,
URL_TYPE,
)
from node_cli.utils.texts import safe_load_texts


G_TEXTS = safe_load_texts()
Expand Down
2 changes: 1 addition & 1 deletion node_cli/core/host.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
from node_cli.core.nftables import NFTablesManager
from node_cli.utils.helper import safe_mkdir

from node_cli.utils.helper import safe_load_texts
from node_cli.utils.texts import safe_load_texts

TEXTS = safe_load_texts()

Expand Down
4 changes: 2 additions & 2 deletions node_cli/core/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
post_request,
)
from node_cli.utils.meta import get_meta_info
from node_cli.utils.texts import Texts
from node_cli.utils.texts import safe_load_texts
from node_cli.utils.exit_codes import CLIExitCodes
from node_cli.utils.decorators import check_not_inited, check_inited, check_user
from node_cli.utils.docker_utils import (
Expand All @@ -86,7 +86,7 @@


logger = logging.getLogger(__name__)
TEXTS = Texts()
TEXTS = safe_load_texts()

BASE_CONTAINERS_AMOUNT = 5
BLUEPRINT_NAME = 'node'
Expand Down
3 changes: 2 additions & 1 deletion node_cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@
from node_cli.core.host import init_logs_dir
from node_cli.utils.node_type import NodeType
from node_cli.configs import LONG_LINE
from node_cli.utils.helper import safe_load_texts, init_default_logger
from node_cli.utils.helper import init_default_logger
from node_cli.utils.texts import safe_load_texts
from node_cli.utils.helper import error_exit

TEXTS = safe_load_texts()
Expand Down
4 changes: 2 additions & 2 deletions node_cli/utils/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
from node_cli.core.host import is_node_inited
from node_cli.utils.global_config import get_system_user
from node_cli.utils.helper import error_exit, is_user_valid, get_g_conf_user
from node_cli.utils.texts import Texts
from node_cli.utils.texts import safe_load_texts
from node_cli.utils.exit_codes import CLIExitCodes


TEXTS = Texts()
TEXTS = safe_load_texts()


def check_not_inited(f):
Expand Down
9 changes: 0 additions & 9 deletions node_cli/utils/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
from node_cli.utils.print_formatters import print_err_response
from node_cli.utils.exit_codes import CLIExitCodes
from node_cli.configs import (
TEXT_FILE,
ADMIN_HOST,
ADMIN_PORT,
HIDE_STREAM_LOG,
Expand Down Expand Up @@ -187,14 +186,6 @@ def safe_get_config(config, key):
return None


def safe_load_texts():
with open(TEXT_FILE, 'r') as stream:
try:
return yaml.safe_load(stream)
except yaml.YAMLError as exc:
print(exc)


def safe_load_yml(filepath):
with open(filepath, 'r') as stream:
try:
Expand Down
4 changes: 2 additions & 2 deletions node_cli/utils/print_formatters.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
from node_cli.configs import LONG_LINE
from node_cli.configs.cli_logger import DEBUG_LOG_FILEPATH
from node_cli.utils.meta import CliMeta
from node_cli.utils.texts import Texts
from node_cli.utils.texts import safe_load_texts

TEXTS = Texts()
TEXTS = safe_load_texts()


def print_wallet_info(wallet):
Expand Down
29 changes: 16 additions & 13 deletions node_cli/utils/texts.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
# -*- coding: utf-8 -*-
#
# This file is part of node-cli
#
# Copyright (C) 2025-Present SKALE Labs
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
Expand All @@ -11,16 +21,9 @@
from node_cli.configs import TEXT_FILE


class Texts:
def __init__(self):
self._texts = self._load()

def __getitem__(self, key):
return self._texts.get(key)

def _load(self):
with open(TEXT_FILE, 'r') as stream:
try:
return yaml.safe_load(stream)
except yaml.YAMLError as exc:
print(exc)
def safe_load_texts():
with open(TEXT_FILE, 'r') as stream:
try:
return yaml.safe_load(stream)
except yaml.YAMLError as exc:
print(exc)
Loading