CCF
CCF copied to clipboard
Docker compose hello world
Is your feature request related to a problem? Please describe.
I want to run this locally so I and start to explore the apis, by writing tests.
I can't figure out how to do this with docker and the current documentation.
Describe the solution you'd like
git clone ccf/example
edit the example.env to .env
docker-compose up
browse app or local host or write tests that talk to localhost apis.
Describe alternatives you've considered
Building from source? it's not really an alternative... I considered trying to figure it out myself, but it would probably be very much faster for someone with experience to just throw this in a public repo and drop a link here.
Additional context
My goal is to be able to test the features of ccf that are exposed by APIs.
In order to do this, I need to be able to test the APIs with the tools I am most familar with.
Ideally at the end of the test, I could push my containerized app to any docker cloud hosting and connect it to a SaaS instance of CCF, and I would have successfully released a "CCF app" without having to operate CCF entirely myself.
Basically I want the Amazon QLDB feeling not the hyperledger fabric feeling.
Here are some examples of a projects that makes this kind of docker testing easy:
- https://github.com/jamaljsr/polar
- https://github.com/google/trillian-examples/tree/master/binary_transparency/firmware
Hi @OR13. We do have some quickstart/sandbox tools, but not a docker compose setup. To run a sandbox instance in the published ccf-app-ci container, you can run:
$ docker run -it ccfciteam/ccf-app-ci:latest
# /opt/ccf/bin/sandbox.sh
Then the hello-world/proof-of-life process would be something like:
$ docker exec -it f15df8a984f0 bash
# curl -k https://127.0.0.1:8000/node/commit
{"transaction_id":"2.9"}
Note that, as the docs highlight, this will by default be completely insecure - running in virtual mode (and thus on any hardware), rather than using SGX enclaves.
As a bit of background (and speaking largely for myself here), the broad justification for the current sandbox setup is that as a framework rather than an application, we need to elide a huge number of security-critical steps in the sandbox that we think should be considered before deployment. We think most apps need to have externally managed member and operator identities, and some thought to distributed hosting, and a custom constitution that bootstraps app logic, and long-term operations infrastructure. We can't do most of that generically. And building a containerised C++ development environment that allows people to produce their own native container images is tricky, and not at all a standard development flow for that kind of native application.
However that reasoning isn't a strict barrier. In particular for the js_generic application, to run it at all we need to be slightly more opinionated on the constitution, and code redeployment is much simpler on a running service - that's why the sandbox is (by default) set up to run this app. We're seeing demand for SaaS hosting of CCF as well, at which point a lot of these operational considerations can be taken out of the app-developer's hands, and trying to balance a framework that gives you a lot of options against a push-button deployment that makes a lot of assumptions.
TL;DR: "Basically I want the Amazon QLDB feeling not the hyperledger fabric feeling." > Us too! We'll re-evaluate the quickstart process and documentation once 2.0 final has shipped.
We're seeing demand for SaaS hosting of CCF as well, at which point a lot of these operational considerations can be taken out of the app-developer's hands, and trying to balance a framework that gives you a lot of options against a push-button deployment that makes a lot of assumptions.
+1 to this.
I followed those instructions, and it worked!
I will have to peek at how to extend from there.... ideally I could get this all into a repo where I can write tests against the extensions I am building, even if they are running in sandbox mode only.
With https://github.com/microsoft/ccf-app-samples, I think we have something reasonable in place now.