How to bootstrap an admin user?
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
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.
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?
Note that there is also a user participant_admin which is created by default which you can use for bootstrapping.
Ah, that is very helpful, haven’t seen that documented anywhere.
Indeed. The docker image isn’t public yet! We are fixing this.