Skip to content

Commit 9d05b05

Browse files
authored
Merge branch 'master' into update-docs-0.7-spec
2 parents 5e67935 + e9cf860 commit 9d05b05

File tree

246 files changed

+24038
-6
lines changed

Some content is hidden

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

246 files changed

+24038
-6
lines changed

Dockerfile

+5-4
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,13 @@
1717
############################
1818
FROM golang:alpine AS builder
1919

20-
# Build Delve - This is helpful if you want to do remote debugging by attaching to one of the docker containers remotely
21-
RUN go get github.com/go-delve/delve/cmd/dlv
22-
2320
# Git is required for fetching the dependencies,
2421
# make is required for building.
25-
RUN apk update && apk add --no-cache git make
22+
# build-base is needed because gcc is required by delve
23+
RUN apk update && apk add --no-cache git make build-base
24+
25+
# Build Delve - This is helpful if you want to do remote debugging by attaching to one of the docker containers remotely
26+
RUN go get github.com/go-delve/delve/cmd/dlv
2627

2728
WORKDIR /go/src/dc-ledger
2829
COPY . .

README.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,13 @@ The ledger consists of
3232
- [Golang Light Client implementation](https://pkg.go.dev/github.com/tendermint/tendermint/lite2?tab=doc)
3333
- [Rust Light Client implementation](https://docs.rs/tendermint/0.13.0/tendermint/lite/index.html)
3434
- Public UI
35-
- https://dcl.dev.dsr-corporation.com.
36-
- based onf the REST API
35+
- https://dcl.dev.dsr-corporation.com
36+
- based on the REST API
3737
- can be used to browse the ledger
3838
- please note that it doesn't show all the accounts on the ledger
3939
- it shows only the default (demo) accounts created on the UI server
4040
- **for demo purposes only**: can be used for sending write requests from the default (demo) accounts
41+
- source code and documentation are located in [dcl-ui](/dcl-ui) directory
4142

4243
#### Public Permissioned Ledger
4344
DC Ledger is a public permissioned ledger in the following sense:

dcl-ui/.browserslistrc

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
2+
# For additional information regarding the format and rule options, please see:
3+
# https://github.com/browserslist/browserslist#queries
4+
5+
# You can see what browsers were selected by your queries by running:
6+
# npx browserslist
7+
8+
> 0.5%
9+
last 2 versions
10+
Firefox ESR
11+
not dead
12+
not IE 9-11 # For IE 9-11 support, remove 'not'.

dcl-ui/.editorconfig

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Editor configuration, see https://editorconfig.org
2+
root = true
3+
4+
[*]
5+
charset = utf-8
6+
indent_style = space
7+
indent_size = 2
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.md]
12+
max_line_length = off
13+
trim_trailing_whitespace = false

dcl-ui/.gitignore

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# See http://help.github.com/ignore-files/ for more about ignoring files.
2+
3+
# compiled output
4+
/dist
5+
/tmp
6+
/out-tsc
7+
# Only exists if Bazel was run
8+
/bazel-out
9+
10+
# dependencies
11+
/node_modules
12+
13+
# profiling files
14+
chrome-profiler-events*.json
15+
speed-measure-plugin*.json
16+
17+
# IDEs and editors
18+
/.idea
19+
.project
20+
.classpath
21+
.c9/
22+
*.launch
23+
.settings/
24+
*.sublime-workspace
25+
26+
# IDE - VSCode
27+
.vscode/*
28+
!.vscode/settings.json
29+
!.vscode/tasks.json
30+
!.vscode/launch.json
31+
!.vscode/extensions.json
32+
.history/*
33+
34+
# misc
35+
/.sass-cache
36+
/connect.lock
37+
/coverage
38+
/libpeerconnection.log
39+
npm-debug.log
40+
yarn-error.log
41+
testem.log
42+
/typings
43+
44+
# System Files
45+
.DS_Store
46+
Thumbs.db

dcl-ui/README.md

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Distributed Compliance Ledger UI
2+
3+
__This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 8.3.20.__
4+
5+
- Run `ng serve` for a dev server
6+
- Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build.
7+
- Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
8+
- Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
9+
10+
__Read more about the project structure:__
11+
12+
- https://medium.com/@motcowley/angular-folder-structure-d1809be95542
13+
- https://itnext.io/choosing-a-highly-scalable-folder-structure-in-angular-d987de65ec7
14+
15+
__Dev environment__
16+
17+
You will want nginx to add 'allow cross origin' headers to `dclcli` responses. Find nginx configuration template in `templates` and place it into `/etc/nginx/conf.d`.
18+
19+
__Deployment__
20+
21+
- Read more about deployment in `ansible/README.md`.
22+
23+
__Configuration__
24+
25+
Configuration is located in: `src/environments/environment.tx` and `src/environments/environment.prod.tx` for dev and prod environments correspondingly.
26+
There are two important settings here:
27+
28+
- `apiUrl`: base path of the running `dclcli rest-server`;
29+
- `chainId`: chain id, `dclchain` by default.

dcl-ui/angular.json

+131
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
{
2+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3+
"version": 1,
4+
"newProjectRoot": "projects",
5+
"projects": {
6+
"dcl-ui": {
7+
"projectType": "application",
8+
"schematics": {
9+
"@schematics/angular:component": {
10+
"style": "scss"
11+
}
12+
},
13+
"root": "",
14+
"sourceRoot": "src",
15+
"prefix": "app",
16+
"architect": {
17+
"build": {
18+
"builder": "@angular-devkit/build-angular:browser",
19+
"options": {
20+
"outputPath": "dist/dcl-ui",
21+
"index": "src/index.html",
22+
"main": "src/main.ts",
23+
"polyfills": "src/polyfills.ts",
24+
"tsConfig": "tsconfig.app.json",
25+
"aot": true,
26+
"assets": [
27+
"src/favicon.ico",
28+
"src/assets"
29+
],
30+
"styles": [
31+
"src/styles.scss"
32+
],
33+
"scripts": [],
34+
"allowedCommonJsDependencies": [
35+
"json2typescript"
36+
]
37+
},
38+
"configurations": {
39+
"production": {
40+
"fileReplacements": [
41+
{
42+
"replace": "src/environments/environment.ts",
43+
"with": "src/environments/environment.prod.ts"
44+
}
45+
],
46+
"optimization": true,
47+
"outputHashing": "all",
48+
"sourceMap": false,
49+
"extractCss": true,
50+
"namedChunks": false,
51+
"extractLicenses": true,
52+
"vendorChunk": false,
53+
"buildOptimizer": true,
54+
"budgets": [
55+
{
56+
"type": "initial",
57+
"maximumWarning": "2mb",
58+
"maximumError": "5mb"
59+
},
60+
{
61+
"type": "anyComponentStyle",
62+
"maximumWarning": "6kb",
63+
"maximumError": "10kb"
64+
}
65+
]
66+
}
67+
}
68+
},
69+
"serve": {
70+
"builder": "@angular-devkit/build-angular:dev-server",
71+
"options": {
72+
"browserTarget": "dcl-ui:build"
73+
},
74+
"configurations": {
75+
"production": {
76+
"browserTarget": "dcl-ui:build:production"
77+
}
78+
}
79+
},
80+
"extract-i18n": {
81+
"builder": "@angular-devkit/build-angular:extract-i18n",
82+
"options": {
83+
"browserTarget": "dcl-ui:build"
84+
}
85+
},
86+
"test": {
87+
"builder": "@angular-devkit/build-angular:karma",
88+
"options": {
89+
"main": "src/test.ts",
90+
"polyfills": "src/polyfills.ts",
91+
"tsConfig": "tsconfig.spec.json",
92+
"karmaConfig": "karma.conf.js",
93+
"assets": [
94+
"src/favicon.ico",
95+
"src/assets"
96+
],
97+
"styles": [
98+
"src/styles.scss"
99+
],
100+
"scripts": []
101+
}
102+
},
103+
"lint": {
104+
"builder": "@angular-devkit/build-angular:tslint",
105+
"options": {
106+
"tsConfig": [
107+
"tsconfig.app.json",
108+
"tsconfig.spec.json",
109+
"e2e/tsconfig.json"
110+
],
111+
"exclude": [
112+
"**/node_modules/**"
113+
]
114+
}
115+
},
116+
"e2e": {
117+
"builder": "@angular-devkit/build-angular:protractor",
118+
"options": {
119+
"protractorConfig": "e2e/protractor.conf.js",
120+
"devServerTarget": "dcl-ui:serve"
121+
},
122+
"configurations": {
123+
"production": {
124+
"devServerTarget": "dcl-ui:serve:production"
125+
}
126+
}
127+
}
128+
}
129+
}},
130+
"defaultProject": "dcl-ui"
131+
}

dcl-ui/ansible/README.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Deploying DC Ledger UI
2+
3+
1. Run `dclcli` rest service on the client machine. See `deployment/ansible` folder in the `dc-ledger` repo.
4+
2. Build the app by running `ng build --prod`.
5+
3. Execute playbooks in the following order: `content`, `nginx`, `config`, `reload`.
6+
4. Use certbot to obtain a certificate and don't forger to open `443` port.

dcl-ui/ansible/config.yml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Copyright 2020 DSR Corporation
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
- hosts: clients
16+
user: ubuntu
17+
become: yes
18+
tasks:
19+
- name: Remove default config
20+
file:
21+
path: "/etc/nginx/sites-enabled/default"
22+
state: absent
23+
- name: Copy nginx configuratioin
24+
copy:
25+
src: "./templates/dcl_ssl.conf"
26+
dest: "/etc/nginx/conf.d/dcl.conf"

dcl-ui/ansible/content.yml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Copyright 2020 DSR Corporation
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
- hosts: clients
16+
user: ubuntu
17+
become: yes
18+
tasks:
19+
- name: Remove existing content
20+
file:
21+
path: "/www/dcl-ui/"
22+
state: absent
23+
- name: Copy new content
24+
copy:
25+
src: "./../dist/dcl-ui/"
26+
dest: "/www/dcl-ui/"
27+
owner: "ubuntu"
28+
group: "ubuntu"

dcl-ui/ansible/nginx.yml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Copyright 2020 DSR Corporation
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
- hosts: clients
16+
user: ubuntu
17+
become: yes
18+
tasks:
19+
- name: Install nginx
20+
apt:
21+
name: nginx
22+
state: present
23+
update_cache: yes

dcl-ui/ansible/reload.yml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Copyright 2020 DSR Corporation
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
- hosts: clients
16+
user: ubuntu
17+
become: yes
18+
tasks:
19+
- name: Reload nginx
20+
service: "name=nginx state=reloaded enabled=yes"

0 commit comments

Comments
 (0)