Ejemplo n.º 1
0
class PeerCa(models.Model):
    node = models.ForeignKey(
        "Node",
        help_text="CA node of peer",
        null=True,
        on_delete=models.CASCADE,
    )
    peer = models.ForeignKey(
        "FabricPeer",
        help_text="Peer node",
        null=True,
        on_delete=models.CASCADE,
    )
    address = models.CharField(help_text="Node Address of ca",
                               default="",
                               max_length=128)
    certificate = models.FileField(
        help_text="Certificate file for ca node.",
        max_length=256,
        upload_to=get_ca_certificate_path,
        blank=True,
        null=True,
    )
    type = models.CharField(
        help_text="Type of ca node for peer",
        choices=FabricCAServerType.to_choices(),
        max_length=64,
        default=FabricCAServerType.Signature.value,
    )
Ejemplo n.º 2
0
class FabricCA(models.Model):
    admin_name = models.CharField(
        help_text="Admin username for ca server",
        default="admin",
        max_length=32,
    )
    admin_password = models.CharField(
        help_text="Admin password for ca server",
        default="adminpw",
        max_length=32,
    )
    hosts = JSONField(
        help_text="Hosts for ca", null=True, blank=True, default=list
    )
    type = models.CharField(
        help_text="Fabric ca server type",
        default=FabricCAServerType.Signature.value,
        choices=FabricCAServerType.to_choices(),
        max_length=32,
    )