Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Banking-app defines its own constitution #53

Merged
merged 35 commits into from
Nov 30, 2022
Merged
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
81a84dd
Copy banking-app from https://github.com/takuro-sato/ccf-app-template…
takuro-sato Oct 5, 2022
5a1dc33
Remove unused codes (#9)
takuro-sato Oct 5, 2022
60990e6
Update README.md (#10)
takuro-sato Oct 7, 2022
1404b8d
Update why ccf + Implement application claim for transfer (#12)
takuro-sato Oct 24, 2022
d0a38b5
Clean up (#13)
takuro-sato Oct 24, 2022
514d121
Add features to devcontainer (#16)
ross-p-smith Oct 25, 2022
3454644
Run tests in CI with virtual mode (#19)
takuro-sato Oct 26, 2022
1b754b4
Added guidelines for running tests (#21)
ross-p-smith Oct 26, 2022
1af9f52
Add linting (#20)
takuro-sato Oct 26, 2022
2e3c941
Add back 'Open in GitHub Codespaces' button (#22)
takuro-sato Oct 26, 2022
955b364
Use docker image that can use virtual (#25)
takuro-sato Nov 3, 2022
eeded36
Create the user certs as part of the demo (#34)
ross-p-smith Nov 3, 2022
28e1964
GitHub Collaboration (#36)
ross-p-smith Nov 4, 2022
c6f2d3b
Added make file to hide scripts (#31)
ross-p-smith Nov 7, 2022
3c36c9a
Created set_js_app.json for governance (#33)
ross-p-smith Nov 9, 2022
ba6f72c
Split demo.sh into demo_governance.sh and demo_application.sh (#40)
Aymalla Nov 14, 2022
7a144cd
Initial banking sample constitution
ross-p-smith Nov 23, 2022
0f17495
Merge branch 'main' into ross/constitution
ross-p-smith Nov 23, 2022
14c34bc
WIP: governance in docker
ross-p-smith Nov 23, 2022
f6a5e41
Working End to end
ross-p-smith Nov 24, 2022
112ca8a
Updated start-host
ross-p-smith Nov 24, 2022
a3b636a
Add more comments
ross-p-smith Nov 24, 2022
742b944
package.lock.json was deleted
ross-p-smith Nov 24, 2022
2d9c839
Copy a temp sandbox.sh to /opt/ccf/bin
ross-p-smith Nov 24, 2022
111ca4a
Now called Constitution-dir
ross-p-smith Nov 28, 2022
ca8ef43
Add enclave into teh docker makefile
ross-p-smith Nov 28, 2022
b7bc0f6
Test the enclave as well as virtual
ross-p-smith Nov 28, 2022
2d4d4df
Single Test Script
ross-p-smith Nov 28, 2022
a9a4d3d
Merge branch 'main' into ross/constitution
ross-p-smith Nov 29, 2022
f3cbe42
Paths for CI
ross-p-smith Nov 29, 2022
f93fa27
Use a trap to stop the sandbox/docker image
ross-p-smith Nov 29, 2022
61be14e
Fix usage in script files and CI
ross-p-smith Nov 29, 2022
e680047
Each sample has it's own build job
ross-p-smith Nov 29, 2022
a274c3f
Error message if sandbox is not running
ross-p-smith Nov 29, 2022
5e1aed5
build the app
ross-p-smith Nov 30, 2022
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
2 changes: 1 addition & 1 deletion .devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"vsls-contrib.codetour",
"esbenp.prettier-vscode"
],
"postCreateCommand": "npm install --prefix=banking-app && npm install --prefix=auditable-logging-app",
"postCreateCommand": "npm install --prefix=banking-app && npm install --prefix=auditable-logging-app && cp sandbox.sh /opt/ccf/bin/sandbox.sh",
takuro-sato marked this conversation as resolved.
Show resolved Hide resolved
"features": {
"ghcr.io/devcontainers/features/docker-from-docker:1": {
"version": "20.10.8"
Expand Down
44 changes: 37 additions & 7 deletions banking-app/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,19 @@ test: ## 🧪 Test the Banking Application
@echo -e "\e[34m$@\e[0m" || true
@./test.sh

# Hack to use default resolve.js
# It should be improved after '--no-default-constitution' is added to sandbox.sh.
# NOTE: This hack replaces the content of /opt/ccf/bin/resolve.js
test-docker: build-virtual run-virtual ## 🧪 Test the Banking Application
@echo -e "\e[34m$@\e[0m" || true
@sleep 20
@. ./test_docker.sh
@{ \
containerId=$$(docker ps -qf ancestor=banking-app:virtual) ;\
docker stop $$containerId ;\
}

# Run sandbox. Consider 3 members as 3 banks.
start-host: build ## 🏃 Start the CCF Sandbox
start-host: build ## 🏁 Start the CCF Sandbox
@echo -e "\e[34m$@\e[0m" || true
@cp constitutions/resolve.js /opt/ccf/bin/resolve.js
@/opt/ccf/bin/sandbox.sh --js-app-bundle ./dist/ --initial-member-count 3 --initial-user-count 0
@/opt/ccf/bin/sandbox.sh --js-app-bundle ./dist/ --initial-member-count 3 --initial-user-count 0 --constitution-dir ./constitution

demo: ## 🎬 Demo the Banking Application
ross-p-smith marked this conversation as resolved.
Show resolved Hide resolved
@echo -e "\e[34m$@\e[0m" || true
Expand All @@ -40,4 +45,29 @@ build-virtual: ## 📦 Build Virtual container image from Dockerfile
build-enclave: ## 📦 Build Enclave container image from Dockerfile
@echo -e "\e[34m$@\e[0m" || true
@../build_image.sh enclave


# We hardcode the IP so that we can set this in the cchost_config
# TODO: Move the cchost_config into the sample folder
run-virtual: ## 🏃 Start a virtual CCF node in Docker
@echo -e "\e[34m$@\e[0m" || true
@docker run --detach --ip 172.17.0.4 banking-app:virtual

# We hardcode the IP so that we can set this in the cchost_config
# TODO: Move the cchost_config into the sample folder
run-enclave: ## 🏃 Start an enclave CCF node in Docker
@echo -e "\e[34m$@\e[0m" || true
@docker run --detach --ip 172.17.0.4 banking-app:enclave

stop-virtual: ## ⛔ Stop a virtual CCF node in Docker
@echo -e "\e[34m$@\e[0m" || true
@{ \
containerId=$$(docker ps -qf ancestor=banking-app:virtual) ;\
docker stop $$containerId ;\
}

stop-enclave: ## ⛔ Stop a virtual CCF node in Docker
@echo -e "\e[34m$@\e[0m" || true
@{ \
containerId=$$(docker ps -qf ancestor=banking-app:enclave) ;\
docker stop $$containerId ;\
}
Loading