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

Upgrade CCF version 1.0.19 to 4.0.1 for use by PDO TP. #443

Merged

Conversation

prakashngit
Copy link
Contributor

Work in progress. Currently supports local deployment of CCF TP on bare metal, and usage with PDO. Tested on Ubuntu 20.04 on an Azure VM. Not tested behind proxy.

Please see ledgers/ccf/README_CCF_v4.md for usage instructions.

… in progress. Please see README_CCF_v4.md for usage instructions

Signed-off-by: Ubuntu <ccf@prakash-services.ngrbedaihgkeramjr13nhjagoc.bx.internal.cloudapp.net>
cp service_cert.pem networkcert.pem
cp member0_cert.pem memberccf_cert.pem
cp member0_privk.pem memberccf_privk.pem
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are you putting the keys into the source tree rather than the deployment tree?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please ignore the deployment model used in this PR. This PR's sole purpose is to get you to a quick working ledger for local development. I need to fix deployment and docker to make the PR move beyond draft.


network_cert = config["start"]["network-cert-file"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will look at the full logic later... but this does not look like the right flow. you've changed the way we are doing things. maybe we should have a config file that we use for our deployment since we are moving away from the cchost.toml file.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same answer as above. The final PR will not have this new flow, we will use cchost to start the network and use the configure.py to carry out all member steps. cchost API, config/governance templates all have changed, which I need to understand before I can move away from the "sandbox" model to "deployment model", Thanks.

…th what currently exists for v1.0.19

Signed-off-by: Ubuntu <ccf@prakash-services.ngrbedaihgkeramjr13nhjagoc.bx.internal.cloudapp.net>
@cmickeyb cmickeyb force-pushed the Prakash.CCF_upgrade_to_v4 branch 2 times, most recently from 03101b8 to b4a2fea Compare June 27, 2023 15:02
In order to get the new CCF to run with the sandbox script
several changes needed to be made. Most importantly, the ledger
URL must be specified with an IP address, not a domain name.
Second, the docker build process is slightly changed to accommodate
the lack of a configuration step in the new build process. As part
of that update, the dependency on PDO_LEDGER_URL environment variable
for configuration is removed and the scripts for configuring the
CCF instance now take explicit host/port parameters. As part of the
update a lot of old unused code was removed from those scripts.

Right now the code assumes that the creation of the ledger keys
by the CCF node is a sufficient indicator that the node is ready.
Some additional checks are in the generate_ledger_authority script
which should be the first called after CCF is started. These
checks should be added to the other scripts as well.

Signed-off-by: Mic Bowman <mic.bowman@intel.com>
Added a new function for forcing name/address to an ip address. This
is useful since CCF requires ledger URLs and interfaces to be
specified as IP addresses.

Pushed changes to use the new function into the docker tools
and the script to start CCF.

Signed-off-by: Mic Bowman <mic.bowman@intel.com>
@marcelamelara marcelamelara marked this pull request as ready for review June 29, 2023 17:35
@marcelamelara marcelamelara changed the title Draft PR: Upgrade CCF version 1.0.19 to 4.0.1 for use by PDO TP. Upgrade CCF version 1.0.19 to 4.0.1 for use by PDO TP. Jun 29, 2023
@cmickeyb cmickeyb self-requested a review July 5, 2023 16:01
@cmickeyb cmickeyb self-assigned this Jul 5, 2023
Copy link
Member

@bvavala bvavala left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, just a couple of comments

@@ -30,7 +30,7 @@ services:
network_mode: "host"
volumes:
- ./xfer/:/project/pdo/xfer/
entrypoint: /project/pdo/tools/start_ccf.sh
# entrypoint: /project/pdo/tools/start_ccf.sh
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove?

Comment on lines 32 to 37
# # -----------------------------------------------------------------
# yell configure services for host $PDO_HOSTNAME and ledger $PDO_LEDGER_URL
# # -----------------------------------------------------------------
# rm -f ${PDO_HOME}/ccf/etc/cchost.toml ${PDO_HOME}/ccf/etc/constitution.js
# try make -C ${PDO_SOURCE_ROOT}/ledgers/ccf keys
# try make -C ${PDO_SOURCE_ROOT}/ledgers/ccf config
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove?

Comment on lines 83 to 95
# if [ "${F_MODE,,}" == "build" ]; then
# yell configure services for host $PDO_HOSTNAME and ledger $PDO_LEDGER_URL
# try make -C ${PDO_SOURCE_ROOT}/ledgers/ccf keys
# try make -C ${PDO_SOURCE_ROOT}/ledgers/ccf config
# elif [ "${F_MODE,,}" == "copy" ]; then
# yell copy the configuration from xfer/ccf/etc and xfer/ccf/keys
# try cp ${XFER_DIR}/ccf/etc/* ${PDO_HOME}/ccf/etc/
# try cp ${XFER_DIR}/ccf/keys/* ${PDO_LEDGER_KEY_ROOT}/
# elif [ "${F_MODE,,}" == "skip" ]; then
# yell restart with existing configuration
# else
# die "invalid restart mode; ${F_MODE}"
# fi
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove?


sleep 5

say configure ccf network : ACK the member, open network, add user
try ${F_SERVICEHOME}/bin/configure_ccf_network.py --logfile __screen__ --loglevel WARNING
while [ ! -f ${PDO_HOME}/ccf/workspace/sandbox_common/service_cert.pem ]; do
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The while condition should cover all the ledger keys that are copied later.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe though I really don't think so. all this is deciding is when it is reasonable to move to the next step. its not a correctness test. not sure there is any value in adding the extra checks. they are written (more or less) atomically.

ledgers/ccf/scripts/start_ccf_network.sh Show resolved Hide resolved
ledgers/ccf/scripts/start_ccf_network.sh Show resolved Hide resolved
Copy link
Member

@marcelamelara marcelamelara left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Super minor nits only.

ledgers/ccf/CMakeLists.txt Show resolved Hide resolved
ledgers/ccf/scripts/stop_cchost.sh Outdated Show resolved Hide resolved
Fixed spelling issue, removed commented code, and
(only functional change) added one more check for
port availability before starting the CCF services.

Signed-off-by: Mic Bowman <mic.bowman@intel.com>
Copy link
Member

@bvavala bvavala left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good

@cmickeyb cmickeyb merged commit 041784e into hyperledger-labs:main Jul 6, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants