Skip to content
Discussions/App Development/How to bootstrap an admin user?Forum ↗

How to bootstrap an admin user?

App Development6 posts238 viewsLast activity Mar 2022
DA
Daniel_PorterOP
Mar 2022

I want to use the new 2.0 metering API to get reports on ledger usage. To do this, I need my participants to have an admin user, and the no-fuss way to do it would be to just add it in the bootstrap script. I’ve pulled down the canton docker demo:

docker run --rm -it digitalasset/canton-community:latest --config examples/01-simple-topology/simple-topology.conf --bootstrap examples/01-simple-topology/simple-ping.canton

and hitting tab on participant1 from within the ammonite repl doesn’t yield anything obviously helpful:

adHocPrettyInstance      commitments              discard                  is_initialized           paramIfDefined           prettyNode               productElementName       resources                testing                  underlying
adminParty               config                   domains                  is_running               paramIfNonEmpty          prettyOfClass            productElementNames      runningNode              toLengthLimitedString    unnamedParam
adminToken               consoleEnvironment       filterString             keys                     paramIfTrue              prettyOfObject           productIterator          self                     toLf                     unnamedParamIfDefined
canEqual                 copy                     health                   ledger_api               paramWithoutValue        prettyOfParam            productPrefix            show                     toProtoPrimitive         unnamedParamIfNonEmpty
certs                    customParam              help                     name                     parties                  prettyOfString           pruning                  showType                 transfer
clear_cache              dars                     id                       packages                 pretty                   productArity             repair                   start                    typeClassInstance
code                     db                       identity                 param                    prettyInfix              productElement           replication              stop                     uid
RA
Ratko_Veprek
Mar 2022

First, please beware the canton-community has now been renamed to canton-open-source. So with canton-community:latest, you will fetch and old version.

Second, the new version has console commands for user allocation: Canton Console — Daml SDK 2.0.0 documentation

Please note that you need to turn them on using canton.features.enable-testing-commands = yes.

DA
Daniel_Porter
Mar 2022

Okay, great. I’m having trouble pulling from canton-open-source, kinda looks like it might be in a different artifactory than the one I’m using for hub - it is it not publicly available?

Also, I’m noting this is under a feature called “testing.” My intent here isn’t testing - I want to bootstrap an admin user. Is there another recommended way to achieve this?

CO
cocreature
Mar 2022

Note that there is also a user participant_admin which is created by default which you can use for bootstrapping.

DA
Daniel_Porter
Mar 2022

Ah, that is very helpful, haven’t seen that documented anywhere.

RA
Ratko_Veprek
Mar 2022

Indeed. The docker image isn’t public yet! We are fixing this.

← Back to Discussions