From 10d8025a1cc3992c32ba3a4ce1edb702ad7684d6 Mon Sep 17 00:00:00 2001 From: mrbusysky <58412572+mrbusysky@users.noreply.github.com> Date: Fri, 8 Oct 2021 03:50:30 -0700 Subject: [PATCH 1/4] Update --- src/thenewboston/models/network_node.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/thenewboston/models/network_node.py b/src/thenewboston/models/network_node.py index a1f2d48..3e93533 100644 --- a/src/thenewboston/models/network_node.py +++ b/src/thenewboston/models/network_node.py @@ -9,7 +9,7 @@ class NetworkNode(models.Model): id = models.UUIDField(default=uuid4, editable=False, primary_key=True) # noqa: A003 account_number = models.CharField(max_length=VERIFY_KEY_LENGTH) - ip_address = models.GenericIPAddressField() + ip_address = models.URLField() node_identifier = models.CharField(max_length=VERIFY_KEY_LENGTH, unique=True) port = models.PositiveIntegerField(blank=True, null=True, validators=[MaxValueValidator(65535)]) protocol = models.CharField(choices=PROTOCOL_CHOICES, max_length=5) From ad1ac3fb5539756f855b851c4b7932dce4e39f22 Mon Sep 17 00:00:00 2001 From: mrbusysky <58412572+mrbusysky@users.noreply.github.com> Date: Fri, 8 Oct 2021 04:00:54 -0700 Subject: [PATCH 2/4] Update initialize_node.py --- src/thenewboston/base_classes/initialize_node.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/thenewboston/base_classes/initialize_node.py b/src/thenewboston/base_classes/initialize_node.py index 662df36..83375a5 100644 --- a/src/thenewboston/base_classes/initialize_node.py +++ b/src/thenewboston/base_classes/initialize_node.py @@ -75,7 +75,7 @@ def get_ip_address(self, value=None): if self.unattended: ip_address = value else: - ip_address = input('Enter public IP address (required): ') + ip_address = input('Enter URL or public IP address (required): ') if not ip_address: self._error('ip_address required') @@ -84,7 +84,7 @@ def get_ip_address(self, value=None): try: validate_ipv46_address(ip_address) except ValidationError: - self._error('Enter a valid IPv4 or IPv6 address') + self._error('Enter a valid Url, IPv4 or IPv6 address') continue self.required_input['ip_address'] = ip_address From 2ccb96ee87e8104edcc76995ad5a891a04aecffc Mon Sep 17 00:00:00 2001 From: Abhay Aysola Date: Fri, 8 Oct 2021 16:34:27 +0530 Subject: [PATCH 3/4] add URLVaidator --- src/thenewboston/base_classes/initialize_node.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/thenewboston/base_classes/initialize_node.py b/src/thenewboston/base_classes/initialize_node.py index 83375a5..51e1ba8 100644 --- a/src/thenewboston/base_classes/initialize_node.py +++ b/src/thenewboston/base_classes/initialize_node.py @@ -2,9 +2,9 @@ from django.core.exceptions import ValidationError from django.core.management.base import BaseCommand, CommandParser -from django.core.validators import validate_ipv46_address +from django.core.validators import URLValidator -from thenewboston.argparser.validators import int_validator, ipv46_validator, str_length_validator +from thenewboston.argparser.validators import int_validator, ipv46_validator, str_length_validator, url_validator from thenewboston.constants.network import PROTOCOL_LIST, VERIFY_KEY_LENGTH """ @@ -82,7 +82,8 @@ def get_ip_address(self, value=None): continue try: - validate_ipv46_address(ip_address) + url_validator = URLValidator + url_validator(ip_address) except ValidationError: self._error('Enter a valid Url, IPv4 or IPv6 address') continue From 88b7a438f866b26a0d5bb9ed72dbd0365e1585ae Mon Sep 17 00:00:00 2001 From: mrbusysky <58412572+mrbusysky@users.noreply.github.com> Date: Sat, 16 Oct 2021 21:24:08 -0700 Subject: [PATCH 4/4] This is needed for some pre beta app testing. --- src/thenewboston/constants/network.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/thenewboston/constants/network.py b/src/thenewboston/constants/network.py index c9bf6bd..f7c6ec5 100644 --- a/src/thenewboston/constants/network.py +++ b/src/thenewboston/constants/network.py @@ -19,7 +19,7 @@ SIGNATURE_LENGTH = 128 VERIFY_KEY_LENGTH = 64 -MEMO_MAX_LENGTH = 64 +MEMO_MAX_LENGTH = 256 MIN_POINT_VALUE = 1 MAX_POINT_VALUE = 281474976710656