Functions, errors and more

A few global tips on the API system

Account instantiated

The API Resources Reference usage and example calls assume you have an account already instantiated. See the account reference on how to do so.

Making Synchronous function calls

from aleph_client.synchronous import fetch_aggregate

fetch_aggregate(...)

Making Asynchronous function calls

from aleph_client.asynchronous import create_aggregate

asyncio.run(create_aggregate(...))

Function types

All functions throughout the API are Positional_or_Keywords argument functions.

# Examples of creating an aggregate

create_aggregate(account, key, content, address, channel)

create_aggregate(account, key, content, channel=channel, api_server=api_server)

create_aggregate(account=account, key=key, content=content, channel=channel)

Warning Messages & Errors

Warning Message = "Message published on IPFS but failed to publish on P2P". This means one of the two protocols used to publish the message by the node has failed but one went through.

api_server

Any core channel node multi-address can be used as an api_server. You can find a list of core nodes here and their multi-address in their "info".

Example of one of the nodes multi-address that can be found on https://account.aleph.im/: /ip4/65.21.141.116/tcp/4025/p2p/QmSuf7N2753dAeiwXmXVPdNW1JBvzhb43t6wXVaR75w64S).

Api Server Url would look like this:

https://<ip-address> or http://<ip-address>:4024

[Future Release] The Aleph-Client will provide load-balancing in the future so the users don't have to pick one.

Reasons for choosing a different api_server:

  • The latency decreases the closer the dApp is from the server

  • Some offer HTTPS others don't (yet).

Last updated