Create an aggregate key
Call the .submit function to create an aggregate of a key-value pair for an address.
Returns
The function will return the aggregate message object created.
If no account is passed in the optional object parameter, the aggregate won't actually be written to the network (aka you would be running a test).
Usage
Required parameters
Parameter | Description |
---|---|
address - string | Address the Aggregate should be associated with or the address that posted the Aggregate. |
key - string | Key to mutate |
content - object | The value content object to save for the key. |
Optional parameters
In addition to the required parameters above, an object of optional parameters can be passed following the content object like so:
aggregates.submit(address, key, content,
{channel: "my_channel", account: account}
)
api_server - string
Default: "https://api1.aleph.im"
Target API server
chain - string
Default: null
The chain used by the sender's account. Value can be
NULS2
,ETH
,DOT
,CSDK
,SOL
,AVAX
.channel - string
Default: null
Channel of the message. Ideally, an application would decide and use one channel.
inline - boolean
Default: true
Should the message be stored as a separate file or inserted inline? âšī¸ Set it to false for data that could fall under GDPR.
storage_engine - string
Default: "storage"
Storage engine to use. Possible values:
storage
,ipfs
account - Account | required for writing to the network
Default: null
Sender's account to use for signing.
âšī¸ Needed if you want to send and save the message on the network. Without it, it is a dry run.
Example: Create an aggregate
Last updated