Add params to brownie run
See original GitHub issueOverview
Now we can put args and kwargs into brownie run, when we are using brownie console mode (here in code), but we can’t do it through calling of brownie run
from shell. Possible it’s very useful feature in CI/CD, scripts etc
- I want to deploy my token in CI/CD with dynamic params (for example address of other contracts, which have deployed earlier in CI/CD). Now I deploy their manually through brownie console.
- I want to run my brownie scripts without interactive mode in docker files.
Specification
For example we can add args and kwargs so:
brownie run <filename> [<function>] [<args1>] … [<argsN>] [options] [kwargs]
, where
* [<args1>] … [<argsN>]
- is tuple of args
*[kwars]
- is kwargs, but without reserves keys like --network
Dependencies
I could not search.
If we can do these changes, than I can implement it at the next week.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:11 (4 by maintainers)
Top Results From Across the Web
How to call `brownie run` with extra script parameters
All arguments are passed into the docopt function which parses the options based on the docstring. Any extra arguments that are not listed ......
Read more >Quickstart — Brownie 1.19.2 documentation
Brownie - Python development framework for Ethereum Compiling contracts. ... To use a fixture, add an argument with the same name to the...
Read more >eth-brownie/community - Gitter
Is it possible to pass parameters in the script main function from the command line? scripts/test.py: def main(param): print(param). From cmd: brownie run...
Read more >The Brownie Python tutorial series—Part 2 - Chainstack
Once we create our scripts, we can use the brownie run command to automatically ... By using all these parameters, you can add...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hiya
Did this ever get resolved?
Im trying to run
brownie run ‘./scripts/create_myToken.py --name “Myname”’ --network rinkeby
I have args = sys.argv[1:] to catch --name etc like normal python
But brownie doesnt seem to like this command line format and returns error “Usage: brownie run <filename> [<function>] [options]”
Is there a solution ?
Cheers -P
Thanks for this proposal! I agree with you on all points:
run
method already exposes this functionalityIf you are OK with implementing the functionality, I’m happy to add it to the next release 👍