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

aiken blueprint apply works with the 1st parameter only #927

Open
1 of 4 tasks
Fell-x27 opened this issue May 8, 2024 · 6 comments
Open
1 of 4 tasks

aiken blueprint apply works with the 1st parameter only #927

Fell-x27 opened this issue May 8, 2024 · 6 comments
Labels
tooling Tooling and developer experience improvements

Comments

@Fell-x27
Copy link

Fell-x27 commented May 8, 2024

What Git revision are you using?

aiken v1.0.26-alpha+075668b

What operating system are you using, and which version?

  • Linux / Ubuntu
  • Linux / Other
  • macOS
  • Windows

Describe what the problem is?

The aiken blueprint apply asks only for the first parameter and ignores others.

What should be the expected behavior?

The command should parse more than one parameter.

@KtorZ
Copy link
Member

KtorZ commented May 8, 2024

That is the expected behavior. Parameters are applied one-by-one, and the command must be called multiple times. One for each parameter.

This isn't set in stone, but I'd like to understand what problems does this cause?

@KtorZ KtorZ added the waiting on response Waiting on author to respond to comments label May 8, 2024
@Fell-x27
Copy link
Author

Fell-x27 commented May 8, 2024

but I'd like to understand what problems does this cause

  1. It doesn't update the blueprint by itself, so if I call it twice, the second attempt will be the same as the first one.
  2. Yes, it shows the updated blueprint in CLI, so I can write it to the file manually, but if I call it like

aiken blueprint apply -v oneshot.gift_card > plutus.json

I get:

    Analyzing blueprint
    Summary 1 error, 0 warnings

in the output and...

 × EOF while parsing a value at line 1 column 0
help: EOF while parsing a value at line 1 column 0

in the file, so the blueprint has been destroyed.

Looks like there is some kind of a bug anyway.
Yes, I can rewrite the blueprint by many other ways, even with copy-paste, but it's a UX problem anyway I think. Writing with ">" shouldn't act like this...

@Fell-x27
Copy link
Author

Fell-x27 commented May 8, 2024

Oh, I see, there is the -o flag for this. But it's still a UX issue. It would be much better if it allowed setting all parameters within the same call step by step, and then asked for the filename to save, using the old one by default. This would provide a smoother and more user-friendly experience.

@rvcas
Copy link
Member

rvcas commented May 9, 2024

@Fell-x27 thanks for the comments, we'll give this some thoughts and see what we can cook up using your advice

@rvcas rvcas added tooling Tooling and developer experience improvements and removed waiting on response Waiting on author to respond to comments labels May 9, 2024
@Fell-x27
Copy link
Author

@Fell-x27 thanks for the comments, we'll give this some thoughts and see what we can cook up using your advice

Thanks. Just want to say - I'm totally in love with Aiken, guys! You did an amazing work!

@nemo83
Copy link

nemo83 commented Feb 24, 2025

Recently the -i was added along with -o which allows to have one plutus.json and then easily chain a few aiken blueprint apply

Options:
  -i, --in <FILEPATH>
          Optional path to the blueprint file to be used as input.

          [default: plutus.json]

  -o, --out <FILEPATH>
          Optional relative filepath to the generated Plutus blueprint. Default to printing to stdout when omitted

So assuming you have just one aiken build and a few PARAMS_1 ... PARAMS_N to apply you can.

export PARAMS_1=....
...
export PARAMS_N=....

aiken blueprint apply -m my_module -v my_validator $PARAMS_1 -o plutus-tmp.json

aiken blueprint apply -m my_module -v my_validator $PARAMS_1 -i plutus-tmp.json -o plutus-tmp.json

Although you need to manually (or write a bash for loop for all params) iterate through the params, it works well in a case like mine where I had multiple params and multiple networks to support:

export PREPROD_PARAMS_1=....
...
export PREPROD_PARAMS_N=....

aiken blueprint apply -m my_module -v my_validator $PREPROD_PARAMS_1 -o plutus-preprod.json

aiken blueprint apply -m my_module -v my_validator $PREPROD_PARAMS_N -i plutus-preprod.json -o plutus-preprod.json

export MAINNET_PARAMS_1=....
...
export MAINNET_PARAMS_N=....

aiken blueprint apply -m my_module -v my_validator $MAINNET_PARAMS_1 -o plutus-mainnet.json

aiken blueprint apply -m my_module -v my_validator $MAINNET_PARAMS_N -i plutus-mainnet.json -o plutus-mainnet.json

Again, not the perfect approach, but it works. You build you actual plutus.json just once and then derive your network specific json.

As I'm writing this it would be nice to be able to leverage the | operator... but this sounds like an overkill.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tooling Tooling and developer experience improvements
Projects
Status: 🔨 Todo
Development

No branches or pull requests

4 participants