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 [] [options]"
Is there a solution ?
Best Answer
brownie run
is designed to be run without any extra arguments besides the ones listed inbrownie run -h
.All arguments are passed into the
docopt
function which parses the options based on the docstring. Any extra arguments that are not listed causes the parser to throw the error you are seeing.You can still use brownie to deploy your contract. But you will need to perform the brownie setup and argument parsing inside your python script. Then just call
python create_myToken.py
with your arguments.The main things to setup for brownie are connecting to a network and loading your project.
Then you can either call your python project contracts on your
myproject
object, or you could go the next step of importing everything, similar to having an active project in the directory. Just be aware that to import, you'll need to either use the resolved name of the project or pass a name in while loading the project.