This repository has been archived by the owner on Jan 27, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 93
Santander AML Example (Web Client part) #180
Open
gbarcomu
wants to merge
6
commits into
hyperledger-archives:main
Choose a base branch
from
gbarcomu:master
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
3f9b7a9
TCF Web Client
gbarcomu 7298815
Added README license, splitted long lines
gbarcomu 671fa95
Changed docker compose aml to be compatible after PR #148
gbarcomu 126462e
Minor changes
gbarcomu bcceddc
Merge master into master
gbarcomu 060e8bc
Deleted information about how to make avalon stateful
gbarcomu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# Copyright 2019 Banco Santander S.A. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
version: '3.5' | ||
|
||
services: | ||
tcf: | ||
container_name: tcf | ||
image: tcf-dev | ||
build: | ||
context: . | ||
dockerfile: ./docker/Dockerfile.tcf-dev | ||
args: | ||
- http_proxy | ||
- https_proxy | ||
- no_proxy | ||
- MAKECLEAN=${MAKECLEAN:-1} | ||
- TCF_DEBUG_BUILD=${TCF_DEBUG_BUILD:-} | ||
- DISPLAY=${DISPLAY:-} | ||
- XAUTHORITY=~/.Xauthority | ||
ports: | ||
- "1947:1947" | ||
volumes: | ||
# Below volume mappings are required for DISPLAY settings by heart disease GUI client | ||
- /tmp/.X11-unix:/tmp/.X11-unix | ||
- ~/.Xauthority:/root/.Xauthority | ||
working_dir: "/project/TrustedComputeFramework" | ||
entrypoint: "bash -c \"\ | ||
source scripts/tcs_startup.sh -y \ | ||
&& tail -f /dev/null \"" | ||
stop_signal: SIGKILL | ||
networks: | ||
- sgx-network | ||
|
||
networks: | ||
sgx-network: | ||
name: sgx-network | ||
driver: bridge | ||
ipam: | ||
config: | ||
- subnet: 172.16.239.0/24 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<!-- | ||
Licensed under Creative Commons Attribution 4.0 International License | ||
https://creativecommons.org/licenses/by/4.0/ | ||
--> | ||
|
||
The aml example is composed by 3 different parts. | ||
1. standalone-cipher: This is an example of a standalone cipher that is proposed as a possible solution. This tool has several functionalities. | ||
- It allows you to create a well formatted JSONs that you can send to the platform just by inputing the CSVs with the information about both the users and the transactions. | ||
- It also allows you to encrypt the JSONs in a manner totally independent from the platform just by feeding the workerInfo of the worker that you are targeting to process your work orders. | ||
|
||
2. web-client: This is a example of a proposed view for the aml application with the following functionalities: | ||
- retrieve the list of available workers and display their information. | ||
- download the workerInfo of a concrete worker. | ||
- send already encrypted JSONs to be processed by the server side. | ||
- retrieve the result of a work order and update the state of the algorithm. | ||
|
||
[Web Client README](web-client/README.md) | ||
|
||
3. workload: Contains the logic used for this aml use case. The algorithm consist on a simplified version of Anti Money Laundering, it searches for money going round in circles and outputs the list of people suspicious of doing so. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
.DS_Store | ||
node_modules | ||
/dist | ||
/deployment/dist | ||
|
||
# local env files | ||
.env.local | ||
.env.*.local | ||
|
||
# Log files | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# Editor directories and files | ||
.idea | ||
.vscode | ||
*.suo | ||
*.ntvs* | ||
*.njsproj | ||
*.sln | ||
*.sw* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<!-- | ||
Licensed under Creative Commons Attribution 4.0 International License | ||
https://creativecommons.org/licenses/by/4.0/ | ||
--> | ||
|
||
# Santander AML DEMO SGX WEB CLIENT | ||
|
||
## Compiles and hot-reloads for development | ||
``` | ||
npm install | ||
npm run serve | ||
``` | ||
|
||
## Deployment in production | ||
|
||
|
||
1. Go to **Project Root Folder** | ||
|
||
2. Build Trusted Compute Framework using "docker-compose-aml-web-client.yaml" | ||
|
||
``` | ||
docker-compose -f docker-compose-aml-web-client.yaml up | ||
``` | ||
|
||
3. Go back to this folder (web-client) | ||
|
||
4. Change variable "SERVER_URL" in file "src/config.js" | ||
|
||
5. Change variable "server_name" in file "deployment/nginx.conf. It must be the same url than the specified in "config.js" file | ||
|
||
6. Install dependencies executing in this folder | ||
|
||
``` | ||
npm install | ||
``` | ||
|
||
7. Compile for production executing in this folder | ||
|
||
``` | ||
npm run build | ||
``` | ||
|
||
8. Go to "deployment" folder. | ||
|
||
9. Execute | ||
|
||
``` | ||
docker-compose up | ||
``` | ||
|
||
10. Open a browser and check if everything is deployed correctly. There must be some workers in "Available Workers" slot. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A couple of steps to guide through the UI would be much appreciated. And a sample request attached along. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module.exports = { | ||
presets: [ | ||
'@vue/app' | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
dist/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Copyright 2019 Banco Santander S.A. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
FROM nginx:1.9.15 | ||
|
||
LABEL maintainer="Santander Blockchain Team" | ||
|
||
#Install Curl | ||
RUN apt-get update | ||
RUN apt-get install curl -y | ||
|
||
#nginx configuration disable defaults | ||
RUN mv /etc/nginx/conf.d/default.conf default.conf.disabled | ||
|
||
#Copy the custom configuration | ||
COPY nginx.conf /etc/nginx/nginx.conf | ||
|
||
#Copy the application distribution | ||
COPY dist /usr/share/nginx/html |
30 changes: 30 additions & 0 deletions
30
examples/apps/aml/web-client/deployment/docker-compose.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Copyright 2019 Banco Santander S.A. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
version: '3.5' | ||
|
||
services: | ||
|
||
sgx-web-client: | ||
build: ./ | ||
image: sgx-web-client | ||
container_name: sgx-web-client | ||
networks: | ||
- sgx-network | ||
ports: | ||
- "0.0.0.0:80:80" | ||
|
||
networks: | ||
sgx-network: | ||
external: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# Copyright 2019 Banco Santander S.A. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
user nginx; | ||
worker_processes 5; ## Default: 1 | ||
error_log /var/log/nginx/error.log warn; | ||
pid /var/run/nginx.pid; | ||
worker_rlimit_nofile 8192; | ||
|
||
events { | ||
worker_connections 4096; ## Default: 1024 | ||
} | ||
|
||
http { | ||
include /etc/nginx/mime.types; | ||
index index.html index.htm index.php; | ||
|
||
default_type application/octet-stream; | ||
log_format main '$remote_addr - $remote_user [$time_local] $status ' | ||
'"$request" $body_bytes_sent "$http_referer" ' | ||
'"$http_user_agent" "$http_x_forwarded_for"'; | ||
access_log /var/log/nginx/access.log main; | ||
|
||
sendfile on; | ||
tcp_nopush on; | ||
server_names_hash_bucket_size 128; # this seems to be required for some vhosts | ||
|
||
upstream myserverbackend { | ||
|
||
server tcf:1947; | ||
} | ||
|
||
server { # simple reverse-proxy | ||
listen 80; | ||
server_name {YOUR DOMAIN}.com www.{YOUR DOMAIN}.com; | ||
|
||
location / { | ||
root /usr/share/nginx/html; | ||
index index.html index.htm; | ||
try_files $uri $uri/ /index.html; | ||
expires 1M; | ||
} | ||
|
||
|
||
# pass requests for dynamic content to rails/turbogears/zope, et al | ||
location /rpc/ { | ||
proxy_pass http://myserverbackend/; | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
} | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can npm build/run be moved to docker? Need to build outside and then deploy for any new changes.