Added create container grpc method

Signed-off-by: Ilyas Niyazov <i.niyazov@yadro.com>
This commit is contained in:
Ilyas Niyazov 2025-03-10 13:46:17 +03:00
parent 9a1b5d778b
commit f8465e5b99
34 changed files with 532 additions and 53 deletions

View file

@ -0,0 +1,8 @@
import grpc
from frostfs_sdk.client.models.ecdsa import ECDSA
class ClientEnvironment:
def __init__(self, ecdsa: ECDSA, channel: grpc.Channel):
self.ecdsa = ecdsa
self.channel = channel

View file

@ -0,0 +1,19 @@
class ClientSettings:
def __init__(self, wif: str = None, address: str = None):
"""
Initializes client settings with validation.
Args:
wif: Wallet import format string
address: FrostFS node host address
"""
self.wif = wif
self.address = address
# Perform validation after initialization
self.validate()
def validate(self):
"""Performs runtime validation of the settings"""
if not (self.address and self.wif):
raise ValueError("The value must be specified ADDRESS and WIF")

View file

@ -0,0 +1,8 @@
from frostfs_sdk.cryptography.key_extension import KeyExtension
class ECDSA:
def __init__(self, wif: str):
self.wif = wif
self.private_key: bytes = KeyExtension().get_private_key_from_wif(wif)
self.public_key: bytes = KeyExtension().get_public_key(self.private_key)