From 9d78d222cd31f0d9da827101f26041f35ae993b8 Mon Sep 17 00:00:00 2001 From: Alexandru Popenta Date: Thu, 5 Jan 2023 16:08:06 +0200 Subject: [PATCH 1/6] initial fix --- .github/workflows/erdpy-publish.yml | 2 +- .github/workflows/erdpy-up-macos.yml | 2 +- .github/workflows/erdpy-up-ubuntu.yml | 2 +- docs/conf.py | 8 +++---- docs/index.rst | 10 ++++----- erdpy/README.md | 6 ++--- erdpy/cli.py | 4 ++-- erdpy/cli_config.py | 2 +- erdpy/cli_deps.py | 4 ++-- erdpy/cli_ledger.py | 4 ++-- erdpy/config.py | 32 +++++++++++++-------------- erdpy/dependencies/install.py | 4 ++-- erdpy/utils.py | 6 ++--- setup.py | 6 ++--- 14 files changed, 46 insertions(+), 46 deletions(-) diff --git a/.github/workflows/erdpy-publish.yml b/.github/workflows/erdpy-publish.yml index 4ef60111..48cad35a 100644 --- a/.github/workflows/erdpy-publish.yml +++ b/.github/workflows/erdpy-publish.yml @@ -28,7 +28,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - echo " - [CHANGELOG](https://github.com/ElrondNetwork/elrond-sdk-erdpy/blob/main/erdpy/CHANGELOG.md)" >> notes.txt + echo " - [CHANGELOG](https://github.com/multiversx/mx-sdk-erdpy/blob/main/erdpy/CHANGELOG.md)" >> notes.txt echo "" >> notes.txt RELEASE_TAG=v$(python3 -c "import erdpy._version; print(erdpy._version.__version__);") diff --git a/.github/workflows/erdpy-up-macos.yml b/.github/workflows/erdpy-up-macos.yml index c0090d53..3201a36e 100644 --- a/.github/workflows/erdpy-up-macos.yml +++ b/.github/workflows/erdpy-up-macos.yml @@ -23,7 +23,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install run: | - wget -O erdpy-up.py https://raw.githubusercontent.com/ElrondNetwork/elrond-sdk-erdpy/$BRANCH_NAME/erdpy-up.py + wget -O erdpy-up.py https://raw.githubusercontent.com/multiversx/mx-sdk-erdpy/$BRANCH_NAME/erdpy-up.py python3 erdpy-up.py --from-branch $BRANCH_NAME <<< "2" - name: Smoke test run: | diff --git a/.github/workflows/erdpy-up-ubuntu.yml b/.github/workflows/erdpy-up-ubuntu.yml index 57efbb33..ce029d34 100644 --- a/.github/workflows/erdpy-up-ubuntu.yml +++ b/.github/workflows/erdpy-up-ubuntu.yml @@ -23,7 +23,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install run: | - wget -O erdpy-up.py https://raw.githubusercontent.com/ElrondNetwork/elrond-sdk-erdpy/$BRANCH_NAME/erdpy-up.py + wget -O erdpy-up.py https://raw.githubusercontent.com/multiversx/mx-sdk-erdpy/$BRANCH_NAME/erdpy-up.py python3 erdpy-up.py --from-branch $BRANCH_NAME - name: Smoke test run: | diff --git a/docs/conf.py b/docs/conf.py index cc5f6022..3b8eb18d 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -17,9 +17,9 @@ # -- Project information ----------------------------------------------------- -project = 'Elrond erdpy SDK' -copyright = '2022, Elrond Network' -author = 'Elrond Network' +project = 'MultiversX erdpy SDK' +copyright = '2022, MultiversX' +author = 'MultiversX' # The full version, including alpha/beta/rc tags release = '1.2.3' @@ -61,4 +61,4 @@ default_dark_mode = True # user starts in light mode -default_dark_mode = False \ No newline at end of file +default_dark_mode = False diff --git a/docs/index.rst b/docs/index.rst index 48fc01f0..c127690f 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -1,9 +1,9 @@ -.. Elrond erdpy SDK documentation master file, created by +.. MultiversX erdpy SDK documentation master file, created by sphinx-quickstart on Sun Mar 20 18:20:17 2022. You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. -Welcome to Elrond erdpy SDK's documentation! +Welcome to MultiversX erdpy SDK's documentation! ============================================ .. toctree:: @@ -22,9 +22,9 @@ Links * :ref:`genindex` * :ref:`modindex` * :ref:`search` -* Source code: https://github.com/ElrondNetwork/elrond-sdk-erdpy -* Documentation: https://docs.elrond.com/sdk-and-tools/erdpy/erdpy/ +* Source code: https://github.com/multiversx/mx-sdk-erdpy +* Documentation: https://docs.multiversx.com/sdk-and-tools/erdpy/erdpy/ * CLI : erdpy/CLI.md -* Distribution: https://docs.elrond.com/sdk-and-tools/erdpy/installing-erdpy/) and [PyPi](https://pypi.org/project/erdpy/#history +* Distribution: https://docs.multiversx.com/sdk-and-tools/erdpy/installing-erdpy/) and [PyPi](https://pypi.org/project/erdpy/#history diff --git a/erdpy/README.md b/erdpy/README.md index 61c67004..781a0290 100644 --- a/erdpy/README.md +++ b/erdpy/README.md @@ -1,8 +1,8 @@ # Description -Elrond Python Command Line Tools and SDK for interacting with the Elrond Network (in general) and Smart Contracts (in particular). +MultiversX Python Command Line Tools and SDK for interacting with the MultiversX Network (in general) and Smart Contracts (in particular). ## Documentation -[docs.elrond.com](https://docs.elrond.com/sdk-and-tools/erdpy/erdpy/) +[docs.multiversx.com](https://docs.multiversx.com/sdk-and-tools/erdpy/erdpy/) [pkg.go.dev](https://pkg.go.dev/github.com/ElrondNetwork/elrond-sdk/erdgo) @@ -10,7 +10,7 @@ Elrond Python Command Line Tools and SDK for interacting with the Elrond Network [CLI](CLI.md) ## Distribution -[erdpy-up](https://docs.elrond.com/sdk-and-tools/erdpy/installing-erdpy/) and [PyPi](https://pypi.org/project/erdpy/#history) +[erdpy-up](https://docs.multiversx.com/sdk-and-tools/erdpy/installing-erdpy/) and [PyPi](https://pypi.org/project/erdpy/#history) ## CHANGELOG [CHANGELOG](CHANGELOG.md) diff --git a/erdpy/cli.py b/erdpy/cli.py index 23d1b369..8c64adbc 100644 --- a/erdpy/cli.py +++ b/erdpy/cli.py @@ -63,11 +63,11 @@ def setup_parser(args: List[str] = sys.argv[1:]): ----------- DESCRIPTION ----------- -erdpy is part of the elrond-sdk and consists of Command Line Tools and Python SDK +erdpy is part of the multiversx-sdk and consists of Command Line Tools and Python SDK for interacting with the Blockchain (in general) and with Smart Contracts (in particular). erdpy targets a broad audience of users and developers. -https://docs.elrond.com/sdk-and-tools/erdpy/erdpy. +https://docs.multiversx.com/sdk-and-tools/erdpy/erdpy. """, formatter_class=argparse.RawDescriptionHelpFormatter ) diff --git a/erdpy/cli_config.py b/erdpy/cli_config.py index 3b754c49..f07d9231 100644 --- a/erdpy/cli_config.py +++ b/erdpy/cli_config.py @@ -9,7 +9,7 @@ def setup_parser(subparsers: Any) -> Any: - parser = cli_shared.add_group_subparser(subparsers, "config", "Configure elrond-sdk (default values etc.)") + parser = cli_shared.add_group_subparser(subparsers, "config", "Configure multiversx-sdk (default values etc.)") subparsers = parser.add_subparsers() sub = cli_shared.add_command_subparser(subparsers, "config", "dump", "Dumps configuration.") diff --git a/erdpy/cli_deps.py b/erdpy/cli_deps.py index 1b0de23d..7197d6f6 100644 --- a/erdpy/cli_deps.py +++ b/erdpy/cli_deps.py @@ -8,12 +8,12 @@ def setup_parser(subparsers: Any) -> Any: - parser = cli_shared.add_group_subparser(subparsers, "deps", "Manage dependencies or elrond-sdk modules") + parser = cli_shared.add_group_subparser(subparsers, "deps", "Manage dependencies or multiversx-sdk modules") subparsers = parser.add_subparsers() choices = ['all'] + list(get_deps_dict().keys()) - sub = cli_shared.add_command_subparser(subparsers, "deps", "install", "Install dependencies or elrond-sdk modules.") + sub = cli_shared.add_command_subparser(subparsers, "deps", "install", "Install dependencies or multiversx-sdk modules.") sub.add_argument("name", choices=choices, help="the dependency to install") sub.add_argument("--overwrite", action="store_true", default=False, help="whether to overwrite an existing installation") sub.add_argument("--tag", help="the tag or version to install") diff --git a/erdpy/cli_ledger.py b/erdpy/cli_ledger.py index fd40a503..413d9630 100644 --- a/erdpy/cli_ledger.py +++ b/erdpy/cli_ledger.py @@ -14,7 +14,7 @@ def setup_parser(subparsers: Any) -> Any: sub.add_argument("--num-addresses", required=False, type=int, default=10, help="The number of addresses to fetch") sub.set_defaults(func=print_addresses) - sub = cli_shared.add_command_subparser(subparsers, "ledger", "version", "Get the version of the Elrond App for Ledger") + sub = cli_shared.add_command_subparser(subparsers, "ledger", "version", "Get the version of the MultiversX App for Ledger") sub.set_defaults(func=print_version) return subparsers @@ -30,5 +30,5 @@ def print_addresses(args): def print_version(args): ledger_app = ElrondLedgerApp() - print("Elrond App version: " + ledger_app.get_version()) + print("MultiversX App version: " + ledger_app.get_version()) ledger_app.close() diff --git a/erdpy/config.py b/erdpy/config.py index 987bc03d..d70471c9 100644 --- a/erdpy/config.py +++ b/erdpy/config.py @@ -6,9 +6,9 @@ from erdpy import errors, utils, workstation -ROOT_FOLDER_NAME = "elrondsdk" +ROOT_FOLDER_NAME = "multiversxsdk" LOCAL_CONFIG_PATH = os.path.join(os.getcwd(), "erdpy.json") -GLOBAL_CONFIG_PATH = os.path.expanduser("~/elrondsdk/erdpy.json") +GLOBAL_CONFIG_PATH = os.path.expanduser("~/multiversxsdk/erdpy.json") DEFAULT_GAS_PRICE = 1000000000 GAS_PER_DATA_BYTE = 1500 @@ -149,13 +149,13 @@ def _guard_valid_config_deletion(name: str): def get_defaults() -> Dict[str, Any]: return { - "proxy": "https://testnet-gateway.elrond.com", + "proxy": "https://testnet-gateway.multiversx.com", "chainID": "T", "txVersion": "1", "dependencies.vmtools.tag": "latest", "dependencies.mx_sdk_rs.tag": "latest", - "dependencies.vmtools.urlTemplate.linux": "https://github.com/ElrondNetwork/wasm-vm/archive/{TAG}.tar.gz", - "dependencies.vmtools.urlTemplate.osx": "https://github.com/ElrondNetwork/wasm-vm/archive/{TAG}.tar.gz", + "dependencies.vmtools.urlTemplate.linux": "https://github.com/multiversx/mx-vm-wasm-go/archive/{TAG}.tar.gz", + "dependencies.vmtools.urlTemplate.osx": "https://github.com/multiversx/mx-vm-wasm-go//archive/{TAG}.tar.gz", "dependencies.llvm.tag": "v9-19feb", "dependencies.llvm.urlTemplate.linux": "https://ide.elrond.com/vendor-llvm/{TAG}/linux-amd64.tar.gz?t=19feb", "dependencies.llvm.urlTemplate.osx": "https://ide.elrond.com/vendor-llvm/{TAG}/darwin-amd64.tar.gz?t=19feb", @@ -163,24 +163,24 @@ def get_defaults() -> Dict[str, Any]: "dependencies.nodejs.tag": "v12.18.3", "dependencies.nodejs.urlTemplate.linux": "https://nodejs.org/dist/{TAG}/node-{TAG}-linux-x64.tar.gz", "dependencies.nodejs.urlTemplate.osx": "https://nodejs.org/dist/{TAG}/node-{TAG}-darwin-x64.tar.gz", - "dependencies.elrond_go.tag": "latest", - "dependencies.elrond_go.urlTemplate.linux": "https://github.com/ElrondNetwork/elrond-go/archive/{TAG}.tar.gz", - "dependencies.elrond_go.urlTemplate.osx": "https://github.com/ElrondNetwork/elrond-go/archive/{TAG}.tar.gz", - "dependencies.elrond_go.url": "https://github.com/ElrondNetwork/elrond-go/archive/{TAG}.tar.gz", - "dependencies.elrond_proxy_go.tag": "latest", - "dependencies.elrond_proxy_go.urlTemplate.linux": "https://github.com/ElrondNetwork/elrond-proxy-go/archive/{TAG}.tar.gz", - "dependencies.elrond_proxy_go.urlTemplate.osx": "https://github.com/ElrondNetwork/elrond-proxy-go/archive/{TAG}.tar.gz", + "dependencies.mx_chain_go.tag": "latest", + "dependencies.mx_chain_go.urlTemplate.linux": "https://github.com/multiversx/mx-chain-go/archive/{TAG}.tar.gz", + "dependencies.mx_chain_go.urlTemplate.osx": "https://github.com/multiversx/mx-chain-go/archive/{TAG}.tar.gz", + "dependencies.mx_chain_go.url": "https://github.com/multiversx/mx-chain-go/archive/{TAG}.tar.gz", + "dependencies.mx_chain_proxy_go.tag": "latest", + "dependencies.mx_chain_proxy_go.urlTemplate.linux": "https://github.com/multiversx/mx-chain-proxy-go/archive/{TAG}.tar.gz", + "dependencies.mx_chain_proxy_go.urlTemplate.osx": "https://github.com/multiversx/mx-chain-proxy-go/archive/{TAG}.tar.gz", "dependencies.golang.tag": "go1.18.4", "dependencies.golang.urlTemplate.linux": "https://golang.org/dl/{TAG}.linux-amd64.tar.gz", "dependencies.golang.urlTemplate.osx": "https://golang.org/dl/{TAG}.darwin-amd64.tar.gz", "dependencies.mcl_signer.tag": "latest", - "dependencies.mcl_signer.urlTemplate.linux": "https://github.com/ElrondNetwork/elrond-sdk-go-tools/releases/download/{TAG}/mcl_signer_{TAG}_ubuntu-latest.tar.gz", - "dependencies.mcl_signer.urlTemplate.osx": "https://github.com/ElrondNetwork/elrond-sdk-go-tools/releases/download/{TAG}/mcl_signer_{TAG}_macos-latest.tar.gz", + "dependencies.mcl_signer.urlTemplate.linux": "https://github.com/multiversx/mx-sdk-erdgo-tools/releases/download/{TAG}/mcl_signer_{TAG}_ubuntu-latest.tar.gz", + "dependencies.mcl_signer.urlTemplate.osx": "https://github.com/multiversx/mx-sdk-erdgo-tools/releases/download/{TAG}/mcl_signer_{TAG}_macos-latest.tar.gz", "dependencies.wasm-opt.tag": "latest", "dependencies.twiggy.tag": "latest", "dependencies.testwallets.tag": "latest", - "dependencies.testwallets.urlTemplate.linux": "https://github.com/ElrondNetwork/elrond-sdk-testwallets/archive/{TAG}.tar.gz", - "dependencies.testwallets.urlTemplate.osx": "https://github.com/ElrondNetwork/elrond-sdk-testwallets/archive/{TAG}.tar.gz", + "dependencies.testwallets.urlTemplate.linux": "https://github.com/multiversx/mx-sdk-testwallets/archive/{TAG}.tar.gz", + "dependencies.testwallets.urlTemplate.osx": "https://github.com/multiversx/mx-sdk-testwallets/archive/{TAG}.tar.gz", "testnet.validate_expected_keys": "false", "github_api_token": "", } diff --git a/erdpy/dependencies/install.py b/erdpy/dependencies/install.py index 00659592..aab8c9f0 100644 --- a/erdpy/dependencies/install.py +++ b/erdpy/dependencies/install.py @@ -64,8 +64,8 @@ def _get_implicitly_installable_deps() -> List[DependencyModule]: return [ VMToolsModule(key="vmtools"), - StandaloneModule(key="elrond_go", repo_name="elrond-go", organisation="ElrondNetwork"), - StandaloneModule(key="elrond_proxy_go", repo_name="elrond-proxy-go", organisation="ElrondNetwork"), + StandaloneModule(key="mx_chain_go", repo_name="mx-chain-go", organisation="multiversx"), + StandaloneModule(key="mx_chain_proxy_go", repo_name="mx-chain-proxy-go", organisation="multiversx"), MclSignerModule(key="mcl_signer"), NpmModule(key="wasm-opt"), CargoModule(key="twiggy"), diff --git a/erdpy/utils.py b/erdpy/utils.py index a7a639b1..aa72339e 100644 --- a/erdpy/utils.py +++ b/erdpy/utils.py @@ -272,9 +272,9 @@ def breakpoint(): def log_explorer(chain, name, path, details): networks = { - "1": ("Elrond Mainnet Explorer", "https://explorer.elrond.com"), - "T": ("Elrond Testnet Explorer", "https://testnet-explorer.elrond.com"), - "D": ("Elrond Devnet Explorer", "https://devnet-explorer.elrond.com"), + "1": ("MultiversX Mainnet Explorer", "https://explorer.multiversx.com"), + "T": ("MultiversX Testnet Explorer", "https://testnet-explorer.multiversx.com"), + "D": ("MultiversX Devnet Explorer", "https://devnet-explorer.multiversx.com"), } try: explorer_name, explorer_url = networks[chain] diff --git a/setup.py b/setup.py index 69975db9..51ff3e07 100644 --- a/setup.py +++ b/setup.py @@ -15,11 +15,11 @@ setuptools.setup( name="erdpy", version=VERSION, - description="Elrond Smart Contracts Tools and Python SDK", + description="MultiversX Smart Contracts Tools and Python SDK", long_description=long_description, long_description_content_type="text/markdown", url="https://github.com/multiversx/mx-sdk-erdpy", - author="Elrond Network", + author="MultiversX", license="GPL", packages=setuptools.find_packages( include=["erdpy*"], exclude=["examples*"]), @@ -39,7 +39,7 @@ "mx-sdk-build-contract-rs==4.0.0" ], zip_safe=False, - keywords=["Elrond"], + keywords=["MultiversX"], classifiers=[ "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", From 648424c6ca88d595216d3055443381179b1f98d5 Mon Sep 17 00:00:00 2001 From: Alexandru Popenta Date: Fri, 6 Jan 2023 16:48:31 +0200 Subject: [PATCH 2/6] renaming --- README.md | 4 +- docs/Makefile | 20 ---- docs/conf.py | 64 ------------ docs/index.rst | 30 ------ docs/make.bat | 35 ------- docs/pages/configuration.rst | 40 -------- docs/pages/getting-started.rst | 56 ---------- docs/pages/installation.rst | 100 ------------------ erdpy-up.py | 49 +++++---- erdpy/CLI.md | 62 +++++------ erdpy/README.md | 2 +- erdpy/cli_ledger.py | 6 +- erdpy/config.py | 7 +- erdpy/dependencies/install.py | 2 +- erdpy/dependencies/modules.py | 4 +- erdpy/ledger/config.py | 6 +- erdpy/ledger/ledger_app_handler.py | 8 +- erdpy/ledger/ledger_functions.py | 8 +- erdpy/projects/core.py | 2 +- erdpy/projects/eei_checks.py | 8 +- erdpy/projects/templates_repository.py | 4 +- erdpy/testnet/config.py | 14 +-- erdpy/testnet/setup.py | 6 +- erdpy/tests/test_cli_testnet.sh | 2 +- erdpy/tests/test_playground_proxy.py | 2 +- erdpy/tests/test_testnet.py | 12 +-- erdpy/wallet/core.py | 6 +- erdpy/wallet/keyfile.py | 2 +- examples/airdrop.py | 66 ------------ examples/bytecode/answer.wasm | Bin 111 -> 0 bytes examples/bytecode/counter.wasm | Bin 335 -> 0 bytes examples/contracts.py | 137 ------------------------- examples/staking.py | 64 ------------ 33 files changed, 108 insertions(+), 720 deletions(-) delete mode 100644 docs/Makefile delete mode 100644 docs/conf.py delete mode 100644 docs/index.rst delete mode 100644 docs/make.bat delete mode 100644 docs/pages/configuration.rst delete mode 100644 docs/pages/getting-started.rst delete mode 100644 docs/pages/installation.rst delete mode 100644 examples/airdrop.py delete mode 100755 examples/bytecode/answer.wasm delete mode 100755 examples/bytecode/counter.wasm delete mode 100644 examples/contracts.py delete mode 100644 examples/staking.py diff --git a/README.md b/README.md index 849894b5..48461a6b 100644 --- a/README.md +++ b/README.md @@ -2,13 +2,13 @@ Python Command Line Tools for interacting with MultiversX. ## Documentation -[docs.elrond.com](https://docs.elrond.com/sdk-and-tools/erdpy/erdpy/) +[docs.multiversx.com](https://docs.multiversx.com/sdk-and-tools/erdpy/erdpy/) ## CLI [CLI](erdpy/CLI.md) ## Distribution -[erdpy-up](https://docs.elrond.com/sdk-and-tools/erdpy/installing-erdpy/) and [PyPi](https://pypi.org/project/erdpy/#history) +[erdpy-up](https://docs.multiversx.com/sdk-and-tools/erdpy/installing-erdpy/) and [PyPi](https://pypi.org/project/erdpy/#history) ## CHANGELOG [CHANGELOG](erdpy/CHANGELOG.md) diff --git a/docs/Makefile b/docs/Makefile deleted file mode 100644 index d4bb2cbb..00000000 --- a/docs/Makefile +++ /dev/null @@ -1,20 +0,0 @@ -# Minimal makefile for Sphinx documentation -# - -# You can set these variables from the command line, and also -# from the environment for the first two. -SPHINXOPTS ?= -SPHINXBUILD ?= sphinx-build -SOURCEDIR = . -BUILDDIR = _build - -# Put it first so that "make" without argument is like "make help". -help: - @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) - -.PHONY: help Makefile - -# Catch-all target: route all unknown targets to Sphinx using the new -# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). -%: Makefile - @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/docs/conf.py b/docs/conf.py deleted file mode 100644 index 3b8eb18d..00000000 --- a/docs/conf.py +++ /dev/null @@ -1,64 +0,0 @@ -# Configuration file for the Sphinx documentation builder. -# -# This file only contains a selection of the most common options. For a full -# list see the documentation: -# https://www.sphinx-doc.org/en/master/usage/configuration.html - -# -- Path setup -------------------------------------------------------------- - -# If extensions (or modules to document with autodoc) are in another directory, -# add these directories to sys.path here. If the directory is relative to the -# documentation root, use os.path.abspath to make it absolute, like shown here. -# -# import os -# import sys -# sys.path.insert(0, os.path.abspath('.')) - - -# -- Project information ----------------------------------------------------- - -project = 'MultiversX erdpy SDK' -copyright = '2022, MultiversX' -author = 'MultiversX' - -# The full version, including alpha/beta/rc tags -release = '1.2.3' - - -# -- General configuration --------------------------------------------------- - -# Add any Sphinx extension module names here, as strings. They can be -# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom -# ones. -extensions = [ -] - -# Add any paths that contain templates here, relative to this directory. -templates_path = ['_templates'] - -# List of patterns, relative to source directory, that match files and -# directories to ignore when looking for source files. -# This pattern also affects html_static_path and html_extra_path. -exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] - - -# -- Options for HTML output ------------------------------------------------- - -# The theme to use for HTML and HTML Help pages. See the documentation for -# a list of builtin themes. -# -html_theme = 'sphinx_rtd_theme' - - -# Add any paths that contain custom static files (such as style sheets) here, -# relative to this directory. They are copied after the builtin static files, -# so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['_static'] - -extensions = ["sphinx_rtd_dark_mode"] - -# user starts in dark mode -default_dark_mode = True - -# user starts in light mode -default_dark_mode = False diff --git a/docs/index.rst b/docs/index.rst deleted file mode 100644 index c127690f..00000000 --- a/docs/index.rst +++ /dev/null @@ -1,30 +0,0 @@ -.. MultiversX erdpy SDK documentation master file, created by - sphinx-quickstart on Sun Mar 20 18:20:17 2022. - You can adapt this file completely to your liking, but it should at least - contain the root `toctree` directive. - -Welcome to MultiversX erdpy SDK's documentation! -============================================ - -.. toctree:: - :maxdepth: 2 - :caption: Contents: - - pages/getting-started - pages/installation - pages/configuration - - - -Links -================== - -* :ref:`genindex` -* :ref:`modindex` -* :ref:`search` -* Source code: https://github.com/multiversx/mx-sdk-erdpy -* Documentation: https://docs.multiversx.com/sdk-and-tools/erdpy/erdpy/ -* CLI : erdpy/CLI.md -* Distribution: https://docs.multiversx.com/sdk-and-tools/erdpy/installing-erdpy/) and [PyPi](https://pypi.org/project/erdpy/#history - - diff --git a/docs/make.bat b/docs/make.bat deleted file mode 100644 index 153be5e2..00000000 --- a/docs/make.bat +++ /dev/null @@ -1,35 +0,0 @@ -@ECHO OFF - -pushd %~dp0 - -REM Command file for Sphinx documentation - -if "%SPHINXBUILD%" == "" ( - set SPHINXBUILD=sphinx-build -) -set SOURCEDIR=. -set BUILDDIR=_build - -if "%1" == "" goto help - -%SPHINXBUILD% >NUL 2>NUL -if errorlevel 9009 ( - echo. - echo.The 'sphinx-build' command was not found. Make sure you have Sphinx - echo.installed, then set the SPHINXBUILD environment variable to point - echo.to the full path of the 'sphinx-build' executable. Alternatively you - echo.may add the Sphinx directory to PATH. - echo. - echo.If you don't have Sphinx installed, grab it from - echo.https://www.sphinx-doc.org/ - exit /b 1 -) - -%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% -goto end - -:help -%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% - -:end -popd diff --git a/docs/pages/configuration.rst b/docs/pages/configuration.rst deleted file mode 100644 index 662975c4..00000000 --- a/docs/pages/configuration.rst +++ /dev/null @@ -1,40 +0,0 @@ -=================== -Configuring erdpy -=================== - -**erdpy** can be configured using the ``erdpy config`` command. - -In order to view the current configuration, you can run the ``erdpy config dump`` command. - -You should have this output. For example: - -.. code:: - - { - "proxy": "https://gateway.elrond.com", - "txVersion": "1", - "dependencies.llvm.tag": "v...", - "dependencies.vmtools.tag": "v...", - "chainID": "...", - "dependencies.rust.tag": "" - } - -You can alter the current configuration using the ``erdpy config set`` command. For - -For example, in order to set the *proxy URL* or the *chain ID*, run the following: - -.. code:: bash - - $ erdpy config set chainID 1... - $ erdpy config set proxy https://gateway.elrond.com - -.. note:: - For *mainnet* use proxy: https://gateway.elrond.com and chainID: 1. - - For *devnet* use proxy: https://devnet-gateway.elrond.com and chainID: D. - - For *testnet* use proxy: https://testnet-api.elrond.com and chainID: T. - -.. tip:: - erdpy's configuration is stored in the file ``~/elrondsdk/erdpy.json``. - diff --git a/docs/pages/getting-started.rst b/docs/pages/getting-started.rst deleted file mode 100644 index 097adc65..00000000 --- a/docs/pages/getting-started.rst +++ /dev/null @@ -1,56 +0,0 @@ -=============================================== -Getting Started with erdpy : CLI and Python SDK -=============================================== - -A quick introduction to building with erdpy - -Introduction -============ - -erpdy is a set of Command Line Tools and Python SDK for interacting with the Blockchain (in general) and with Smart Contracts (in particular). - -Source Code -=========== - -The erdpy source code can be found at https://github.com/ElrondNetwork/elrond-sdk-erdpy - -Features -======== - -erdpy targets a broad audience of users and developers, as depicted below: - -.. list-table:: - :widths: auto - :header-rows: 1 - - * - Feature - - Audience - - * - Compile Smart Contracts (Rust, C, C++) to WASM - - Smart Contract developers - - * - Deploy, execute (call), query Smart Contracts - - Smart Contract developers, application developers, tech enthusiasts - - * - Run Mandos (testing platform) JSON tests against Smart Contracts - - Smart Contract developers - - * - Sign & send `System Smart Contract transactions `_ - - Validator owners - - * - Sign & send regular transactions - - Application developers, tech enthusiasts - - * - Query Network status, transactions status / details - - Application developers, tech enthusiasts - - * - Query account details - - Application developers, tech enthusiasts - - * - Generate PEM files, recover private key from mnemonic - - Tech enthusiasts - - * - Miscellaneous support features (e.g. bech32 conversion) - - Tech enthusiasts - - \ No newline at end of file diff --git a/docs/pages/installation.rst b/docs/pages/installation.rst deleted file mode 100644 index 72669ace..00000000 --- a/docs/pages/installation.rst +++ /dev/null @@ -1,100 +0,0 @@ -============== -Installation -============== - - -**erdpy** is currently available in Linux and MacOS. Some of its feature as may work on Windows. However, we do not recommend or support its usage on Windows at the moment. - -Before installing **erdpy**, make sure you have a working Python3 environment. -*For Linux or MacOS, version 3.8 or later is recommended.* - - - - -Smart contract written in **C** requires the *ncurses* library routines for compiling. To install the library, run the command: - -.. code-block:: bash - - $sudo apt install libncurses5 - -Install using `erpdy-up` (recommended) -====================================== - -To install **erdpy** using the `erdpy-up` installation script, run the following command on your terminal: - -.. code-block:: python - - wget -O erdpy-up.py https://raw.githubusercontent.com/ElrondNetwork/elrond-sdk-erdpy/master/erdpy-up.py - python3.8 erdpy-up.py - -This command creates a python virtual environment (based on the ``venv``) in ``~/elrondsdk/erdpy-venv`` and also includes ``~/elrondsdk`` in your ``$PATH`` variable (by editing the appropriate ``.profile`` file). - -Troubleshooting and other notes -=============================== - -If you are using `Ubuntu 20.04`, you may run into an ``invalid command 'bdist_wheel'`` error. To clear this error, run the command below and retry ``erdpy-up`` command to clear the error: - -.. code-block:: python - - pip3 install wheel - python3 erdpy-up.py - -On MacOS, you can switch to Python 3.8: - -.. code-block:: - - brew info python@3.8 - brew unlink python - brew link --force python@3.8 - python3 --version - -Install without erdpy-up -========================= - -You can install without the ``erdpy-up`` as well. If you would like to install without relying on the installation script, simply follow the instructions in this section. Otherwise, feel free to skip. - -Prepare PATH -============= - -Firstly, ensure you have ``pip3`` installed. -To have the command **erdpy** available in your shell after installation, make sure you adjust the ``PATH`` environment variable as described below: - -On Linux in ``~/.profile`` run: - -.. code-block:: - - export PATH="$HOME/.local/bin:$PATH" - -On MacOS in ``~/.bash_profile`` or ``~/.zshrc`` if youโ€™re using ``zsh`` run: - -.. code-block:: - - export PATH=$HOME/Library/Python/3.8/bin:${PATH} - -.. note:: - ADD THE RIGHT VERSION: - - In the snippet above, replace ``3.8`` with your actual ``MAJOR.MINOR`` version of Python. This can be found by running: - -.. code:: - - python3 -c "import sys; print(f'{sys.version_info.major}.{sys.version_info.minor}')" - -You may need to restart your user session for these changes to take effect. - -Install and smoke test -======================= - -To install **erdpy**, run the following command: - -.. code-block:: - - pip3 install --user --upgrade --no-cache-dir erdpy - -Troubleshooting -================= -If you encounter *encoding-related* issues while installing, such as ``UnicodeDecodeError: 'ascii' codec can't decode byte``, set the ``PYTHONENCODING`` environment variable: - -.. code-block:: - - PYTHONIOENCODING=utf8 pip3 install --user --upgrade --no-cache-dir erdpy diff --git a/erdpy-up.py b/erdpy-up.py index f0b99e3a..f690ab94 100644 --- a/erdpy-up.py +++ b/erdpy-up.py @@ -13,26 +13,26 @@ MIN_REQUIRED_PYTHON_VERSION = (3, 8, 0) -elrondsdk_path = None +sdk_path = None exact_version = None from_branch = None def main(): - global elrondsdk_path + global sdk_path global exact_version global from_branch parser = ArgumentParser() parser.add_argument("--modify-path", dest="modify_path", action="store_true", help="whether to modify $PATH (in profile file)") parser.add_argument("--no-modify-path", dest="modify_path", action="store_false", help="whether to modify $PATH (in profile file)") - parser.add_argument("--elrondsdk-path", default=get_elrond_sdk_path_default(), help="where to install elrond-sdk") + parser.add_argument("--sdk-path", default=get_sdk_path_default(), help="where to install mx-sdk") parser.add_argument("--exact-version", help="the exact version of erdpy to install") - parser.add_argument("--from-branch", help="use a branch of ElrondNetwork/elrond-sdk-erdpy") + parser.add_argument("--from-branch", help="use a branch of multiversx/mx-sdk-erdpy") parser.set_defaults(modify_path=True) args = parser.parse_args() - elrondsdk_path = os.path.expanduser(args.elrondsdk_path) + sdk_path = os.path.expanduser(args.sdk_path) modify_path = args.modify_path exact_version = args.exact_version from_branch = args.from_branch @@ -56,7 +56,8 @@ def main(): if operating_system != "linux" and operating_system != "osx": raise InstallError("Your operating system is not supported yet.") - remove_installation() + # TODO: will come in a future version + # migrate_installation(sdk_path) create_venv() install_erdpy() if modify_path: @@ -92,19 +93,14 @@ def get_operating_system(): return operating_system -def remove_installation(): - old_folder = os.path.expanduser("~/ElrondSCTools") +def migrate_installation(sdk_path: str) -> None: + old_folder = os.path.expanduser("~/elrondsdk") if os.path.isdir(old_folder): - answer = input(f"Older installation in {old_folder} has to be removed. Allow? (y/n)") + answer = input(f"Older installation folder {old_folder} has to be renamed. Allow? (y/n)") if answer.lower() not in ["y", "yes"]: raise InstallError("Installation will not continue.") - shutil.rmtree(old_folder) - logger.info("Removed previous installation (ElrondSCTools).") - - folder = get_erdpy_path() - if os.path.isdir(folder): - shutil.rmtree(folder) - logger.info("Removed previous installation (virtual environment).") + shutil.move(old_folder, sdk_path) + logger.info("Renamed folder.") def create_venv(): @@ -119,7 +115,7 @@ def create_venv(): builder.create(folder) # Create symlink to "bin/activate" - link_path = os.path.join(elrondsdk_path, "erdpy-activate") + link_path = os.path.join(sdk_path, "erdpy-activate") if os.path.exists(link_path): os.remove(link_path) os.symlink(os.path.join(folder, "bin", "activate"), link_path) @@ -142,10 +138,11 @@ def require_venv(): def get_erdpy_path(): - return os.path.join(elrondsdk_path, "erdpy-venv") + return os.path.join(sdk_path, "erdpy-venv") -def get_elrond_sdk_path_default(): +def get_sdk_path_default(): + # TODO: will come in a future version return os.path.expanduser("~/elrondsdk") @@ -156,7 +153,7 @@ def ensure_folder(folder): def install_erdpy(): logger.info("Installing erdpy in virtual environment...") if from_branch: - erdpy_to_install = f"https://github.com/ElrondNetwork/elrond-sdk-erdpy/archive/refs/heads/{from_branch}.zip" + erdpy_to_install = f"https://github.com/multiversx/mx-sdk-erdpy/archive/refs/heads/{from_branch}.zip" else: erdpy_to_install = "erdpy" if not exact_version else f"erdpy=={exact_version}" @@ -174,7 +171,7 @@ def install_erdpy(): upgrade_erdpy_config() # Create symlink to "bin/erdpy" - link_path = os.path.join(elrondsdk_path, "erdpy") + link_path = os.path.join(sdk_path, "erdpy") if os.path.exists(link_path): os.remove(link_path) os.symlink(os.path.join(get_erdpy_path(), "bin", "erdpy"), link_path) @@ -196,16 +193,16 @@ def run_in_venv(args): def add_sdk_to_path(): logger.info("Checking PATH variable.") PATH = os.environ["PATH"] - if elrondsdk_path in PATH: - logger.info(f"elrond-sdk path ({elrondsdk_path}) already in $PATH variable.") + if sdk_path in PATH: + logger.info(f"mx-sdk path ({sdk_path}) already in $PATH variable.") return profile_file = get_profile_file() - logger.info(f"Adding elrond-sdk path [{elrondsdk_path}] to $PATH variable.") + logger.info(f"Adding mx-sdk path [{sdk_path}] to $PATH variable.") logger.info(f"[{profile_file}] will be modified.") with open(profile_file, "a") as file: - file.write(f'\nexport PATH="{elrondsdk_path}:$PATH"\t# elrond-sdk\n') + file.write(f'\nexport PATH="{sdk_path}:$PATH"\t# elrond-sdk\n') logger.info(f""" ############################################################################### @@ -278,6 +275,6 @@ def __init__(self, message, inner=None): logger.info(""" -For more information go to https://docs.elrond.com. +For more information go to https://docs.multiversx.com. For support, please contact us at https://t.me/ElrondDevelopers. """) diff --git a/erdpy/CLI.md b/erdpy/CLI.md index 40b887e3..bc2d8964 100644 --- a/erdpy/CLI.md +++ b/erdpy/CLI.md @@ -12,11 +12,11 @@ usage: erdpy [-h] [-v] [--verbose] COMMAND-GROUP [-h] COMMAND ... ----------- DESCRIPTION ----------- -erdpy is part of the elrond-sdk and consists of Command Line Tools and Python SDK +erdpy is part of the multiversx-sdk and consists of Command Line Tools and Python SDK for interacting with the Blockchain (in general) and with Smart Contracts (in particular). erdpy targets a broad audience of users and developers. -https://docs.elrond.com/sdk-and-tools/erdpy/erdpy. +https://docs.multiversx.com/sdk-and-tools/erdpy/erdpy. COMMAND GROUPS: @@ -37,8 +37,8 @@ account Get Account data (nonce, balance) from the Networ ledger Get Ledger App addresses and version wallet Create wallet, derive secret key from mnemonic, bech32 address helpers etc. network Get Network parameters, such as number of shards, chain identifier etc. -deps Manage dependencies or elrond-sdk modules -config Configure elrond-sdk (default values etc.) +deps Manage dependencies or multiversx-sdk modules +config Configure multiversx-sdk (default values etc.) hyperblock Get Hyperblock from the Network testnet Set up, start and control local testnets data Data manipulation omnitool @@ -56,7 +56,7 @@ usage: erdpy contract COMMAND [-h] ... Build, deploy, upgrade and interact with Smart Contracts COMMANDS: - {new,templates,build,clean,test,report,deploy,call,upgrade,query} + {new,templates,build,clean,test,report,deploy,call,upgrade,query,verify,reproducible-build} OPTIONS: -h, --help show this help message and exit @@ -74,6 +74,8 @@ deploy Deploy a Smart Contract. call Interact with a Smart Contract (execute function). upgrade Upgrade a previously-deployed Smart Contract. query Query a Smart Contract (call a pure function) +verify Verify the authenticity of the code of a deployed Smart Contract +reproducible-build Build a Smart Contract and get the same output as a previously built Smart Contract ``` ### Contract.New @@ -207,7 +209,7 @@ optional arguments: --ledger-account-index LEDGER_ACCOUNT_INDEX ๐Ÿ” the index of the account when using Ledger --ledger-address-index LEDGER_ADDRESS_INDEX ๐Ÿ” the index of the address when using Ledger --sender-username SENDER_USERNAME ๐Ÿ–„ the username of the sender - --proxy PROXY ๐Ÿ”— the URL of the proxy (default: https://testnet-gateway.elrond.com) + --proxy PROXY ๐Ÿ”— the URL of the proxy (default: https://testnet-gateway.multiversx.com) --nonce NONCE # the nonce for the transaction --recall-nonce โญฎ whether to recall the nonce when creating the transaction (default: False) @@ -278,7 +280,7 @@ optional arguments: --ledger-account-index LEDGER_ACCOUNT_INDEX ๐Ÿ” the index of the account when using Ledger --ledger-address-index LEDGER_ADDRESS_INDEX ๐Ÿ” the index of the address when using Ledger --sender-username SENDER_USERNAME ๐Ÿ–„ the username of the sender - --proxy PROXY ๐Ÿ”— the URL of the proxy (default: https://testnet-gateway.elrond.com) + --proxy PROXY ๐Ÿ”— the URL of the proxy (default: https://testnet-gateway.multiversx.com) --nonce NONCE # the nonce for the transaction --recall-nonce โญฎ whether to recall the nonce when creating the transaction (default: False) @@ -357,7 +359,7 @@ optional arguments: --ledger-account-index LEDGER_ACCOUNT_INDEX ๐Ÿ” the index of the account when using Ledger --ledger-address-index LEDGER_ADDRESS_INDEX ๐Ÿ” the index of the address when using Ledger --sender-username SENDER_USERNAME ๐Ÿ–„ the username of the sender - --proxy PROXY ๐Ÿ”— the URL of the proxy (default: https://testnet-gateway.elrond.com) + --proxy PROXY ๐Ÿ”— the URL of the proxy (default: https://testnet-gateway.multiversx.com) --nonce NONCE # the nonce for the transaction --recall-nonce โญฎ whether to recall the nonce when creating the transaction (default: False) @@ -391,7 +393,7 @@ positional arguments: optional arguments: -h, --help show this help message and exit - --proxy PROXY ๐Ÿ”— the URL of the proxy (default: https://testnet-gateway.elrond.com) + --proxy PROXY ๐Ÿ”— the URL of the proxy (default: https://testnet-gateway.multiversx.com) --function FUNCTION the function to call --arguments ARGUMENTS [ARGUMENTS ...] arguments for the contract transaction, as [number, bech32-address, ascii string, boolean] or hex-encoded. E.g. --arguments 42 0x64 1000 0xabba @@ -507,7 +509,7 @@ optional arguments: --send โœ“ whether to broadcast the transaction (default: False) --simulate whether to simulate the transaction (default: False) --relay whether to relay the transaction (default: False) - --proxy PROXY ๐Ÿ”— the URL of the proxy (default: https://testnet-gateway.elrond.com) + --proxy PROXY ๐Ÿ”— the URL of the proxy (default: https://testnet-gateway.multiversx.com) --wait-result signal to wait for the transaction result - only valid if --send is set --timeout TIMEOUT max num of seconds to wait for result - only valid if --wait-result is set @@ -539,7 +541,7 @@ optional arguments: -h, --help show this help message and exit --infile INFILE input file (a previously saved transaction) --outfile OUTFILE where to save the output (the hash) (default: stdout) - --proxy PROXY ๐Ÿ”— the URL of the proxy (default: https://testnet-gateway.elrond.com) + --proxy PROXY ๐Ÿ”— the URL of the proxy (default: https://testnet-gateway.multiversx.com) ``` ### Transactions.Get @@ -567,7 +569,7 @@ optional arguments: --hash HASH the hash --sender SENDER the sender address --with-results will also return the results of transaction - --proxy PROXY ๐Ÿ”— the URL of the proxy (default: https://testnet-gateway.elrond.com) + --proxy PROXY ๐Ÿ”— the URL of the proxy (default: https://testnet-gateway.multiversx.com) --omit-fields OMIT_FIELDS omit fields in the output payload (default: []) ``` @@ -598,7 +600,7 @@ Get hyperblock optional arguments: -h, --help show this help message and exit - --proxy PROXY ๐Ÿ”— the URL of the proxy (default: https://testnet-gateway.elrond.com) + --proxy PROXY ๐Ÿ”— the URL of the proxy (default: https://testnet-gateway.multiversx.com) --key KEY the hash or the nonce of the hyperblock ``` @@ -645,7 +647,7 @@ Stake value into the Network optional arguments: -h, --help show this help message and exit - --proxy PROXY ๐Ÿ”— the URL of the proxy (default: https://testnet-gateway.elrond.com) + --proxy PROXY ๐Ÿ”— the URL of the proxy (default: https://testnet-gateway.multiversx.com) --pem PEM ๐Ÿ”‘ the PEM file, if keyfile not provided --pem-index PEM_INDEX ๐Ÿ”‘ the index in the PEM file (default: 0) --keyfile KEYFILE ๐Ÿ”‘ a JSON keyfile, if PEM not provided @@ -683,7 +685,7 @@ Unstake value optional arguments: -h, --help show this help message and exit - --proxy PROXY ๐Ÿ”— the URL of the proxy (default: https://testnet-gateway.elrond.com) + --proxy PROXY ๐Ÿ”— the URL of the proxy (default: https://testnet-gateway.multiversx.com) --pem PEM ๐Ÿ”‘ the PEM file, if keyfile not provided --pem-index PEM_INDEX ๐Ÿ”‘ the index in the PEM file (default: 0) --keyfile KEYFILE ๐Ÿ”‘ a JSON keyfile, if PEM not provided @@ -719,7 +721,7 @@ Unjail a Validator Node optional arguments: -h, --help show this help message and exit - --proxy PROXY ๐Ÿ”— the URL of the proxy (default: https://testnet-gateway.elrond.com) + --proxy PROXY ๐Ÿ”— the URL of the proxy (default: https://testnet-gateway.multiversx.com) --pem PEM ๐Ÿ”‘ the PEM file, if keyfile not provided --pem-index PEM_INDEX ๐Ÿ”‘ the index in the PEM file (default: 0) --keyfile KEYFILE ๐Ÿ”‘ a JSON keyfile, if PEM not provided @@ -755,7 +757,7 @@ Unbond tokens for a bls key optional arguments: -h, --help show this help message and exit - --proxy PROXY ๐Ÿ”— the URL of the proxy (default: https://testnet-gateway.elrond.com) + --proxy PROXY ๐Ÿ”— the URL of the proxy (default: https://testnet-gateway.multiversx.com) --pem PEM ๐Ÿ”‘ the PEM file, if keyfile not provided --pem-index PEM_INDEX ๐Ÿ”‘ the index in the PEM file (default: 0) --keyfile KEYFILE ๐Ÿ”‘ a JSON keyfile, if PEM not provided @@ -791,7 +793,7 @@ Change the reward address optional arguments: -h, --help show this help message and exit - --proxy PROXY ๐Ÿ”— the URL of the proxy (default: https://testnet-gateway.elrond.com) + --proxy PROXY ๐Ÿ”— the URL of the proxy (default: https://testnet-gateway.multiversx.com) --pem PEM ๐Ÿ”‘ the PEM file, if keyfile not provided --pem-index PEM_INDEX ๐Ÿ”‘ the index in the PEM file (default: 0) --keyfile KEYFILE ๐Ÿ”‘ a JSON keyfile, if PEM not provided @@ -827,7 +829,7 @@ Claim rewards optional arguments: -h, --help show this help message and exit - --proxy PROXY ๐Ÿ”— the URL of the proxy (default: https://testnet-gateway.elrond.com) + --proxy PROXY ๐Ÿ”— the URL of the proxy (default: https://testnet-gateway.multiversx.com) --pem PEM ๐Ÿ”‘ the PEM file, if keyfile not provided --pem-index PEM_INDEX ๐Ÿ”‘ the index in the PEM file (default: 0) --keyfile KEYFILE ๐Ÿ”‘ a JSON keyfile, if PEM not provided @@ -884,7 +886,7 @@ Query account details (nonce, balance etc.) optional arguments: -h, --help show this help message and exit - --proxy PROXY ๐Ÿ”— the URL of the proxy (default: https://testnet-gateway.elrond.com) + --proxy PROXY ๐Ÿ”— the URL of the proxy (default: https://testnet-gateway.multiversx.com) --address ADDRESS ๐Ÿ–„ the address to query --balance whether to only fetch the balance --nonce whether to only fetch the nonce @@ -903,7 +905,7 @@ Query account transactions optional arguments: -h, --help show this help message and exit - --proxy PROXY ๐Ÿ”— the URL of the proxy (default: https://testnet-gateway.elrond.com) + --proxy PROXY ๐Ÿ”— the URL of the proxy (default: https://testnet-gateway.multiversx.com) --outfile OUTFILE where to save the output (default: stdout) --address ADDRESS ๐Ÿ–„ the address to query @@ -1091,7 +1093,7 @@ Get the number of shards. optional arguments: -h, --help show this help message and exit - --proxy PROXY ๐Ÿ”— the URL of the proxy (default: https://testnet-gateway.elrond.com) + --proxy PROXY ๐Ÿ”— the URL of the proxy (default: https://testnet-gateway.multiversx.com) ``` ### Network.BlockNonce @@ -1105,7 +1107,7 @@ Get the latest block nonce, by shard. optional arguments: -h, --help show this help message and exit - --proxy PROXY ๐Ÿ”— the URL of the proxy (default: https://testnet-gateway.elrond.com) + --proxy PROXY ๐Ÿ”— the URL of the proxy (default: https://testnet-gateway.multiversx.com) --shard SHARD the shard ID (use 4294967295 for metachain) ``` @@ -1120,7 +1122,7 @@ Get the chain identifier. optional arguments: -h, --help show this help message and exit - --proxy PROXY ๐Ÿ”— the URL of the proxy (default: https://testnet-gateway.elrond.com) + --proxy PROXY ๐Ÿ”— the URL of the proxy (default: https://testnet-gateway.multiversx.com) ``` ## Group **Dependencies** @@ -1130,7 +1132,7 @@ optional arguments: $ erdpy deps --help usage: erdpy deps COMMAND [-h] ... -Manage dependencies or elrond-sdk modules +Manage dependencies or multiversx-sdk modules COMMANDS: {install,check} @@ -1141,7 +1143,7 @@ OPTIONS: ---------------- COMMANDS summary ---------------- -install Install dependencies or elrond-sdk modules. +install Install dependencies or multiversx-sdk modules. check Check whether a dependency is installed. ``` @@ -1152,10 +1154,10 @@ check Check whether a dependency is installed. $ erdpy deps install --help usage: erdpy deps install [-h] ... -Install dependencies or elrond-sdk modules. +Install dependencies or multiversx-sdk modules. positional arguments: - {all,llvm,clang,cpp,rust,nodejs,golang,wabt,vmtools,elrond_go,elrond_proxy_go,mcl_signer,wasm-opt,twiggy,testwallets} + {all,llvm,clang,cpp,rust,nodejs,golang,vmtools,mx_chain_go,mx_chain_proxy_go,mcl_signer,wasm-opt,twiggy,testwallets} the dependency to install optional arguments: @@ -1174,7 +1176,7 @@ usage: erdpy deps check [-h] ... Check whether a dependency is installed. positional arguments: - {all,llvm,clang,cpp,rust,nodejs,golang,wabt,vmtools,elrond_go,elrond_proxy_go,mcl_signer,wasm-opt,twiggy,testwallets} + {all,llvm,clang,cpp,rust,nodejs,golang,vmtools,mx_chain_go,mx_chain_proxy_go,mcl_signer,wasm-opt,twiggy,testwallets} the dependency to check optional arguments: @@ -1189,7 +1191,7 @@ optional arguments: $ erdpy config --help usage: erdpy config COMMAND [-h] ... -Configure elrond-sdk (default values etc.) +Configure multiversx-sdk (default values etc.) COMMANDS: {dump,get,set,delete,new,switch,list} diff --git a/erdpy/README.md b/erdpy/README.md index 781a0290..7a0c63cb 100644 --- a/erdpy/README.md +++ b/erdpy/README.md @@ -4,7 +4,7 @@ MultiversX Python Command Line Tools and SDK for interacting with the MultiversX ## Documentation [docs.multiversx.com](https://docs.multiversx.com/sdk-and-tools/erdpy/erdpy/) -[pkg.go.dev](https://pkg.go.dev/github.com/ElrondNetwork/elrond-sdk/erdgo) +[pkg.go.dev](https://pkg.go.dev/github.com/MultiversX/mx-sdk/erdgo) ## CLI [CLI](CLI.md) diff --git a/erdpy/cli_ledger.py b/erdpy/cli_ledger.py index 413d9630..e8cda0fe 100644 --- a/erdpy/cli_ledger.py +++ b/erdpy/cli_ledger.py @@ -1,4 +1,4 @@ -from erdpy.ledger.ledger_app_handler import ElrondLedgerApp +from erdpy.ledger.ledger_app_handler import MultiversXLedgerApp from erdpy import cli_shared import logging from typing import Any @@ -21,7 +21,7 @@ def setup_parser(subparsers: Any) -> Any: def print_addresses(args): - ledger_app = ElrondLedgerApp() + ledger_app = MultiversXLedgerApp() for i in range(args.num_addresses): address = ledger_app.get_address(0, i) print('account index = %d | address index = %d | address: %s' % (0, i, address)) @@ -29,6 +29,6 @@ def print_addresses(args): def print_version(args): - ledger_app = ElrondLedgerApp() + ledger_app = MultiversXLedgerApp() print("MultiversX App version: " + ledger_app.get_version()) ledger_app.close() diff --git a/erdpy/config.py b/erdpy/config.py index d70471c9..4d74b767 100644 --- a/erdpy/config.py +++ b/erdpy/config.py @@ -1,4 +1,4 @@ -import os.path +import os from pathlib import Path from typing import Any, Dict, List @@ -6,9 +6,9 @@ from erdpy import errors, utils, workstation -ROOT_FOLDER_NAME = "multiversxsdk" +ROOT_FOLDER_NAME = "elrondsdk" LOCAL_CONFIG_PATH = os.path.join(os.getcwd(), "erdpy.json") -GLOBAL_CONFIG_PATH = os.path.expanduser("~/multiversxsdk/erdpy.json") +GLOBAL_CONFIG_PATH = os.path.expanduser("~/elrondsdk/erdpy.json") DEFAULT_GAS_PRICE = 1000000000 GAS_PER_DATA_BYTE = 1500 @@ -157,6 +157,7 @@ def get_defaults() -> Dict[str, Any]: "dependencies.vmtools.urlTemplate.linux": "https://github.com/multiversx/mx-vm-wasm-go/archive/{TAG}.tar.gz", "dependencies.vmtools.urlTemplate.osx": "https://github.com/multiversx/mx-vm-wasm-go//archive/{TAG}.tar.gz", "dependencies.llvm.tag": "v9-19feb", + # ide.elrond.com will be removed, TBD if clang will still be downloaded "dependencies.llvm.urlTemplate.linux": "https://ide.elrond.com/vendor-llvm/{TAG}/linux-amd64.tar.gz?t=19feb", "dependencies.llvm.urlTemplate.osx": "https://ide.elrond.com/vendor-llvm/{TAG}/darwin-amd64.tar.gz?t=19feb", "dependencies.rust.tag": "nightly", diff --git a/erdpy/dependencies/install.py b/erdpy/dependencies/install.py index aab8c9f0..2d3662fd 100644 --- a/erdpy/dependencies/install.py +++ b/erdpy/dependencies/install.py @@ -60,7 +60,7 @@ def _get_explicitly_installable_deps() -> List[DependencyModule]: def _get_implicitly_installable_deps() -> List[DependencyModule]: - # See: https://github.com/ElrondNetwork/elrond-sdk-erdpy/pull/55 + # See: https://github.com/multiversx/mx-sdk-erdpy/pull/55 return [ VMToolsModule(key="vmtools"), diff --git a/erdpy/dependencies/modules.py b/erdpy/dependencies/modules.py index e6aa6817..69779393 100644 --- a/erdpy/dependencies/modules.py +++ b/erdpy/dependencies/modules.py @@ -395,8 +395,8 @@ def __init__(self, key: str, aliases: List[str] = None): aliases = list() super().__init__(key, aliases) - self.organisation = 'ElrondNetwork' - self.repo_name = 'elrond-sdk-go-tools' + self.organisation = 'multiversx' + self.repo_name = 'mx-sdk-erdgo-tools' def _post_install(self, tag: str): directory = self.get_directory(tag) diff --git a/erdpy/ledger/config.py b/erdpy/ledger/config.py index 89aa9152..e374f5e3 100644 --- a/erdpy/ledger/config.py +++ b/erdpy/ledger/config.py @@ -1,12 +1,12 @@ -class ElrondLedgerAppConfiguration: +class MultiversXLedgerAppConfiguration: data_activated: bool account_index: int address_index: int version: str -def load_ledger_config_from_response(response: bytes) -> ElrondLedgerAppConfiguration: - config = ElrondLedgerAppConfiguration() +def load_ledger_config_from_response(response: bytes) -> MultiversXLedgerAppConfiguration: + config = MultiversXLedgerAppConfiguration() config.data_activated = False if response[0] == 0x01: diff --git a/erdpy/ledger/ledger_app_handler.py b/erdpy/ledger/ledger_app_handler.py index e958aa7b..2795b874 100644 --- a/erdpy/ledger/ledger_app_handler.py +++ b/erdpy/ledger/ledger_app_handler.py @@ -1,10 +1,10 @@ from ledgercomm import Transport from erdpy.errors import LedgerError -from erdpy.ledger.config import load_ledger_config_from_response, ElrondLedgerAppConfiguration +from erdpy.ledger.config import load_ledger_config_from_response, MultiversXLedgerAppConfiguration SIGN_USING_HASH_VERSION = "1.0.11" -CONNECTION_ERROR_MSG = "check if device is plugged in, unlocked and on Elrond app" +CONNECTION_ERROR_MSG = "check if device is plugged in, unlocked and on MultiversX app" class Apdu: @@ -15,7 +15,7 @@ class Apdu: data: bytes -class ElrondLedgerApp: +class MultiversXLedgerApp: def __init__(self): try: self.transport = Transport(interface="hid", debug=False) # Nano S/X using HID interface @@ -48,7 +48,7 @@ def get_address(self, account_index=0, address_index=0) -> str: address = response_body.decode("utf-8") return address - def get_app_configuration(self) -> ElrondLedgerAppConfiguration: + def get_app_configuration(self) -> MultiversXLedgerAppConfiguration: self.transport.send(cla=0xed, ins=0x02, p1=0x00, p2=0x00, cdata=b"") sw, response = self.transport.recv() err = get_error(sw) diff --git a/erdpy/ledger/ledger_functions.py b/erdpy/ledger/ledger_functions.py index e1570da9..710f65a7 100644 --- a/erdpy/ledger/ledger_functions.py +++ b/erdpy/ledger/ledger_functions.py @@ -1,5 +1,5 @@ import logging -from erdpy.ledger.ledger_app_handler import ElrondLedgerApp +from erdpy.ledger.ledger_app_handler import MultiversXLedgerApp TX_HASH_SIGN_VERSION = 2 TX_HASH_SIGN_OPTIONS = 1 @@ -13,7 +13,7 @@ def do_sign_transaction_with_ledger( address_index: int, sign_using_hash: bool ) -> str: - ledger_handler = ElrondLedgerApp() + ledger_handler = MultiversXLedgerApp() ledger_handler.set_address(account_index=account_index, address_index=address_index) logger.info("Ledger: please confirm the transaction on the device") @@ -24,7 +24,7 @@ def do_sign_transaction_with_ledger( def do_get_ledger_address(account_index: int, address_index: int) -> str: - ledger_handler = ElrondLedgerApp() + ledger_handler = MultiversXLedgerApp() ledger_address = ledger_handler.get_address(account_index=account_index, address_index=address_index) ledger_handler.close() @@ -32,7 +32,7 @@ def do_get_ledger_address(account_index: int, address_index: int) -> str: def do_get_ledger_version() -> str: - ledger_handler = ElrondLedgerApp() + ledger_handler = MultiversXLedgerApp() ledger_version = ledger_handler.get_version() ledger_handler.close() diff --git a/erdpy/projects/core.py b/erdpy/projects/core.py index e06e188e..76b8c7a9 100644 --- a/erdpy/projects/core.py +++ b/erdpy/projects/core.py @@ -85,5 +85,5 @@ def get_projects_in_workspace(workspace: Path) -> List[Project]: def get_project_paths_recursively(base_path: Path) -> List[Path]: guards.is_directory(base_path) - path_list = [elrond_json.parent for elrond_json in base_path.glob("**/elrond.json")] + path_list = [multiversx_json.parent for multiversx_json in base_path.glob("**/elrond.json")] return sorted(path_list) diff --git a/erdpy/projects/eei_checks.py b/erdpy/projects/eei_checks.py index 7dc5266b..4a8b7e95 100644 --- a/erdpy/projects/eei_checks.py +++ b/erdpy/projects/eei_checks.py @@ -8,10 +8,10 @@ logger = logging.getLogger("eei") -MAINNET_PROXY_URL = "https://gateway.elrond.com" -MAINNET_ENABLE_EPOCHS_URL = "https://raw.githubusercontent.com/ElrondNetwork/elrond-config-mainnet/master/enableEpochs.toml" -DEVNET_PROXY_URL = "https://devnet-gateway.elrond.com" -DEVNET_ENABLE_EPOCHS_URL = "https://raw.githubusercontent.com/ElrondNetwork/elrond-config-devnet/master/enableEpochs.toml" +MAINNET_PROXY_URL = "https://gateway.multiversx.com" +MAINNET_ENABLE_EPOCHS_URL = "https://raw.githubusercontent.com/multiversx/mx-chain-mainnet-config/master/enableEpochs.toml" +DEVNET_PROXY_URL = "https://devnet-gateway.multiversx.com" +DEVNET_ENABLE_EPOCHS_URL = "https://raw.githubusercontent.com/multiversx/mx-chain-devnet-config/master/enableEpochs.toml" def check_compatibility(project: IProject): diff --git a/erdpy/projects/templates_repository.py b/erdpy/projects/templates_repository.py index 6c57b738..54e9356c 100644 --- a/erdpy/projects/templates_repository.py +++ b/erdpy/projects/templates_repository.py @@ -59,8 +59,8 @@ def get_templates(self): return templates def is_template(self, subfolder: str) -> bool: - elrond_json_file = self.get_metadata_file(subfolder) - return elrond_json_file.is_file() + multiversx_json_file = self.get_metadata_file(subfolder) + return multiversx_json_file.is_file() def get_metadata_file(self, template_folder: str) -> Path: return self.get_payload_folder() / template_folder / "elrond.json" diff --git a/erdpy/testnet/config.py b/erdpy/testnet/config.py index 3535b448..62dfe4a3 100644 --- a/erdpy/testnet/config.py +++ b/erdpy/testnet/config.py @@ -137,15 +137,15 @@ def node_config_source(self) -> Path: return self.node_source() / 'cmd' / 'node' / 'config' def node_source(self) -> Path: - path = self.folders['elrond_go'] + path = self.folders['mx_chain_go'] assert isinstance(path, Path) return path def proxy_source(self) -> Path: - return self.folders['elrond_proxy_go'] + return self.folders['max_chain_proxy_go'] def proxy_config_source(self): - return self.folders['elrond_proxy_go'] / 'cmd' / 'proxy' / 'config' + return self.folders['mx_chain_proxy_go'] / 'cmd' / 'proxy' / 'config' def validator_key_files(self): for config_folder in self.validator_config_folders(): @@ -308,10 +308,10 @@ def default(cls): 'wasm_vm_binary': False } config['folders'] = { - 'elrond_go': - '{ELRONDSDK}/elrond_go/{TAG}/elrond-go-{NOvTAG}', - 'elrond_proxy_go': - '{ELRONDSDK}/elrond_proxy_go/{TAG}/elrond-proxy-go-{NOvTAG}', + 'mx_chain_go': + '{ELRONDSDK}/mx_chain_go/{TAG}/mx-chain-go-{NOvTAG}', + 'mx_chain_proxy_go': + '{ELRONDSDK}/mx_chain_proxy_go/{TAG}/mx-chain-proxy-go-{NOvTAG}', } config['metashard'] = { 'consensus_size': 1, diff --git a/erdpy/testnet/setup.py b/erdpy/testnet/setup.py index 08b7e67d..878fa460 100644 --- a/erdpy/testnet/setup.py +++ b/erdpy/testnet/setup.py @@ -13,7 +13,7 @@ logger = logging.getLogger("testnet") -DEPENDENCY_KEYS = ["elrond_go", "elrond_proxy_go", "testwallets"] +DEPENDENCY_KEYS = ["mx_chain_go", "mx_chain_proxy_go", "testwallets"] def install_dependencies(): @@ -248,7 +248,7 @@ def build_binaries(testnet_config: TestnetConfiguration): # Now copy the binaries to the testnet folder wasm_vm_version = _get_wasm_vm_version(testnet_config) - libwasmer_path = path.join(golang.get_gopath(), f"pkg/mod/github.com/!elrond!network/arwen-wasm-vm@{wasm_vm_version}/wasmer/libwasmer_darwin_amd64.dylib") + libwasmer_path = path.join(golang.get_gopath(), f"pkg/mod/github.com/!elrond!network/wasm-vm@{wasm_vm_version}/wasmer/libwasmer_darwin_amd64.dylib") shutil.copy(seednode_folder / "seednode", testnet_config.seednode_folder()) if workstation.get_platform() == "osx": @@ -268,6 +268,6 @@ def build_binaries(testnet_config: TestnetConfiguration): def _get_wasm_vm_version(testnet_config: TestnetConfiguration): go_mod = testnet_config.node_source() / "go.mod" lines = utils.read_lines(go_mod) - line = next(line for line in lines if "github.com/ElrondNetwork/arwen-wasm-vm" in line) + line = next(line for line in lines if "github.com/ElrondNetwork/wasm-vm" in line) parts = line.split() return parts[1] diff --git a/erdpy/tests/test_cli_testnet.sh b/erdpy/tests/test_cli_testnet.sh index ae90204c..800f5bda 100644 --- a/erdpy/tests/test_cli_testnet.sh +++ b/erdpy/tests/test_cli_testnet.sh @@ -8,7 +8,7 @@ testStart() { cleanSandbox mkdir -p ${SANDBOX}/testnet_foo - ${ERDPY} config set dependencies.elrond_proxy_go.tag fix-node-ref + ${ERDPY} config set dependencies.mx_chain_proxy_go.tag fix-node-ref ${ERDPY} testnet prerequisites cp ./testdata/testnets/testnet_foo.toml ${SANDBOX}/testnet_foo/testnet.toml diff --git a/erdpy/tests/test_playground_proxy.py b/erdpy/tests/test_playground_proxy.py index d1dc07b4..a9098757 100644 --- a/erdpy/tests/test_playground_proxy.py +++ b/erdpy/tests/test_playground_proxy.py @@ -3,7 +3,7 @@ import requests -class TestPlaygroundElrondProxy(unittest.TestCase): +class TestPlaygroundProxy(unittest.TestCase): @unittest.skip('manual run only') def test_do_request(self): # use a valid proxy address diff --git a/erdpy/tests/test_testnet.py b/erdpy/tests/test_testnet.py index 0a9c0896..cce9f4a1 100644 --- a/erdpy/tests/test_testnet.py +++ b/erdpy/tests/test_testnet.py @@ -56,19 +56,19 @@ def test_merge_configs(): def test_init(): data = dict() data['folders'] = { - 'elrond_go': '{ELRONDSDK}/bar', - 'elrond_proxy_go': '{ELRONDSDK}/foobar', + 'mx_chain_go': '{ELRONDSDK}/bar', + 'mx_chain_proxy_go': '{ELRONDSDK}/foobar', 'testnet': '/some/where/mytestnet', } sdk_folder = workstation.get_tools_folder() - node_folder = erdpy.config.get_dependency_parent_directory('elrond_go') + node_folder = erdpy.config.get_dependency_parent_directory('mx_chain_go') (node_folder / 'v1.2.3').mkdir(parents=True, exist_ok=True) - proxy_folder = erdpy.config.get_dependency_parent_directory('elrond_proxy_go') + proxy_folder = erdpy.config.get_dependency_parent_directory('mx_chain_proxy_go') (proxy_folder / 'v2.3.4').mkdir(parents=True, exist_ok=True) testnet_config = config.TestnetConfiguration(data) - assert testnet_config.folders["elrond_go"] == sdk_folder / "bar" - assert testnet_config.folders["elrond_proxy_go"] == sdk_folder / "foobar" + assert testnet_config.folders["mx_chain_go"] == sdk_folder / "bar" + assert testnet_config.folders["mx_chain_proxy_go"] == sdk_folder / "foobar" assert testnet_config.folders["testnet"] == Path("/some/where/mytestnet") diff --git a/erdpy/wallet/core.py b/erdpy/wallet/core.py index ce85e86d..efcb5a37 100644 --- a/erdpy/wallet/core.py +++ b/erdpy/wallet/core.py @@ -10,7 +10,7 @@ BIP39_SALT_MODIFIER = "mnemonic" BIP39_PBKDF2_ROUNDS = 2048 BIP32_SEED_MODIFIER = b'ed25519 seed' -ELROND_DERIVATION_PATH = [44, 508, 0, 0] +MULTIVERSX_DERIVATION_PATH = [44, 508, 0, 0] HARDENED_OFFSET = 0x80000000 BITS_PER_BYTE = 8 BIP39_WORD_COUNT = 2048 @@ -60,7 +60,7 @@ def generate_mnemonic() -> str: # BIP39 algorithm steps from: # https://medium.com/coinmonks/mnemonic-generation-bip39-simply-explained-e9ac18db9477 # Javascript implementations: -# https://github.com/ElrondNetwork/elrond-sdk-erdjs/blob/main/src/walletcore/mnemonic.ts +# https://github.com/multiversx/mx-sdk-erdjs-walletcore/blob/main/src/mnemonic.ts # https://github.com/bitcoinjs/bip39/blob/5faee2c17b2195f30b03cb125df68c20d7dd584b/src/index.js#L108 def generate_mnemonic_from_entropy(entropy_bytes: bytes) -> str: with open_text("erdpy.wallet", "bip39words.txt") as words_file: @@ -99,7 +99,7 @@ def bip39seed_to_master_key(seed): def bip39seed_to_secret_key(seed, account_index=0): key, chain_code = bip39seed_to_master_key(seed) - for segment in ELROND_DERIVATION_PATH + [account_index]: + for segment in MULTIVERSX_DERIVATION_PATH + [account_index]: key, chain_code = _ckd_priv(key, chain_code, segment + HARDENED_OFFSET) return key diff --git a/erdpy/wallet/keyfile.py b/erdpy/wallet/keyfile.py index cdc82579..98309b74 100644 --- a/erdpy/wallet/keyfile.py +++ b/erdpy/wallet/keyfile.py @@ -103,7 +103,7 @@ def make_cyphertext(backend: Any, key: bytes, iv: bytes, secret_key: str): # erdjs implementation: -# https://github.com/ElrondNetwork/elrond-sdk-erdjs/blob/main/src/walletcore/userWallet.ts +# https://github.com/multiversx/mx-sdk-erdjs-walletcore/blob/main/src/userWallet.ts def format_key_json(uid: str, pubkey: str, iv: bytes, ciphertext: bytes, salt: bytes, mac: bytes) -> Any: address = accounts.Address(pubkey) diff --git a/examples/airdrop.py b/examples/airdrop.py deleted file mode 100644 index bf9107cc..00000000 --- a/examples/airdrop.py +++ /dev/null @@ -1,66 +0,0 @@ - -import logging -from argparse import ArgumentParser -from pathlib import Path -from typing import cast - -from erdpy.accounts import Account, Address -from erdpy.accounts_repository import AccountsRepository -from erdpy.proxy import ElrondProxy -from erdpy.proxy.core import ElrondProxy -from erdpy.transactions import BunchOfTransactions, Transaction - - -def main(): - """ - cd elrond-sdk-erdpy - export PYTHONPATH=. - python3 ./examples/airdrop.py \ - --proxy=https://testnet-gateway.elrond.com \ - --accounts=~/elrondsdk/testwallets/latest/users \ - --sender=erd1qyu5wthldzr8wx5c9ucg8kjagg0jfs53s8nr3zpz3hypefsdd8ssycr6th\ - --value=1000000000000000000 - """ - - logging.basicConfig(level=logging.ERROR) - - parser = ArgumentParser() - parser.add_argument("--proxy", required=True) - parser.add_argument("--accounts", required=True) - parser.add_argument("--sender", help="sender address", required=True) - parser.add_argument("--value", type=int, help="value, as a number (atoms of EGLD)") - args = parser.parse_args() - - proxy = ElrondProxy(args.proxy) - network = proxy.get_network_config() - accounts = AccountsRepository.create_from_folder(Path(args.accounts)) - sender = cast(Account, accounts.get_account(Address(args.sender))) - sender.sync_nonce(proxy) - receivers = [account for account in accounts.get_all() if account.address.bech32() != sender.address.bech32()] - - print("Sender", sender.address, "nonce", sender.nonce) - - transactions: BunchOfTransactions = BunchOfTransactions() - - for account in receivers: - transaction = Transaction() - transaction.nonce = sender.nonce - transaction.sender = sender.address.bech32() - transaction.receiver = account.address.bech32() - transaction.value = str(args.value) - transaction.gasPrice = network.min_gas_price - transaction.gasLimit = 50000 - transaction.chainID = network.chain_id - transaction.version = network.min_tx_version - transaction.sign(sender) - sender.nonce += 1 - - transactions.add_prepared(transaction) - - num, hashes = transactions.send(proxy) - print(f"Sent {num} transactions:") - print(hashes) - - -if __name__ == "__main__": - main() diff --git a/examples/bytecode/answer.wasm b/examples/bytecode/answer.wasm deleted file mode 100755 index 3ed833dba9d0a4364bd3094a7abd3b6b18578c6d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 111 zcmWN;u?~VT6a~Pp@eUXvvz#-@+z?Wf{IJ`;ncX!~c=glr5*$WN*GF=GNZN(?)CH{etZ+Hi H+aK%?h$I&s diff --git a/examples/bytecode/counter.wasm b/examples/bytecode/counter.wasm deleted file mode 100755 index 4f31dbb4b4199cd1d4c3a906ec86a710182ff30d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 335 zcmaKly-UPE6vSutBbRdvBcg?s_y=es_KDbuf**Z?x1K4INU{imWTVw#<)7?EFJd81 zGmqcQdk;ld5de2oF1_#RbKyPvoIP?tWK!DtX{)T=$#LhJwpiNhU=|p8@|&MG#R43$ z`NH>QU3L!;QY#sxG#^Q7Nr)(>XZo>HW_F~b%2rMLETF=IgPfQ3U27{_JE-}>PP3Lv z>kw_cQ*9$1R>OdFmN6NEuxAd*exj2nuVa?+ Date: Mon, 9 Jan 2023 10:21:23 +0200 Subject: [PATCH 3/6] delete changelog and fixes --- erdpy/CHANGELOG.md | 654 ----------------------------------------- erdpy/config.py | 4 +- erdpy/testnet/setup.py | 2 +- 3 files changed, 3 insertions(+), 657 deletions(-) delete mode 100644 erdpy/CHANGELOG.md diff --git a/erdpy/CHANGELOG.md b/erdpy/CHANGELOG.md deleted file mode 100644 index 9d2cf064..00000000 --- a/erdpy/CHANGELOG.md +++ /dev/null @@ -1,654 +0,0 @@ -# Change Log - -All notable changes will be documented in this file. - -Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file. - -## [Unreleased] - - TBD - -## [3.0.3] - - Fixes after repository migrations - -## [3.0.2] - - Fixes after repository migrations - -## [3.0.1] - - [Contract verify: fix CLI arguments & json request](https://github.com/ElrondNetwork/elrond-sdk-erdpy/pull/171) - -## [3.0.0] - - [Blockatlas cleanup](https://github.com/ElrondNetwork/elrond-sdk-erdpy/pull/161) - - [Deprecate *.wat and *.imports.json generation (replaced by elrond-wasm-rs's build pipeline)](https://github.com/ElrondNetwork/elrond-sdk-erdpy/pull/162) - - [Erdpy cli contract verify](https://github.com/ElrondNetwork/elrond-sdk-erdpy/pull/163) - - [Reproducible builds endpoint for erdpy cli](https://github.com/ElrondNetwork/elrond-sdk-erdpy/pull/164) - -## [2.1.0] - - [Bypass EEI checks, by default](https://github.com/ElrondNetwork/elrond-sdk-erdpy/pull/159) - -## [2.0.4] - - Fix resolving latest release of Github repositories - -## [2.0.3] - - [Hot fix: Rust env for contract reports is missing system PATH](https://github.com/ElrondNetwork/elrond-sdk-erdpy/pull/154) - -## [2.0.2] - - [Fix environment variables for Rust](https://github.com/ElrondNetwork/elrond-sdk-erdpy/pull/153) - -## [2.0.1] - - [Fix erdpy testnet config](https://github.com/ElrondNetwork/elrond-sdk-erdpy/pull/150) - - [Fix tests](https://github.com/ElrondNetwork/elrond-sdk-erdpy/pull/149) - - [Fix test replacement rules](https://github.com/ElrondNetwork/elrond-sdk-erdpy/pull/148) - -## [2.0.0] - - [Show password prompt if no passfile specificied](https://github.com/ElrondNetwork/elrond-sdk-erdpy/pull/144) - -## [1.5.2] - - [Fix build arguments for report creator](https://github.com/ElrondNetwork/elrond-sdk-erdpy/pull/143) - -## [1.5.1] - - [Pass contract build options to report creator](https://github.com/ElrondNetwork/elrond-sdk-erdpy/pull/142) - -## [1.5.0] - - [Improve "contract build" for Rust projects](https://github.com/ElrondNetwork/elrond-sdk-erdpy/pull/140) - -## [1.4.0] - - [Add `ledgercomm[hid]`](https://github.com/ElrondNetwork/elrond-sdk-erdpy/pull/139) - -## [1.3.3] - - [Pin cryptography](https://github.com/ElrondNetwork/elrond-sdk-erdpy/pull/137) - -## [1.3.2] - - [Do not copy test wallets into the newly created contract (not necessary anymore)](https://github.com/ElrondNetwork/elrond-sdk-erdpy/pull/134) - -## [1.3.1] - - [Re-add the pattern erdpy/wallet/*.txt in MANIFEST.in. Was removed by mistake in a previous release.](https://github.com/ElrondNetwork/elrond-sdk-erdpy/pull/133) - -## [1.3.0] - - [Prepare integration with erdjs-snippets (from templates)](https://github.com/ElrondNetwork/elrond-sdk-erdpy/pull/126) - - [Move test wallets to a separate repository. Handle them as an erdpy dependency.](https://github.com/ElrondNetwork/elrond-sdk-erdpy/pull/127) - - [Fix log for builds using absolute paths.](https://github.com/ElrondNetwork/elrond-sdk-erdpy/pull/128) - - [CLI output builder: remove deprecated fields.](https://github.com/ElrondNetwork/elrond-sdk-erdpy/pull/129) - -## [1.2.3] - - [Fix activation flag check, fix flag name](https://github.com/ElrondNetwork/elrond-sdk-erdpy/pull/123) - - [Fix reference to libwasmer (referenced by mandos-test)](https://github.com/ElrondNetwork/elrond-sdk-erdpy/pull/124) - -## [1.2.2] - - [Add (update) examples of using erdpy in Python scripts. Refactoring.](https://github.com/ElrondNetwork/elrond-sdk-erdpy/pull/120) - - [Allow "str:" and "0x" as contract arguments, as well](https://github.com/ElrondNetwork/elrond-sdk-erdpy/pull/121) - -## [1.2.1] - 07.03.2022 - - [Bugfix: fix functions in EEI registry](https://github.com/ElrondNetwork/elrond-sdk-erdpy/pull/119) - - [Bit of cleanup (remove deprecated files / functionality)](https://github.com/ElrondNetwork/elrond-sdk-erdpy/pull/113) - -## [1.2.0] - 07.03.2022 - - [On contract builld, reveal imported functions and check compatibility](https://github.com/ElrondNetwork/elrond-sdk-erdpy/pull/111) - -## [1.1.0] - 01.03.2022 - - [Add reports: contract sizes and twiggy symbol checks](https://github.com/ElrondNetwork/elrond-sdk-erdpy/pull/106) - - [Add `--recursive` option on contract build](https://github.com/ElrondNetwork/elrond-sdk-erdpy/pull/104) - - [Local testnet: minor refactoring, and remove `*:TRACE` from the default log-level](https://github.com/ElrondNetwork/elrond-sdk-erdpy/pull/103) - - [Transaction simulation & cost simulation: fix & redesign](https://github.com/ElrondNetwork/elrond-sdk-erdpy/pull/102) - -## [1.0.25] - 02.02.2022 - - Remove old & deprecated, experimental code related to the Elrond IDE - - Fix `erdpy account get-transactions` (handle transactions with no data field) - - Fix link in documentation - - Fix build (test) issues on Github Actions by setting erdpy's `github_api_token` - - Added caching for the github releases URL when creating projects from templates in order to avoid rate limit errors - - Fix issue with project creation when using the `crowdfunding-esdt` template due to dependencies - - Add `readable` and `payable_by_sc` code metadata flags - - `erdpy contract clean` fix - the `meta/target` folder is removed - -## [1.0.24] - 16.12.2021 - - Refactor and fix Ledger signing - - Fix erdpy-up `venv` installation on Ubuntu - - Remove tests for ERC20 contracts, they have been deprecated - -## [1.0.23] - 29.11.2021 - - Fix - when specifying `latest` for a dependency, get the highest semantic version instead of the most recent release - - Fix github actions to run `pytest` tests as well - -## [1.0.22] - 22.11.2021 - - Fix the patching of the `meta` subproject - - Add a check when signing transactions so that the gas limit is below the maximum allowed - - Add `--from-branch` option for `erdpy-up.py` - - Add github actions check for MacOS - - Update help strings and `CLI.md` - -## [1.0.21] - 01.11.2021 - - New command `erdpy wallet new`, which generates a new wallet mnemonic and optionally saves it to JSON or PEM - - Add support for Rust contract `meta` crates - - Update reference to the renamed VM repository (VM dependency is now named `vmtools`) - - Change `erdpy deps install all` to avoid installing / overwriting non-repository dependencies, e.g. Rust, LLVM, Go - - Update help strings and `CLI.md` - -## [1.0.20] - 26.10.2021 - - Bugfix by [phanletrunghieu](https://github.com/phanletrunghieu): use $PATH in `erdpy-up` - - Bugfix by [x2ocoder](https://github.com/x2ocoder): add missing `enable_epochs` configurations - - Dependency tags now accept `latest` - - New optional configuration value `github_api_token` for querying latest versions from Github - - The command `erdpy deps install` now accepts `all` as an argument - - More fixes for `erdpy testnet` - -## [1.0.19] - 05.10.2021 - - Bugfix by [MWFIAE](https://github.com/MWFIAE): add missing `enable_epochs` configurations - -## [1.0.18] - 14.09.2021 - - Load a local `erdpy.json` file when running `erdpy` commands, containing default values for CLI options per project - - Bugfix by [MWFIAE](https://github.com/MWFIAE): correctly verify the value of the `--bytecode` argument - - Bugfix by [MWFIAE](https://github.com/MWFIAE): `QueryResult` objects are now properly JSON-serializable - - Add more output information after building and deploying contracts - - Improve error reporting to standard output - - Enable `mypy` checking as a GitHub action - - Add and fix more type hints for `mypy` - -## [1.0.16] - 27.08.2021 - - Merge branch `legolas-addons` - - Fix `erdpy testnet` to work with recent changes in `elrond-go` - - Add more type hints for `mypy` - - Many small improvements - -## [1.0.12] - 22.03.2021 - - Minor fixes to the configuration profiles support - - Dependency `arwentools` is now built locally, instead of fetching precompiled binaries - -## [1.0.11] - 12.03.2021 - - Update commands for testnet in order to work with the development and master elrond-go branch - - Update the proxy config for testnet in order to have all the api routes active - - Added new commands for validator - - Fix bug with the command add-nodes for staking-provider - - Add --wait-result flag for erdpy tx new cli command. - -## [1.0.10] - 25.02.2021 - - [Fixed a bug in the testnet setup process when creating the config for the proxy app #213](https://github.com/ElrondNetwork/elrond-sdk/pull/213) - -## [1.0.9] - 29.01.2021 - - [Multiple config templates #152](https://github.com/ElrondNetwork/elrond-sdk/pull/152). One can now `switch` between different **configuration** profiles. - - [Refactor validator.pem parser, allow lookup by index #126](https://github.com/ElrondNetwork/elrond-sdk/pull/126). - - [erdpy contract build - naming fix, extra CLI options #161](https://github.com/ElrondNetwork/elrond-sdk/pull/161). - -## [1.0.8] - 25.01.2021 - - Fix flags for phase 3 features #162. - -## [1.0.7] - 19.01.2021 - - Update reference to newer Arwentools (Mandos). - -## [1.0.6] - 15.01.2021 - - Add commands for the delegation manager contract. - - Added commands for DNS. Tests for DNS CLI. - - Added `--sender-username` and `--receiver-username` parameters. - - For Rust projects, run ABI generator upon building the WASM file. - - For Rust projects, patch contract templates wrt. ABI module. - - Cache templates repository (30 seconds). - - Add github workflow for erdpy. - - Optimize running time for tests, build time (for rust projects). - - Add PIP update prior installing dependencies #136 @tebayoso (PR from community). - - `erdpy testnet` - enabled Phase 3 features. - - `erdpy testnet`: Fixes for MacOS, enable log-save for Proxy. - -## [1.0.3] - 28.12.2020 - - `erdpy contract new`: Fix typo (`crate` / `create`). - - `erdpy contract new`: remove `path` of `dev-dependencies`, for rust templates. - - `erdpy contract new`: remove debug-related logic (not needed anymore). - -## [1.0.2] - 28.12.2020 - - Update reference to templates. - -## [1.0.1] - 21.12.2020 - - Update reference to templates. - -## [1.0.0] - 16.12.2020 - - Update reference to templates. - -## [0.9.9] - 14.12.2020 - - Update reference to templates, to arwentools. - - Handle empty query response. - - Remove some redundant logging. - - Automatically copy devnet wallets into the project (at `contract new`). - -## [0.9.8] - 10.12.2020 - - Fix devnet config wrt. latest node changes. - - Fix path to templates (for contract new). - -## [0.9.7] - 03.12.2020 - - Refactor (mostly around validator commands). - - Add "send", "simulate" for `validator` commands. - - Fix `staking.py` example. - - Add `Address.is_contract_address()`. - - Change testnet URL. - - Fix tests, cleanup test data. - -## [0.9.5] - 28.10.2020 - - Add dependency tag for elrond-wasm-rs. - -## [0.9.4] - 27.10.2020 - - Minor fix for Rust templates. - -## [0.9.3] - 26.10.2020 - - Add better output for simulated deployments. - -## [0.9.2] - 26.10.2020 - - Do not build `.hex` file anymore at `contract build`. - - Patch field `name` in contract templates / mandos tests. - - Patch logging and log-level for local testnet. Include `arwen` logs. - - Optimize local testnet: **no observers, only 4 DNS contracts, less waiting time.** - - Fix `testnet clean` (when folder is missing). - - Implement global scope. Initialize `chainID` and `proxy` parameters from `testnet.toml`, if any. - - Add `erdpy data` sub-command to parse files, store and load key-value pairs. Useful for IDE snippets, but not limited to. - - Pretty handling of `Ctrl+C`, overall. - - Reference newest **Mandos**. - - For NodeJS dependency, add a symlink to latest version. Set `env` for nodejs execution. Will be used for `erdtestjs` etc. - - Prettier dump of `account` json (`erdpy get account`). - - Support `omit-fields` parameter (when dumping) for `account get` and `tx get`. - -## [0.9.1] - 15.10.2020 - - Adjust `erdpy validator` commands to use the `MCL signer` (external component). - - Fix `erdpy account` with flags `--nonce, --balance`. - - Possible fix for setup / installation: https://github.com/ElrondNetwork/elrond-sdk/issues/58. - -## [0.8.9] - 09.10.2020 - - Minor `erdpy-up` improvements. - - Minor `erdpy testnet ...` fixes regarding the patched configuration of the Node (`config.toml`). - - Reference newest `arwentools`. - - Fix response casing for `contract query`. - -## [0.8.7] - 29.09.2020 - - Allow one to start a local testnet via `erdpy testnet ...` commands. - - Simulate transactions via `--simulate` flag (both regular and smart contract transactions). - - Rust build - fix name of binary artifact ("-" vs. "_"). - -## [0.8.5] - 14.09.2020 - - Fix templates patching to work with elrond-wasm `0.6.0`. - - Update build with respect to elrond-wasm `0.6.0`. - - Update reference to newest Mandos `v0.3.35`, update tests runner. - - Remove dependency on `list_api.txt` for C projects. - - Trim whitespace for "wallet derive --mnemonic". - - Fix `erdpy validator` commands (were broken upon refactoring). - -## [0.8.3] - 12.08.2020 - - Fix proxy requests, implement `hyperblock` route. - -## [0.8.2] - 06.08.2020 - - Strip password for keyfile (remove left & right spaces, newlines) - - Allow one to specify path to WASM (bytecode) for `contract deploy` and `contract upgrade` - - Update reference to Arwen Tools - - Allow sending SC transactions in offline mode (`--send` defaults to `false`). - - Allow multi-pem files (selection via `--pem-index` parameter). - - -## [0.8.1] - 29.07.2020 - - - Add SDK helpers to generate relayed transactions. - -## [0.8.0] - 26.07.2020 - - - Updated signing procedure with respect to the `data` field (which is now base64-encoded) - - Redesigned the CLI for `validator stake` - - Refactoring and design improvements - - -**Note that below, the changelog is in chronological order. It will be soon updated to be in inverse chronological order (how it should have been in the first place).** - -## [0.0.4] - -- Initial release - -## [0.0.5] - -### Fixed - -- Include **psutil** in the list of dependencies in `setup.py`. -- Handle missing / `none` arguments at deploy. -- Default to current directory in `build` command. -- Allow paths starting with `~` when specifying PEM. -- Forward gas limit, gas price parameters correctly. - -### Changed - -- Improve example for testnet to allow query after deploy. - -## [0.0.6] - -### Fixed - -- Default to current directory in `build` command. - -## [0.0.7] - -### Added - -- Enabled test runner: `erdpy test --wildcard='*'` - -## [0.0.8] - -### Fixed - -- Set `LD_LIBRARY_PATH` before executing `nodedebug` and `testrunner`. - -## [0.0.9] - -### Fixed - -- Fixed passing environment variables to test runner. - -## [0.1.0] - -### Fixed - -- Fixed node-debug stdout & stderr decode. - -### Other - -- Updated reference to node-debug. -- SOLL migration in progress (Solidity build does not work yet). - -## [0.1.1] - -### Fixed - -- Fixed Solidity / SOLL buildchain. - -## [0.1.2] - -### Fixed - -- Default to current directory for `erdpy deploy`. - -## [0.1.3] - -### Fixed - -- Fix passing arguments for command `erdpy call`. - -## [0.1.4] - -### Fixed - -- Fix passing arguments for command `erdpy query`. - -## [0.1.5] - -### Fixed - -- For MacOS `chmod +x` upon downloading SOLL, nodedebug. - -## [0.1.6] - -### Fixed - -- Downloads performed using `requests` module (certificate errors on MacOS otherwise). - -## [0.1.7] - -### Fixed - -- Node-debug build for MacOS. - -### Other - -- Updated reference to node-debug. - -## [0.1.9] - -### Fixed - -- Transaction signing - updated to **Ed25519** -- Removed **node-debug** from the testnet flows (deployment and execution of smart contracts) -- Fixed contract project generation from Rust templates -- Minor fixes on the build flow. - -### Other - -- Temporarily disabled node-debug interaction (node-debug's place will be soon taken by a debug version of Arwen VM) -- Added extra command to prepare and send transactions against the testnet -- Added extra examples. - -## [0.2.0] - -### Fixed - -- Fixed getting metrics from testnet. - -### Other - -- Temporarily disabled transaction costs estimators. - -## [0.2.1] - -### Fixed - -- Fixed reference to pycryptodomex. - -## [0.2.2] - -### Fixed - -- Fixed (improved) handling of proxy request errors. - -## [0.2.3] - -### Fixed - -- Fixed CPP compilation support. - -## [0.2.4] - -### Fixed - -- Dependency to psutils. - -### Added - -- Extra CLI command to prepare and send transaction. - -## [0.2.5] - -### Fixed - -- Format of "transaction.data" field. - - -## [0.2.6] - -### Fixed - -- Upgradeable smart contracts. - -## [0.2.7] - -### Other - -- Implement bech32 addresses. - -## [0.2.8] - -### Fixed - -- Fixed calls to estimators. - -## [0.2.9] - -### Fixed - -- Adjust reference to the new JSON testing tool. -- Other minor fixes. - -## [0.3.0] - -### Fixed - -- Fix path to WASM binary (for rust projects). -- Fix build of rust projects (trim size of artifact). - -## [0.3.1], [0.3.2] - -### Fixed - -- Fix path to contract binary within JSON tests. -- Fix templates download by deleting the "templates" folder at first. - -## [0.3.3] - -### Fixed - -- Display address of smart contract upon deploy -- Improve tests CLI -- Copy build artifacts to "output" folder - -## [0.3.4] - -### Fixed - -- Extra exported function for C builds - -## [0.3.5] - -### Features - -- Stake, UnStake, UnBound, UnJail, ChangeRewardAddress - -## [0.3.6] - -### Fixed - -- Extra exported function for C builds - -## [0.3.7] - -### Fixed - -- Serialization algorithm used for signing ("data as string") -- Prettier CLI - -## [0.3.8] - -### Fixed - -- Long description for setup (temporary workaround). - -## [0.3.9] - -### Fixed - -- Add `claim` function for validators - -## [0.4.0] - -### Fixed - -- Fixed action of CLI / network. - -## [0.4.1] - -## [0.4.2] - -### Fixed - -- Fixed passing arguments for stake. - -## [0.4.3] - -### Features - -- First implementation of the transactions dispatcher. - -## [0.4.4] - -### Features - -- Fix packaging. - - -## [0.4.5] - -### Features - -- Fix gas estimators for staking. -- Add mnemonic to PEM converter. - - -## [0.4.6] - -### Fixed - -- Fixed `new` command (default directory). -- Improved `deploy` command (add parameter `outfile`). - -## [0.4.7] - -### Fixed - -- Mark `gas-limit` field as required. - -## [0.4.8] - -### Fixed - -- Update reference to `mandos`, fix templating for tests. - - -## [0.4.9] - 24.06.2020 - -### Fixed - -- Improved CLI for contracts (added CLI group of actions) -- Fixed response handling for `send-multiple` - -## [0.5.0] - 25.06.2020 - -### Fixed - -- Fixed list of `elrondei` functions. - -## [0.5.1] - 25.06.2020 - -### Fixed - -- Fix passing `--nonce` argument to validator commands. -- Add flag `--recall-nonce`, as an alternative to specifying the `--nonce=42`. - -### Other - -- Deprecated commands `stake-prepare` and `stake-send`. Will be replaced soon by `stake --prepare` and `tx send`. - -## [0.7.0] - 13.07.2022 - - - Redesigned CLI for creating and broadcasting transactions (`erdpy tx`). - - Included `chainID` and `version` in transactions (erdpy, erdjs), updated signature accordingly. - - Allow provisioning of wallet JSON **key-file** as well, in addition to PEM files (which will be deprecated). Many thanks to [flyingbasalt](https://github.com/flyingbasalt/erdkeys). - - Redesign `erdpy-up` to use light Python virtual environments (`venv`). - - Allow options `--no-modiy-path` and `--exact-version` in `erdpy-up` - - Renamed some CLI commands (for `wallet`, for `tx`). - - Cleanup templating logic for Smart Contracts - moved some features to Elrond IDE. - - erdtestjs fixes and design improvements / refactoring. - - Completely redesigned dependency management (`erdpy deps`), improved associated CLI. - - Refactor and group (under `erdpy group`) validator-related commands. - - Improved CLI help, added descriptions. - - Do not receive mnemonic as parameter in `erdpy wallet derive`, but ask for user input instead. - - Add Clean command for Smart Contract projects. - - Create symlinks for `arwentools` binaries. - - Updated references to `arwentools` components (Mandos, Arwen Debug). - - Added CLI group `erdpy config`, which manages `~/elrondsdk/elrond.json`. - - Deprecated `~/ElrondSCTools`, which will be removed by `erdpy-up`. The new installation folder is `~/elrondsdk`. - - Require Python 3.8 on MacOS. - - Smart Contracts `query` - return as base64, hex, number. - - Require nonce for SC `deploy` & `call`. - - Removed .py SC interaction samples, moved to `sc-examples` `sc-examples-rs` repositories, so that they become available in Elrond IDE. - - Removed some deprecated code. - - `mypy`-related refactoring. - - Fix accounts CLI. Truncate data for "account get-transactions". - -## [0.7.1] - 13.07.2020 - -### Fixed - - - Installation of `rust` (was broken upon refactoring). - - Re-added command `erdpy contract test`. - - Throw error when bad input for `erdpy validator ...`. - -## [0.7.2] - 13.07.2020 - -### Fixed - - - Fixed call to `BunchOfTransactions`. diff --git a/erdpy/config.py b/erdpy/config.py index 4d74b767..8ba3c91f 100644 --- a/erdpy/config.py +++ b/erdpy/config.py @@ -154,8 +154,8 @@ def get_defaults() -> Dict[str, Any]: "txVersion": "1", "dependencies.vmtools.tag": "latest", "dependencies.mx_sdk_rs.tag": "latest", - "dependencies.vmtools.urlTemplate.linux": "https://github.com/multiversx/mx-vm-wasm-go/archive/{TAG}.tar.gz", - "dependencies.vmtools.urlTemplate.osx": "https://github.com/multiversx/mx-vm-wasm-go//archive/{TAG}.tar.gz", + "dependencies.vmtools.urlTemplate.linux": "https://github.com/multiversx/mx-chain-vm-go/archive/{TAG}.tar.gz", + "dependencies.vmtools.urlTemplate.osx": "https://github.com/multiversx/mx-chain-vm-go/archive/{TAG}.tar.gz", "dependencies.llvm.tag": "v9-19feb", # ide.elrond.com will be removed, TBD if clang will still be downloaded "dependencies.llvm.urlTemplate.linux": "https://ide.elrond.com/vendor-llvm/{TAG}/linux-amd64.tar.gz?t=19feb", diff --git a/erdpy/testnet/setup.py b/erdpy/testnet/setup.py index 878fa460..535fe780 100644 --- a/erdpy/testnet/setup.py +++ b/erdpy/testnet/setup.py @@ -268,6 +268,6 @@ def build_binaries(testnet_config: TestnetConfiguration): def _get_wasm_vm_version(testnet_config: TestnetConfiguration): go_mod = testnet_config.node_source() / "go.mod" lines = utils.read_lines(go_mod) - line = next(line for line in lines if "github.com/ElrondNetwork/wasm-vm" in line) + line = next(line for line in lines if "github.com/ElrondNetwork/arwen-wasm-vm" in line) parts = line.split() return parts[1] From 07b2c503d086987a24eea9a4d1554b0dc806c636 Mon Sep 17 00:00:00 2001 From: Alexandru Popenta Date: Mon, 9 Jan 2023 14:02:04 +0200 Subject: [PATCH 4/6] fix after review --- .github/workflows/erdpy-publish.yml | 5 +---- README.md | 3 --- erdpy/README.md | 16 ---------------- erdpy/_version.py | 2 +- erdpy/ledger/config.py | 6 +++--- erdpy/ledger/ledger_app_handler.py | 6 +++--- erdpy/ledger/ledger_functions.py | 8 ++++---- erdpy/projects/templates_repository.py | 4 ++-- erdpy/testnet/config.py | 2 +- erdpy/testnet/setup.py | 2 +- erdpy/wallet/core.py | 2 +- setup.py | 4 ++-- 12 files changed, 19 insertions(+), 41 deletions(-) delete mode 100644 erdpy/README.md diff --git a/.github/workflows/erdpy-publish.yml b/.github/workflows/erdpy-publish.yml index 48cad35a..2b7769a1 100644 --- a/.github/workflows/erdpy-publish.yml +++ b/.github/workflows/erdpy-publish.yml @@ -28,11 +28,8 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - echo " - [CHANGELOG](https://github.com/multiversx/mx-sdk-erdpy/blob/main/erdpy/CHANGELOG.md)" >> notes.txt - echo "" >> notes.txt - RELEASE_TAG=v$(python3 -c "import erdpy._version; print(erdpy._version.__version__);") - gh release create $RELEASE_TAG --title="$RELEASE_TAG" --generate-notes --notes-file=notes.txt + gh release create $RELEASE_TAG --title="$RELEASE_TAG" --generate-notes - name: Build and publish env: diff --git a/README.md b/README.md index 48461a6b..703a6055 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,3 @@ Python Command Line Tools for interacting with MultiversX. ## Distribution [erdpy-up](https://docs.multiversx.com/sdk-and-tools/erdpy/installing-erdpy/) and [PyPi](https://pypi.org/project/erdpy/#history) - -## CHANGELOG -[CHANGELOG](erdpy/CHANGELOG.md) diff --git a/erdpy/README.md b/erdpy/README.md deleted file mode 100644 index 7a0c63cb..00000000 --- a/erdpy/README.md +++ /dev/null @@ -1,16 +0,0 @@ -# Description -MultiversX Python Command Line Tools and SDK for interacting with the MultiversX Network (in general) and Smart Contracts (in particular). - -## Documentation -[docs.multiversx.com](https://docs.multiversx.com/sdk-and-tools/erdpy/erdpy/) - -[pkg.go.dev](https://pkg.go.dev/github.com/MultiversX/mx-sdk/erdgo) - -## CLI -[CLI](CLI.md) - -## Distribution -[erdpy-up](https://docs.multiversx.com/sdk-and-tools/erdpy/installing-erdpy/) and [PyPi](https://pypi.org/project/erdpy/#history) - -## CHANGELOG -[CHANGELOG](CHANGELOG.md) diff --git a/erdpy/_version.py b/erdpy/_version.py index 8d1c8625..ce1305bf 100644 --- a/erdpy/_version.py +++ b/erdpy/_version.py @@ -1 +1 @@ -__version__ = "3.0.3" +__version__ = "4.0.0" diff --git a/erdpy/ledger/config.py b/erdpy/ledger/config.py index e374f5e3..f9584006 100644 --- a/erdpy/ledger/config.py +++ b/erdpy/ledger/config.py @@ -1,12 +1,12 @@ -class MultiversXLedgerAppConfiguration: +class LedgerAppConfiguration: data_activated: bool account_index: int address_index: int version: str -def load_ledger_config_from_response(response: bytes) -> MultiversXLedgerAppConfiguration: - config = MultiversXLedgerAppConfiguration() +def load_ledger_config_from_response(response: bytes) -> LedgerAppConfiguration: + config = LedgerAppConfiguration() config.data_activated = False if response[0] == 0x01: diff --git a/erdpy/ledger/ledger_app_handler.py b/erdpy/ledger/ledger_app_handler.py index 2795b874..e0a536a9 100644 --- a/erdpy/ledger/ledger_app_handler.py +++ b/erdpy/ledger/ledger_app_handler.py @@ -1,7 +1,7 @@ from ledgercomm import Transport from erdpy.errors import LedgerError -from erdpy.ledger.config import load_ledger_config_from_response, MultiversXLedgerAppConfiguration +from erdpy.ledger.config import load_ledger_config_from_response, LedgerAppConfiguration SIGN_USING_HASH_VERSION = "1.0.11" CONNECTION_ERROR_MSG = "check if device is plugged in, unlocked and on MultiversX app" @@ -15,7 +15,7 @@ class Apdu: data: bytes -class MultiversXLedgerApp: +class LedgerApp: def __init__(self): try: self.transport = Transport(interface="hid", debug=False) # Nano S/X using HID interface @@ -48,7 +48,7 @@ def get_address(self, account_index=0, address_index=0) -> str: address = response_body.decode("utf-8") return address - def get_app_configuration(self) -> MultiversXLedgerAppConfiguration: + def get_app_configuration(self) -> LedgerAppConfiguration: self.transport.send(cla=0xed, ins=0x02, p1=0x00, p2=0x00, cdata=b"") sw, response = self.transport.recv() err = get_error(sw) diff --git a/erdpy/ledger/ledger_functions.py b/erdpy/ledger/ledger_functions.py index 710f65a7..a17b221b 100644 --- a/erdpy/ledger/ledger_functions.py +++ b/erdpy/ledger/ledger_functions.py @@ -1,5 +1,5 @@ import logging -from erdpy.ledger.ledger_app_handler import MultiversXLedgerApp +from erdpy.ledger.ledger_app_handler import LedgerApp TX_HASH_SIGN_VERSION = 2 TX_HASH_SIGN_OPTIONS = 1 @@ -13,7 +13,7 @@ def do_sign_transaction_with_ledger( address_index: int, sign_using_hash: bool ) -> str: - ledger_handler = MultiversXLedgerApp() + ledger_handler = LedgerApp() ledger_handler.set_address(account_index=account_index, address_index=address_index) logger.info("Ledger: please confirm the transaction on the device") @@ -24,7 +24,7 @@ def do_sign_transaction_with_ledger( def do_get_ledger_address(account_index: int, address_index: int) -> str: - ledger_handler = MultiversXLedgerApp() + ledger_handler = LedgerApp() ledger_address = ledger_handler.get_address(account_index=account_index, address_index=address_index) ledger_handler.close() @@ -32,7 +32,7 @@ def do_get_ledger_address(account_index: int, address_index: int) -> str: def do_get_ledger_version() -> str: - ledger_handler = MultiversXLedgerApp() + ledger_handler = LedgerApp() ledger_version = ledger_handler.get_version() ledger_handler.close() diff --git a/erdpy/projects/templates_repository.py b/erdpy/projects/templates_repository.py index 54e9356c..a6876e0d 100644 --- a/erdpy/projects/templates_repository.py +++ b/erdpy/projects/templates_repository.py @@ -59,8 +59,8 @@ def get_templates(self): return templates def is_template(self, subfolder: str) -> bool: - multiversx_json_file = self.get_metadata_file(subfolder) - return multiversx_json_file.is_file() + project_config_file = self.get_metadata_file(subfolder) + return project_config_file.is_file() def get_metadata_file(self, template_folder: str) -> Path: return self.get_payload_folder() / template_folder / "elrond.json" diff --git a/erdpy/testnet/config.py b/erdpy/testnet/config.py index 62dfe4a3..8f531b5a 100644 --- a/erdpy/testnet/config.py +++ b/erdpy/testnet/config.py @@ -142,7 +142,7 @@ def node_source(self) -> Path: return path def proxy_source(self) -> Path: - return self.folders['max_chain_proxy_go'] + return self.folders['mx_chain_proxy_go'] def proxy_config_source(self): return self.folders['mx_chain_proxy_go'] / 'cmd' / 'proxy' / 'config' diff --git a/erdpy/testnet/setup.py b/erdpy/testnet/setup.py index 535fe780..4fa0364b 100644 --- a/erdpy/testnet/setup.py +++ b/erdpy/testnet/setup.py @@ -248,7 +248,7 @@ def build_binaries(testnet_config: TestnetConfiguration): # Now copy the binaries to the testnet folder wasm_vm_version = _get_wasm_vm_version(testnet_config) - libwasmer_path = path.join(golang.get_gopath(), f"pkg/mod/github.com/!elrond!network/wasm-vm@{wasm_vm_version}/wasmer/libwasmer_darwin_amd64.dylib") + libwasmer_path = path.join(golang.get_gopath(), f"pkg/mod/github.com/!elrond!network/arwen-wasm-vm@{wasm_vm_version}/wasmer/libwasmer_darwin_amd64.dylib") shutil.copy(seednode_folder / "seednode", testnet_config.seednode_folder()) if workstation.get_platform() == "osx": diff --git a/erdpy/wallet/core.py b/erdpy/wallet/core.py index efcb5a37..e20a8014 100644 --- a/erdpy/wallet/core.py +++ b/erdpy/wallet/core.py @@ -10,7 +10,7 @@ BIP39_SALT_MODIFIER = "mnemonic" BIP39_PBKDF2_ROUNDS = 2048 BIP32_SEED_MODIFIER = b'ed25519 seed' -MULTIVERSX_DERIVATION_PATH = [44, 508, 0, 0] +BIP39_WALLET_DERIVATION_PATH = [44, 508, 0, 0] HARDENED_OFFSET = 0x80000000 BITS_PER_BYTE = 8 BIP39_WORD_COUNT = 2048 diff --git a/setup.py b/setup.py index aaa8dc80..06f8884e 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ with open("README.md", "r") as fh: long_description = "https://github.com/multiversx/mx-sdk-erdpy" -VERSION = "3.0.3" +VERSION = "4.0.0" try: with open('./erdpy/_version.py', 'wt') as versionfile: @@ -15,7 +15,7 @@ setuptools.setup( name="erdpy", version=VERSION, - description="MultiversX Smart Contracts Tools and Python SDK", + description="MultiversX Smart Contracts Tools", long_description=long_description, long_description_content_type="text/markdown", url="https://github.com/multiversx/mx-sdk-erdpy", From ae8945730a5802f73791a51cf3616a2ea372a0d8 Mon Sep 17 00:00:00 2001 From: Alexandru Popenta Date: Mon, 9 Jan 2023 14:05:46 +0200 Subject: [PATCH 5/6] fix import --- erdpy/cli_ledger.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/erdpy/cli_ledger.py b/erdpy/cli_ledger.py index e8cda0fe..804abc9d 100644 --- a/erdpy/cli_ledger.py +++ b/erdpy/cli_ledger.py @@ -1,4 +1,4 @@ -from erdpy.ledger.ledger_app_handler import MultiversXLedgerApp +from erdpy.ledger.ledger_app_handler import LedgerApp from erdpy import cli_shared import logging from typing import Any @@ -21,7 +21,7 @@ def setup_parser(subparsers: Any) -> Any: def print_addresses(args): - ledger_app = MultiversXLedgerApp() + ledger_app = LedgerApp() for i in range(args.num_addresses): address = ledger_app.get_address(0, i) print('account index = %d | address index = %d | address: %s' % (0, i, address)) @@ -29,6 +29,6 @@ def print_addresses(args): def print_version(args): - ledger_app = MultiversXLedgerApp() + ledger_app = LedgerApp() print("MultiversX App version: " + ledger_app.get_version()) ledger_app.close() From 83e70764f3ae5b847fae1705f35b100097fea078 Mon Sep 17 00:00:00 2001 From: Alexandru Popenta Date: Mon, 9 Jan 2023 14:12:16 +0200 Subject: [PATCH 6/6] fix variable name --- erdpy/wallet/core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erdpy/wallet/core.py b/erdpy/wallet/core.py index e20a8014..128c1c9b 100644 --- a/erdpy/wallet/core.py +++ b/erdpy/wallet/core.py @@ -99,7 +99,7 @@ def bip39seed_to_master_key(seed): def bip39seed_to_secret_key(seed, account_index=0): key, chain_code = bip39seed_to_master_key(seed) - for segment in MULTIVERSX_DERIVATION_PATH + [account_index]: + for segment in BIP39_WALLET_DERIVATION_PATH + [account_index]: key, chain_code = _ckd_priv(key, chain_code, segment + HARDENED_OFFSET) return key