Fixed admin port for hc sandbox

Hi!

I’m looking for a way to set a fixed admin port for the conductor. My current understanding got me to 2 road blocks :grinning:

  1. When using hc sandbox there’s an option --force-admin-ports or -f according to the subcommand help. But it seems to no be up to date because I get
hc sandbox generate workdir/happ  --force-admin-ports 65000
error: Found argument '--force-admin-ports' which wasn't expected, or isn't valid in this context

  1. When using holochain and the conductor-config.yml, I can configure
...
admin_interfaces:
  - driver:
      type: websocket
      port: 65000
...

which allows me to run the conductor, but I don’t know how to specify my DNAs or hApp. Is there any documentation on this?

So I’m asking to be pointed to docs or a hint how to achieve a fixed admin port.

OR - in case this is an XY problem - what I’m really trying to do is, I have a client web app that needs to call zome functions, and I’m currently using the conductor’s admin API to figure out the cell IDs and then run the functions. But the admin port changes every time I run the sandbox.

Many options, any help appreciated :slightly_smiling_face:

1 Like

Hey Jost…

With this, you are already halfway there…

Just use adminClient and these two methods on it:

1 Like

Actually, since you have a happ file … you could use :

1 Like

Of course, I didn’t see the forest for the trees :crazy_face:

That works well and begs more questions for me regarding if a holochain is global for a participant and hApps are all installed to the same holochain or if each app that a user wants to install on their device comes with its own holochain. But this is a matter of deployment and distribution so I’ll research the forum and would post another question.

Thanks @Connoropolous! :grinning:

1 Like

If I’m not mistaken, the force admin argument needs to go right after the “generate” keyword. It should work, at least with the shortened version “-f”.

1 Like

Hm that sounds accurate. @jost.schulte I’d also advise trying Guillem’s advice

@guillemcordoba @Connoropolous Both variants -f and --force-admin-ports work, but only directly after sandbox.

hc sandbox -f=65000 generate workdir/happ
hc sandbox --force-admin-ports=65000 generate workdir/happ

In the meantime there’s a much simpler solution to my problem, and yes it was an XY problem. Connecting to the admin API first to install a hApp or query for the installed hApp is quite laborious and would be impractical if that was the default way of figuring out a cell ID.

So the easiest solution to the problem is to use the app API’s appInfo function call to retrieve the cell ID and then make zome calls (thank you @tixel).

2 Likes