1.1.0 • Published 3 years ago

@pelicandistress/erkle v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

Erkle 🔀

Smart contract workflow automation

A simple CLI application which accelerates the process of deploying, migrating and replacing addresses across your contracts, interface and subgraph.

Why 🧐

Working on a project, i found myself going through multiple folders and files after a new deployment or migration to change the address of contracts and replace ABIS with new versions.

Installation ✨

Erkle requires Node.js v10+ to run.

In your favorite terminal, enter and run the following.

npm install -g @pelicandistress/erkle

Usage

🚨 Backup your codebase before usage

Tasks run in this order

  1. Compile
  2. Migrate
  3. Update ABI
  4. Run Subgraph
  5. Extra Tasks e.g Running a next server

An erkle configuration file is required for this to work, here's an example config. After each run, if you ran the replace task, the new string you entered in the CLI will be written to your erkle config file for the next run.

erkle --config="/path-to-erkle-config-file.json"

Config File Options

PropertyDescription
contractPathPath to your truffle or hardhat project
subgraphPathPath to your subgraph
abiUpdate.skipSet to true to skip abi copy transfer
abiUpdate.compiledContractsPath to compiled contract ABI relative to contractPath e.g /build/contracts/Factory.json
abiUpdate.copyABIToPath to where updated ABIs will be transfered to, a folder abis will be created at the end of the path
compile.skipSet to true to skip compilation tasks
compile.tasksSequence of child tasks
compile.tasks[i].descriptionA short description of what the task entails, will be outputted to the CLI
compile.tasks[i].scriptCommand which will be executed in the CLI
compile.tasks[i].skipSet to true to skip individual task
migration.skipSet to true to skip migration tasks
migration.tasksSequence of child tasks
migration.tasks[i].descriptionA short description of what the task entails, will be outputted to the CLI
migration.tasks[i].scriptCommand which will be executed in the CLI
migration.tasks[i].skipSet to true to skip individual task
replace.skipSet to true to skip replace tasks
replace.tasksSequence of child tasks
replace.tasks[index].descriptionA short description of what the task entails, will be outputted to the CLI
replace.tasks[index].pathPath to where the replacement task occurs, will be outputted to the CLI
replace.tasks[index].replaceOld string to replace
replace.tasks[index].extensionsArray of file extensions on which changes will be applied e.g ["*.ts", "*.yaml"]
replace.tasks[index].skipSet to true to skip individual task
subgraph.skipSet to true to skip subgraph tasks
subgraph.tasksSequence of child tasks
subgraph.tasks[i].descriptionA short description of what the task entails, will be outputted to the CLI
subgraph.tasks[i].scriptBuild script command e.g yarn install
subgraph.tasks[index].skipSet to true to skip individual task
extras.skipSet to true to skip miscellaneous tasks
extras.tasksSequence of child tasks
extras.tasks[index].descriptionA short description of what the task entails, will be outputted to the CLI
extras.tasks[index].skipSet to true to skip individual task
extras.tasks[index].pathPath where task will be executed

CLI flags

Options specified via the CLI overrides options specified in the config file:

OptionDescriptionUsage
--configPath to erkle config file--config=<path-to-folder>, --c=<path-to-folder>
--subgraphPath, --spPath to your subgraph folder--subgraphPath=<path-to-folder>, --sp=<path-to-folder>
--contractPath, --cpPath to your truffle or hardhat contract project--contractPath=<path-to-folder>, --cp=<path-to-folder>
--skipCompile, --scSkips compilation tasks--skipCompile, --sc
--skipMigration, --smSkips migration task--skipMigration, --sm
--skipAbiUpdate , --sabiSkips ABI update task--skipAbiUpdate, --sabi
--skipReplace, --srSkips string search and replace task--skipReplace, --sr
--skipSubgraph, --ssSkips subgraph tasks--skipSubgraph, --ss
--skipExtras, seSkips extra tasks at the end--skipExtras, --se
--skipCompileTask, --sctSkip child compile task(s) by index--skipCompileTask=<comma-separated-indexes>, --sct=<comma-separated-indexes>
--skipMigrationTask, --smtSkip child migration task(s) by index--skipMigrationTask=<comma-separated-indexes>, --smt=<comma-separated-indexes>
--skipSubgraphTask, --sstSkip child subgraph task(s) by index--skipSubgraphTask=<comma-separated-indexes>, --sst=<comma-separated-indexes>
--skipReplaceTask, --srtSkip child replace task(s) by index--skipReplaceTask=<comma-separated-indexes>, --srt=<comma-separated-indexes>
--skipExtrasTask, --sextSkip child extras task(s) by index--skipExtrasTask=<comma-separated-indexes>, --sext=<comma-separated-indexes>

Development

Contributions are welcome!

License

MIT

Free Software, Hell Yeah!