diff --git a/docs/run-first-validator.md b/docs/run-first-validator.md index 46ff836..f362fb3 100644 --- a/docs/run-first-validator.md +++ b/docs/run-first-validator.md @@ -4,7 +4,7 @@ - [ansible](playbooks/README.md#ansible-installation) - [laconic-so](https://github.com/cerc-io/stack-orchestrator/?tab=readme-ov-file#install) -- Link to LPS distribution spreadsheet +- LPS distribution spreadsheet URL or excel file path ## Export testnet state @@ -49,7 +49,7 @@ - Generate LPS lockup distribution JSON file ``` - bash ~/cerc/laconicd-stack/scripts/generate-lps-lock.sh "" + bash ~/cerc/laconicd-stack/scripts/generate-lps-lock.sh "" ``` - This will generate the `distribution.json` file at `~/cerc/laconicd-stack/distribution.json` diff --git a/scripts/generate-lps-distribution-json.py b/scripts/generate-lps-distribution-json.py index abdb82d..602f15a 100644 --- a/scripts/generate-lps-distribution-json.py +++ b/scripts/generate-lps-distribution-json.py @@ -63,14 +63,18 @@ def convert_excel_to_json(excel_path, json_path): def main(): if len(sys.argv) != 2: - print('Usage: python download_and_convert_google_sheet.py ') + print('Usage: python generate-lps-distribution-json.py ') sys.exit(1) - google_sheet_url = sys.argv[1] - excel_url = get_excel_download_url(google_sheet_url) - excel_path = 'sheet.xlsx' + input_arg = sys.argv[1] + if input_arg.startswith('https://'): + excel_url = get_excel_download_url(input_arg) + excel_path = 'sheet.xlsx' + print(f'Downloading Excel file from: {excel_url}') + download_excel(excel_url, excel_path) + else: + excel_path = input_arg + print(f'Using Excel file at path: {excel_path}') json_path = 'distribution.json' - print(f'Downloading Excel file from: {excel_url}') - download_excel(excel_url, excel_path) print('Converting Excel to JSON...') convert_excel_to_json(excel_path, json_path) print(f'JSON saved to {json_path}') diff --git a/scripts/generate-lps-lock.sh b/scripts/generate-lps-lock.sh index a634a9b..1cbf776 100644 --- a/scripts/generate-lps-lock.sh +++ b/scripts/generate-lps-lock.sh @@ -17,8 +17,8 @@ if [ ! -d "$venv_dir" ]; then fi # Activate venv and install dependencies -"$venv_dir/bin/pip" install --upgrade pip > /dev/null -"$venv_dir/bin/pip" install requests pandas openpyxl > /dev/null +"$venv_dir/bin/pip" install --upgrade pip +"$venv_dir/bin/pip" install requests pandas openpyxl echo "Running LPS lock generation script..." "$venv_dir/bin/python" "$script_dir/generate-lps-distribution-json.py" "$sheet_url"