Skip to content

Commit

Permalink
vns
Browse files Browse the repository at this point in the history
  • Loading branch information
y19818 committed Dec 2, 2019
1 parent 3c8dc91 commit dc03404
Show file tree
Hide file tree
Showing 360 changed files with 40,499 additions and 52,070 deletions.
110 changes: 55 additions & 55 deletions ARCHITECTURE.md
Original file line number Diff line number Diff line change
@@ -1,55 +1,55 @@
methods/*
These files define all methods callable under
web3.db.*
web3.eth.*
web3.net.*
web3.personal.*
web3.shh.*

Methods and properties are first defined as a dictionary
and then are converted to real functions and attached to the
respective objects. This will make it easier to mirror the
next migrations of the web3.js library. Both types are defined
in method.py and property.py respectively.

RequestManager
Is supplied with one Provider at initialisation which
can be replaced by calling setProvider(). It uses Jsonrpc
to convert the methods into raw payloads and to validate
responses attained with receive().

Has three other methods:

- send(data, timeout=None)
If timeout is None, send blocks until the result is
available, which it then returns.

If the timeout is 0, send returns immediately, only
returning the id of the request, which can be used
to poll with receive() later.

If the timeout is greater than 0, it blocks until
either the result is available or the timeout is
reached, at which point a ValueError is thrown.
send() makes use of the other two functions:

- forward(data)
Forwards the data to the provider and returns the
request id.

- receive(requestid, timeout=0)
Implements the timeout functionality described in send.
If timeout is 0, it returns None if the response was
not available.

Provider
On initialisation, is started in a separate thread.
Continuously fetches incoming requests from a queue
and appends the responses to another queue. Providers
only receives and returns "raw" requests, JSON validation
and decoding happens in the Request Manager.

As of now there are two implementations:
- RPCProvider
- IPCProvider
methods/*
These files define all methods callable under
web3.db.*
web3.vns.*
web3.net.*
web3.personal.*
web3.shh.*

Methods and properties are first defined as a dictionary
and then are converted to real functions and attached to the
respective objects. This will make it easier to mirror the
next migrations of the web3.js library. Both types are defined
in method.py and property.py respectively.

RequestManager
Is supplied with one Provider at initialisation which
can be replaced by calling setProvider(). It uses Jsonrpc
to convert the methods into raw payloads and to validate
responses attained with receive().

Has three other methods:

- send(data, timeout=None)
If timeout is None, send blocks until the result is
available, which it then returns.

If the timeout is 0, send returns immediately, only
returning the id of the request, which can be used
to poll with receive() later.

If the timeout is greater than 0, it blocks until
either the result is available or the timeout is
reached, at which point a ValueError is thrown.
send() makes use of the other two functions:

- forward(data)
Forwards the data to the provider and returns the
request id.

- receive(requestid, timeout=0)
Implements the timeout functionality described in send.
If timeout is 0, it returns None if the response was
not available.

Provider
On initialisation, is started in a separate thread.
Continuously fetches incoming requests from a queue
and appends the responses to another queue. Providers
only receives and returns "raw" requests, JSON validation
and decoding happens in the Request Manager.

As of now there are two implementations:
- RPCProvider
- IPCProvider
68 changes: 34 additions & 34 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
# Development

To start development you should begin by cloning the repo.

```bash
$ git clone [email protected]/ethereum/web3.py.git
```


# Cute Animal Pictures

All pull requests need to have a cute animal picture. This is a very important
part of the development process.


# Pull Requests

In general, pull requests are welcome. Please try to adhere to the following.

- code should conform to PEP8 and as well as the linting done by `flake8 web3/ tests/`
- include tests.
- include any relevant documentation updates.

It's a good idea to make pull requests early on. A pull request represents the
start of a discussion, and doesn't necessarily need to be the final, finished
submission.

GitHub's documentation for working on pull requests is [available here](https://help.github.com/articles/about-pull-requests/).

Always run the tests before submitting pull requests, and ideally run `tox` in
order to check that your modifications don't break anything.

Once you've made a pull request take a look at the travis build status in the
GitHub interface and make sure the tests are runnning as you'd expect.
# Development

To start development you should begin by cloning the repo.

```bash
$ git clone [email protected]/ethereum/web3.py.git
```


# Cute Animal Pictures

All pull requests need to have a cute animal picture. This is a very important
part of the development process.


# Pull Requests

In general, pull requests are welcome. Please try to adhere to the following.

- code should conform to PEP8 and as well as the linting done by `flake8 web3/ tests/`
- include tests.
- include any relevant documentation updates.

It's a good idea to make pull requests early on. A pull request represents the
start of a discussion, and doesn't necessarily need to be the final, finished
submission.

GitHub's documentation for working on pull requests is [available here](https://help.github.com/articles/about-pull-requests/).

Always run the tests before submitting pull requests, and ideally run `tox` in
order to check that your modifications don't break anything.

Once you've made a pull request take a look at the travis build status in the
GitHub interface and make sure the tests are runnning as you'd expect.
39 changes: 19 additions & 20 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
FROM python:3.6

# Set up code directory
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app

# Install Linux dependencies
RUN apt-get update && apt-get install -y libssl-dev

COPY web3 ./web3/
COPY tests ./tests/
COPY ens ./ens/
COPY ethpm ./ethpm/

COPY setup.py .
COPY README.md .

RUN pip install -e .[dev]

WORKDIR /code
FROM python:3.6

# Set up code directory
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app

# Install Linux dependencies
RUN apt-get update && apt-get install -y libssl-dev

COPY web3 ./web3/
COPY tests ./tests/
COPY ens ./ens/

COPY setup.py .
COPY README.md .

RUN pip install -e .[dev]

WORKDIR /code
42 changes: 21 additions & 21 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
The MIT License (MIT)

Copyright (c) 2016 Piper Merriam

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
The MIT License (MIT)
Copyright (c) 2016 Piper Merriam
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
16 changes: 7 additions & 9 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
include LICENSE
include VERSION
include README.md
include requirements.txt

recursive-exclude * __pycache__
recursive-exclude * *.py[co]

recursive-include ethpm/assets/ *
include LICENSE
include VERSION
include README.md
include requirements.txt

recursive-exclude * __pycache__
recursive-exclude * *.py[co]
Loading

0 comments on commit dc03404

Please sign in to comment.