issue-tracker icon indicating copy to clipboard operation
issue-tracker copied to clipboard

CLI add-contract Automation

Open xactant opened this issue 3 years ago • 1 comments

Currently the add-contract CLI script is interactive: asking the user to select events and then iterating through the events to add detail about each event (description, table anme, etc.). When you have a contract, or a group of contracts that have multiple events the interactive process is long and cound be error prone (human caused errors I mean).

Since this script is interactive it is not scriptable which means this process cannot be included in an automated deployment scheme.

Currently the add-contract script is called as:

moralis-admin-cli add-contract --moralisApiKey FAM6pYzBKjcM --moralisApiSecret 7thQGNKKqX8s
--abiPath ".\MyContract.json"

To enable a user to included this script in automated deployement, the add-contract script could accept a new parameter --jsonPath "MY JSON FILE". This json file would have the list of event names (or signatures) with required details. The script would then only need to be modified to read the json file and then use the data in the json file instead of the interactive portion of the script. So the add-contract script would be called as:

moralis-admin-cli add-contract --moralisApiKey FAM6pYzBKjcM --moralisApiSecret 7thQGNKKqX8s 
--abiPath ".\MyContract.json" --jsonPath ".\MyContractSetup.json"

The user could then include a set of add-contract calls to an automated deployment script.

xactant avatar May 25 '21 17:05 xactant

big +1 on this

plus additional flags: --force-reset-tables (defaults = false) --backup-tables (defaults = $force-reset-tables)

as in the dev process if i redeploy contracts, true automation would require that the old tables are dropped or renamed so that the new contract sync plugin can use the same table names as before

gotjoshua avatar Jun 10 '21 16:06 gotjoshua