holochain / scaffolding

Scaffolding tool to quickly generate and edit holochain applications
https://docs.rs/holochain_scaffolding_cli
220 stars 19 forks source link

Suggestion: Enhance Flexibility in Setting Number of Agents via Environment Variable #240

Closed Soushi888 closed 6 months ago

Soushi888 commented 6 months ago

Hello,

I'm writing to suggest a modification to the environment variables start and start:tauri in the Holochain scaffolding tool. Currently, these variables are hardcoded to use a specific number of agents. I propose changing them to AGENTS=${AGENTS:-2}. This change would allow the default number of agents to be set from the scripts and easily overridden by the user in the terminal, for example, AGENTS=1 npm start.

This modification would be particularly useful for developers who wish to test their applications with a different number of agents than the default without having to modify the scripts. It would provide greater flexibility and ease of use, especially during the development and testing phases.

Currently, developers must directly modify the scripts to adjust the number of agents, a process that requires additional effort, carries the risk of introducing errors, and alters the file's version in the git repository unless properly rolled back.

I believe this change would enhance the usability of the Holochain scaffolding tool and make it more adaptable to various development and testing scenarios.

Startup Script Example:

Here's how I currently set up my startup script:

"start": "AGENTS=${AGENTS:-2} BOOTSTRAP_PORT=$(port) SIGNAL_PORT=$(port) npm run network"


Thank you for considering this suggestion.

c12i commented 6 months ago

Thanks for your suggestion @Soushi888, this is definitely a valuable addition