Skip to main content

Compute-over-Data (CoD) network for time series data on Aleph.im

Project description

fishnet-cod

P2P Financial Signal Hosting Network on Aleph

Initial setup

Install the FastAPI library and Uvicorn:

pip install -r requirements.txt

Uvicorn is used to run ASGI compatible web applications, such as the app web application from the example above. You need to specify it the name of the Python module to use and the name of the app:

cd src  # the following command must be run from the src folder

python -m uvicorn fishnet_cod.api.main:app --reload

Then open the app in a web browser on http://localhost:8000

Tip: With --reload, Uvicorn will automatically reload your code upon changes

Upload on Aleph

The same app we just used with Gunicorn can be used by Aleph to run the web app, since Aleph attempts to be compatible with ASGI.

To upload the app, we can use the aleph command line tool.

aleph program api app

Testing

Open the HTTP interface of a node running the VM Supervisor:

http://ip-of-supervisor:4020/vm/{message_hash}/

Deployment

You can deploy your own Fishnet instance using the fishnet_cod.deployment package.

from pathlib import Path

import asyncio

from aleph.sdk.client import AuthenticatedAlephClient
from aleph.sdk.chains.sol import get_fallback_account
from aleph.sdk.conf import settings

from fishnet_cod.deployment import deploy_api, deploy_executors

async def main():
    aleph_session = AuthenticatedAlephClient(
        get_fallback_account(),
        settings.API_HOST
    )  # you'll need tons of $ALEPH
    
    executors = await deploy_executors(
        executor_path=Path("/your/executor/folder"),
        time_slices=[0, -1],  # one executor for all data
        deployer_session=aleph_session,
        channel="MY_DEPLOYMENT_CHANNEL",
    )
    
    await deploy_api(
        api_path=Path("/your/api/folder"),
        deployer_session=aleph_session,
        executors=executors,
        channel="MY_DEPLOYMENT_CHANNEL",
    )

asyncio.run(main())

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fishnet_cod-1.0.0b4.tar.gz (58.4 MB view details)

Uploaded Source

Built Distribution

fishnet_cod-1.0.0b4-py3-none-any.whl (31.6 kB view details)

Uploaded Python 3

File details

Details for the file fishnet_cod-1.0.0b4.tar.gz.

File metadata

  • Download URL: fishnet_cod-1.0.0b4.tar.gz
  • Upload date:
  • Size: 58.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for fishnet_cod-1.0.0b4.tar.gz
Algorithm Hash digest
SHA256 11102297aaef62f6fe93671a488acab7266732b6ea3cb5a57707f1dcc0945d1f
MD5 a5632b720057527d0ec61b3f256b5d2e
BLAKE2b-256 43a7dad9ab11cdf51fc5250344e57dd321577036eff8c6c1521d27d1bc551715

See more details on using hashes here.

File details

Details for the file fishnet_cod-1.0.0b4-py3-none-any.whl.

File metadata

File hashes

Hashes for fishnet_cod-1.0.0b4-py3-none-any.whl
Algorithm Hash digest
SHA256 d9a8d28503915a2d348783a053e0c47b266895a8068567c5da9bb117db359d0c
MD5 8b1075fe0b2943180844b0efe7478fc0
BLAKE2b-256 4e6102ffd69b5ebd8c28dfd152a9902f3cdca70fcdda67ff5a6e83f6799b2b1e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page