From 1ac664d0ea1f7b314ffc377ef2baec5cb0252853 Mon Sep 17 00:00:00 2001 From: Alex Date: Wed, 31 Dec 2025 01:20:37 +0300 Subject: [PATCH] =?UTF-8?q?=D0=B2=D0=B0=D1=88=D0=B5=20=D1=81=D0=BE=D0=BE?= =?UTF-8?q?=D0=B1=D1=89=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=BA=D0=BE=D0=BC=D0=BC?= =?UTF-8?q?=D0=B8=D1=82=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 3 ++ scripts/internal/db/db_init_helper.sh | 54 +-------------------------- 2 files changed, 5 insertions(+), 52 deletions(-) diff --git a/.gitignore b/.gitignore index b7e5009..79cdbd1 100644 --- a/.gitignore +++ b/.gitignore @@ -210,3 +210,6 @@ dle-template.tar.gz.join.sh # Локальные скрипты разработки sync-to-vds.sh + +# Database initialization helper script +scripts/internal/db/db_init_helper.sh diff --git a/scripts/internal/db/db_init_helper.sh b/scripts/internal/db/db_init_helper.sh index cdf0177..1d7bb3f 100755 --- a/scripts/internal/db/db_init_helper.sh +++ b/scripts/internal/db/db_init_helper.sh @@ -73,26 +73,6 @@ BEGIN INSERT INTO rpc_providers (network_id_encrypted, rpc_url_encrypted, chain_id) VALUES (encrypt_text('sepolia', get_encryption_key()), encrypt_text('https://1rpc.io/sepolia', get_encryption_key()), 11155111); END IF; - - -- Arbitrum Sepolia - IF NOT EXISTS ( - SELECT 1 FROM rpc_providers - WHERE decrypt_text(network_id_encrypted, get_encryption_key()) = 'arbitrum-sepolia' - AND chain_id = 421614 - ) THEN - INSERT INTO rpc_providers (network_id_encrypted, rpc_url_encrypted, chain_id) - VALUES (encrypt_text('arbitrum-sepolia', get_encryption_key()), encrypt_text('https://sepolia-rollup.arbitrum.io/rpc', get_encryption_key()), 421614); - END IF; - - -- Base Sepolia - IF NOT EXISTS ( - SELECT 1 FROM rpc_providers - WHERE decrypt_text(network_id_encrypted, get_encryption_key()) = 'base-sepolia' - AND chain_id = 84532 - ) THEN - INSERT INTO rpc_providers (network_id_encrypted, rpc_url_encrypted, chain_id) - VALUES (encrypt_text('base-sepolia', get_encryption_key()), encrypt_text('https://sepolia.base.org', get_encryption_key()), 84532); - END IF; END \$\$;" # Заполняем токены аутентификации с проверкой дубликатов @@ -103,44 +83,14 @@ BEGIN IF NOT EXISTS ( SELECT 1 FROM auth_tokens WHERE decrypt_text(network_encrypted, get_encryption_key()) = 'sepolia' - AND decrypt_text(address_encrypted, get_encryption_key()) = '0xdD27a91692da59d1Ee7dD1Fb342B9f1B5FF29386' + AND decrypt_text(address_encrypted, get_encryption_key()) = '0x8e96DdB110aa1C55A4b9ded8c16E66Fbdb5E63E1' ) THEN INSERT INTO auth_tokens (name_encrypted, address_encrypted, network_encrypted, min_balance, readonly_threshold, editor_threshold) VALUES ( encrypt_text('DLE', get_encryption_key()), - encrypt_text('0xdD27a91692da59d1Ee7dD1Fb342B9f1B5FF29386', get_encryption_key()), + encrypt_text('0x8e96DdB110aa1C55A4b9ded8c16E66Fbdb5E63E1', get_encryption_key()), encrypt_text('sepolia', get_encryption_key()), 1.000000000000000000, 1, 1 ); END IF; - - -- Arbitrum Sepolia token - IF NOT EXISTS ( - SELECT 1 FROM auth_tokens - WHERE decrypt_text(network_encrypted, get_encryption_key()) = 'arbitrum-sepolia' - AND decrypt_text(address_encrypted, get_encryption_key()) = '0xdD27a91692da59d1Ee7dD1Fb342B9f1B5FF29386' - ) THEN - INSERT INTO auth_tokens (name_encrypted, address_encrypted, network_encrypted, min_balance, readonly_threshold, editor_threshold) - VALUES ( - encrypt_text('DLE', get_encryption_key()), - encrypt_text('0xdD27a91692da59d1Ee7dD1Fb342B9f1B5FF29386', get_encryption_key()), - encrypt_text('arbitrum-sepolia', get_encryption_key()), - 1.000000000000000000, 1, 1 - ); - END IF; - - -- Base Sepolia token - IF NOT EXISTS ( - SELECT 1 FROM auth_tokens - WHERE decrypt_text(network_encrypted, get_encryption_key()) = 'base-sepolia' - AND decrypt_text(address_encrypted, get_encryption_key()) = '0xdD27a91692da59d1Ee7dD1Fb342B9f1B5FF29386' - ) THEN - INSERT INTO auth_tokens (name_encrypted, address_encrypted, network_encrypted, min_balance, readonly_threshold, editor_threshold) - VALUES ( - encrypt_text('DLE', get_encryption_key()), - encrypt_text('0xdD27a91692da59d1Ee7dD1Fb342B9f1B5FF29386', get_encryption_key()), - encrypt_text('base-sepolia', get_encryption_key()), - 1.000000000000000000, 1, 1 - ); - END IF; END \$\$;"