Skip to content

Cybersecurity-LINKS/trust-service

Repository files navigation

Trust service

This project is a microservice for creating and verifying proofs of data authenticity and data integrity. The application store the proofs on the IOTA Tangle. To answer the requirement that a user should not own crypto tokens, a centralized approach has been used where the service handles the identity keys of the user. The microservice also expose the API to mint an NFT representing a dataset. The microservice logs are stored on IPFS and the CID to retrieve them is stored in traditional storage.

Getting started

Requirements

  • Rust and Cargo. Follow the documentation to install them.
  • Docker and Docker compose
  • Smart contracts already deployed on the same network that the trust-service will interact with. More information here.

Run

Beware of the configuration of the environment variables. Note: Modify .env and .mongo.env reasonably. (ADDR, MONGO_ENDPOINT, ASSET_FACTORY_ADDR,L2_PRIVATE_KEY)

Locally

For testing the application with MongoDB, follow these steps:

  • Run docker compose --profile dev up -d to start the MongoDB and IPFS containers.
  • Create a database called MODERATE.
  • Create a collection called Users.
  • Use MongoDB Compass to view the database content. Note: MongoDB Compass is a tool that can be used to interact with MongoDB databases and inspect their content.

Create the smart contract Rust bindings (mandatory the first time or if the smart contracts change)

cd abigen
# assuming the ipr-management folder is located in the same root folder of the trust-service
cargo run -- --contract AssetFactory --abi-source "../../ipr-management/artifacts/contracts/AssetFactory.sol/AssetFactory.json"
cargo run -- --contract Asset --abi-source "../../ipr-management/artifacts/contracts/Asset.sol/Asset.json"

Then, launch the application:

cd actix-server
cargo run --release --bin actix-trust-service

Via docker

Copy the smart contract json files to create the Rust bindings (mandatory the first time or if the smart contracts change)

    mkdir smart-contracts
    # assuming the ipr-management folder is located in the same root folder of the trust-service
    cp ../ipr-management/artifacts/contracts/AssetFactory.sol/AssetFactory.json ./smart-contracts
    cp ../ipr-management/artifacts/contracts/Asset.sol/Asset.json ./smart-contracts

Commands for building the app’s container image and starting the app container:

docker compose --profile deploy up -d

Usage

License

Apache-2.0

About

Trust service application with actix framework

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published