Skip to content

Commit e61b351

Browse files
Merge branch 'main' into PostgreSQL-update
2 parents f80f349 + 97dfe73 commit e61b351

56 files changed

Lines changed: 5023 additions & 428 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.devcontainer/devcontainer.json

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"name": "Hyperledger Cello",
3+
"image": "mcr.microsoft.com/devcontainers/base:ubuntu-22.04",
4+
"features": {
5+
"ghcr.io/devcontainers/features/docker-in-docker:1": {},
6+
"ghcr.io/devcontainers/features/node:1": {
7+
"version": "20"
8+
},
9+
"ghcr.io/devcontainers/features/python:1": {
10+
"version": "3.10"
11+
}
12+
},
13+
"containerEnv": {
14+
"CELLO_STORAGE_PATH": "/opt/cello"
15+
},
16+
"forwardPorts": [8080, 8081],
17+
"portsAttributes": {
18+
"8080": {
19+
"label": "API Engine",
20+
"onAutoForward": "notify"
21+
},
22+
"8081": {
23+
"label": "Dashboard",
24+
"onAutoForward": "notify"
25+
}
26+
},
27+
"postCreateCommand": "make local",
28+
"customizations": {
29+
"vscode": {
30+
"extensions": [
31+
"ms-azuretools.vscode-docker",
32+
"ms-python.python",
33+
"dbaeumer.vscode-eslint"
34+
]
35+
}
36+
}
37+
}

.github/workflows/lint-check.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
- name: Install Nodejs dependencies
3232
working-directory: src/dashboard
3333
run: |
34-
yarn install --frozen-lockfile
35-
34+
corepack yarn install --frozen-lockfile
35+
3636
- name: Check code
3737
run: make check

docs/reference/configuration/server.md

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -3,134 +3,134 @@
33
```bash
44
$ CONFIG_VAR=xxx make start
55
```
6-
6+
77
## 1. Api Engine
88

99
all related configuration variable is written in ==.makerc/api-engine==.
1010

1111
???+ info "API_ENGINE_WEBROOT"
1212

1313
**default**: `/engine`
14-
14+
1515
**description**: {>>Web ROOT for api engine, which defined the url where user can visit to api engine.<<}
16-
16+
1717
**usage**:
1818
```bash
1919
$ API_ENGINE_WEBROOT=/engine make start
2020
```
21-
22-
21+
22+
2323
???+ info "API_ENGINE_SERVICE_PORT"
2424

2525
**default**: `8085`
26-
26+
2727
**description**: {>>External port of api engine, only work for docker-compose deploy.<<}
28-
28+
2929
**usage**:
3030
```bash
3131
$ API_ENGINE_SERVICE_PORT=8085 make start
3232
```
33-
33+
3434
???+ info "API_ENGINE_ADMIN_TOKEN"
3535

3636
**default**: `administrator`
37-
37+
3838
**description**: {>>Default operator token of api engine, which have the maximum rights.<<}
39-
39+
4040
**usage**:
4141
```bash
4242
$ API_ENGINE_ADMIN_TOKEN=administrator make start
4343
```
44-
44+
4545
???+ info "API_ENGINE_ADMIN_USERNAME"
4646

4747
**default**: `admin`
48-
48+
4949
**description**: {>>Default operator username of api engine, who have the maximum rights.<<}
50-
50+
5151
**usage**:
5252
```bash
5353
$ API_ENGINE_ADMIN_USERNAME=admin make start
5454
```
55-
55+
5656
???+ info "API_ENGINE_ADMIN_PASSWORD"
5757

5858
**default**: `pass`
59-
59+
6060
**description**: {>>Default operator pass of api engine, who have the maximum rights.<<}
61-
61+
6262
**usage**:
6363
```bash
6464
$ API_ENGINE_ADMIN_PASSWORD=pass make start
6565
```
66-
66+
6767
???+ info "API_ENGINE_ADMIN_EMAIL"
6868

6969
**default**: `admin@cello.com`
70-
70+
7171
**description**: {>>Default admin email of api engine, who have the maximum rights.<<}
72-
72+
7373
**usage**:
7474
```bash
7575
$ API_ENGINE_ADMIN_EMAIL=admin@cello.com make start
7676
```
77-
77+
7878
???+ info "API_DOCKER_HOST"
7979

8080
**default**: `unix://var/run/docker.sock`
81-
82-
**description**: {>>Docker host for launch agent container, can be unix socket or ip:port,
81+
82+
**description**: {>>Docker host for launch agent container, can be unix socket or ip:port,
8383
if use remote docker host, remember download all agent images.<<}
84-
84+
8585
**usage**:
8686
```bash
8787
$ API_DOCKER_HOST=unix://var/run/docker.sock make start
8888
```
89-
89+
9090
???+ info "API_VERSION"
9191

9292
**default**: `master`
93-
93+
9494
**description**: {>>API version shown in swagger.<<}
95-
95+
9696
**usage**:
9797
```bash
9898
$ API_VERSION=master make start
9999
```
100100

101101
## 2. Dashboard
102-
102+
103103
???+ info "DASHBOARD_SERVICE_PORT"
104104

105105
**default**: `8085`
106-
106+
107107
**description**: {>>External port for dashboard, only work for docker-compose.<<}
108-
108+
109109
**usage**:
110110
```bash
111111
$ DASHBOARD_SERVICE_PORT=8085 make start
112112
```
113113

114114
Below configurations only work for `make start-dashboard-dev`, and must install all need node modules under the src/dashboard folder.
115-
115+
116116
???+ info "MOCK"
117117

118118
**default**: `True`
119-
119+
120120
**description**: {>>Whether start the dashboard with mock mode, all the data is mock.<<}
121-
121+
122122
**usage**:
123123
```bash
124124
$ Mock=True make start-dashboard-dev
125125
```
126-
126+
127127
???+ info "PROXY"
128128

129129
**default**: `empty`
130-
130+
131131
**description**: {>>When MOCK=False, this variable will have effect,
132132
set the api engine server url, where the api request will redirect to.<<}
133-
133+
134134
**usage**:
135135
```bash
136136
$ PROXY=http://api-engine-server:8085/engine make start-dashboard-dev

docs/setup/server.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,22 +63,22 @@ As Docker Compose V1 will reach its [end of life](https://www.docker.com/blog/an
6363
* Solution:
6464
```bash
6565
$ sudo mkdir /opt/cello
66-
66+
6767
# Then go to Docker Desktop -> Preferences... -> Resources -> File Sharing
6868
# Add the path /opt/cello into the File Sharing list, apply the change and restart Docker Desktop
6969
```
7070

7171
* Operation not permitted when using Docker Desktop
7272
* Error message:
7373
```bash
74-
Error response from daemon:
74+
Error response from daemon:
7575
error while creating mount source path '/opt/cello/pgdata': mkdir /opt/cello/pgdata: permission denied
7676
make: *** [start-docker-compose] Error 1
7777
```
7878
* Solution:
7979
```bash
8080
$ sudo chmod -R 777 /opt/cello
81-
81+
8282
# Then go to Docker Desktop -> Preferences... -> General -> Choose file sharing implementation for your containers
8383
# Choose osxfs, apply the change and restart Docker Desktop
8484
```

docs/tutorials/agent.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,5 +52,5 @@ See you then👋!
5252

5353
to set up a *Hyperledger Cello* **server and agent** in the same place as quick as possible.
5454

55-
However, in order to give you a deeper understanding of how everything works,
55+
However, in order to give you a deeper understanding of how everything works,
5656
we instead walked through the entire setup step-by-step in this tutorial.

docs/tutorials/server.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,5 +73,5 @@ See you then👋!
7373

7474
to set up a *Hyperledger Cello* **server and agent** in the same place as quick as possible.
7575

76-
However, in order to give you a deeper understanding of how everything works,
76+
However, in order to give you a deeper understanding of how everything works,
7777
we instead walked through the entire setup step-by-step in this tutorial.
Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,42 @@
11
from rest_framework import serializers
22

3-
from channel.service import create_channel
3+
from channel.service import create_channel, generate_invitation_definition, sign_config_update, join_channel
44

55
class ChannelSerializer(serializers.Serializer):
66
name = serializers.CharField(help_text="Channel Name")
77

88
def create(self, validated_data):
99
create_channel(validated_data["name"])
1010
return self
11+
12+
13+
class InvitationDefinitionSerializer(serializers.Serializer):
14+
organization_msp_ids = serializers.ListField(
15+
child=serializers.CharField(help_text="Organization MSP ID"),
16+
help_text="List of MSP IDs for invited organizations",
17+
)
18+
19+
def create(self, validated_data):
20+
channel_name = self.context["channel_name"]
21+
artifact = generate_invitation_definition(
22+
channel_name,
23+
validated_data["organization_msp_ids"],
24+
)
25+
validated_data["artifact"] = artifact
26+
return validated_data
27+
28+
29+
class InvitationSignSerializer(serializers.Serializer):
30+
def create(self, validated_data):
31+
channel_name = self.context["channel_name"]
32+
artifact_bytes = self.context["artifact_bytes"]
33+
signed = sign_config_update(channel_name, artifact_bytes)
34+
return {"artifact": signed}
35+
36+
37+
class InvitationJoinSerializer(serializers.Serializer):
38+
def create(self, validated_data):
39+
channel_name = self.context["channel_name"]
40+
artifact_bytes = self.context["artifact_bytes"]
41+
join_channel(channel_name, artifact_bytes)
42+
return validated_data

0 commit comments

Comments
 (0)