Giter Club home page Giter Club logo

earthdiver's Introduction

Overview

EarthDiver is a prototype for a REST based protocol for a node in the DPN network of replicating nodes. Currently it shows data structures and some proposed REST calls that could be used to negotiate interactions in the DPN network.

Build Status

  • Master: Build Status
  • Develop: Build Status

Installation

For demonstration purposes this is being checked out and run under django runserver and not currently intended for a production release.

Setup Python Environment

  • Python 3.4 is a requirement, this comes installed by default on many modern linux distributions, usually under python3 rather than the system default.
  • It's always recommended to use a virtualenv for your python dependencies or an image like vagrant. Python 3 recommends using venv for the virtual env. The venv command is typically named pyvenv-3.4 on most of these systems as well.

NOTE ON UBUNTU:

There is a known bug with venv in Ubuntu 14.04 (and perhaps other versions as well.) as it is missing the 'ensurepip' module required for venv to work correctly.

To fix you'll need to download the current python 3.4 source and untar it to a local directory. Then copy /Lib/ensurepip your python 3 Lib directory, which is usually /usr/lib/python3.4

Setup Project Code

  • Clone the project from GitHub as needed to a local directory.
  • Setup whatever DB you want to use. I use sqlite against a *.db file in the project data directory for development or when using runserver. *.db files are in the .gitignore file.
  • With the virtual environment active pip install -r requirements.txt
  • Copy EarthDiver/dpnode/localsettings_dist.py to EarthDover/dpnode/localsettings.py and configure as needed.
  • From EarthDiver/dpnode/ run python manage.py migrate twice the first time (It needs to run the base migrations than the local ones).

System Dependencies

  • In development it will frequently require you to have some development libraries installed as well.

    >sudo apt-get install libpython3-dev, libyaml-dev

Setup SuperUser & Groups

  • Group permissions are supplied the EarthDiver/data/GroupPermissions.json fixture that support the access model of the REST calls.
  • Load it by executing 'python manage.py loaddata ../data/GroupPermissions.json'
  • Create your initial superuser by 'python manage.py createsuperuser'

Creating API Users

  • Normal users and created and assigned in the django admin interface.
  • Create a user and save them.
  • Edit the user and click on the 'Profile' section and assign the user to an appropriate node. (This controls what transfers they can see and more)
  • Edit the user and assign them to the appropriate user group:
    • 'api_users' are users from other nodes, it allows them to query the API and view returns as needed.
    • 'api_admins' are for a localnode user, it includes the above permissions plus the ability to add transfers or registry entries.

Setting up test data:

  • Activate your virtual environment.
  • To populate with stub test data execute the following manage.py commands:
    • python manage.py make_nodes Makes some stub node data, etc.
    • python manage.py make_testdata Makes some test registry entries and transfers.
  • Add a new user to use an auth token for and assign them to a node. Permissions are based on user permissions and they can only see their own node content for transfers.

Runserver for Development Testing:

  • Activate your virtual environment. (noticing a theme here?)
  • from EarthDiver/dpnode run python manage.py runserver

Testing:

  • Use something like PostMan in Firefox or a similar Chrome plugin to easily mimic REST client calls. You'll need to set the Authorized token header for it to work.

earthdiver's People

Contributors

streamweaver avatar

Watchers

A. Diamond avatar Dave Pcolar avatar  avatar James Cloos avatar Christian Dahlhausen avatar Kelly Croswell Cobb avatar Allison C. Flavia Ruffner avatar  avatar

Forkers

dgalewsky

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.