Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Write a script to perform contract updates #1989

Open
fredo opened this issue Jun 28, 2023 · 0 comments
Open

Write a script to perform contract updates #1989

fredo opened this issue Jun 28, 2023 · 0 comments
Labels

Comments

@fredo
Copy link
Contributor

fredo commented Jun 28, 2023

Updating the contracts is a composition of multiple steps. They are listed below. It would be great to have a single script which consumes the following:

Here are the steps which are to be performed

1) beamer config read ..... 1-chainA.deployment.json deployments/state/1-chainA.state # read state of chain A
2) cat deployments/state/1-chainA.state # display state and have a look whats going on
3) beamer config modify deployments/state/1-chainA.state
5) beamer config write ... 1-chainA.deployment.json deployments/state/1-chainA.state /tmp/state/1-chainA.desired # write state of chain A
6) beamer config read ..... 1-chainA.deployment.json deployments/state/1-chainA.state # read state of chain A again
7) cat deployments/state/1-chainA.state # display state and verify that changes have been applied

Options for the commans

--rpc-file
--keystore-file
--password
--abi-dir
--state-dir

Additionally, artifact files can be consumed as arguments. Each artifact file represents a chain on which the modification will be tried to be applied.

Additional information

  • The script expects a certain pattern of files in the respective directories. State files are expected to be named the same as the artifact file, just with the ending .state.json.
  • Desired files with the ending .desired.json will be stored in /tmp/beamer/state/ directory as they are considered to be temporary in the course of updating the contracts.
  • In the event of already existing state files (updated twice during system run time, the desired file simply gets overwritten.
  • If state files already exist, they get consumed by the beamer config read command and are updated accordingly.
  • The end state are updated contracts, and updated state files.
  • The script should read after the write command and run a verification process if new state and desired state match
  • What if modification does not change the current state? The script should stop after the read process. The modify command should notice this and tell the user that modifications to not apply any changes.
  • Allow a -v option to pretty print state after reading
@fredo fredo added enhancement New feature or request infrastructure 🔨 labels Jun 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant