Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to create or modify account permissions by openssl

Shulou Source: shulou.com Published: 2022-06-01 02:52:14 10月06日 Update

This article mainly explains "how to create or modify account permissions in openssl". Friends who are interested may wish to take a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how openssl creates or modifies account permissions.

Create or modify account permissions

Command format: $cleos set account permission ${permission} ${account} ${permission_json} ${account_authority}

To modify the permissions of an account, you must have the permissions of the account and the permissions you are modifying. The set account permissions command may change, so the class it is associated with does not have a complete record.

$cleos set account permission test active'{"threshold": 1, "keys": [{"permission": {"key": "EOS8X7Mp7apQWtL6T2sfSZzBcQNUqZB7tARFEm9gA9Tn9nbMdsvBB", "permission": "active"}, "weight": 1}], "accounts": [{"permission": {"actor": "acc2", "permission": "active"}, "weight": 50}]} 'owner

The second example modifies the same account permissions, but deletes the key set from the previous example and grants the active permissions of the @ test account to another account.

$cleos set account permission test active'{"threshold": 1, "keys": [], "accounts": [{"permission": {"actor": "sandwich", "permission": "active"}, "weight": 1}, {"permission": {"actor": "acc1", "permission": "active"}, "weight": 50}]} 'owner

The third example shows how to set permissions for multisig

Cleos set account permission test active'{"threshold": 100, "keys": [{"permission": {"key": "EOS8X7Mp7apQWtL6T2sfSZzBcQNUqZB7tARFEm9gA9Tn9nbMdsvBB", "permission": "active"}, "weight": 25}], "accounts": [{"permission": {"actor": "@ sandwich", "permission": "active"}, "weight": 75}]} 'owner

The JSON object used in this command actually consists of two different types of objects that make up the permission JSON object.

{"threshold": 100,100 / * An integer that defines cumulative signature weight required for authorization*/ "keys": [], / * An array made up of individual permissions defined with an EOS PUBLIC KEY*/ "accounts": [] / * An array made up of individual permissions defined with an EOS ACCOUNT*/}

... It includes one or more permission objects

/ * Set Permission with Key*/ {"permission": {"key": "EOS8X7Mp7apQWtL6T2sfSZzBcQNUqZB7tARFEm9gA9Tn9nbMdsvBB", "permission": "active"}, weight: 25 / * Set the weight of a signature from this permission*/} / * Set Permission with Account*/ {"permission": {"actor": "sandwich", "permission": "active"} Weight: 75 / * Set the weight of a signature from this permission*/} so far I believe you have a deeper understanding of "how to create or modify account permissions in openssl". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Tags: Permissions accounts objects commands examples content actual learning different practical deeper same three interests including multiple practical actually keys Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Information Huawei Redmi Shulou Technology Microsoft