multiversx / mx-sdk-py-cli

Python Command Line Tools and SDK for interacting with the MultiversX blockchain and dApps.
Other
48 stars 36 forks source link

Migration support: "v7" to "v8" #311

Closed popenta closed 11 months ago

popenta commented 1 year ago

mxpy v8 has suffered a few breaking changes compared to the previous version.

If you are running mxpy contract build or mxpy contract clean commands from outside the contract's directory, instead of passing the contract path as a positional argument, it's now done using --path <path to contract>. The default value is still the current working directory.

mxpy just forwards the parameters to sc-meta for building and cleaning contracts, taking care of all the logic. If you'd like to know more about sc-meta continue reading here.

Some other changes are listed below.

Extra references:

popenta commented 1 year ago

mxpy deps install rust

Now, when rust is installed using the above command, sc-meta is also installed.

Make sure to do a mxpy deps install rust --overwrite upon installing mxpy v8.

Extra references:

popenta commented 1 year ago

Removed the default values for proxy and chain ID

If --proxy is provided will get the chain ID from the network, or if --chain is provided will simply use that value. If both are provided and the values do not match, will use the value obtained from the proxy.

Extra references:

popenta commented 1 year ago

mxpy contract report

When using the above command, in case twiggy is not installed, it automatically installs it.

Extra references:

popenta commented 1 year ago

mxpy network

The mxpy network command group has been removed. The commands can simply be replaced with a curl request.

Here's an example:

eg: curl https://devnet-api.multiversx.com/network/config

Extra references:

popenta commented 1 year ago

mxpy wallet pem-address & mxpy wallet pem-address-hex

The above commands have also been removed as they brought too little benefice.

Extra references:

popenta commented 1 year ago

Removed BunchOfTransactions

The BunchOfTransactions class was not used within mxpy, so it's been removed. In case you we're using mxpy as a package and not as a cli tool we've extracted the class in this PR's description so you can copy it and use it directly.

Extra references:

popenta commented 1 year ago

Colored logging

mxpy now has colored log lines.

Extra references:

popenta commented 1 year ago

mxpy hyperblock

The mxpy hyperblock get command has been removed. It can be easily replaced with a curl request.

eg: curl https://devnet-gateway.multiversx.com/hyperblock/by-nonce/123456

Extra references:

popenta commented 1 year ago

mxpy-up.py

The installation script has been made less verbose as it was very difficult to read. In case someone want's to see all the lines the --verbose argument can be passed when running the script.

Extra references: