raiden-contracts
raiden-contracts copied to clipboard
Chain deployment script commands
Currently, for setting up a testnet, you need to run:
python -m raiden_contracts.deploy raiden
python -m raiden_contracts.deploy token
python -m raiden_contracts.deploy register
As suggested by @kelsos , it would be nice to chain the commands. However, we need to make sure the deployment functionality is clear for production vs. development.
I guess the most sensible way is to keep
python -m raiden_contracts.deploy token
as a separate command, and combine
python -m raiden_contracts.deploy raiden
python -m raiden_contracts.deploy register
Now I'm not sure. register can be called multiple times after raiden.
The most annoying thing is that we have to copy over addresses from stdout of one command to the command line argument of another invocation. What if register command reads the address of TokenNetworkRegistry from the deployment file?
Since I needed a script to deploy the contracts easily on a private testnet I ended up doing this https://github.com/kelsos/test-environment-scripts/blob/master/scripts/deploy_testnet.py
While I haven't updated it for a while, at least it helps me get the private network setup on a single step.
Maybe something like this would work?
python -m raiden_contracts.deploy token ... | python -m raiden_contracts.deploy register --token-address - ...
--token-address - says "use the standard input as the token address".
Maybe click’s command chaining could help you here? http://click.palletsprojects.com/en/7.x/commands/#multi-command-pipelines
Now it's becoming fun.
This should wait till https://github.com/raiden-network/raiden-contracts/issues/963 is done.