Skip to content

Commit

Permalink
storjterms -> storjlib
Browse files Browse the repository at this point in the history
  • Loading branch information
F483 committed Feb 6, 2016
1 parent 612171d commit 07e0fed
Show file tree
Hide file tree
Showing 14 changed files with 51 additions and 39 deletions.
8 changes: 4 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ install:
- pip install -r requirements.txt
- pip install -r test_requirements.txt
- python setup.py install
- python -m storjterms.api startserver --hostname="127.0.0.1" --port=7000 < /dev/null &>/dev/null &
- python -m storjlib.api startserver --hostname="127.0.0.1" --port=7000 < /dev/null &>/dev/null &


script:
- pep8 storjterms
- pep8 storjlib
- pep8 tests
- bash -c "source <(curl -s https://raw.githubusercontent.com/Storj/storjspec/master/test_storjterms_compatibility.sh)"
- travis_wait coverage run --source="storjterms" setup.py test
- bash -c "source <(curl -s https://raw.githubusercontent.com/Storj/storjspec/master/test_storjlib_compatibility.sh)"
- travis_wait coverage run --source="storjlib" setup.py test
- coverage report --fail-under=80

after_success:
Expand Down
10 changes: 7 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,17 @@ view_readme: setup
env/bin/restview README.rst


rpcserver: setup
env/bin/python -m storjlib.api startserver --hostname="127.0.0.1" --port=7000


test: setup
$(PEP8) storjterms
$(PEP8) storjlib
$(PEP8) tests
bash start_rpc.sh
bash -c "source <(curl -s https://raw.githubusercontent.com/Storj/storjspec/master/test_storjterms_compatibility.sh)"
bash -c "source <(curl -s https://raw.githubusercontent.com/Storj/storjspec/master/test_storjlib_compatibility.sh)"
bash stop_rpc.sh
$(COVERAGE) run --source="storjterms" setup.py test
$(COVERAGE) run --source="storjlib" setup.py test
$(COVERAGE) report --fail-under=80


Expand Down
34 changes: 17 additions & 17 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
##########
storjterms
##########
########
storjlib
########

|BuildLink|_ |CoverageLink|_ |BuildLink2|_ |CoverageLink2|_ |LicenseLink|_

.. |BuildLink| image:: https://img.shields.io/travis/Storj/storjterms/master.svg?label=Build-Master
.. _BuildLink: https://travis-ci.org/Storj/storjterms
.. |BuildLink| image:: https://img.shields.io/travis/Storj/storjlib/master.svg?label=Build-Master
.. _BuildLink: https://travis-ci.org/Storj/storjlib

.. |CoverageLink| image:: https://img.shields.io/coveralls/Storj/storjterms/master.svg?label=Coverage-Master
.. _CoverageLink: https://coveralls.io/r/Storj/storjterms
.. |CoverageLink| image:: https://img.shields.io/coveralls/Storj/storjlib/master.svg?label=Coverage-Master
.. _CoverageLink: https://coveralls.io/r/Storj/storjlib

.. |BuildLink2| image:: https://img.shields.io/travis/Storj/storjterms/develop.svg?label=Build-Develop
.. _BuildLink2: https://travis-ci.org/Storj/storjterms
.. |BuildLink2| image:: https://img.shields.io/travis/Storj/storjlib/develop.svg?label=Build-Develop
.. _BuildLink2: https://travis-ci.org/Storj/storjlib

.. |CoverageLink2| image:: https://img.shields.io/coveralls/Storj/storjterms/develop.svg?label=Coverage-Develop
.. _CoverageLink2: https://coveralls.io/r/Storj/storjterms
.. |CoverageLink2| image:: https://img.shields.io/coveralls/Storj/storjlib/develop.svg?label=Coverage-Develop
.. _CoverageLink2: https://coveralls.io/r/Storj/storjlib

.. |LicenseLink| image:: https://img.shields.io/badge/license-MIT-blue.svg
.. _LicenseLink: https://raw.githubusercontent.com/Storj/storjterms
.. _LicenseLink: https://raw.githubusercontent.com/Storj/storjlib


storjterms reference implementation.
storjlib reference implementation.


Setup
Expand All @@ -31,14 +31,14 @@ Install
::

$ sudo apt-get install python-dev gcc
$ sudo pip install storjterms
$ storjterms --help
$ sudo pip install storjlib
$ storjlib --help


Update

::

$ sudo pip install storjterms --upgrade
$ storjterms --help
$ sudo pip install storjlib --upgrade
$ storjlib --help

8 changes: 4 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@
from setuptools import setup, find_packages


exec(open('storjterms/version.py').read()) # load __version__
exec(open('storjlib/version.py').read()) # load __version__


setup(
name='storjterms',
description="Storjterms reference implementation.",
name='storjlib',
description="Storjlib reference implementation.",
long_description=open("README.rst").read(),
keywords="storj, reference, protocol, DHT",
url='http://storj.io',
author='Fabian Barkhau',
author_email='shawn+storjterms@storj.io',
author_email='shawn+storjlib@storj.io',
license="MIT",
version=__version__, # NOQA
test_suite="tests",
Expand Down
4 changes: 2 additions & 2 deletions start_rpc.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

screen -dmS storjterms_rpc_server;
screen -dmS storjlib_rpc_server;
sleep 1
screen -S storjterms_rpc_server -X stuff $'env/bin/python -m storjterms.api startserver --hostname="127.0.0.1" --port=7000 &> storjterms_rpc_server.log\n'
screen -S storjlib_rpc_server -X stuff $'env/bin/python -m storjlib.api startserver --hostname="127.0.0.1" --port=7000 &> storjlib_rpc_server.log\n'

2 changes: 1 addition & 1 deletion stop_rpc.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env bash

screen -S storjterms_rpc_server -X kill
screen -S storjlib_rpc_server -X kill
File renamed without changes.
4 changes: 2 additions & 2 deletions storjterms/api.py → storjlib/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from . version import __version__ # NOQA


class Storjterms(apigen.Definition):
class Storjlib(apigen.Definition):

@apigen.command()
def contract_is_valid(self, contract):
Expand All @@ -19,4 +19,4 @@ def contract_is_valid(self, contract):


if __name__ == "__main__":
apigen.run(Storjterms)
apigen.run(Storjlib)
File renamed without changes.
File renamed without changes.
16 changes: 12 additions & 4 deletions storjterms/contract/schema.py → storjlib/contract/schema.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
CONTRACT_SCHEMA = {
import json

CONTRACT_SCHEMA = json.loads("""
{
"type": "object",
"properties": {
"type": {
"enum": [
("56ce3e837f575827cb5a94e2b609756"
"a48fa4a3882f5e762b262af31f432878d")
"56ce3e837f575827cb5a94e2b609756a48fa4a3882f5e762b262af31f432878d"
]
},
"renter_id": {
Expand Down Expand Up @@ -66,6 +68,10 @@
"type": ["integer", "null"],
"minimum": 0
},
"audit_merkle_root": {
"type": ["string", "null"],
"pattern": "^[0-9a-f]{64,64}$"
},
"heartbeat_algorithm": {
"type": ["string", "null"]
},
Expand Down Expand Up @@ -105,7 +111,7 @@
"minimum": 0
}
},
"additionalProperties": False,
"additionalProperties": false,
"required": [
"type",
"renter_id",
Expand All @@ -123,6 +129,7 @@
"store_end",
"audit_algorithm",
"audit_count",
"audit_merkle_root",
"heartbeat_algorithm",
"heartbeat_count",
"heartbeat_coverage",
Expand All @@ -136,3 +143,4 @@
"payment_interval"
]
}
""")
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions tests/api.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import unittest
import storjterms
import storjlib


EXAMPLE_CONTRACT = {
Expand Down Expand Up @@ -36,7 +36,7 @@
class TestIsValid(unittest.TestCase):

def test_example(self):
api = storjterms.api.Storjterms()
api = storjlib.api.Storjlib()
self.assertTrue(api.contract_is_valid(EXAMPLE_CONTRACT))


Expand Down

0 comments on commit 07e0fed

Please sign in to comment.