Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature- add CLI options to init command #444

Open
Sanket-0510 opened this issue May 4, 2024 · 5 comments
Open

feature- add CLI options to init command #444

Sanket-0510 opened this issue May 4, 2024 · 5 comments

Comments

@Sanket-0510
Copy link
Contributor

Currently, executing fablo init initializes a small network configuration file. However, it would greatly enhance user experience if I could specify the number of organizations and peers directly from the command line interface (CLI). This would enable the generation of the configuration JSON file based on the inputs provided via CLI options.

@Sanket-0510
Copy link
Contributor Author

hey @dzikowski any thoughts over this? I may raise PR to add this feature soon then.

@dzikowski
Copy link
Contributor

I think it might be a bit tricky to implement, but you can start it if you want

@Sanket-0510
Copy link
Contributor Author

Sanket-0510 commented May 22, 2024

This one is indeed a tricky one cause its such a difficult task to identify where exactly the fablo-config.json is getting created. Turns out that, this line -

fablo/fablo.sh

Line 122 in cbd4ed0

local fablo_workspace="${2:-$FABLO_TEMP_DIR}"

initializes a temporary directory which has fablo as starting name and then some random string eg. fablo.34dfgrt
and this is created at /tmp/fablo.xxxxxx. I understand this gets created but from where are we getting this sample config file already defined in this folder. basically it should initialise the temp folder but from where do am I getting this sample config file?

from console debugging I identified where the flow is going turn out that the schema for the sample-config file is getting modified here -https://github.com/hyperledger-labs/fablo/blob/cbd4ed0049d1b0876927cdbea80ee10531bbc7ba/src/init/index.ts
but again changing log statements here had no effect on actual command run.

@Sanket-0510
Copy link
Contributor Author

What I am guessing is that when I do init everything gets mounted to a docker container and that container and log statements and everything gets executed from there and that container gets destroyed after the execution, again I am not sure, I am guessing from this command - https://github.com/hyperledger-labs/fablo/blob/cbd4ed0049d1b0876927cdbea80ee10531bbc7ba/fablo.sh#L145C1-L150C9

@Sanket-0510
Copy link
Contributor Author

@dzikowski @Hejwo you guys have done a lot of engineering and encapsulation while setting up this sample fablo-config.json 😥

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants