Giter Site home page Giter Site logo

blindstore's Introduction

logo

blindstore

Blindstore server

Build Status

Installation

System requirements: Python 3.4, numpy, libscarab.

Python requirements:

$ pip install -r requirements.txt

Running a server

To run a Blindstore server, simply run server.py with Python 3.4.

To run the server in Flask debug mode, use the --debug switch. Never use this mode on a production machine, as it allows for remote code execution on the server.

Using the server from Python

A Python class for accessing a Blindstore server is provided. A simple example to connect, set and retrieve is shown below:

from client import BlindstoreArray

URL = 'http://localhost:5000/'

array = BlindstoreArray(URL)

print("The Blindstore array has {count} entries of {size} bits each."
        .format(count=array.length, size=array.record_size))

print("Setting...")
array.set(2, bytearray([5]))

print("Retrieving...")
print(array.retrieve(2))
# -> [0, 1, 0, 1]

To connect to the server, we create a BlindstoreArray object, passing the server's URL. The BlindstoreArray object retrieves the number of records on the server, and the size (in bits) of each record, storing them in the length and record_size attributes respectively.

To store data on the server, we call the set method, passing the index to set as an int and the data as a byte array.

To retrieve data, simply call retrieve with the index. The data is returned as a list of bits.

Both set and retrieve calls are synchronous.

License

MIT License

Credits

Logo:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.