{"id":13762210,"url":"https://github.com/hyperledger-archives/sawtooth-next-directory","last_synced_at":"2025-05-10T14:31:44.625Z","repository":{"id":71924387,"uuid":"111021627","full_name":"hyperledger-archives/sawtooth-next-directory","owner":"hyperledger-archives","description":null,"archived":true,"fork":false,"pushed_at":"2020-02-25T14:43:47.000Z","size":35011,"stargazers_count":87,"open_issues_count":1,"forks_count":80,"subscribers_count":93,"default_branch":"master","last_synced_at":"2025-04-19T10:14:33.366Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://wiki.hyperledger.org/display/sawtooth","language":"HTML","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hyperledger-archives.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":"docs/support.rst","governance":null,"roadmap":null,"authors":null}},"created_at":"2017-11-16T20:58:21.000Z","updated_at":"2024-06-09T10:48:23.000Z","dependencies_parsed_at":"2023-09-16T16:35:17.669Z","dependency_job_id":null,"html_url":"https://github.com/hyperledger-archives/sawtooth-next-directory","commit_stats":null,"previous_names":["hyperledger/sawtooth-next-directory"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperledger-archives%2Fsawtooth-next-directory","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperledger-archives%2Fsawtooth-next-directory/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperledger-archives%2Fsawtooth-next-directory/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperledger-archives%2Fsawtooth-next-directory/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hyperledger-archives","download_url":"https://codeload.github.com/hyperledger-archives/sawtooth-next-directory/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253428347,"owners_count":21906900,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T14:00:36.777Z","updated_at":"2025-05-10T14:31:41.484Z","avatar_url":"https://github.com/hyperledger-archives.png","language":"HTML","funding_links":[],"categories":["Sawtooth_Applications"],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/hyperledger/sawtooth-next-directory.svg?branch=master)](https://travis-ci.org/hyperledger/sawtooth-next-directory)\n[![License](https://img.shields.io/badge/License-Apache%202.0-yellowgreen.svg)](https://github.com/hyperledger/sawtooth-next-directory/blob/master/LICENSE)\n[![Documentation Status](https://readthedocs.org/projects/sawtooth-next-directory/badge/?version=latest)](https://sawtooth-next-directory.readthedocs.io/?badge=latest)  \n\n![logo](./readmeUI/logo.png)\n# Hyperledger Sawtooth NEXT Identity Platform\nA Federated Tool for Managing Entitlements.\n\n## Introduction\n### What is NEXT? \nNEXT is an open-source Identity and Access Management Platform for enterprise. NEXT is built by leveraging the Sawtooth blockchain to not only improve the status-quo of identity governance and auditing, but also replaces trust with cryptographic proof. Originally envisioned and designed by T-Mobile, NEXT is an enterprise-grade blockchain application, built to integrate with a wide-ranging number of indentity consuming and identity-providing applications. NEXT can integrate with industry standard directory services and provide request, approval, and audit features with the integrity of the blockchain.\n\nThe main components of NEXT includes: Sawtooth, a modular platform created by Intel that sits atop of The Linux Foundation's Hyperledger project, a transaction processor which handles RBAC-specific transaction logic, and a ledger sync which writes the blockchain state changes to a local database. The NEXT platform also features a chatbot component as well as an intuitive UI which will provide a smooth experience for users. \n\nAt its heart, NEXT is about replacing trust with cryptographic truth. It is a federated tool for managing entitlements. \n\n\n### Table of Contents:\n* [Application Flow](#application-flow)\n* [How to Contribute](#how-to-contribute)\n* [Using the Platform](#using-next)\n* [Acknowledgements](#Acknowledgements)\n\n\n## Application Flow  \n### _UI for User's Request Dashboard_\n![User_request_dashboard](./readmeUI/NextUI/user_request_dashboard.png)  \n\n### _User Requests To Join a Security Group_\n![User_request_dashboard](./readmeUI/NextUI/user_awaiting_approval.png)  \n\n### _User's Role Request Appears in Admin's Request Dashboard_\n![User_request_dashboard](./readmeUI/NextUI/admin_approval_with_chat.png)  \n\n### _Owner Approves the User's Request and the User is Notified_\n![User_request_dashboard](./readmeUI/NextUI/user_role_approved.png) \n\n### _Owner History of Accepted/Reject Permission Requests_\n![User_request_dashboard](./readmeUI/NextUI/admin_history.png) \n\n\nThis flow highlights the typical use-case of this platform. The a user requests access to be apart of a group. The owner of the group either accepts or rejects the user's request. The owner's activity log gets updated and auditing can be done in a fast and simple manner reducing overhead.\n\n\n## How to Contribute  \nAwesome! So you want to be apart of the NEXT Project. There are a couple of good resources for you to get started with. The first being the [developer setup](https://github.com/hyperledger/sawtooth-next-directory/wiki/Developer-Setup). This document helps to standardize\nthe developer environment for everyone across different operating systems so when developing, we are all on the same page. \n\nHere are some ideas on how to get started:\n\n### Good First Issues\nOur team has tagged some issues with the \"Good First Issues\" tag which are issues that can be picked up and worked on without having to know much about the overall guts and intracacies of the system. These [issues](https://github.com/hyperledger/sawtooth-next-directory/labels/good%20first%20issue) will also allow you to gradually get up to speed into the different components of NEXT, which will let you contribute to \"bigger\" issues down the line.\n\nIf you have any questions or comments, or you just want to chat, here is a link to our [Rocketchat](https://chat.hyperledger.org/channel/sawtooth-next-directory)! \n\n\n## Using NEXT\nThe easiest way to set-up the NEXT platform is by using\n[Docker](https://www.docker.com/what-docker). To start these components,\nfirst install Docker for your platform and clone this repo.\n\nDocker volume mounts must be enabled, to allow docker to mount the repository\nfiles.\n\nTo build and deploy the app, run:\n\n```bash\ndocker-compose up\n```\n\nA shortcut is available via:\n```bash\nbin/start -b\n```\n\nThis will build all components, start them in individual Docker containers,\nand download and run the necessary Sawtooth components.\n\n- Sawtooth's blockchain REST API will be available at **http://localhost:8080**\n- Rethink's database admin panel will be available at **http://localhost:9090**\n- The next generation NEXT UI will be available at **http://localhost:4201**\n\n\n\nTo stop the containers, hit Ctrl-C and then:\n\n```bash\ndocker-compose down\n```\n\nA shortcut is available via:\n```bash\nbin/stop\n```\n\n## Persistent Data\n\nBy default, the data in the development environment is ephemeral.\nIt will be lost when the application is stopped and restarted.\n\nTo enable persistent data, use the -c flag:\n\n```bash\nbin/start -c\n```\n\nTo delete the persistent data, delete the related docker volumes:\n\nTo clear data and start again from genesis, delete the volumes:\n    docker volume ls\n    docker volume rm {folder_name}_chain\n    docker volume rm {folder_name}_keys\n    docker volume rm {folder_name}_db\n\n## Rebuilds\n\nOne may tell docker to rebuild the containers, using the the \n`--build` flag. This may be useful if dependencies have changed\nin a way docker did not detect. \n\n```bash\ndocker-compose up --build\n```\n\nA shortcut is available via:\n```bash\nbin/start -b\n```\n\nTo do a hard rebuild by first removing all cached docker volumes \nand python caches, run:\n\n```bash\nbin/clean\nbin/start\n```\n\n## Development\n\n#### System Dependencies \n\nThe server code is written in python 3. Confirm your version using command:\n\n    python -V\n\nFor information in setting up your development environment, visit:\nhttps://github.com/hyperledger/sawtooth-next-directory/wiki/Developer-Setup\n\n#### Deploying Multi-Node Network\n\nThe multi-node network consists of four nodes (more can be added) hosting Sawtooth \nNext Directory. The multi-node network utilizes the PoET simulator consensus \nbetween the validators allowing PoET to run on non-SGX hardware. \n\nAfter starting the containers, the Next Directory UI will be available at:\n- **http://10.5.0.70:4200** (node 0)\n- **http://10.5.0.71:4200** (node 1)\n- **http://10.5.0.72:4200** (node 2)\n- **http://10.5.0.73:4200** (node 3)\n\n\nTo start the containers in a multi-node configuration run:\n```bash\ndocker-compose -f docker-multi-node.yaml up\n```\n\n\n## Deploying to Any Non-Localhost Server\n\nPay special attention to the notes about secret keys in .env. \nDue to their private/sensitive nature, the values of these keys should be \nprovided to the application using \n  - a configuration file that is not stored/managed by git \n  - cli arguments \n  - some other means that prevents them from being publicly available\n  \nThey are the most sensitive components for the security of your application.\nManage them wisely and responsibly.\n\nWhen no such keys are provided, random keys are generated on application\nbootstrap to simplify development. This avoids publication of the keys in\ngit and allows the application to start up in their absence. Work is \nunderway to cause startup to fail fast and explosively when keys are missing.\nOnce that work is complete, the random key generation can be removed as well.\nIn other words: It must be made obvious to a user when startup fails due to \nmissing keys.\n\n#### Configure SSL/TLS on NEXT\n\nTo configure SSL/TLS on NEXT, visit our Sphinx Docs and navigate to the Configure SSL/TLS page.\n\nAfter following those steps, run the following command to run the containers with SSL/TLS enabled:\n\n```./bin/start -b -p```\n\n## Testing\n\n#### Preparing Unit Tests\n\nIf you are unit testing a feature having a new Pip dependency in it, then add the new dependency to tests.Dockerfile\nto ensure it is available in the test runtime.\n\n#### Populating Test Data\n\nTo quickly populate the application with test users, roles, etc., run script \nbin/populate_test_data.py once the application is up and running. It will spin up\na rest client and create the objects through the application's rest api.\n\n#### Running Automated Tests\n\nLibrary test can be run using (pytest)[https://docs.pytest.org/en/latest/]:\n\n```bash\npytest -m \"library\"\n```\n\nIntegration tests can be run non-interactively via the `run_docker_test` script, \nwith the desired docker-compose file as an argument. For example:\n\n```bash\nbin/run_docker_test docker-tests.yaml\n```\n\nA shortcut is available via:\n```bash\nbin/build -t\n```\n\nThey can be run interactively from the rbac-shell:\n```bash\ndocker exec -it rbac-shell bash\npytest\n```\n\nUnit tests can be run with the following command:\n\n```bash \npytest tests/unit/\n```\n\n#### Docs Set-up\nDocumentation for the NEXT project is available (here)[https://sawtooth-next-directory.readthedocs.io/en/latest/]\n\nHere are the following steps to create documentation:\n1. Navigate to the home directory and navigate into the \"docs\" folder. \n2. Create a new reStructuredText file.\n3. When editing the reStructuredText file, please follow the guidelines listed (here)[http://docutils.sourceforge.net/rst.html]\n4. When finished, save the document and navigate into the \"index.rst\" file, add your file name without the \".rst\" extension into the section you see fit, and then save the document.\n5. Once the pull request is approved, your new document should be published and available to read.\n\n#### Cleaning the Docker Image Cache\n\nDocker-compose relies on image caching to improve build and deployment time. Some changes (directory renaming, etc)\ncan cause the loading of cached images to result in build failures in docker-compose. In addition, not shutting down\ncontainers properly by doing a docker-compose down also leads to this scenario. When it occurs, you will experience\nhanging in the legacy UI and stack traces from rbac_server:\n\n     Traceback (most recent call last):\n    rbac-server    |   File \"/usr/local/lib/python3.5/dist-packages/sanic/app.py\", line 556, in handle_request\n    rbac-server    |     response = await response\n    rbac-server    |   File \"/usr/lib/python3.5/asyncio/coroutines.py\", line 105, in __next__\n    rbac-server    |     return self.gen.send(None)\n    rbac-server    |   File \"/project/hyperledger-rbac/server/api/users.py\", line 74, in create_new_user\n    rbac-server    |     request.app.config.AES_KEY, txn_key.public_key, private_key.as_bytes()\n    rbac-server    |   File \"/project/hyperledger-rbac/server/api/utils.py\", line 172, in encrypt_private_key\n    rbac-server    |     cipher = AES.new(bytes.fromhex(aes_key), AES.MODE_CBC, init_vector)\n    rbac-server    | ValueError: non-hexadecimal number found in fromhex() arg at position 30\n\nTo work around this situation, shut down the application, delete all containers and images, and rebuild/deploy:\n\n    bin/stop\n\n    docker rm -vf $(docker ps -a -q)\n\n    docker rmi -f $(docker images -a -q)\n\n    bin/start -b \n    \n\n# License\nHyperledger Sawtooth NEXT Identity Platform software is licensed under the \n[Apache License Version 2.0](LICENSE) software license.\n\n# Acknowledgements\n### Big Thanks\n\nCross-browser Testing Platform and Open Source \u003c3 provided by [Saucelabs]\n\nContinuous Integration Platform provided by [Travis-CI]\n\nProject Management Platform provided by [Zenhub] \n\n[Saucelabs]: https://saucelabs.com\n[Travis-CI]: https://travis-ci.com/\n[Zenhub]: https://www.zenhub.com/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhyperledger-archives%2Fsawtooth-next-directory","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhyperledger-archives%2Fsawtooth-next-directory","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhyperledger-archives%2Fsawtooth-next-directory/lists"}