Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
76a62e7
Remove Celery
dodo920306 Aug 25, 2025
97fabfa
Remove Celery tasks
dodo920306 Aug 25, 2025
b52eae9
Refactor user module
dodo920306 Aug 25, 2025
120109d
Replace envsubst with plain python
dodo920306 Aug 25, 2025
53f9929
Create 'auth' application
dodo920306 Aug 26, 2025
70b01b2
Refactor organization into an application
dodo920306 Aug 26, 2025
4fb0703
Refactor agent into an application
dodo920306 Aug 27, 2025
93e6134
Refactor node into an application
dodo920306 Aug 27, 2025
14dfbf8
Fulfill node initialization
dodo920306 Aug 28, 2025
e47fc90
Finish testing new auth, user, organization APIs
dodo920306 Sep 13, 2025
22eee32
Remove duplicate config assignments
dodo920306 Sep 13, 2025
155458c
Remove duplicate config assignments
dodo920306 Sep 13, 2025
dbd6c78
Reduce duplicate codes of paginators
dodo920306 Sep 16, 2025
eeb7959
Reduce duplicate codes UserInfoSerializer
dodo920306 Sep 16, 2025
732d691
Reduce duplicate codes of NodeListSerializer
dodo920306 Sep 16, 2025
6b992b1
Make Node migrations
dodo920306 Sep 16, 2025
fd91921
Finish node container creation
dodo920306 Sep 22, 2025
111592e
Finish channel creation
dodo920306 Sep 27, 2025
284fc8a
Remove old channel codes
dodo920306 Sep 27, 2025
ce6ba86
Finish list chaincodes
dodo920306 Sep 27, 2025
407eb5c
Finish upload chaincodes
dodo920306 Sep 27, 2025
be87027
Finish chaincode creation
dodo920306 Sep 28, 2025
715ed1f
Finish chaincode commit
dodo920306 Sep 29, 2025
9222ed8
Remove redundant old API files
dodo920306 Sep 29, 2025
6b45ce1
Remove redundant old API files
dodo920306 Sep 29, 2025
c4fab83
Make migrations
dodo920306 Sep 29, 2025
1577c07
Move Docker file into api engine
dodo920306 Sep 29, 2025
21e575f
Simplify entrypoint
dodo920306 Sep 29, 2025
f9f1b5f
Remove Fabric Node templates
dodo920306 Sep 29, 2025
d4d5642
Remove redundant mkdir
dodo920306 Sep 29, 2025
d1edf76
Fix missing 'l'
dodo920306 Sep 29, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ fabric.properties
bin/
tmp/
*.tmp
*.bak
*.swp
*~.nib
local.properties
Expand Down Expand Up @@ -219,7 +218,6 @@ yarn-error.log
/coverage
.idea
package-lock.json
*bak
.vscode

# visual studio code
Expand All @@ -244,9 +242,9 @@ src/dashboard/lambda/mock/index.js
.config
.config.old

# Cello local storage
/**/opt/*
/**/cello/*
# Fabric
src/api-engine/cello/builders
src/api-engine/cello/config

# Local Netlify folder
.netlify
Expand Down
1 change: 0 additions & 1 deletion build_image/docker/cello-hlf/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ RUN wget -O /go/bin/yq https://github.com/mikefarah/yq/releases/download/2.4.1/y
RUN go install github.com/golang/protobuf/protoc-gen-go@latest \
&& go install github.com/maxbrunsfeld/counterfeiter/v6@latest \
&& go install github.com/axw/gocov/gocov@latest \
&& go install github.com/axw/gocov/gocov@latest \
&& go install golang.org/x/tools/cmd/goimports@latest \
&& go install github.com/onsi/ginkgo/ginkgo@latest

Expand Down
27 changes: 0 additions & 27 deletions build_image/docker/common/api-engine/entrypoint.sh

This file was deleted.

2 changes: 1 addition & 1 deletion build_image/docker/common/dashboard/Dockerfile.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM node:20.15

WORKDIR /usr/src/app/
USER root
RUN mkdir -p /usr/src/app && cd /usr/src/app
RUN cd /usr/src/app
COPY src/dashboard /usr/src/app
RUN export NODE_OPTIONS=--openssl-legacy-provider && yarn --network-timeout 600000 && yarn run build

Expand Down
2 changes: 1 addition & 1 deletion build_image/docker/common/dashboard/default.conf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ server {
root /usr/share/nginx/html;

location / {
index index.html index.htm;
index index.html index.html;
try_files $uri $uri/ /index.html;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,15 @@ RUN apt-get update \
# Set the working dir
WORKDIR /var/www/server

# Install compiled code tools from Artifactory and copy it to opt folder.
RUN curl -L --retry 5 --retry-delay 3 "https://github.com/hyperledger/fabric/releases/download/v2.5.13/hyperledger-fabric-linux-amd64-2.5.13.tar.gz" | tar xz -C /opt/

# Copy source code to the working dir
COPY src/api-engine ./
COPY template/node /opt/node

# Install compiled code tools from Artifactory and copy it to opt folder.
RUN curl -L --retry 5 --retry-delay 3 "https://github.com/hyperledger/fabric/releases/download/v2.5.13/hyperledger-fabric-linux-amd64-2.5.10.tar.gz" | tar xz -C ./cello/

# Install python dependencies
RUN pip3 install -r requirements.txt

# Add uwsgi configuration file
COPY build_image/docker/common/api-engine/server.ini /etc/uwsgi/apps-enabled/

ENV RUN_MODE=server

COPY build_image/docker/common/api-engine/entrypoint.sh /
CMD ["bash", "/entrypoint.sh"]
CMD ["bash", "entrypoint.sh"]
53 changes: 0 additions & 53 deletions src/api-engine/api/auth.py

This file was deleted.

140 changes: 0 additions & 140 deletions src/api-engine/api/common/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,146 +69,6 @@ def names(cls):
return [name.lower() for name, _ in cls.__members__.items()]


@unique
class HostStatus(ExtraEnum):
Inactive = 0
Active = 1


@unique
class NetworkStatus(ExtraEnum):
Stopped = 0
Running = 1
Error = 2


@unique
class LogLevel(ExtraEnum):
Info = 0
Warning = 1
Debug = 2
Error = 3
Critical = 4


@unique
class Operation(ExtraEnum):
Start = 0
Stop = 1
Restart = 2


@unique
class NetworkOperation(ExtraEnum):
Join = 0
Leave = 1


@unique
class HostType(ExtraEnum):
Docker = 0
Kubernetes = 1


@unique
class ChannelType(ExtraEnum):
System = 0
Normal = 1


@unique
class NetworkType(ExtraEnum):
Fabric = "fabric"


@unique
class FabricCAServerType(ExtraEnum):
# every company only can create one TLS type ca server
TLS = "tls"
Signature = "signature"


@unique
class FabricVersions(ExtraEnum):
V1_4 = "1.4.2"
V1_5 = "1.5"


@unique
class FabricNodeType(ExtraEnum):
Ca = 0
Orderer = 1
Peer = 2


@unique
class NodeStatus(ExtraEnum):
Created = 0
Restarting = 1
Running = 2
Removing = 3
Paused = 4
Exited = 5
Dead = 6


@unique
class FabricCAUserType(ExtraEnum):
Peer = "peer"
Orderer = "orderer"
User = "user"


@unique
class FabricCAUserStatus(ExtraEnum):
Registering = "registering"
Registered = "registered"
Fail = "fail"


@unique
class NetworkCreateType(ExtraEnum):
New = 0
Import = 1


@unique
class K8SCredentialType(ExtraEnum):
CertKey = 0
Config = 1
UsernamePassword = 2


@unique
class ConsensusPlugin(ExtraEnum):
Solo = 0
Kafka = 1


@unique
class UserRole(ExtraEnum):
Admin = 0
Operator = 1
User = 2


@unique
class FileType(ExtraEnum):
Certificate = 0


@unique
class AgentOperation(ExtraEnum):
Create = "create"
Start = "start"
Stop = "stop"
Query = "query"
Update = "update"
Delete = "delete"
FabricCARegister = "fabric:ca:register"
NewNetwork = "new:network"


class EnumWithDisplayMeta(EnumMeta):
def __new__(mcs, name, bases, attrs):
display_strings = attrs.get("DisplayStrings")
Expand Down
34 changes: 30 additions & 4 deletions src/api-engine/api/common/response.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,37 @@
}

"""
import enum
from typing import Type, Dict

from rest_framework import serializers

def ok(data):
return {"data": data, "msg": None, "status": "successful"}
class Status(enum.Enum):
SUCCESSFUL = "SUCCESSFUL"
FAILED = "FAILED"

def make_response_serializer(data_serializer: Type[serializers.Serializer]):
class _ResponseBody(serializers.Serializer):
status = serializers.ChoiceField(
choices=[(s.value, s.name) for s in Status]
)
msg = serializers.CharField(required=False, allow_null=True, allow_blank=True)
data = data_serializer(required=False, allow_null=True)

def err(msg):
return {"data": None, "msg": msg, "status": "fail"}
_ResponseBody.__name__ = f"ResponseBody[{data_serializer.__name__}]"
return _ResponseBody


def ok(data: Dict[str, any]) -> Dict[str, any]:
return {
"status": Status.SUCCESSFUL.value,
"msg": None,
"data": data
}

def err(msg: str) -> Dict[str, any]:
return {
"status": Status.FAILED.value,
"msg": msg,
"data": None
}
16 changes: 0 additions & 16 deletions src/api-engine/api/config.py

This file was deleted.

4 changes: 0 additions & 4 deletions src/api-engine/api/lib/agent/__init__.py

This file was deleted.

Loading
Loading