Skip to content

setmeta.a ​

The setmeta.a action is the first version of the setmeta action for the Ultra blockchain. It allows users to set or update the meta_uri and meta_hash for an existing group in the groups.a table.

Behavior ​

  • Only the creator of the group can update the group meta.
  • The creator pays for the RAM usage for the update.

Action Parameters ​

NameC++ TypeJavaScript TypeRemarks
creatornameStringThe account that originally created the group.
group_iduint64_tNumber/StringThe ID of the group to be modified.
meta_urioptional<string>String/NullURI pointing to the group's off-chain metadata.
meta_hashoptional<checksum256>String/NullHash of the group's metadata.
memostringStringA memo string.

Note:

  • The meta_uri and meta_hash can be null or an empty string, except that the combination of a null/empty meta_uri and a non-null/non-empty meta_hash is not allowed.
  • The same pair of meta_uri and meta_hash cannot be set again if they already exist for the group.

CLI - cleos ​

To set or update the metadata of a group, use the following cleos command:

bash
cleos push action eosio.group setmeta.a '{"creator": "alice", "group_id": 1, "meta_uri": "https://ultra/group/meta/germany", "meta_hash": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08", "memo": "set group meta"}' -p alice@active

JavaScript - eosjs ​

You can also use the following eosjs code to interact with this action:

javascript
await api.transact({
  actions: [
    {
      "account": "eosio.group",
      "name": "setmeta.a",
      "authorization": [{ "actor": "alice", "permission": "active" }],
      "data": {
        "creator": "alice",
        "group_id": 1,
        "meta_uri": "https://ultra/group/meta/germany",
        "meta_hash": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",
        "memo": "set group meta"
      }
    }
  ]
});