Skip to content

Commit

Permalink
Hardening/doc (#77)
Browse files Browse the repository at this point in the history
* Update README content

* Adding generation of API Doc file

* New test

* New test

* New test

* New test

* New test

* New test

* New test

* Add changes to API Doc

* Update documentation

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
flopezag and github-actions[bot] authored Oct 16, 2023
1 parent c41dc36 commit 264d986
Show file tree
Hide file tree
Showing 9 changed files with 695 additions and 56 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/docapi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: generate API docs
on:
push:
branches:
- master
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: "recursive"
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
- name: Use Node.js 14.x
uses: actions/setup-node@v1
with:
node-version: 14.x
- name: Install node package
run: npm install @redocly/cli -g
- name: Generate API Doc
run: redocly build-docs ./api/api.yaml
- name: Move the file to the final folder
run: mv redoc-static.html ./docs/apidoc.html
- name: Commit files
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add ./docs/apidoc.html
git commit -a -m "Add changes to API Doc"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,16 @@ dist

# general configuration file
src/config/config.json

# generated files
target/
it/target

# IDE
.vscode

# Autogenerate Doc
html/

# Node.js package info for automatic API Doc generation
package-lock.json
29 changes: 0 additions & 29 deletions Dockerfile

This file was deleted.

12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,30 @@
<br/>
![CI](https://github.com/FIWARE/canismajor/workflows/Integration-test/badge.svg)

CanisMajor is a blockchain adaptor that supports persistence and verification of [NGSI-LD](https://docbox.etsi.org/isg/cim/open/Latest%20release%20NGSI-LD%20API%20for%20public%20comment.pdf) Entity-Transactions(e.g. create/delete/update- operations) in blockchains.
CanisMajor is a blockchain adaptor that supports persistence and verification of [NGSI-LD](https://www.etsi.org/deliver/etsi_gs/CIM/001_099/009/01.07.01_60/gs_cim009v010701p.pdf) Entity-Transactions (e.g., create/delete/update- operations) in blockchains.


This project is a part of [FIWARE](https://github.com/fiware). For more information check the FIWARE Catalogue entry for the
[Core Context Management](https://github.com/Fiware/catalogue/tree/master/core).

| :books: [Documentation](https://fiware.github.io/CanisMajor/) | :mortar_board: [Academy](https://github.com/fiware/tutorials.Step-by-Step) | <img style="height:1em" src="https://quay.io/static/img/quay_favicon.png"/> [quay.io](https://quay.io/repository/fiware/canis-major) | :dart: [Roadmap](https://github.com/fiware/CanisMajor/blob/master/roadmap.md) |
| :books: [Documentation](https://fiware.github.io/CanisMajor) | :mortar_board: [Academy](https://github.com/fiware/tutorials.Step-by-Step) | <img style="height:1em" src="https://quay.io/static/img/quay_favicon.png"/> [quay.io](https://quay.io/repository/fiware/canis-major) | :dart: [Roadmap](https://github.com/orgs/FIWARE/projects/2/views/1) |
| --------------------------------------------------------------------- | ------------------------------------------------------------------------------------------ | ---------------------------------------------------------- | --------------------------------------------------------------------------- |

## Overview

![Current Architecture](./docs/images/canis-major-overview.svg)

In order to persist transactions inside the blockchain, a client has to send information about its transactions(e.g. create/update/delete entity) to CanisMajor.
The request should include information about the Wallet(e.g. Keystore) to be used for signing the transaction. Please check the [API](./api/api.yaml)(tag `NGIS-LD`) on how to
send the transactions and provide the Wallet-Information. CanisMajor will create a [Merkle-Tree](https://en.wikipedia.org/wiki/Merkle_tree) from the send informations
The request should include information about the Wallet (e.g., Keystore) to be used for signing the transaction. Please check the [API](./api/api.yaml) (tag `NGSI-LD`) on how to
send the transactions and provide the Wallet-Information. CanisMajor will create a [Merkle-Tree](https://en.wikipedia.org/wiki/Merkle_tree) from the submitted data
and include it as data into the transaction for the Blockchain. In order to properly sign the transaction, CanisMajor uses the provided Wallet-Information and delegates the
signing to the client's Wallet. The signed transaction is then put into the Oketh-compatible blockchain.

## Testing

Run unit-tests via: ```mvn clean test```

A set of integration tests(using [cucumber](https://cucumber.io/)) is available under [it/](./it).
A set of integration tests (using [cucumber](https://cucumber.io/)) is available under [it/](./it).
To run them use:
```shell
cd it
Expand All @@ -48,6 +48,6 @@ To run them use:

## License

CanisMajor is licensed under the Apache License, Version 2.0. See [LICENSE](https://github.com/fiware/CanisMajor/blob/master/LICENSE) for the full license text.
CanisMajor is licensed under the Apache License, Version 2.0. See [LICENSE](LICENSE) for the full license text.

© 2021 FIWARE Foundation e.V.
11 changes: 6 additions & 5 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

All APIs supported by CanisMajor can be found in the [OpenApi-Spec](https://github.com/FIWARE/CanisMajor/tree/master/api/api.yaml).

It essentially consists of 3 types(seperated by tag):
* Ops - basic APIs to support the operation of CanisMajor
* NGSI-LD - [NGSI-LD related](https://docbox.etsi.org/isg/cim/open/Latest%20release%20NGSI-LD%20API%20for%20public%20comment.pdf) endpoints to persist transactions
* Entity - endpoints to retrieve transaction information, based on the enities they relate to
It essentially consists of 3 types (separated by tag):

Check the spec for dedicated information.
* Ops - basic APIs to support the operation of CanisMajor.
* NGSI-LD - [ETSI NGSI-LD related](https://www.etsi.org/deliver/etsi_gs/CIM/001_099/009/01.07.01_60/gs_cim009v010701p.pdf) endpoints to persist transactions.
* Entity - endpoints to retrieve transaction information, based on the entities they relate to

Check the [spec](apidoc.html) for dedicated information.
Loading

0 comments on commit 264d986

Please sign in to comment.