From 0556ed93ace5de74c322c0e390e79a1e45154507 Mon Sep 17 00:00:00 2001 From: Eduardo Gonzalez Lazo <30321688+EddyTheCo@users.noreply.github.com> Date: Mon, 1 Apr 2024 20:58:26 +0200 Subject: [PATCH] Add documentation (#26) * Added license * added explanation and image link * remove investment advice :) --- Client/README.md | 26 +++++++++- README.md | 12 +++-- .../.github/workflows/build-test-install.yml | 51 ------------------- Server/.github/workflows/build-wasm.yaml | 17 ------- Server/.gitignore | 6 --- Server/README.md | 48 +++++++++++++++-- 6 files changed, 79 insertions(+), 81 deletions(-) delete mode 100644 Server/.github/workflows/build-test-install.yml delete mode 100644 Server/.github/workflows/build-wasm.yaml delete mode 100644 Server/.gitignore diff --git a/Client/README.md b/Client/README.md index dddc664..6f48af4 100644 --- a/Client/README.md +++ b/Client/README.md @@ -17,7 +17,31 @@ by entering the Client account. If the book and payment are accepted by the server, the server will send the client an NFT signed by the server. By presenting this NFT to the server you can open the locker. -To do this, this application sends the NFT to a server address but with expiration time in the past, so you continue owning the NFT +To do this, this application sends the NFT to a server address but with an expiration time in the past, so you continue owning the NFT and can reuse it as many times as you want. +## Getting the Client app + +### From source code +``` +git clone https://github.com/EddyTheCo/DLockers.git + +mkdir build +cd build +qt-cmake -G Ninja -DCMAKE_INSTALL_PREFIX=installDir -DCMAKE_BUILD_TYPE=Release -DQTDEPLOY=ON -DUSE_THREADS=ON -DBUILD_SERVER=OFF ../Dlockers + +cmake --build . + +cmake --install . +``` +where `installDir` is the installation path, `QTDEPLOY` install Qt dependencies(To be used only if compiling the desktop app). +The use of multithreading is controlled by the `USE_THREADS` variable. +The `-DBUILD_SERVER=OFF` has to be set if compiling for Android, because the server is not meant to run on Android. + +The application major dependencies are the [Qt](https://doc.qt.io/), [OpenCV](https://github.com/opencv/opencv) and [openssl](https://github.com/openssl/openssl) libraries. + +For more information on how to compile for the different platforms refer to the GitHub workflows of the repo. +### From GitHub releases +Download the releases from this repo. + diff --git a/README.md b/README.md index 44461e6..fa07459 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,14 @@ # DLockers -This repo produces a [server](https://github.com/EddyTheCo/DLockers/tree/main/Server/) and a [client](https://github.com/EddyTheCo/DLockers/tree/main/Client/) applications that communicate peer-to-peer using the IOTA network. -We are not interested in crypto's speculative side and are not associated with the Iota Foundation. -We discourage investing in Shimmer and IOTA because that will be investing in the Iota Foundation and its pursuit of centralizing the development and protocol. +This repo produces a [server](Server/) and a [client](Client/) applications that communicate peer-to-peer using the IOTA network. +We are not interested in crypto's speculative side. Use the [web client](https://eddytheco.github.io/DLockers/Client/) or set a [MockUpServer](https://eddytheco.github.io/DLockers/MockupServer/). +Watch the [showcase video](https://youtu.be/JoLe93Gzwho?si=A9S8vM_HUYCxYcHv) +Read how the [Dedicated Post](https://eddytheco.github.io/Shimmerpp/posts/NFT_as_Ticket_in_IoT/) and contribute! + ## The bigger picture * Any person can start renting physical space for lockers. @@ -14,3 +16,7 @@ Use the [web client](https://eddytheco.github.io/DLockers/Client/) or set a [Moc * As long as you maintain a node(blockchain), your gainings and business data are cryptographically secured. * The open source code grants you certain rights and responsibilities to respect other people's rights. * By using NFTs the client can pass the right to open a box to other clients. + + + + diff --git a/Server/.github/workflows/build-test-install.yml b/Server/.github/workflows/build-test-install.yml deleted file mode 100644 index 5cf2068..0000000 --- a/Server/.github/workflows/build-test-install.yml +++ /dev/null @@ -1,51 +0,0 @@ -name: push-build-release -run-name: ${{ github.actor }} ${{ github.event_name }} to ${{ github.base_ref }} -on: - - push: - tags: - - 'v*' - pull_request: - branches: [develop] -jobs: - build_test_package: - strategy: - matrix: - os: [ubuntu-latest,macos-latest,windows-latest] - sharedLib: [true] - useThread: [true,false] - - uses: EddyTheCo/Common/.github/workflows/build-test-install.yml@main - permissions: - contents: write - with: - os: ${{ matrix.os }} - sharedLib: ${{ matrix.sharedLib }} - useThread: ${{ matrix.useThread }} - qtModules: 'qtwebsockets qtshadertools qtmultimedia' - test: false - qtVersion: '6.6.0' - secrets: - NODE_JWT: ${{ secrets.NODE_JWT }} - release: - if: startsWith(github.ref, 'refs/tags/v') - needs: build_test_package - runs-on: ubuntu-latest - - permissions: - contents: write - - steps: - - - uses: actions/checkout@v3 - - - uses: actions/download-artifact@v3 - with: - path: artifacts - - name: Display structure of downloaded files - run: ls -R - - - name: Releases - uses: softprops/action-gh-release@v1 - with: - files: ./artifacts/*/* diff --git a/Server/.github/workflows/build-wasm.yaml b/Server/.github/workflows/build-wasm.yaml deleted file mode 100644 index 389650a..0000000 --- a/Server/.github/workflows/build-wasm.yaml +++ /dev/null @@ -1,17 +0,0 @@ -name: build-wasm -run-name: ${{ github.actor }} ${{ github.event_name }} to ${{ github.base_ref }} -on: - pull_request_target: - types: [closed] - branches: [main] -jobs: - build-html: - uses: EddyTheCo/Common/.github/workflows/build-wasm.yml@main - if: ${{ (github.event.pull_request.merged == true) && (startsWith(github.base_ref, 'main')) }} - permissions: - pages: write - id-token: write - with: - qtModules: 'qtwebsockets qtshadertools' - secrets: - NODE_JWT: ${{ secrets.NODE_JWT }} diff --git a/Server/.gitignore b/Server/.gitignore deleted file mode 100644 index a10f916..0000000 --- a/Server/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -.git/ -doc/html/ -doc/*.tag -*.swp -*.autosave -*.wasm diff --git a/Server/README.md b/Server/README.md index 96a99d4..4f367bf 100644 --- a/Server/README.md +++ b/Server/README.md @@ -10,7 +10,7 @@ If using the mainnet **you are the ONLY responsible for the eventual loss of you To book a box one can use the [client](https://eddytheco.github.io/DLockers/Client). The communication between server and client relies on creating outputs on the ledger. -Because of that, the server needs an initial amount of funds to be able to publish its state on the ledger. +Because of that, the server needs an initial amount of funds to publish its state on the ledger. These initial funds are always owned by the server. @@ -25,9 +25,51 @@ The signed NFT has immutable metadata that references certain time intervals of ## Platforms The server is configured to run on a raspberry-pi, with a 4g and GPS module by using the [evt yocto Layer](https://github.com/EddyTheCo/meta-evt) -The server will set the pin 17(this can be configured) up when a valid NFT is received. +The server will set the pin `17`(this can be configured) up when a valid NFT is received. The latter will open the electrical locker. If using the GPS, the geographical position of the server will be public. - +The GPS is configured to communicate using the serial port `/dev/ttyUSB1`. One can also set up a [mock-up Server](https://eddytheco.github.io/DLockers/MockupServer) for testing just by using the browser. The releases from this repo are also a mock-up Server. + + +## Getting the Server app + +### From source code + +``` +git clone https://github.com/EddyTheCo/DLockers.git + +mkdir build +cd build +qt-cmake -G Ninja -DCMAKE_INSTALL_PREFIX=installDir -DCMAKE_BUILD_TYPE=Release -DQTDEPLOY=ON -DVAULT_PASS="EstervDlockers" -DRPI_SERIAL_PN="serial:/dev/ttyUSB1" -DRPI_SERVER_GPIO=17 -DRPI_SERVER=ON -DBUILD_SHARED_LIBS=ON -DBUILD_CLIENT=OFF ../Dlockers + +cmake --build . + +cmake --install . +``` +where `installDir` is the installation path, `QTDEPLOY` install Qt dependencies(To be used only if compiling the desktop app). +The `-DBUILD_CLIENT=OFF` does not configure the Client app. +The `RPI_SERVER` variable controls configuring a real Server(ON) or a MockupServer(OFF). +The Server App creates a vault to store the random seed when is first created. +The `VAULT_PASS` variable sets the value of the password, by default `EstervDlockers` is used. +The serial port for GPS is set by the `RPI_SERIAL_PN`, by default `serial:/dev/ttyUSB1` is used. +The pin `17` is used by default to open the locker, but this can be configured by the `RPI_SERIAL_PN` variable. + +The application's major dependencies are the [Qt](https://doc.qt.io/) and [openssl](https://github.com/openssl/openssl) libraries. + +For more information on how to compile for the different platforms refer to the GitHub workflows of the repo and the [evt yocto Layer](https://github.com/EddyTheCo/meta-evt/releases/tag/DlockersImageV0.0.1). + +### From GitHub releases + +Download the releases from this repo. +The releases of the Server app from this repo are mock-up servers. +### Yocto image + +One can get the image I used for a Raspberry Pi3 in the [showcase video](https://www.youtube.com/watch?v=JoLe93Gzwho). +The image was created using this tag of the [evt yocto Layer](https://github.com/EddyTheCo/meta-evt/releases/tag/DlockersImageV0.0.1). +The image can be downloaded from this [link](https://drive.google.com/file/d/1xcjNCxDmNiy2UezKV6mg3VdZ25qZXl_1/view?usp=drive_link). +Please check the different licenses of the components used on the image. + + +