redspot icon indicating copy to clipboard operation
redspot copied to clipboard

[feature request] Add `deploy` functionality

Open VargSupercolony opened this issue 3 years ago • 4 comments

For bigger projects, it would be nice to have deploy functionality, similar to hardhat.

Basically, instead of writing individual scripts, a developer would write the deploy functions, which would execute synchronously within one API instance (instead of doing for script in ./deploy/*; do npx redspot run "$script" --no-compile; done, which would in turn connect and disconnect node API).

VargSupercolony avatar Oct 11 '21 14:10 VargSupercolony

As far as I know, hardhat doesn't provide a deploy command either, https://hardhat.org/tutorial/deploying-to-a-live-network.html#_7-deploying-to-a-live-network. Did I miss something?

ii-ii-ii avatar Oct 14 '21 02:10 ii-ii-ii

You mean the deploy function? Can't this function work? https://github.com/patractlabs/redspot/blob/master/examples/erc20/scripts/deploy.ts#L24

ii-ii-ii avatar Oct 14 '21 02:10 ii-ii-ii

As far as I know, hardhat doesn't provide a deploy command either, https://hardhat.org/tutorial/deploying-to-a-live-network.html#_7-deploying-to-a-live-network. Did I miss something?

Hardhat indeed does not provide hardhat deploy command. It is done by hardhat-deploy plugin. I was curious, if you'd be interested in having such in Redspot.

You mean the deploy function? Can't this function work? https://github.com/patractlabs/redspot/blob/master/examples/erc20/scripts/deploy.ts#L24

This works yeah, but as soon as we get to deploying 15-20 contracts, the deploy file gets convoluted and there is an urge to logically separate the deploys. Obviously, we can do this separation into functions (each function deploys one contract), but that'd mean that we lose dependency management, metadata about each deployment and so on. Please see hardhat-deploy readme.

VargSupercolony avatar Oct 14 '21 10:10 VargSupercolony

Well, I think it does look OK. We'll add this in the next version.

ii-ii-ii avatar Oct 18 '21 00:10 ii-ii-ii