Hosted Demo Preparation
To prepare an instance for users to run the tutorial, a broad access rule needs to be created, and the users and their invites provisioned.
create role tutorial-users
create allow access rule { action = "any/action", resource = ["AccessRule", "Address", "Transfer", "TransferRule"], initiate = "roles/tutorial-users" }
Then for each user (e.g. jane
, with SSO user name users/2d5R294YADljFEMcVj3GtMVscm9
from the Admin API), run
USER=jane SSO=users/2d5R294YADljFEMcVj3GtMVscm9 treasury script -f /path/to/snippet.csl
with snippet
TUTORIAL_USER = concat(env("USER"), "-tutorial")
create human user id($TUTORIAL_USER) { roles = ["roles/tutorial-users"], labels.sso-user = env("SSO") }
create invite credential for id($TUTORIAL_USER) { public_key = invite-public(hex($TUTORIAL_USER)) }
Setting the SSO user label allows easy selection of appropriate Treasury user in the web UI.
Then communicate to the user:
API_URL
- User ID
jane-tutorial
- Instruct use of
hex("jane-tutorial")
when setting up credentials
To get the hex code, simply execute hex(<invite-ascii>)
in a CSL interpreter.