Create an aggregate

Call the .create_aggregate() function to create an aggregate of a key-value pair for an address.

Returns

The function will return the aggregate message object created.

Usage

def create_aggregate(
    account,
    key,
    content,
    address,
    channel,
    session,
    api_server)

Required Arguments

account - Account

Sender's account to use for signing. The account address will be the aggregate's address if no different optional address is passed.

key - string

Key to mutate

content - object

The value content object to save for the key.

Optional Arguments

  • 4. address - string Default: None Address the aggregate should be associated with. One can pass a different address than the account address to update the aggregate for this target address (see update for another address and security key). If none is passed, the aggregate will be for the account address.

  • 5. channel - string Default: "TEST" Channel of the message. Ideally, an application would decide and use one channel.

  • 6. session Default: None

  • 7. api_server - string Default: "https://api2.aleph.im" Target API Server

Example

>>> from aleph_client.synchronous import create_aggregate

>>> create_aggregate(
...    account, 'testkey', {'a': 1, 'b': 2}, channel='MY_CHANNEL')

Last updated