Skip to main content

banner

events-handler

Provider's events handler agent dealing with Keeper Contract events

Features

Monitors ServiceExecutionAgreement events and act as a provider agent to grant access and release reward for the publisher/provider. This is a critical part in the process of consuming data sets in the Ocean Protocol network. Every provider in the network must run some sort of an events-handler to be able to fulfill the access condition of an Access service in an SEA .

This release only supports the Access service type that is defined in an Ocean DDO. More service types will be supported in the events-handler when they're added to the Ocean services.

Prerequisites

Python 3.6

Running Locally

First, clone this repository:

git clone git@github.com:oceanprotocol/events-handler.git
cd events-handler/

Start a keeper node and other services of the ocean network:

git clone git@github.com:oceanprotocol/barge.git
cd barge
bash start_ocean.sh --no-events-handler --no-commons --local-spree-node

Barge is the repository where all the Ocean Docker Compose files are located. We are running the script start_ocean.sh: the easy way to have Ocean projects up and running. We run without an events-handler instance because we will run it directly.

To learn more about Barge, visit the Barge repository.

Note that it runs an Aquarius instance and an Elasticsearch instance but Aquarius can also work with BigchainDB or MongoDB.

Export environment variables PROVIDER_ADDRESS, PROVIDER_PASSWORD and PROVIDER_KEYFILE (or PROVIDER_ENCRYPTED_KEY). Use the values from the tox.ini file, or use your own. Instead of using keyfile and password, you can use the private key directly by setting the env var PROVIDER_KEY.

The most simple way to start is:

pip install -r requirements_dev.txt
export CONFIG_FILE=config.ini
./scripts/wait_for_migration_and_extract_keeper_artifacts.sh
./start_events_monitor.sh

Once the events-handler is running, you can use the Ocean API (Squid library available in python, node, and java implementation) to publish an asset and start a consume request. For more details on using the
Ocean ecosystem please refer to Ocean API

To run the events-handler as a provider, you can either run it from source as described above or use a docker image docker pull oceanprotocol/events-handler:latest. To run the docker image please refer to the docker-compose file in barge events_handler.yml

Code style

The information about code style in python is documented in this two links python-developer-guide and python-style-guide.

Testing

Automatic tests are setup via Travis, executing tox. Our test use pytest framework.

License

Copyright 2018 Ocean Protocol Foundation Ltd.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.


Release files for ocean-events-handler 0.4.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ocean-events-handler 0.4.7
File Size Uploaded
ocean-events-handler-0.4.7.tar.gz 55.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ocean-events-handler 0.4.7
File Interpreter ABI Platform
ocean_events_handler-0.4.7-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 77.4 kB

Release files / ocean-events-handler-0.4.7.tar.gz

Download URL ocean-events-handler-0.4.7.tar.gz
Size 55.6 kB
Tags Source
SHA-256 checksum
How to use checksums
068a8378f879c0b449500a61be722684222ea3f8ea45640e016169816413f46f
BLAKE2b-256 checksum
How to use checksums
553850722cc32d6280fa90964cdc706940d944832144112496c3b5a18c28cb5c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.6.7

Release files / ocean_events_handler-0.4.7-py2.py3-none-any.whl

Download URL ocean_events_handler-0.4.7-py2.py3-none-any.whl
Size 21.8 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
0ca4a503b3d19ada07741c70a3fd1da70cc053e254d172801bab9afd84380826
BLAKE2b-256 checksum
How to use checksums
70e41434104c90ddc6d391dfa20cfffb8a5dc66fba315187d19ba6fd4eb0d1ce
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.6.7

Release history Release notifications | RSS feed

This release

0.4.7 This release

2 release files

0.4.5

2 release files

0.4.4

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.3

2 release files

0.2.0

2 release files

0.1.2

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page