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

Hello World contract family #63

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

cmickeyb
Copy link
Contributor

@cmickeyb cmickeyb commented Sep 25, 2024

Initial commit for the example contract family. The example contract family is primarily used as a means of documenting the process of writing, building, and extending a contract family. In addition, the example contract family provides a template for building a new contract family. Copying the example contract family to a new directory and editing family.cmake should be sufficient to create a new family.

Detailed documentation is provided that includes an explanation of the various parts of a contract family, how to create a new one, and how to define additional methods in a contract family. Most of this is provided as a step-by-step guide.

A functioning Jupyter notebook is also provided. However, documentation for customizing Jupyter is still work in progress.

NOTE: This PR depends on #64

@cmickeyb
Copy link
Contributor Author

cmickeyb commented Oct 2, 2024

#64 should be committed first.

Copy link
Member

@mbrandenburger mbrandenburger left a comment

Choose a reason for hiding this comment

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

Great detailed hello world tutorial. It really helped to get an idea how to start writing my first contract family.

However, I was not able to run my helloworld contract within my personal time limit of ~45min.

Is there a dev container image that helps me to kickstart and provides me all the tools/deps needed as described in docs/install.md?


There are a number of configuration options for interacting with PDO
contracts. More information can be found in the
[Getting Started](common/documents/getting_started.ipynb) notebook.
Copy link
Member

Choose a reason for hiding this comment

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

link does not work. Do you mean ../../common-contracts/................?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this would work from the jupyter server. i'll clarify how these work.



To experiment with these contracts, explore the
[Exchange Contract Family notebook](exchange/index.ipynb)
Copy link
Member

Choose a reason for hiding this comment

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

link does not work

Copy link
Member

Choose a reason for hiding this comment

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

Maybe also link to the document that tell me how to setup my environment (install PDO client, etc ...) (with docker?!!) :D

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 as above. these are designed to work from the jupyter server, not from the shell. this needs to be clarified. AND... per your more general comment, it would be nice to build a dev image that had a jupyter server running so you could get at this information structured correctly.

Copy link
Member

Choose a reason for hiding this comment

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

ahh cool! so I suggest that somewhere, maybe the root README.md one should explain how jump into the dev container and how to read things using jupyter. However, if the "jupyter" root is set to the repository root, couldnt one create links that work for both, jupyter and the normal github or any local IDE? 🤓

Copy link
Contributor Author

Choose a reason for hiding this comment

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

possibly...

first i'm going to 1) create a getting started container, 2) update the readme with instructions on how to get that started, and possibly 3) make the notebooks here more interactive & supportive of the builds.

we do have the issue that many of the docs are generated by jupytext (jupyter notebooks are notoriously difficult to manage with git).

docs/notebooks/index.md Outdated Show resolved Hide resolved
common-contract/README.md Outdated Show resolved Hide resolved

[Hyperledger Private Data Objects](https://github.com/hyperledger-labs/private-data-objects) operates as a Hyperledger Labs project. This code is provided solely to demonstrate basic PDO mechanisms and to facilitate
collaboration to refine PDO architecture and define minimum viable product requirements.
[Hyperledger Private Data Objects](https://github.com/hyperledger-labs/private-data-objects)
Copy link
Member

Choose a reason for hiding this comment

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

For consistency I would rename index.md to README.md.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is the same issue as above. anything in the "notebooks" subdirectory is supposed to be viewed through the jupyter server. in that context... index.md make more sense than README.md

Comment on lines +7 to +9
This directory contains a number of pdo-shell scripts to test the
digital asset contract family. The scripts assume that a complete
installation of the PDO client is complete.
Copy link
Member

Choose a reason for hiding this comment

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

You mean the example contact family I guess?!

Comment on lines +23 to +24
This script sets up and runs the functional test suite for the digital asset
contract family. The actual tests will be found in the pdo-shell script
Copy link
Member

Choose a reason for hiding this comment

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

example contract familiy?

@@ -26,13 +26,13 @@ will refer to the windows as `container_1` (for the user) and
`container_2` (for the issuer).

**Container_1: Create the keys for the token user.** Open the
notebook `documents/getting_started.ipynb` and run all cells. Navigate
notebook `common/documents/getting_started.ipynb` and run all cells. Navigate
Copy link
Member

Choose a reason for hiding this comment

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

these links seem to be broken. I was wondering if I am missing some commit in this PR


**The protocols and software are for reference purposes only and not intended for production usage.**

# Example Contract Family #
Copy link
Member

Choose a reason for hiding this comment

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

In your PR you call it Hello World Contract Family ... maybe that is a better name than Example, in particular, if there are folders in the recommended project structure that is called example.


1. Copy the `example-contract` directory to a new directory. To be
picked up by the build system automatically, the new directory
should be named with `myfirst-contract`.
Copy link
Member

Choose a reason for hiding this comment

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

to be consistent with your PR title ... helloworld-contract maybe call is?

cmickeyb and others added 8 commits November 7, 2024 17:07
Initial commit for the example contract family. The example contract
family is primarily used as a means of documenting the process of
writing, building, and extending a contract family. In addition, the
example contract family provides a template for building a new
contract family. Copying the example contract family to a new
directory and editing family.cmake should be sufficient to create a
new family.

Signed-off-by: Mic Bowman <[email protected]>
Adds a simple, getting started target for building and
running the example contract.

Signed-off-by: Mic Bowman <[email protected]>
Adds the basic factory/template model for the example contract. This
should allow for, more or less, a cut and paste for creating a new
contract that preserved the counter. That is, the factory & template
are for the specific contract type and would have to be replaced
completely for a new contract.

Signed-off-by: Mic Bowman <[email protected]>
There is no particular reason to remove the downloaded
model during docker clean up. This should save some time
during build/debug/test cycles.

The model can be removed with the clean_model target.

Signed-off-by: Mic Bowman <[email protected]>
Add a docker target to start a contracts container that is running
Jupyter. The current source directory is mounted in /project/pdo/dev
inside the container. When used with the Jupyter shell, this provides
a relatively easy way to develop and test contracts.

Signed-off-by: Mic Bowman <[email protected]>
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.

2 participants