mirror of
https://github.com/planetmint/planetmint.git
synced 2025-06-07 14:46:38 +00:00
Merge pull request #27 from planetmint/plntmnt-cryptoconditions
Plntmnt cryptoconditions
This commit is contained in:
commit
f366aab1f2
@ -10,7 +10,7 @@ WORKDIR /usr/src/app
|
|||||||
RUN apk --update add sudo bash \
|
RUN apk --update add sudo bash \
|
||||||
&& apk --update add python3 openssl ca-certificates git \
|
&& apk --update add python3 openssl ca-certificates git \
|
||||||
&& apk --update add --virtual build-dependencies python3-dev \
|
&& apk --update add --virtual build-dependencies python3-dev \
|
||||||
libffi-dev openssl-dev build-base jq \
|
libffi-dev openssl-dev build-base jq zsh \
|
||||||
&& apk add --no-cache libstdc++ dpkg gnupg \
|
&& apk add --no-cache libstdc++ dpkg gnupg \
|
||||||
&& pip3 install --upgrade pip cffi \
|
&& pip3 install --upgrade pip cffi \
|
||||||
&& pip install -e . \
|
&& pip install -e . \
|
||||||
|
@ -5,7 +5,7 @@ COPY . /usr/src/app/
|
|||||||
WORKDIR /usr/src/app
|
WORKDIR /usr/src/app
|
||||||
RUN apk --update add sudo \
|
RUN apk --update add sudo \
|
||||||
&& apk --update add python3 py-pip openssl ca-certificates git\
|
&& apk --update add python3 py-pip openssl ca-certificates git\
|
||||||
&& apk --update add --virtual build-dependencies python3-dev \
|
&& apk --update add --virtual build-dependencies python3-dev zsh \
|
||||||
libffi-dev openssl-dev build-base \
|
libffi-dev openssl-dev build-base \
|
||||||
&& apk add --no-cache libstdc++ \
|
&& apk add --no-cache libstdc++ \
|
||||||
&& pip3 install --upgrade pip cffi \
|
&& pip3 install --upgrade pip cffi \
|
||||||
|
@ -3,7 +3,7 @@ FROM python:${python_version}
|
|||||||
LABEL maintainer "contact@ipdb.global"
|
LABEL maintainer "contact@ipdb.global"
|
||||||
|
|
||||||
RUN apt-get update \
|
RUN apt-get update \
|
||||||
&& apt-get install -y git \
|
&& apt-get install -y git zsh\
|
||||||
&& pip install -U pip \
|
&& pip install -U pip \
|
||||||
&& apt-get autoremove \
|
&& apt-get autoremove \
|
||||||
&& apt-get clean
|
&& apt-get clean
|
||||||
|
@ -12,10 +12,9 @@ so show the latest GitHub release instead.
|
|||||||
|
|
||||||
[](https://codecov.io/github/planetmint/planetmint?branch=master)
|
[](https://codecov.io/github/planetmint/planetmint?branch=master)
|
||||||
[](https://github.com/planetmint/planetmint/releases)
|
[](https://github.com/planetmint/planetmint/releases)
|
||||||
[](https://pypi.org/project/Planetmint/)
|
[](https://pypi.org/project/Planetmint)
|
||||||
[](https://travis-ci.com/planetmint/planetmint)
|
[](https://app.travis-ci.com/planetmint/planetmint)
|
||||||
[](https://docs.planetmint.com/projects/server/en/latest/)
|
[](https://gitter.im/planetmint/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||||
[](https://gitter.im/planetmint/planetmint?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
|
||||||
|
|
||||||
# Planetmint Server
|
# Planetmint Server
|
||||||
|
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
FROM python:3.9
|
FROM python:3.9
|
||||||
|
|
||||||
|
RUN apt-get update && apt-get install -y vim zsh
|
||||||
RUN mkdir -p /src
|
RUN mkdir -p /src
|
||||||
RUN pip install --upgrade \
|
RUN pip install --upgrade \
|
||||||
pycco \
|
pycco \
|
||||||
websocket-client~=0.47.0 \
|
websocket-client~=0.47.0 \
|
||||||
pytest~=3.0 \
|
pytest~=3.0 \
|
||||||
bigchaindb-driver~=0.6.2 \
|
planetmint-driver>=0.9.0 \
|
||||||
blns
|
blns
|
||||||
|
@ -24,8 +24,8 @@
|
|||||||
import os
|
import os
|
||||||
|
|
||||||
# For this test case we import and use the Python Driver.
|
# For this test case we import and use the Python Driver.
|
||||||
from bigchaindb_driver import BigchainDB
|
from planetmint_driver import Planetmint
|
||||||
from bigchaindb_driver.crypto import generate_keypair
|
from planetmint_driver.crypto import generate_keypair
|
||||||
|
|
||||||
|
|
||||||
def test_basic():
|
def test_basic():
|
||||||
@ -34,7 +34,7 @@ def test_basic():
|
|||||||
# connect to localhost, but you can override this value using the env variable
|
# connect to localhost, but you can override this value using the env variable
|
||||||
# called `PLANETMINT_ENDPOINT`, a valid value must include the schema:
|
# called `PLANETMINT_ENDPOINT`, a valid value must include the schema:
|
||||||
# `https://example.com:9984`
|
# `https://example.com:9984`
|
||||||
bdb = BigchainDB(os.environ.get('PLANETMINT_ENDPOINT'))
|
bdb = Planetmint(os.environ.get('PLANETMINT_ENDPOINT'))
|
||||||
|
|
||||||
# ## Create keypairs
|
# ## Create keypairs
|
||||||
# This test requires the interaction between two actors with their own keypair.
|
# This test requires the interaction between two actors with their own keypair.
|
||||||
|
@ -26,18 +26,18 @@
|
|||||||
# And of course, we also need the `BadRequest`.
|
# And of course, we also need the `BadRequest`.
|
||||||
import os
|
import os
|
||||||
import pytest
|
import pytest
|
||||||
from bigchaindb_driver.exceptions import BadRequest
|
from planetmint_driver.exceptions import BadRequest
|
||||||
|
|
||||||
# For this test case we import and use the Python Driver.
|
# For this test case we import and use the Python Driver.
|
||||||
from bigchaindb_driver import BigchainDB
|
from planetmint_driver import Planetmint
|
||||||
from bigchaindb_driver.crypto import generate_keypair
|
from planetmint_driver.crypto import generate_keypair
|
||||||
|
|
||||||
|
|
||||||
def test_divisible_assets():
|
def test_divisible_assets():
|
||||||
# ## Set up a connection to Planetmint
|
# ## Set up a connection to Planetmint
|
||||||
# Check [test_basic.py](./test_basic.html) to get some more details
|
# Check [test_basic.py](./test_basic.html) to get some more details
|
||||||
# about the endpoint.
|
# about the endpoint.
|
||||||
bdb = BigchainDB(os.environ.get('PLANETMINT_ENDPOINT'))
|
bdb = Planetmint(os.environ.get('PLANETMINT_ENDPOINT'))
|
||||||
|
|
||||||
# Oh look, it is Alice again and she brought her friend Bob along.
|
# Oh look, it is Alice again and she brought her friend Bob along.
|
||||||
alice, bob = generate_keypair(), generate_keypair()
|
alice, bob = generate_keypair(), generate_keypair()
|
||||||
|
@ -11,13 +11,13 @@ from uuid import uuid4
|
|||||||
from threading import Thread
|
from threading import Thread
|
||||||
import queue
|
import queue
|
||||||
|
|
||||||
import bigchaindb_driver.exceptions
|
import planetmint_driver.exceptions
|
||||||
from bigchaindb_driver import BigchainDB
|
from planetmint_driver import Planetmint
|
||||||
from bigchaindb_driver.crypto import generate_keypair
|
from planetmint_driver.crypto import generate_keypair
|
||||||
|
|
||||||
|
|
||||||
def test_double_create():
|
def test_double_create():
|
||||||
bdb = BigchainDB(os.environ.get('PLANETMINT_ENDPOINT'))
|
bdb = Planetmint(os.environ.get('PLANETMINT_ENDPOINT'))
|
||||||
alice = generate_keypair()
|
alice = generate_keypair()
|
||||||
|
|
||||||
results = queue.Queue()
|
results = queue.Queue()
|
||||||
@ -33,7 +33,7 @@ def test_double_create():
|
|||||||
try:
|
try:
|
||||||
bdb.transactions.send_commit(tx)
|
bdb.transactions.send_commit(tx)
|
||||||
results.put('OK')
|
results.put('OK')
|
||||||
except bigchaindb_driver.exceptions.TransportError as e:
|
except planetmint_driver.exceptions.TransportError as e:
|
||||||
results.put('FAIL')
|
results.put('FAIL')
|
||||||
|
|
||||||
t1 = Thread(target=send_and_queue, args=(tx, ))
|
t1 = Thread(target=send_and_queue, args=(tx, ))
|
||||||
|
@ -25,15 +25,15 @@
|
|||||||
import os
|
import os
|
||||||
|
|
||||||
# For this test case we import and use the Python Driver.
|
# For this test case we import and use the Python Driver.
|
||||||
from bigchaindb_driver import BigchainDB
|
from planetmint_driver import Planetmint
|
||||||
from bigchaindb_driver.crypto import generate_keypair
|
from planetmint_driver.crypto import generate_keypair
|
||||||
|
|
||||||
|
|
||||||
def test_multiple_owners():
|
def test_multiple_owners():
|
||||||
# ## Set up a connection to Planetmint
|
# ## Set up a connection to Planetmint
|
||||||
# Check [test_basic.py](./test_basic.html) to get some more details
|
# Check [test_basic.py](./test_basic.html) to get some more details
|
||||||
# about the endpoint.
|
# about the endpoint.
|
||||||
bdb = BigchainDB(os.environ.get('PLANETMINT_ENDPOINT'))
|
bdb = Planetmint(os.environ.get('PLANETMINT_ENDPOINT'))
|
||||||
|
|
||||||
# Hey Alice and Bob, nice to see you again!
|
# Hey Alice and Bob, nice to see you again!
|
||||||
alice, bob = generate_keypair(), generate_keypair()
|
alice, bob = generate_keypair(), generate_keypair()
|
||||||
|
@ -24,9 +24,9 @@ from blns import blns
|
|||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
# For this test case we import and use the Python Driver.
|
# For this test case we import and use the Python Driver.
|
||||||
from bigchaindb_driver import BigchainDB
|
from planetmint_driver import Planetmint
|
||||||
from bigchaindb_driver.crypto import generate_keypair
|
from planetmint_driver.crypto import generate_keypair
|
||||||
from bigchaindb_driver.exceptions import BadRequest
|
from planetmint_driver.exceptions import BadRequest
|
||||||
|
|
||||||
naughty_strings = blns.all()
|
naughty_strings = blns.all()
|
||||||
|
|
||||||
@ -36,7 +36,7 @@ def send_naughty_tx(asset, metadata):
|
|||||||
# ## Set up a connection to Planetmint
|
# ## Set up a connection to Planetmint
|
||||||
# Check [test_basic.py](./test_basic.html) to get some more details
|
# Check [test_basic.py](./test_basic.html) to get some more details
|
||||||
# about the endpoint.
|
# about the endpoint.
|
||||||
bdb = BigchainDB(os.environ.get('PLANETMINT_ENDPOINT'))
|
bdb = Planetmint(os.environ.get('PLANETMINT_ENDPOINT'))
|
||||||
|
|
||||||
# Here's Alice.
|
# Here's Alice.
|
||||||
alice = generate_keypair()
|
alice = generate_keypair()
|
||||||
|
@ -27,8 +27,8 @@ from uuid import uuid4
|
|||||||
# [websocket](https://github.com/websocket-client/websocket-client) module
|
# [websocket](https://github.com/websocket-client/websocket-client) module
|
||||||
from websocket import create_connection
|
from websocket import create_connection
|
||||||
|
|
||||||
from bigchaindb_driver import BigchainDB
|
from planetmint_driver import Planetmint
|
||||||
from bigchaindb_driver.crypto import generate_keypair
|
from planetmint_driver.crypto import generate_keypair
|
||||||
|
|
||||||
|
|
||||||
def test_stream():
|
def test_stream():
|
||||||
@ -40,7 +40,7 @@ def test_stream():
|
|||||||
# *That's pretty bad, but let's do like this for now.*
|
# *That's pretty bad, but let's do like this for now.*
|
||||||
WS_ENDPOINT = 'ws://{}:9985/api/v1/streams/valid_transactions'.format(BDB_ENDPOINT.rsplit(':')[0])
|
WS_ENDPOINT = 'ws://{}:9985/api/v1/streams/valid_transactions'.format(BDB_ENDPOINT.rsplit(':')[0])
|
||||||
|
|
||||||
bdb = BigchainDB(BDB_ENDPOINT)
|
bdb = Planetmint(BDB_ENDPOINT)
|
||||||
|
|
||||||
# Hello to Alice again, she is pretty active in those tests, good job
|
# Hello to Alice again, she is pretty active in those tests, good job
|
||||||
# Alice!
|
# Alice!
|
||||||
|
@ -11,7 +11,7 @@ There are many ways you can contribute to Planetmint.
|
|||||||
It includes several sub-projects.
|
It includes several sub-projects.
|
||||||
|
|
||||||
- `Planetmint Server <https://github.com/planetmint/planetmint>`_
|
- `Planetmint Server <https://github.com/planetmint/planetmint>`_
|
||||||
- `Planetmint Python Driver <https://github.com/planetmint/bigchaindb-driver>`_
|
- `Planetmint Python Driver <https://github.com/planetmint/planetmint-driver>`_
|
||||||
- `Planetmint JavaScript Driver <https://github.com/planetmint/js-bigchaindb-driver>`_
|
- `Planetmint JavaScript Driver <https://github.com/planetmint/js-bigchaindb-driver>`_
|
||||||
- `Planetmint Java Driver <https://github.com/planetmint/java-bigchaindb-driver>`_
|
- `Planetmint Java Driver <https://github.com/planetmint/java-bigchaindb-driver>`_
|
||||||
- `cryptoconditions <https://github.com/planetmint/cryptoconditions>`_ (a Python package by us)
|
- `cryptoconditions <https://github.com/planetmint/cryptoconditions>`_ (a Python package by us)
|
||||||
|
@ -22,7 +22,6 @@ People ask questions about Planetmint in the following places:
|
|||||||
|
|
||||||
- Gitter
|
- Gitter
|
||||||
- [planetmint/planetmint](https://gitter.im/planetmint/community)
|
- [planetmint/planetmint](https://gitter.im/planetmint/community)
|
||||||
- [planetmint/js-planetmint-driver](https://gitter.im/planetmint/community))
|
|
||||||
- [Twitter](https://twitter.com/planetmint)
|
- [Twitter](https://twitter.com/planetmint)
|
||||||
- [Stack Overflow "planetmint"](https://stackoverflow.com/search?q=planetmint)
|
- [Stack Overflow "planetmint"](https://stackoverflow.com/search?q=planetmint)
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ If you're writing code, you should also update any related docs. However, you mi
|
|||||||
You can certainly do that!
|
You can certainly do that!
|
||||||
|
|
||||||
- The docs for Planetmint Server live under ``planetmint/docs/`` in the ``planetmint/planetmint`` repo.
|
- The docs for Planetmint Server live under ``planetmint/docs/`` in the ``planetmint/planetmint`` repo.
|
||||||
- There are docs for the Python driver under ``bigchaindb-driver/docs/`` in the ``planetmint/bigchaindb-driver`` repo.
|
- There are docs for the Python driver under ``planetmint-driver/docs/`` in the ``planetmint/planetmint-driver`` repo.
|
||||||
- There are docs for the JavaScript driver under ``planetmint/js-bigchaindb-driver`` in the ``planetmint/js-bigchaindb-driver`` repo.
|
- There are docs for the JavaScript driver under ``planetmint/js-bigchaindb-driver`` in the ``planetmint/js-bigchaindb-driver`` repo.
|
||||||
- The source code for the Planetmint website is in a private repo, but we can give you access if you ask.
|
- The source code for the Planetmint website is in a private repo, but we can give you access if you ask.
|
||||||
|
|
||||||
|
@ -205,10 +205,6 @@ Tendermint voting 파워가 0인 노드인 추종자 노드를 생성할 수 있
|
|||||||
|
|
||||||
[MongoDB node.js 드라이버](https://mongodb.github.io/node-mongodb-native/?jmp=docs)와 같은 MongoDB 드라이버를 사용하여 다음 중 하나를 사용하여 노드의 MongoDB 데이터베이스에 연결할 수 있습니다. 여기 자바스크립트 쿼리 코드에 대한 링크가 있습니다.
|
[MongoDB node.js 드라이버](https://mongodb.github.io/node-mongodb-native/?jmp=docs)와 같은 MongoDB 드라이버를 사용하여 다음 중 하나를 사용하여 노드의 MongoDB 데이터베이스에 연결할 수 있습니다. 여기 자바스크립트 쿼리 코드에 대한 링크가 있습니다.
|
||||||
|
|
||||||
<<<<<<< HEAD
|
- [The Planetmint JavaScript/Node.js driver source code](https://github.com/bigchaindb/js-bidchaindb-driver)
|
||||||
- [The Planetmint JavaScript/Node.js driver source code](https://github.com/planetmint/js-bigchaindb-driver)
|
- [Example code by @manolodewiner](https://github.com/manolodewiner/query-mongodb-bigchaindb/blob/master/queryMongo.js)
|
||||||
=======
|
- [More example code by @manolodewiner](https://github.com/bigchaindb/bigchaindb/issues/2315#issuecomment-392724279)
|
||||||
- [The Planetmint JavaScript/Node.js driver source code](https://github.com/planetmint/js-planetmint-driver)
|
|
||||||
>>>>>>> 3bfc3298f8210b135084e823eedd47f213538088
|
|
||||||
- [Example code by @manolodewiner](https://github.com/manolodewiner/query-mongodb-planetmint/blob/master/queryMongo.js)
|
|
||||||
- [More example code by @manolodewiner](https://github.com/planetmint/planetmint/issues/2315#issuecomment-392724279)
|
|
@ -9,8 +9,8 @@ WORKDIR /
|
|||||||
RUN apk add --no-cache --update curl bind-tools python3-dev g++ \
|
RUN apk add --no-cache --update curl bind-tools python3-dev g++ \
|
||||||
libffi-dev make vim git nodejs openssl-dev \
|
libffi-dev make vim git nodejs openssl-dev \
|
||||||
&& pip3 install ipython \
|
&& pip3 install ipython \
|
||||||
&& git clone https://github.com/bigchaindb/bigchaindb-driver \
|
&& git clone https://github.com/planetmint/planetmint-driver \
|
||||||
&& cd bigchaindb-driver \
|
&& cd planetmint-driver \
|
||||||
&& pip3 install -e . \
|
&& pip3 install -e . \
|
||||||
&& npm install -g wsc
|
&& npm install -g wsc
|
||||||
ENTRYPOINT ["/bin/sh"]
|
ENTRYPOINT ["/bin/sh"]
|
||||||
|
20
setup.py
20
setup.py
@ -16,6 +16,9 @@ from setuptools import setup, find_packages
|
|||||||
if sys.version_info < (3, 9):
|
if sys.version_info < (3, 9):
|
||||||
sys.exit('Please use Python version 3.9 or higher.')
|
sys.exit('Please use Python version 3.9 or higher.')
|
||||||
|
|
||||||
|
with open('README.md') as readme_file:
|
||||||
|
readme = readme_file.read()
|
||||||
|
|
||||||
# get the version
|
# get the version
|
||||||
version = {}
|
version = {}
|
||||||
with open('planetmint/version.py') as fp:
|
with open('planetmint/version.py') as fp:
|
||||||
@ -59,7 +62,6 @@ tests_require = [
|
|||||||
'flake8',
|
'flake8',
|
||||||
'flake8-quotes==0.8.1',
|
'flake8-quotes==0.8.1',
|
||||||
'hypothesis>=5.3.0',
|
'hypothesis>=5.3.0',
|
||||||
# Removed pylint because its GPL license isn't Apache2-compatible
|
|
||||||
'pytest>=3.0.0',
|
'pytest>=3.0.0',
|
||||||
'pytest-cov==2.8.1',
|
'pytest-cov==2.8.1',
|
||||||
'pytest-mock',
|
'pytest-mock',
|
||||||
@ -74,7 +76,7 @@ install_requires = [
|
|||||||
'chardet==3.0.4',
|
'chardet==3.0.4',
|
||||||
'aiohttp==3.7.4',
|
'aiohttp==3.7.4',
|
||||||
'bigchaindb-abci==1.0.7',
|
'bigchaindb-abci==1.0.7',
|
||||||
'cryptoconditions==0.8.1',
|
'planetmint-cryptoconditions>=0.9.0',
|
||||||
'flask-cors==3.0.10',
|
'flask-cors==3.0.10',
|
||||||
'flask-restful==0.3.9',
|
'flask-restful==0.3.9',
|
||||||
'flask==2.0.1',
|
'flask==2.0.1',
|
||||||
@ -97,20 +99,12 @@ setup(
|
|||||||
name='Planetmint',
|
name='Planetmint',
|
||||||
version=version['__version__'],
|
version=version['__version__'],
|
||||||
description='Planetmint: The Blockchain Database',
|
description='Planetmint: The Blockchain Database',
|
||||||
long_description=(
|
long_description=readme,
|
||||||
"Planetmint allows developers and enterprises to deploy blockchain "
|
long_description_content_type='text/markdown',
|
||||||
"proof-of-concepts, platforms and applications with a blockchain "
|
|
||||||
"database. Planetmint supports a wide range of industries and use cases "
|
|
||||||
"from identity and intellectual property to supply chains, energy, IoT "
|
|
||||||
"and financial ecosystems. With high throughput, low latency, powerful "
|
|
||||||
"query functionality, decentralized control, immutable data storage and "
|
|
||||||
"built-in asset support, Planetmint is like a database with blockchain "
|
|
||||||
"characteristics."
|
|
||||||
),
|
|
||||||
url='https://github.com/Planetmint/planetmint/',
|
url='https://github.com/Planetmint/planetmint/',
|
||||||
author='Planetmint Contributors',
|
author='Planetmint Contributors',
|
||||||
author_email='contact@ipdb.global',
|
author_email='contact@ipdb.global',
|
||||||
license='Apache Software License 2.0',
|
license='AGPLv3',
|
||||||
zip_safe=False,
|
zip_safe=False,
|
||||||
python_requires='>=3.9',
|
python_requires='>=3.9',
|
||||||
classifiers=[
|
classifiers=[
|
||||||
|
Loading…
x
Reference in New Issue
Block a user