Michele971 / hypfs-upgrade

Integrating Algorand blockchain with decentralized keywords Search Engine based on a hypercube structure, and using IPFS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Hypercube on IPFS with Blockchain

Implementation of a DApp (Decentralized Application) using decentralized keywords Search Engine based on a hypercube structure; integrated with IPFS and Algorand blockchain using Python.

Smart Contracts are developed with Reach language and are located inside SmartContract_UI.

The folder /SmartContract_UI/test-suite contains some smart contracts and the simulation scripts.

Status

Working on proof of location, simulated in a permissionless system.

Working on interactions between Python and Smart Contract.

Performance evaluation with startSimulation.py .

Install the Hypercube with Docker

Requirements
Commands
git clone
cd hypfs/server
docker build -t hypercube .
cd ../client
docker build -t hypercube-client .
cd ..
docker-compose up -d

Note: running the Hypercube in local mode

To run in "local mode" skip usage section and use:

  • docker run -d --name ipfs_host -e IPFS_PROFILE=server -v $ipfs_staging:/export -v $ipfs_data:/data/ipfs -p 4001:4001 -p 4001:4001/udp -p 127.0.0.1:8080:8080 -p 127.0.0.1:5001:5001 ipfs/go-ipfs:latest: this allow to start an IPFS docker container Source
  • Install both the requirements.txt inside client and server directories pip3 install -r requirements.txt
  • Start the server: python server.py 8881, where 8881 is the port
  • Start the client: python menu.py /ip4/127.0.0.1/tcp/5001 1

Usage the Hypercube

  1. Check status docker-compose logs -f for all services docker-compose logs -f hypercube_0 for an hypercube node `docker-compose logs -f ipfs

  2. Start client hash docker-compose run hypercube-client bash

  3. Work with the client bash python menu.py /ip4/127.0.0.1/tcp/5001 1

    • the first parameter is your IPFS node API address
    • the second parameter is the ID one Hypercube node (are configured to be from 1 to 8)

    python

    • to open a python console, then:
    • from client import Client
    • client = Client('/ip4/127.0.0.1/tcp/5001',1) (a warning will appear)
    • client.add_obj('test.txt',3) for adding an object, use only keywords from 0 to 7
    • client.pin_search(3,-1) to search using the keyword '3'
    • client.get_obj('QmT78zSuBmuS4z925WZfrqQ1qHaJ56DQaTfyMUF7F8ff5o') will download an object from IPFS in the objects directory

Hypercube folders

./server
  • contains the hypercube and node implementation
  • /hop_counter contains an app for counting network hops
./client
  • contains all the client for interacting with nodes
  • /results: contains the results of tests carried out with the bench.py script.
  • /demo: contains a library for the interface of the menu.py script.
  • /objects: contains the objects downloaded from IPFS.
client executables
  • menu.py: script that provides a user-friendly command line UI.
  • bench.py: script used for testing.

References

License

Apache License 2.0

TODO

  • writeobblockchain file: Remove the passphase
  • writeobblockchain file: Send the transaction to a specific address: the address of the COMPANY
  • SmartContract_UI/index.rsh: Notify the attacher when he is inserting a new position. If his DID already exists, the position will not be added to the map
  • SmartContract_UI/index.mjs: Refactoring the amount sent by Verifier to smart contract
  • SmartContract_UI: recover the address of users in the map passing a specific row of the map to frontend. Then split and passed the address to backend
  • SmartContract_UI/index.rsh: add the timeout to the first API (insert_position)
  • Display the whole map to the Verifier, when he required for that

About

Integrating Algorand blockchain with decentralized keywords Search Engine based on a hypercube structure, and using IPFS

License:Apache License 2.0


Languages

Language:Python 56.9%Language:Shell 22.5%Language:RenderScript 13.7%Language:JavaScript 6.0%Language:Dockerfile 1.0%