diff --git a/README.md b/README.md
index d51a9ff9..6db1aa4c 100644
--- a/README.md
+++ b/README.md
@@ -64,22 +64,22 @@ Depending on the distro you are using will determine which `python3` package to
### DUNES installation on Linux
-This is the fastest way to get started. From the [latest release](https://github.com/AntelopeIO/DUNE/releases/latest) page, download DUNES `*.deb` file or visit the [release tags](https://github.com/AntelopeIO/DUNE/releases) page to download specific version of DUNES deb package.
+This is the fastest way to get started. From the [latest release](https://github.com/AntelopeIO/DUNES/releases/latest) page, download DUNES `*.deb` file or visit the [release tags](https://github.com/AntelopeIO/DUNES/releases) page to download specific version of DUNES deb package.
Once you have a `*.deb` file downloaded, you can install it as follows:
```bash
sudo apt-get update
-sudo apt-get install -y ~/Downloads/antelopeio-dunes*.deb
+sudo apt-get install -y ~/Downloads/dunes*.deb
```
Your download path may vary.
#### Alternative: DUNES installation using RPM package
-From the [latest release](https://github.com/AntelopeIO/DUNE/releases/latest) page, download DUNES `*.rpm` file.
+From the [latest release](https://github.com/AntelopeIO/DUNES/releases/latest) page, download DUNES `*.rpm` file.
Once you have a `*.rpm` file downloaded, you can install it as follows:
```bash
-sudo rpm -i ~/Downloads/antelopeio-dunes*.rpm
+sudo rpm -i ~/Downloads/dunes*.rpm
```
Your download path may vary.
@@ -107,7 +107,7 @@ $ echo "PATH=:$PATH" >> .bashrc
If you want to rebuild the DUNES image pick your preferred terminal application and input the following command:
```console
-/DUNES$ ./bootstrap.sh
+/DUNES$ ./bootstrap.sh
```
### Windows 10 & 11
@@ -133,19 +133,19 @@ Visit the download page for [Python 3](https://python.org/downloads). You should
Make sure you mark "Add Python to PATH" during installation.
After installation open `cmd.exe` and verify `python --version` returns current Python version.
-#### DUNE installation on Windows
+#### DUNES installation on Windows
1. Install [Chocolatey](https://docs.chocolatey.org/en-us/choco/setup).
-2. Download latest `*.nupkg` from [latest release](https://github.com/AntelopeIO/DUNE/releases/latest) page.
+2. Download latest `*.nupkg` from [latest release](https://github.com/AntelopeIO/DUNES/releases/latest) page.
3. Run PowerShell as administrator and go to the directory where your *`.nupkg` was downloaded.
4. Run following commands:
```
-choco uninstall antelopeio-dune -y
+choco uninstall dunes -y
choco install netfx-4.8 python311 docker-desktop -y
```
5. Now restart PowerShell as administrator again (so that `python` command could be executed) and run:
```
-choco install .\antelopeio-dunes.1.1.0.nupkg -y
+choco install .\dunes.1.1.0.nupkg -y
```
5. Restart your computer (this is because %PATH% has to be reloaded. In cmd.exe it is enough to run command `refreshenv`).
6. Open PowerShell / cmd.exe and try that following command works: `dunes.bat --version`.
@@ -284,7 +284,7 @@ This will build a given CMake app project. This command takes a directory to the
**--destroy-container**
This will destroy and remove the currently running container.
WARNING! This will delete all data that is running.
-This is useful if you need to update to a new version of DUNE or if you corrupt the container some how.
+This is useful if you need to update to a new version of DUNES or if you corrupt the container some how.
---
@@ -294,7 +294,7 @@ This will stop the currently running container.
---
**--start-container**
-This will start the `dune` container.
+This will start the `dunes` container.
---
@@ -381,7 +381,7 @@ The core concept of this utility is to abstract over Leap programs such as `node
As such some of the commands might seem restrictive. Please take note that if you find any of the commands to be too
restrictive then you can use the command `--` followed by whatever normal `cleos`, `nodeos`, CDT and OS commands that you need.
-When you run any command with DUNE, if a container has not been created yet it will automatically create one for you.
+When you run any command with DUNES, if a container has not been created yet it will automatically create one for you.
The command of `start-container` shouldn't necessarily be needed during normal operation.
A developer wallet is automatically created for you and is always unlocked
diff --git a/bootstrap.bat b/bootstrap.bat
index b58453cd..82450c03 100644
--- a/bootstrap.bat
+++ b/bootstrap.bat
@@ -1,4 +1,4 @@
@echo off
SET mypath=%~dp0
-docker build --no-cache -f Dockerfile.win -t dune %mypath%
+docker build --no-cache -f Dockerfile.win -t dunes %mypath%
diff --git a/bootstrap.sh b/bootstrap.sh
index 2ad09b28..f5b3c2cd 100755
--- a/bootstrap.sh
+++ b/bootstrap.sh
@@ -48,4 +48,4 @@ if [[ $(uname) == "Darwin" ]]; then
GROUP_ID=200
fi
-docker build --no-cache --build-arg USER_ID=0 --build-arg GROUP_ID="$GROUP_ID" $LEAP_ARGUMENT $CDT_ARGUMENT -f Dockerfile.unix -t dune "$SDIR"
+docker build --no-cache --build-arg USER_ID=0 --build-arg GROUP_ID="$GROUP_ID" $LEAP_ARGUMENT $CDT_ARGUMENT -f Dockerfile.unix -t dunes "$SDIR"
diff --git a/docs/PLUGIN.md b/docs/PLUGIN.md
index 89af90d7..1f182fc2 100644
--- a/docs/PLUGIN.md
+++ b/docs/PLUGIN.md
@@ -7,7 +7,7 @@ DUNES allows users to extend its functionality through the use of plugins. DUNES
2. In the aforementioned subdirectory you need to create script `main.py`.
3. `main.py` needs to define 3 functions:
1. `add_parsing(parser)` - function that receives instance of [argparse.ArgumentParser](https://docs.python.org/3/library/argparse.html). It is used to add new DUNES command parsing arguments.
- 2. (optionally) `set_dune(dune)` - function that receives instance of DUNES so the user could interact with DUNES. It might be stored for later usage if needed.
+ 2. (optionally) `set_dunes(dunes)` - function that receives instance of DUNES so the user could interact with DUNES. It might be stored for later usage if needed.
3. `handle_args(args)` - function that receives populated namespace returned by [ArgumentParser.parse_args](https://docs.python.org/3/library/argparse.html#argparse.ArgumentParser.parse_args). It is used to handle new DUNES command arguments.
@@ -15,17 +15,17 @@ DUNES allows users to extend its functionality through the use of plugins. DUNES
You can find example plugins in [plugin_example directory](../plugin_example/).
To test the example plugins, copy or symbolically link the contents of the [../plugin_example/](../plugin_example) directory into the [../src/plugin/](../src/plugin/) directory. This way, DUNES will automatically discover the new plugins.
-### dune_hello
+### dunes_hello
The simplest plugin, which adds `--hello` to DUNES commands. When command `dunes --hello` is executed then an example output is printed.
### account_setup
Plugin adds command `--bootstrap-account` to DUNES commands. When it is executed 3 example accounts are created: `alice`, `bob` and `cindy`.
Additionally the contract `eosio.token` is deployed to all above accounts.
-In this example you can see how `set_dune` function is being used to store `dune` instance and later use it to create and prepare accounts.
+In this example you can see how `set_dunes` function is being used to store `dunes` instance and later use it to create and prepare accounts.
## Implementation details
DUNES starts with auto-discovering the plugins in the `src/plugin` subdirectories and dynamically loading each `main.py` file. The functions from each plugin are then called in the following order:
1. `add_parsing(parser)` - this function is called first to add parsing arguments. Users can also initialize their plugin at this stage, however, it should be noted that at this point it is not known if the plugin will be used.
-2. (optionally) `set_dune(dune)` - if the user wants to interact with DUNES, they should store the DUNES object in this function.
+2. (optionally) `set_dunes(dunes)` - if the user wants to interact with DUNES, they should store the DUNES object in this function.
3. `handle_args(args)` - the user should check if their parsing arguments are being used and handle them in this function. This is the main function where the plugin does its job. The DUNES object is usually needed in this function.
diff --git a/docs/RELEASE.md b/docs/RELEASE.md
index 6b6943c1..7f02284e 100644
--- a/docs/RELEASE.md
+++ b/docs/RELEASE.md
@@ -1,7 +1,7 @@
# How to prepare new DUNES release?
## How to generate a package on Windows?
-1. Edit `packaging\antelopeio-dunes\antelopeio-dunes.nuspec` and edit the current version in XML tag `version`
+1. Edit `packaging\antelopeio-dunes\dunes.nuspec` and edit the current version in XML tag `version`
2. If you do not have yet [Chocolatey](https://chocolatey.org/) installed open Windows console as administrator.
Otherwise you can open Windows console as a regular user.
3. Go to `packaging` directory and run `generate_chocolatey.bat` (if you run it for the first time then Chocolatey will be installed)
@@ -14,8 +14,8 @@ Otherwise you can open Windows console as a regular user.
3. Run `./bootstrap.sh` in your DUNES directory
4. Change below `X.Y.Z` to your version and in DUNES directory run:
```
-docker tag dune ghcr.io/antelopeio/dune:latest
-docker push ghcr.io/antelopeio/dune:latest
-docker tag dune ghcr.io/antelopeio/dune:X.Y.Z
-docker push ghcr.io/antelopeio/dune:X.Y.Z
+docker tag dunes ghcr.io/antelopeio/dunes:latest
+docker push ghcr.io/antelopeio/dunes:latest
+docker tag dunes ghcr.io/antelopeio/dunes:X.Y.Z
+docker push ghcr.io/antelopeio/dunes:X.Y.Z
```
diff --git a/docs/man/dune.1 b/docs/man/dunes.1
similarity index 62%
rename from docs/man/dune.1
rename to docs/man/dunes.1
index 5b06e5b0..4a1f8702 100644
--- a/docs/man/dune.1
+++ b/docs/man/dunes.1
@@ -1,13 +1,13 @@
-.\" Automatically generated by Pandoc 2.5
+.\" Automatically generated by Pandoc 2.9.2.1
.\"
.TH "DUNES" "1" "April 04, 2023" "AntelopeIO" "Docker Utilities for Node Execution and Subsystems"
.hy
.SH NAME
.PP
-DUNES \- Docker Utilities for Node Execution.
+DUNES - Docker Utilities for Node Execution.
.SH SYNOPSIS
.PP
-\f[C]dunes [] [\-\- ]\f[R]
+\f[C]dunes [] [-- ]\f[R]
.SH DESCRIPTION
.PP
\f[B]DUNES\f[R] is a tool to abstract over Leap programs, CDT, and other
@@ -16,18 +16,18 @@ compiling smart contracts, running tests, and other tasks required to
develop smart contracts on Antelope blockchains.
.SH OPTIONS
.PP
-\f[B]\f[CB]\-\- \f[B]\f[R]
+\f[B]\f[CB]-- \f[B]\f[R]
.IP
.nf
\f[C]
Adding double dashes and space at the end of the command line appends trailing arguments to the current
command. If the current command is empty, trailing arguments are passed as though they are the command.
-Example: dunes \-\- cleos \-\-help
+Example: dunes -- cleos --help
\f[R]
.fi
.PP
-\f[B]\f[CB]\-h, \-\-help\f[B]\f[R]
+\f[B]\f[CB]-h, --help\f[B]\f[R]
.IP
.nf
\f[C]
@@ -35,7 +35,7 @@ Print the help message and exit
\f[R]
.fi
.PP
-\f[B]\f[CB]\-s, \-\-start \f[B]\f[R]
+\f[B]\f[CB]-s, --start \f[B]\f[R]
.IP
.nf
\f[C]
@@ -43,15 +43,15 @@ Start a new node with a given name
\f[R]
.fi
.PP
-\f[B]\f[CB]\-c , \-\-config \f[B]\f[R]
+\f[B]\f[CB]-c , --config \f[B]\f[R]
.IP
.nf
\f[C]
-Optionally used with \-\-start, a path containing the config.ini file to use.
+Optionally used with --start, a path containing the config.ini file to use.
\f[R]
.fi
.PP
-\f[B]\f[CB]\-\-stop \f[B]\f[R]
+\f[B]\f[CB]--stop \f[B]\f[R]
.IP
.nf
\f[C]
@@ -59,7 +59,7 @@ Stop a node with a given name.
\f[R]
.fi
.PP
-\f[B]\f[CB]\-\-remove \f[B]\f[R]
+\f[B]\f[CB]--remove \f[B]\f[R]
.IP
.nf
\f[C]
@@ -67,7 +67,7 @@ Remove a node with a given name. If the node is running it will be stopped.
\f[R]
.fi
.PP
-\f[B]\f[CB]\-\-list\f[B]\f[R]
+\f[B]\f[CB]--list\f[B]\f[R]
.IP
.nf
\f[C]
@@ -75,15 +75,15 @@ Print list of all available nodes and their status.
\f[R]
.fi
.PP
-\f[B]\f[CB]\-\-simple\-list\f[B]\f[R]
+\f[B]\f[CB]--simple-list\f[B]\f[R]
.IP
.nf
\f[C]
-Print the same as \-\-list but without formatting.
+Print the same as --list but without formatting.
\f[R]
.fi
.PP
-\f[B]\f[CB]\-\-set\-active \f[B]\f[R]
+\f[B]\f[CB]--set-active \f[B]\f[R]
.IP
.nf
\f[C]
@@ -91,7 +91,7 @@ Make the given node active.
\f[R]
.fi
.PP
-\f[B]\f[CB]\-\-get\-active\f[B]\f[R]
+\f[B]\f[CB]--get-active\f[B]\f[R]
.IP
.nf
\f[C]
@@ -99,28 +99,28 @@ Print name of the active node.
\f[R]
.fi
.PP
-\f[B]\f[CB]\-\-export\-node \f[B]\f[R]
+\f[B]\f[CB]--export-node \f[B]\f[R]
.IP
.nf
\f[C]
Export state and blocks log of the given node. PATH may be a directory or a filename with \[ga].tgz\[ga] extension.
-Example: dunes \-\-export\-node node \[ti]/storage/
+Example: dunes --export-node node \[ti]/storage/
\f[R]
.fi
.PP
-\f[B]\f[CB]\-\-import\-node \f[B]\f[R]
+\f[B]\f[CB]--import-node \f[B]\f[R]
.IP
.nf
\f[C]
Import state and blocks log to a given node. PATH *must* be a path to a file which contains previously exported
node with \[ga].tgz\[ga] extension.
-Example: dunes \-\-import\-node node \[ti]/storage/node.tgz\[ga]
+Example: dunes --import-node node \[ti]/storage/node.tgz\[ga]
\f[R]
.fi
.PP
-\f[B]\f[CB]\-\-monitor\f[B]\f[R]
+\f[B]\f[CB]--monitor\f[B]\f[R]
.IP
.nf
\f[C]
@@ -128,7 +128,7 @@ Monitor the currently active node.
\f[R]
.fi
.PP
-\f[B]\f[CB]\-\-import\-dev\-key \f[B]\f[R]
+\f[B]\f[CB]--import-dev-key \f[B]\f[R]
.IP
.nf
\f[C]
@@ -136,15 +136,15 @@ Import a private key into development wallet.
\f[R]
.fi
.PP
-\f[B]\f[CB]\-\-create\-key\f[B]\f[R]
+\f[B]\f[CB]--create-key\f[B]\f[R]
.IP
.nf
\f[C]
-Create a public key \- private key pair.
+Create a public key - private key pair.
\f[R]
.fi
.PP
-\f[B]\f[CB]\-\-export\-wallet\f[B]\f[R]
+\f[B]\f[CB]--export-wallet\f[B]\f[R]
.IP
.nf
\f[C]
@@ -152,7 +152,7 @@ Export the development wallet.
\f[R]
.fi
.PP
-\f[B]\f[CB]\-\-import\-wallet \f[B]\f[R]
+\f[B]\f[CB]--import-wallet \f[B]\f[R]
.IP
.nf
\f[C]
@@ -160,7 +160,7 @@ Import the development wallet.
\f[R]
.fi
.PP
-\f[B]\f[CB]\-\-create\-account [CREATOR] [PUB_KEY] [PRIV_KEY] [\-\- OPTIONS]\f[B]\f[R]
+\f[B]\f[CB]--create-account [CREATOR] [PUB_KEY] [PRIV_KEY] [-- OPTIONS]\f[B]\f[R]
.IP
.nf
\f[C]
@@ -170,7 +170,7 @@ so you may send additional cleos command line options to the call as OPTIONS
\f[R]
.fi
.PP
-\f[B]\f[CB]\-\-system\-newaccount [CREATOR] [PUB_KEY] [PRIV_KEY] [\-\- OPTIONS]\f[B]\f[R]
+\f[B]\f[CB]--system-newaccount [CREATOR] [PUB_KEY] [PRIV_KEY] [-- OPTIONS]\f[B]\f[R]
.IP
.nf
\f[C]
@@ -178,11 +178,11 @@ Create an EOSIO account with initial resources using \[dq]cleos system newaccoun
This options calls cleos utility in the Docker container
so you may send additional cleos command line options to the call as OPTIONS
-Example: dunes \-\-system\-newaccount myaccount \-\- \-\-buy\-ram\-bytes 3000
+Example: dunes --system-newaccount myaccount -- --buy-ram-bytes 3000
\f[R]
.fi
.PP
-\f[B]\f[CB]\-\-create\-cmake\-app \f[B]\f[R]
+\f[B]\f[CB]--create-cmake-app \f[B]\f[R]
.IP
.nf
\f[C]
@@ -190,7 +190,7 @@ Create a new smart contract project at the given location.
\f[R]
.fi
.PP
-\f[B]\f[CB]\-\-create\-bare\-app \f[B]\f[R]
+\f[B]\f[CB]--create-bare-app \f[B]\f[R]
.IP
.nf
\f[C]
@@ -199,29 +199,29 @@ Create a new empty smart contract project at the given location.
\f[R]
.fi
.PP
-\f[B]\f[CB]\-\-cmake\-build [\-\- OPTIONS]\f[B]\f[R]
+\f[B]\f[CB]--cmake-build [-- OPTIONS]\f[B]\f[R]
.IP
.nf
\f[C]
Build a smart contract project at the given directory.
Additional CMake options can be added to CMake call as OPTIONS
-Example: dunes \-\-cmake\-build \[ti]/project \-\- \-DFLAG1=On \-DFLAG2=Off
+Example: dunes --cmake-build \[ti]/project -- -DFLAG1=On -DFLAG2=Off
\f[R]
.fi
.PP
-\f[B]\f[CB]\-\-ctest [\-\- OPTIONS]\f[B]\f[R]
+\f[B]\f[CB]--ctest [-- OPTIONS]\f[B]\f[R]
.IP
.nf
\f[C]
Run the ctest tests for a smart contract project at the directory given.
Additional ctest options can be added to ctest call as OPTIONS
-Example: dunes \-\-ctest \[ti]/project \-\- \-\-progress \-V
+Example: dunes --ctest \[ti]/project -- --progress -V
\f[R]
.fi
.PP
-\f[B]\f[CB]\-\-gdb [\-\- OPTIONS]\f[B]\f[R]
+\f[B]\f[CB]--gdb [-- OPTIONS]\f[B]\f[R]
.IP
.nf
\f[C]
@@ -230,7 +230,7 @@ Additional gdb options can be added to the call as OPTIONS
\f[R]
.fi
.PP
-\f[B]\f[CB]\-\-deploy \f[B]\f[R]
+\f[B]\f[CB]--deploy \f[B]\f[R]
.IP
.nf
\f[C]
@@ -238,7 +238,7 @@ Deploy a smart contract to a given account.
\f[R]
.fi
.PP
-\f[B]\f[CB]\-\-destroy\-container\f[B]\f[R]
+\f[B]\f[CB]--destroy-container\f[B]\f[R]
.IP
.nf
\f[C]
@@ -246,7 +246,7 @@ Destroy the current Docker container. Warning! This will destroy your state and
\f[R]
.fi
.PP
-\f[B]\f[CB]\-\-stop\-container\f[B]\f[R]
+\f[B]\f[CB]--stop-container\f[B]\f[R]
.IP
.nf
\f[C]
@@ -254,7 +254,7 @@ Stop the current Docker container.
\f[R]
.fi
.PP
-\f[B]\f[CB]\-\-start\-container\f[B]\f[R]
+\f[B]\f[CB]--start-container\f[B]\f[R]
.IP
.nf
\f[C]
@@ -262,7 +262,7 @@ Start the current Docker container.
\f[R]
.fi
.PP
-\f[B]\f[CB]\-\-set\-core\-contract \f[B]\f[R]
+\f[B]\f[CB]--set-core-contract \f[B]\f[R]
.IP
.nf
\f[C]
@@ -270,7 +270,7 @@ Set the core contract to the specified account (use \[ga]eosio\[ga] as account f
\f[R]
.fi
.PP
-\f[B]\f[CB]\-\-set\-bios\-contract \f[B]\f[R]
+\f[B]\f[CB]--set-bios-contract \f[B]\f[R]
.IP
.nf
\f[C]
@@ -278,7 +278,7 @@ Set the bios contract to the specified account (use \[ga]eosio\[ga] as account f
\f[R]
.fi
.PP
-\f[B]\f[CB]\-\-set\-token\-contract \f[B]\f[R]
+\f[B]\f[CB]--set-token-contract \f[B]\f[R]
.IP
.nf
\f[C]
@@ -286,7 +286,7 @@ Set the token contract to the specified account (use \[ga]eosio.token\[ga] as ac
\f[R]
.fi
.PP
-\f[B]\f[CB]\-\-bootstrap\-system\f[B]\f[R]
+\f[B]\f[CB]--bootstrap-system\f[B]\f[R]
.IP
.nf
\f[C]
@@ -295,18 +295,18 @@ Install boot contracts to eosio and activate all protocol features.
\f[R]
.fi
.PP
-\f[B]\f[CB]\-\-bootstrap\-system\-full [CURRENCY] [MAX_VALUE] [INITIAL_VALUE]\f[B]\f[R]
+\f[B]\f[CB]--bootstrap-system-full [CURRENCY] [MAX_VALUE] [INITIAL_VALUE]\f[B]\f[R]
.IP
.nf
\f[C]
-Do the same as \[ga]\-\-bootstrap\-system\[ga] but also creates accounts for core contracts and deploys
+Do the same as \[ga]--bootstrap-system\[ga] but also creates accounts for core contracts and deploys
the core, token, and multisig contracts.
If optional arguments are provided, it creates specific CURRENCY (default \[dq]SYS\[dq])
with maximum amount of MAX_VALUE and initial value of INITIAL_VALUE.
\f[R]
.fi
.PP
-\f[B]\f[CB]\-\-send\-action \f[B]\f[R]
+\f[B]\f[CB]--send-action \f[B]\f[R]
.IP
.nf
\f[C]
@@ -314,7 +314,7 @@ Send an action to a specified account with given data and permission.
\f[R]
.fi
.PP
-\f[B]\f[CB]\-\-get\-table \f[B]\f[R]
+\f[B]\f[CB]--get-table \f[B]\f[R]
.IP
.nf
\f[C]
@@ -322,7 +322,7 @@ Print data from a given table.
\f[R]
.fi
.PP
-\f[B]\f[CB]\-\-activate\-feature \f[B]\f[R]
+\f[B]\f[CB]--activate-feature \f[B]\f[R]
.IP
.nf
\f[C]
@@ -330,7 +330,7 @@ Activate a given protocol feature.
\f[R]
.fi
.PP
-\f[B]\f[CB]\-\-list\-features\f[B]\f[R]
+\f[B]\f[CB]--list-features\f[B]\f[R]
.IP
.nf
\f[C]
@@ -338,7 +338,7 @@ Print a list of available protocol features.
\f[R]
.fi
.PP
-\f[B]\f[CB]\-\-version\f[B]\f[R]
+\f[B]\f[CB]--version\f[B]\f[R]
.IP
.nf
\f[C]
@@ -346,7 +346,7 @@ Display the current version of DUNES.
\f[R]
.fi
.PP
-\f[B]\f[CB]\-\-version\-all\f[B]\f[R]
+\f[B]\f[CB]--version-all\f[B]\f[R]
.IP
.nf
\f[C]
@@ -354,7 +354,7 @@ Display the current versions of DUNES, CDT, and leap.
\f[R]
.fi
.PP
-\f[B]\f[CB]\-\-debug\f[B]\f[R]
+\f[B]\f[CB]--debug\f[B]\f[R]
.IP
.nf
\f[C]
@@ -362,7 +362,7 @@ Print additional information useful for debugging, such as running docker comman
\f[R]
.fi
.PP
-\f[B]\f[CB]\-\-upgrade\f[B]\f[R]
+\f[B]\f[CB]--upgrade\f[B]\f[R]
.IP
.nf
\f[C]
@@ -370,7 +370,7 @@ Upgrade DUNES image to the latest version.
\f[R]
.fi
.PP
-\f[B]\f[CB]\-\-leap [LEAP_VERSION]\f[B]\f[R]
+\f[B]\f[CB]--leap [LEAP_VERSION]\f[B]\f[R]
.IP
.nf
\f[C]
@@ -378,7 +378,7 @@ Set the version of leap. If no version is provided, display available leap versi
\f[R]
.fi
.PP
-\f[B]\f[CB]\-\-cdt [CDT_VERSION]\f[B]\f[R]
+\f[B]\f[CB]--cdt [CDT_VERSION]\f[B]\f[R]
.IP
.nf
\f[C]
@@ -386,7 +386,7 @@ Set the version of CDT (Contract Development Toolkit). If no version is provided
\f[R]
.fi
.PP
-\f[B]\f[CB]\-\-create\-project [VER]\f[B]\f[R]
+\f[B]\f[CB]--create-project [VER]\f[B]\f[R]
.IP
.nf
\f[C]
@@ -394,7 +394,7 @@ Create a smart contract project at the specified location.
\f[R]
.fi
.PP
-\f[B]\f[CB]\-\-add\-app [CMPLR_OPTS] [LINK_OPTS]\f[B]\f[R]
+\f[B]\f[CB]--add-app [CMPLR_OPTS] [LINK_OPTS]\f[B]\f[R]
.IP
.nf
\f[C]
@@ -402,7 +402,7 @@ Add an application to the specified smart contract project.
\f[R]
.fi
.PP
-\f[B]\f[CB]\-\-add\-lib [CMPLR_OPTS] [LINK_OPTS]\f[B]\f[R]
+\f[B]\f[CB]--add-lib [CMPLR_OPTS] [LINK_OPTS]\f[B]\f[R]
.IP
.nf
\f[C]
@@ -410,7 +410,7 @@ Add a library to the specified smart contract project.
\f[R]
.fi
.PP
-\f[B]\f[CB]\-\-add\-dep [LOCATION] [TAG/RELEASE] [HASH]\f[B]\f[R]
+\f[B]\f[CB]--add-dep [LOCATION] [TAG/RELEASE] [HASH]\f[B]\f[R]
.IP
.nf
\f[C]
@@ -418,7 +418,7 @@ Add a dependency to the specified smart contract project.
\f[R]
.fi
.PP
-\f[B]\f[CB]\-\-remove\-app \f[B]\f[R]
+\f[B]\f[CB]--remove-app \f[B]\f[R]
.IP
.nf
\f[C]
@@ -426,7 +426,7 @@ Remove an application from the specified smart contract project.
\f[R]
.fi
.PP
-\f[B]\f[CB]\-\-remove\-lib \f[B]\f[R]
+\f[B]\f[CB]--remove-lib \f[B]\f[R]
.IP
.nf
\f[C]
@@ -434,7 +434,7 @@ Remove a library from the specified smart contract project.
\f[R]
.fi
.PP
-\f[B]\f[CB]\-\-remove\-dep \f[B]\f[R]
+\f[B]\f[CB]--remove-dep \f[B]\f[R]
.IP
.nf
\f[C]
@@ -442,7 +442,7 @@ Remove a dependency from the specified smart contract project.
\f[R]
.fi
.PP
-\f[B]\f[CB]\-\-update\-app [CMPLR_OPTS] [LINK_OPTS]\f[B]\f[R]
+\f[B]\f[CB]--update-app [CMPLR_OPTS] [LINK_OPTS]\f[B]\f[R]
.IP
.nf
\f[C]
@@ -450,7 +450,7 @@ Update an application in the given smart contract project.
\f[R]
.fi
.PP
-\f[B]\f[CB]\-\-update\-lib [CMPLR_OPTS] [LINK_OPTS]\f[B]\f[R]
+\f[B]\f[CB]--update-lib [CMPLR_OPTS] [LINK_OPTS]\f[B]\f[R]
.IP
.nf
\f[C]
@@ -458,7 +458,7 @@ Update a library in the given smart contract project.
\f[R]
.fi
.PP
-\f[B]\f[CB]\-\-update\-dep [LOCATION] [TAG/RELEASE] [HASH]\f[B]\f[R]
+\f[B]\f[CB]--update-dep [LOCATION] [TAG/RELEASE] [HASH]\f[B]\f[R]
.IP
.nf
\f[C]
@@ -466,7 +466,7 @@ Update a dependency in the given smart contract project.
\f[R]
.fi
.PP
-\f[B]\f[CB]\-\-build\-project \f[B]\f[R]
+\f[B]\f[CB]--build-project \f[B]\f[R]
.IP
.nf
\f[C]
@@ -475,7 +475,7 @@ Build the given smart contract project.
\f[R]
.fi
.PP
-\f[B]\f[CB]\-\-clean\-build\-project \f[B]\f[R]
+\f[B]\f[CB]--clean-build-project \f[B]\f[R]
.IP
.nf
\f[C]
@@ -484,7 +484,7 @@ Clean the given project and rebuild it from scratch.
\f[R]
.fi
.PP
-\f[B]\f[CB]\-\-validate \f[B]\f[R]
+\f[B]\f[CB]--validate \f[B]\f[R]
.IP
.nf
\f[C]
@@ -493,7 +493,7 @@ Validate the given smart contract project.
\f[R]
.fi
.PP
-\f[B]\f[CB]\-\-populate \f[B]\f[R]
+\f[B]\f[CB]--populate \f[B]\f[R]
.IP
.nf
\f[C]
@@ -504,15 +504,15 @@ Populate the given smart contract project.
.PP
\f[B]0\f[R] Success
.PP
-\f[B]non\-zero\f[R] Fail
+\f[B]non-zero\f[R] Fail
.SH REPORTING BUGS
.PP
Please submit bug reports online at
-https://github.com/AntelopeIO/DUNE/issues
+https://github.com/AntelopeIO/DUNES/issues
.SH SEE ALSO
.PP
\f[B]cdt\f[R](1), \f[B]leap\f[R](1)
.SH COLOPHON
.PP
For more details consult the full documentation and sources
-https://github.com/AntelopeIO/DUNE
+https://github.com/AntelopeIO/DUNES
diff --git a/docs/man/dune.1.md b/docs/man/dunes.1.md
similarity index 99%
rename from docs/man/dune.1.md
rename to docs/man/dunes.1.md
index 2bedf93c..ddc1379a 100644
--- a/docs/man/dune.1.md
+++ b/docs/man/dunes.1.md
@@ -282,7 +282,7 @@ contracts on Antelope blockchains.
# REPORTING BUGS
-Please submit bug reports online at https://github.com/AntelopeIO/DUNE/issues
+Please submit bug reports online at https://github.com/AntelopeIO/DUNES/issues
# SEE ALSO
@@ -290,4 +290,4 @@ Please submit bug reports online at https://github.com/AntelopeIO/DUNE/issues
# COLOPHON
-For more details consult the full documentation and sources https://github.com/AntelopeIO/DUNE
\ No newline at end of file
+For more details consult the full documentation and sources https://github.com/AntelopeIO/DUNES
\ No newline at end of file
diff --git a/docs/man/make_man.sh b/docs/man/make_man.sh
index 5c3790ab..7c21fff0 100755
--- a/docs/man/make_man.sh
+++ b/docs/man/make_man.sh
@@ -1,3 +1,3 @@
#!/bin/sh
-pandoc dune.1.md -s -t man -o dune.1
\ No newline at end of file
+pandoc dunes.1.md -s -t man -o dunes.1
\ No newline at end of file
diff --git a/dunes b/dunes
index c52a2ac1..6f85fd30 100755
--- a/dunes
+++ b/dunes
@@ -1,4 +1,4 @@
#!/usr/bin/env bash
SDIR=$(dirname "$(readlink -f "$0")")
-python3 $SDIR/src/dune "$@"
+python3 $SDIR/src/dunes "$@"
diff --git a/dunes.bat b/dunes.bat
index dc271b99..c7eafe41 100644
--- a/dunes.bat
+++ b/dunes.bat
@@ -4,11 +4,11 @@ SET mypath=%~dp0
where python.exe >nul
if %ERRORLEVEL% EQU 0 (
- python %mypath%\src\dune %*
+ python %mypath%\src\dunes %*
) else (
where python3.exe >nul
if %ERRORLEVEL% EQU 0 (
- python3 %mypath%\src\dune %*
+ python3 %mypath%\src\dunes %*
) else (
echo "Python/3 was not found, please install and add to PATH."
exit /b
diff --git a/packaging/antelopeio-dune/antelopeio-dune.nuspec b/packaging/antelopeio-dune/antelopeio-dune.nuspec
index 0454b6e8..0f19a43e 100644
--- a/packaging/antelopeio-dune/antelopeio-dune.nuspec
+++ b/packaging/antelopeio-dune/antelopeio-dune.nuspec
@@ -2,20 +2,20 @@
- antelopeio-dune
+ dunes
1.1.0
EOS Network Foundation
- AntelopeIO DUNE
+ DUNES
EOS Network Foundation
- https://github.com/AntelopeIO/DUNE
+ https://github.com/AntelopeIO/DUNES
EOS Network Foundation
- https://github.com/AntelopeIO/DUNE/blob/main/LICENSE
+ https://github.com/AntelopeIO/DUNES/blob/main/LICENSE
false
- antelopeio-dunes package
- https://github.com/AntelopeIO/DUNE
- https://github.com/AntelopeIO/DUNE/issues
- antelopeio-dunes
- ### antelopeio-dunes eos cleos nodeos leap cdt antelope antelopeio
+ dunes package
+ https://github.com/AntelopeIO/DUNES
+ https://github.com/AntelopeIO/DUNES/issues
+ dunes
+ ### dunes eos cleos nodeos leap cdt antelope antelopeio
Docker Utilities for Node Execution and Subsystems (DUNES) is a tool to abstract over Leap programs, CDT and other services/tools related to Antelope blockchains.
diff --git a/packaging/generate_chocolatey.bat b/packaging/generate_chocolatey.bat
index 3ed078c8..a7838ade 100644
--- a/packaging/generate_chocolatey.bat
+++ b/packaging/generate_chocolatey.bat
@@ -9,10 +9,10 @@ if errorlevel 1 (
set mypath=%cd%
set script-path=%~dp0
-set target-dir=%script-path%\antelopeio-dune\tools
+set target-dir=%script-path%\dunes\tools
mkdir %target-dir%
copy %script-path%\..\LICENSE %target-dir%
-copy "%script-path%"\..\dune* %target-dir%
+copy "%script-path%"\..\dunes* %target-dir%
copy "%script-path%"\..\Dockerfile* %target-dir%
copy "%script-path%"\..\bootstrap* %target-dir%
copy "%script-path%"\..\README* %target-dir%
@@ -32,11 +32,11 @@ mkdir %target-dir%\docs\
xcopy "%script-path%"\..\docs\* %target-dir%\docs\ /e /k /h /i
-cd %script-path%\antelopeio-dune
+cd %script-path%\dunes
choco pack
cd %mypath%
rmdir /Q /S %target-dir%
-move %script-path%\antelopeio-dune\*.nupkg %mypath%
+move %script-path%\dunes\*.nupkg %mypath%
echo Nupkg has been created in the current directory
\ No newline at end of file
diff --git a/packaging/generate_deb.sh b/packaging/generate_deb.sh
index c4651f1a..a43cf746 100755
--- a/packaging/generate_deb.sh
+++ b/packaging/generate_deb.sh
@@ -13,7 +13,7 @@ if [[ -z $RELEASE ]]; then
RELEASE="1"
fi
-PACKAGE_NAME=$(echo "$PROJECT_PREFIX-$PROJECT")
+PACKAGE_NAME=$(echo "$PROJECT")
NAME="${PACKAGE_NAME}_${VERSION_NO_SUFFIX}-${RELEASE}_all"
mkdir -p "$PROJECT"/DEBIAN
diff --git a/packaging/generate_package.sh b/packaging/generate_package.sh
index 2a617dcb..b9fc72fb 100755
--- a/packaging/generate_package.sh
+++ b/packaging/generate_package.sh
@@ -25,10 +25,9 @@ cd $DIR
BUILD_DIR="$DIR/../"
VENDOR="EOSNetworkFoundation"
-PROJECT_PREFIX="antelopeio"
PROJECT="dunes"
DESC="Docker Utilities for Node Execution and Subsystems (DUNES) is a tool to abstract over Leap programs, CDT and other services/tools related to Antelope blockchains."
-URL="https://github.com/AntelopeIO/DUNE"
+URL="https://github.com/AntelopeIO/DUNES"
EMAIL="support@eosnetwork.com"
export BUILD_DIR
@@ -36,7 +35,6 @@ export VERSION_NO_SUFFIX
export VERSION_SUFFIX
export VERSION
export VENDOR
-export PROJECT_PREFIX
export PROJECT
export DESC
export URL
diff --git a/packaging/generate_rpm.sh b/packaging/generate_rpm.sh
index 5964ff75..175e3f94 100755
--- a/packaging/generate_rpm.sh
+++ b/packaging/generate_rpm.sh
@@ -11,8 +11,7 @@ if [[ -z $RELEASE ]]; then
RELEASE="1"
fi
-#add PROJECT_PREFIX to avoid conflict with ocaml dune
-PROJECT="$PROJECT_PREFIX-$PROJECT"
+PROJECT="$PROJECT"
NAME="${PROJECT}-${VERSION_NO_SUFFIX}-${RELEASE}"
export PREFIX
diff --git a/scripts/write_context.sh b/scripts/write_context.sh
index bf292351..cc84c1c0 100755
--- a/scripts/write_context.sh
+++ b/scripts/write_context.sh
@@ -1,3 +1,3 @@
#! /bin/sh
-echo $1 > /app/.dune.ctx
\ No newline at end of file
+echo $1 > /app/.dunes.ctx
\ No newline at end of file
diff --git a/src/dune/__main__.py b/src/dunes/__main__.py
similarity index 96%
rename from src/dune/__main__.py
rename to src/dunes/__main__.py
index 257b1de0..cb84e0fd 100644
--- a/src/dune/__main__.py
+++ b/src/dunes/__main__.py
@@ -6,11 +6,11 @@
from args import parse_optional
import version_selector
from docker import docker_error
-from dune import dune
-from dune import dune_error
-from dune import dune_node_not_found
-from dune import node
-from dune import version_full
+from dunes import dunes
+from dunes import dunes_error
+from dunes import dunes_node_not_found
+from dunes import node
+from dunes import version_full
def handle_version():
@@ -80,7 +80,7 @@ def load_all_modules_from_dir(plugin_dir):
handle_simple_args()
- dune_sys = dune(args)
+ dune_sys = dunes(args)
for module in modules:
if hasattr(module, 'set_dune'):
@@ -93,7 +93,7 @@ def load_all_modules_from_dir(plugin_dir):
WAS_REMAINDER_ARGS_USED = False
if args.start is not None:
- n: object
+ n: object = None
if args.config is None:
n = node(args.start[0])
elif len(args.config) == 1:
@@ -184,7 +184,8 @@ def load_all_modules_from_dir(plugin_dir):
commands, WAS_REMAINDER_ARGS_USED = parse_optional(args.remainder)
if (len(args.system_newaccount) > 4
- or (WAS_REMAINDER_ARGS_USED and len(args.system_newaccount) < 4)):
+ or (WAS_REMAINDER_ARGS_USED
+ and len(args.system_newaccount) < 4)):
parser.exit_with_help_message("--system-newaccount has invalid arguments\n")
if WAS_REMAINDER_ARGS_USED:
dune_sys.system_newaccount(*args.system_newaccount, commands)
@@ -273,8 +274,8 @@ def load_all_modules_from_dir(plugin_dir):
elif args.version_all:
handle_version()
- dune_sys.execute_cmd(['apt','list','leap'], colors=True)
- dune_sys.execute_cmd(['apt','list','cdt'], colors=True)
+ dune_sys.execute_cmd(['apt', 'list', 'leap'], colors=True)
+ dune_sys.execute_cmd(['apt', 'list', 'cdt'], colors=True)
# Integration with antler-proj begin ----------------------------------------------------------------------
@@ -345,10 +346,10 @@ def load_all_modules_from_dir(plugin_dir):
except KeyboardInterrupt:
pass
- except dune_node_not_found as err:
+ except dunes_node_not_found as err:
print('Node not found [' + err.name() + ']', file=sys.stderr)
sys.exit(1)
- except dune_error as err:
+ except dunes_error as err:
print("Internal Error", file=sys.stderr)
sys.exit(1)
except docker_error as err:
diff --git a/src/dune/args.py b/src/dunes/args.py
similarity index 99%
rename from src/dune/args.py
rename to src/dunes/args.py
index 472ee4c4..7414515b 100644
--- a/src/dune/args.py
+++ b/src/dunes/args.py
@@ -136,7 +136,7 @@ def __init__(self):
'and multisig contracts. If optional arguments are provided '
'it creates specific CURRENCY (default "SYS") with maximum amount of '
'MAX_VALUE and initial value of INITIAL_VALUE')
- self._parser.add_argument('--send-action', nargs=4, action=fix_action_data,
+ self._parser.add_argument('--send-action', nargs=4,
metavar=("", "", "", ""),
help='send action to account with data given and permission')
self._parser.add_argument('--get-table', nargs=3, metavar=("", "", ""),
diff --git a/src/dune/context.py b/src/dunes/context.py
similarity index 98%
rename from src/dune/context.py
rename to src/dunes/context.py
index e2addbe3..a1ba084c 100644
--- a/src/dune/context.py
+++ b/src/dunes/context.py
@@ -6,7 +6,7 @@ class ctx:
class context:
- _file_name = ".dune.ctx"
+ _file_name = ".dunes.ctx"
_dir = '/app/'
_docker = None
_ctx = ctx()
diff --git a/src/dune/docker.py b/src/dunes/docker.py
similarity index 89%
rename from src/dune/docker.py
rename to src/dunes/docker.py
index d33bf384..ea98139a 100644
--- a/src/dune/docker.py
+++ b/src/dunes/docker.py
@@ -12,7 +12,7 @@ class docker:
_container = ""
_image = ""
_cl_args = None
- _dune_url = 'ghcr.io/antelopeio/dune:latest'
+ _dunes_url = 'ghcr.io/antelopeio/dunes:latest'
def __init__(self, container, image, cl_args):
self._container = container
@@ -31,26 +31,26 @@ def __init__(self, container, image, cl_args):
self.execute_docker_cmd(
['container', 'start', self._container])
else:
- # download dune image
- dune_image = subprocess.check_output(['docker', 'images', '-q', self._image], stderr=None, encoding='utf-8')
+ # download DUNES image
+ dunes_image = subprocess.check_output(['docker', 'images', '-q', self._image],
+ stderr=None, encoding='utf-8')
- if dune_image == '':
- print('Downloading Dune image')
+ if dunes_image == '':
+ print('Downloading DUNES image')
self.upgrade()
- with subprocess.Popen(['docker', 'tag', self._dune_url, 'dune:latest']) as proc:
+ with subprocess.Popen(['docker', 'tag', self._dunes_url, 'dunes:latest']) as proc:
proc.communicate()
-
# start a new container
print("Creating docker container [" + self._container + "]")
host_dir = '/'
if platform.system() == 'Windows':
host_dir = 'C:/'
- stdout, stderr, exit_code = self.execute_docker_cmd(
+ self.execute_docker_cmd(
['run', '-p', '127.0.0.1:8888:8888/tcp', '-p', '127.0.0.1:9876:9876/tcp', '-p',
- '127.0.0.1:8080:8080/tcp', '-p', '127.0.0.1:3000:3000/tcp', '-p', '127.0.0.1:8000:8000/tcp', '-v',
- host_dir + ':/host', '-d', '--name=' + self._container,
+ '127.0.0.1:8080:8080/tcp', '-p', '127.0.0.1:3000:3000/tcp', '-p',
+ '127.0.0.1:8000:8000/tcp', '-v', host_dir + ':/host', '-d', '--name=' + self._container,
self._image, 'tail', '-f', '/dev/null'])
@staticmethod
@@ -85,6 +85,7 @@ def print_streams(self, stdout, stderr):
def execute_docker_cmd(self, cmd, *, check_status=True, capture_output=True):
"""Execute the given docker command in the active container.
+ :param cmd: the command
:param check_status: if command has a return code != 0 then raise an exception
:param capture_output: whether to capture stdout and stderr and return them or to
print the streams normally
@@ -115,7 +116,7 @@ def execute_docker_cmd(self, cmd, *, check_status=True, capture_output=True):
print('docker '+' '.join(cmd))
self.print_streams(stdout, stderr)
- return (stdout, stderr, status)
+ return stdout, stderr, status
def file_exists(self, file_name):
# not checking status code here because a non-zero status is a normal
@@ -154,8 +155,8 @@ def find_pid(self, process_name):
def get_container_name(self):
return self._container
- def commit(self, name):
- self.execute_docker_cmd(['commit', 'dune', 'dune'])
+ def commit(self):
+ self.execute_docker_cmd(['commit', 'dunes', 'dunes'])
def start(self):
print("Starting docker container [" + self._container + "]")
@@ -189,5 +190,5 @@ def execute_bg_cmd(self, cmd):
return self.execute_cmd(cmd + ['&'])
def upgrade(self):
- with subprocess.Popen(['docker', 'pull', self._dune_url]) as proc:
+ with subprocess.Popen(['docker', 'pull', self._dunes_url]) as proc:
proc.communicate()
diff --git a/src/dune/dune.py b/src/dunes/dunes.py
similarity index 88%
rename from src/dune/dune.py
rename to src/dunes/dunes.py
index 669853ab..24322c8f 100644
--- a/src/dune/dune.py
+++ b/src/dunes/dunes.py
@@ -1,11 +1,12 @@
# pylint: disable=missing-function-docstring, missing-module-docstring
import os
-import sys # sys.stderr
+import sys # sys.stderr
import time
from context import context
from docker import docker
from node_state import node_state
+
# VERSION INFORMATION
def version_major():
return 1
@@ -31,11 +32,11 @@ def version_full():
return main_version + "." + version_suffix()
-class dune_error(Exception):
+class dunes_error(Exception):
pass
-class dune_node_not_found(dune_error):
+class dunes_node_not_found(dunes_error):
_name = ""
def __init__(self, n):
@@ -69,7 +70,7 @@ def config_dir(self):
return '/app/nodes/' + self.name()
-class dune:
+class dunes:
_docker = None
_wallet_pw = None
_context = None
@@ -79,7 +80,7 @@ class dune:
def __init__(self, cl_args):
self._cl_args = cl_args
- self._docker = docker('dune_container', 'dune:latest', cl_args)
+ self._docker = docker('dunes_container', 'dunes:latest', cl_args)
self._wallet_pw = self.get_wallet_pw()
self._context = context(self._docker)
@@ -93,7 +94,7 @@ def set_active(self, nod):
if self.node_exists(nod):
self._context.set_active(nod)
else:
- raise dune_node_not_found(nod.name())
+ raise dunes_node_not_found(nod.name())
def get_active(self):
return self._context.get_active()
@@ -117,9 +118,9 @@ def start_node(self, nod, snapshot=None):
cmd = cmd + [' ']
# if node name is not found we need to create it
- is_restart=True
+ is_restart = True
if not nod.name() in stdout:
- is_restart=False
+ is_restart = False
self.create_node(nod)
# copy config.ini to config-dir
@@ -158,7 +159,7 @@ def monitor(self):
print(stdout)
if exit_code != 0:
print(stderr)
- raise dune_error
+ raise dunes_error
def stop_node(self, nod):
if self.node_exists(nod):
@@ -177,7 +178,7 @@ def stop_node(self, nod):
max_wait_time_secs -= 1
- if max_wait_time_secs <= 0 :
+ if max_wait_time_secs <= 0:
print("ERROR: Cannot stop [" + nod.name() + "], PID: " + pid)
sys.exit(1)
@@ -186,7 +187,7 @@ def stop_node(self, nod):
else:
print("Node [" + nod.name() + "] is not running")
else:
- raise dune_node_not_found(nod.name())
+ raise dunes_node_not_found(nod.name())
def remove_node(self, nod):
self.stop_node(nod)
@@ -209,33 +210,31 @@ def stop_container(self):
def start_container(self):
self._docker.start()
-
def state_list(self):
# [(node_name, active, running, ports),...]
- rv=[]
+ rv = []
stdout, stderr, exit_code = self._docker.execute_cmd(['ls', '/app/nodes'])
ctx = self._context.get_ctx()
for node_name in stdout.split():
active = False
if node_name == ctx.active:
- active=True
+ active = True
running = self.is_node_running(node(node_name))
addrs = self._context.get_config_args(node(node_name))
- rv.append( node_state(node_name, active, running, addrs[0], addrs[1], addrs[2]) )
+ rv.append(node_state(node_name, active, running, addrs[0], addrs[1], addrs[2]))
return rv
-
# pylint: disable=too-many-branches
def list_nodes(self, simple=False, sep='|'):
buffer = 3
node_name = "Node Name"
- states=self.state_list()
+ states = self.state_list()
name_width = len(node_name) + buffer
if not simple:
for state in states:
- name_width = max( len(state.name) + buffer, name_width)
+ name_width = max(len(state.name) + buffer, name_width)
if simple:
print("Node|Active|Running|HTTP|P2P|SHiP")
@@ -245,12 +244,12 @@ def list_nodes(self, simple=False, sep='|'):
print(f'{"":{"-"}<{name_width + len(header)}}')
for state in states:
- print( state.string(sep=sep, simple=simple, name_width=name_width) )
+ print(state.string(sep=sep, simple=simple, name_width=name_width))
def stop_conflicting_nodes(self, nod):
- my_addrs=self._context.get_config_args(nod)
- was_running=[]
- was_active=None
+ my_addrs = self._context.get_config_args(nod)
+ was_running = []
+ was_active = None
# For each state, make decisions based on it's
for state in self.state_list():
@@ -266,23 +265,21 @@ def stop_conflicting_nodes(self, nod):
self.stop_node(node(state.name))
print("\t", state.name, "was stopped due to address collision.")
- return (was_active, was_running)
+ return was_active, was_running
# pylint: disable=too-many-locals,too-many-statements
def export_node(self, nod, path):
# Sanity check
if not self.node_exists(nod):
- raise dune_node_not_found(nod.name())
+ raise dunes_node_not_found(nod.name())
ctx = self._context.get_ctx()
- is_active=nod.name() == ctx.active
- is_running=self.is_node_running(nod)
-
- was_running=[]
- was_active=None
+ is_active = nod.name() == ctx.active
+ is_running = self.is_node_running(nod)
- initial_states=[]
+ was_running = []
+ was_active = None
if not is_active or not is_running:
(was_active, was_running) = self.stop_conflicting_nodes(nod)
@@ -294,25 +291,24 @@ def export_node(self, nod, path):
self.set_active(nod)
# Paths:
- directory=path
- filename=nod.name()+".tgz"
+ directory = path
+ filename = nod.name() + ".tgz"
# Update paths based on input.
if os.path.splitext(path)[1].lower() == ".tgz":
- directory=os.path.split(path)[0]
- filename=os.path.split(path)[1]
+ directory = os.path.split(path)[0]
+ filename = os.path.split(path)[1]
# Ensure the directory is absolute and it exists.
- directory=os.path.realpath(directory)
+ directory = os.path.realpath(directory)
if not os.path.exists(directory):
os.makedirs(directory)
# Determine the final full path.
- fullpath=os.path.join(directory,filename)
-
- src_path='/app/nodes/' + nod.name()
- dst_path='/app/tmp/' + nod.name()
+ fullpath = os.path.join(directory, filename)
+ src_path = '/app/nodes/' + nod.name()
+ dst_path = '/app/tmp/' + nod.name()
print("Exporting data from node [" + nod.name() + "] to location " + fullpath)
@@ -324,7 +320,8 @@ def export_node(self, nod, path):
self._docker.execute_cmd(['mkdir', '-p', dst_path])
self._docker.execute_cmd(['cp', '-R', src_path + '/blocks', dst_path + '/blocks'])
self._docker.execute_cmd(['cp', src_path + '/config.ini', dst_path + '/config.ini'])
- self._docker.execute_cmd(['cp', '-R', src_path + '/protocol_features', dst_path + '/protocol_features'])
+ self._docker.execute_cmd(
+ ['cp', '-R', src_path + '/protocol_features', dst_path + '/protocol_features'])
self._docker.execute_cmd(['cp', '-R', src_path + '/snapshots', dst_path + '/snapshots'])
self._docker.tar_dir(nod.name(), 'tmp/' + nod.name())
@@ -344,16 +341,15 @@ def export_node(self, nod, path):
for old_runner in was_running:
self.start_node(node(old_runner))
-
def import_node(self, path, nod):
# Sanity check path
if not os.path.exists(path):
print("File not found: ", path, file=sys.stderr)
- raise dune_error
+ raise dunes_error
if os.path.splitext(path)[1].lower() != ".tgz":
print("Path extension must be `.tgz`: ", path, file=sys.stderr)
- raise dune_error
+ raise dunes_error
print("Importing node data [" + nod.name() + "]")
@@ -365,28 +361,28 @@ def import_node(self, path, nod):
stdout, stderr, exit_code = self._docker.cp_from_host(path, '/app/tmp.tgz')
if exit_code != 0:
print(stderr)
- raise dune_error
+ raise dunes_error
# Clean up the tmp file, untar, and remove the file.
- self._docker.rm_file('/app/tmp') # remove any existing file
+ self._docker.rm_file('/app/tmp') # remove any existing file
self._docker.untar('/app/tmp.tgz')
self._docker.rm_file('/app/tmp.tgz')
# Find the path inside temp of the import data.
stdout, stderr, exit_code = self._docker.execute_cmd(['ls', '/app/tmp'])
- src_name=stdout.split()[0]
- src_path='/app/tmp/' + src_name
+ src_name = stdout.split()[0]
+ src_path = '/app/tmp/' + src_name
# Calculate and create the destination path.
- dst_path='/app/nodes/' + nod.name()
+ dst_path = '/app/nodes/' + nod.name()
self._docker.execute_cmd(['mkdir', '-p', dst_path + '/blocks'])
# Move data to the destination.
self._docker.execute_cmd(['mv', src_path + '/blocks/blocks.index', dst_path + '/blocks/blocks.index'])
- self._docker.execute_cmd(['mv', src_path + '/blocks/blocks.log', dst_path + '/blocks/blocks.log'])
- self._docker.execute_cmd(['mv', src_path + '/config.ini', dst_path + '/config.ini'])
- self._docker.execute_cmd(['mv', src_path + '/protocol_features', dst_path + '/protocol_features'])
- self._docker.execute_cmd(['mv', src_path + '/snapshots', dst_path + '/snapshots'])
+ self._docker.execute_cmd(['mv', src_path + '/blocks/blocks.log', dst_path + '/blocks/blocks.log'])
+ self._docker.execute_cmd(['mv', src_path + '/config.ini', dst_path + '/config.ini'])
+ self._docker.execute_cmd(['mv', src_path + '/protocol_features', dst_path + '/protocol_features'])
+ self._docker.execute_cmd(['mv', src_path + '/snapshots', dst_path + '/snapshots'])
# Clean up the temp.
self._docker.rm_file('/app/tmp')
@@ -394,7 +390,7 @@ def import_node(self, path, nod):
stdout, stderr, exit_code = self._docker.execute_cmd(['ls', dst_path + '/snapshots'])
if len(stdout) == 0:
print('No snapshot found for ', nod.name(), ' sourced from: \n\t', path, file=sys.stderr)
- raise dune_error
+ raise dunes_error
# Start and activate the node...
self.start_node(nod, stdout.split()[0])
@@ -417,8 +413,7 @@ def unlock_wallet(self):
# we don't want to fail here
return
stderr = stderr or '\n' # do not fail on next line if stderr is None
- raise dune_error(stderr.splitlines()[0])
-
+ raise dunes_error(stderr.splitlines()[0])
def import_key(self, key):
self.unlock_wallet()
@@ -465,7 +460,7 @@ def create_account(self, name, creator=None, pub=None, private=None):
self.import_key(private)
print(stderr)
- #pylint: disable=too-many-arguments
+ # pylint: disable=too-many-arguments
def system_newaccount(self, name, creator=None, pub=None, private=None, additional_args=None):
if private is None:
keys = self.create_key()
@@ -491,7 +486,7 @@ def system_newaccount(self, name, creator=None, pub=None, private=None, addition
self.import_key(private)
print(stderr)
-# Integration with antler-proj begin ----------------------------------------------------------------------
+ # Integration with antler-proj begin ------------------------------------------
def create_project(self, path: str, name: str, ver: str = None):
@@ -533,11 +528,11 @@ def add_lib(self, path: str, dependency_name: str, lang: str,
self._docker.execute_cmd(["antler-proj", "add", container_dir, "lib",
dependency_name, lang] + opts)
- def add_dep(self, path: str, # project path
- object_name: str, # object name (app/lib)
- dependency_name: str, # dependency name
- location: str = None, # location of dep
- tag_rel: str = None, # tag/release number
+ def add_dep(self, path: str, # project path
+ object_name: str, # object name (app/lib)
+ dependency_name: str, # dependency name
+ location: str = None, # location of dep
+ tag_rel: str = None, # tag/release number
hash_str: str = None): # hash
opts: list = []
@@ -581,11 +576,11 @@ def update_lib(self, path: str, dependency_name: str, lang: str,
self._docker.execute_cmd(["antler-proj", "update", container_dir, "lib",
dependency_name, lang] + opts)
- def update_dep(self, path: str, # project path
- object_name: str, # object name (app/lib)
- dependency_name: str, # dependency name
- location: str = None, # location of dep
- tag_rel: str = None, # tag/release number
+ def update_dep(self, path: str, # project path
+ object_name: str, # object name (app/lib)
+ dependency_name: str, # dependency name
+ location: str = None, # location of dep
+ tag_rel: str = None, # tag/release number
hash_str: str = None): # hash
opts: list = []
@@ -601,22 +596,22 @@ def update_dep(self, path: str, # project path
self._docker.execute_cmd(["antler-proj", "update", container_dir, "dep",
object_name, dependency_name] + opts)
- def remove_dep(self, path: str, # project path
- object_name: str, # object name (app/lib)
- dependency_name: str): # dependency name
+ def remove_dep(self, path: str, # project path
+ object_name: str, # object name (app/lib)
+ dependency_name: str): # dependency name
container_dir = self._docker.abs_host_path(path)
self._docker.execute_cmd(["antler-proj", "remove", container_dir, "dep",
object_name, dependency_name])
- def remove_app(self, path: str, # project path
- app_name: str): # app name
+ def remove_app(self, path: str, # project path
+ app_name: str): # app name
container_dir = self._docker.abs_host_path(path)
self._docker.execute_cmd(["antler-proj", "remove", container_dir, "app", app_name])
- def remove_lib(self, path: str, # project path
- lib_name: str): # lib name
+ def remove_lib(self, path: str, # project path
+ lib_name: str): # lib name
container_dir = self._docker.abs_host_path(path)
self._docker.execute_cmd(["antler-proj", "remove", container_dir, "lib", lib_name])
@@ -636,7 +631,7 @@ def populate_project(self, path):
container_dir = self._docker.abs_host_path(path)
self._docker.execute_cmd(["antler-proj", "populate", container_dir])
-# Integration with antler-proj end ----------------------------------------------------------------------
+ # Integration with antler-proj end ----------------------------------------------------------------------
def execute_cmd(self, args, **kwargs):
self._docker.execute_cmd(args, capture_output=False, **kwargs)
@@ -677,7 +672,7 @@ def init_project(self, name, directory, cmake=True):
['cdt-init', '-project', name, '-path', directory] + bare)
if exit_code != 0:
print(stdout)
- raise dune_error()
+ raise dunes_error()
def create_snapshot(self):
ctx = self._context.get_ctx()
@@ -709,7 +704,7 @@ def deploy_contract(self, directory, acnt):
print(stdout)
else:
print(stderr)
- raise dune_error()
+ raise dunes_error()
def preactivate_feature(self):
ctx = self._context.get_ctx()
@@ -725,7 +720,7 @@ def preactivate_feature(self):
if exit_code != 0:
print(stderr)
- raise dune_error()
+ raise dunes_error()
print("Preactivate Features: " + stdout)
def send_action(self, action, acnt, data, permission='eosio@active'):
@@ -851,17 +846,20 @@ def activate_feature(self, code_name, preactivate=False):
'eosio@active')
else:
print("Feature Not Found")
- raise dune_error()
+ raise dunes_error()
def setup_token(self, currency, max_value, initial_value):
- #Create the currency with a maximum value of max_value tokens.
- self.send_action('create', 'eosio.token', '[ "eosio", "' + max_value + " " + currency + '" ]', 'eosio.token@active')
- #Issue initial_value tokens (Remaining tokens not in circulation can be considered to be held in reserve.)
- self.send_action('issue', 'eosio.token', '[ "eosio", "' + initial_value + " " + currency + '", "memo" ]')
- #Initialize the system account with code zero (needed at initialization time) and currency / token with precision 4
+ # Create the currency with a maximum value of max_value tokens.
+ self.send_action('create', 'eosio.token', '[ "eosio", "' + max_value + " " + currency + '" ]',
+ 'eosio.token@active')
+ # Issue initial_value tokens (Remaining tokens not in circulation can be considered to be held in reserve.)
+ self.send_action('issue', 'eosio.token',
+ '[ "eosio", "' + initial_value + " " + currency + '", "memo" ]')
+ # Initialize the system account with code zero (needed at initialization time) and currency / token with precision 4
self.send_action('init', 'eosio', '["0", "4,' + currency + '"]')
- def bootstrap_system(self, full, currency = 'SYS', max_value = '10000000000.0000', initial_value = '1000000000.0000'):
+ def bootstrap_system(self, full, currency='SYS', max_value='10000000000.0000',
+ initial_value='1000000000.0000'):
self.preactivate_feature()
if full:
# create account for multisig contract
diff --git a/src/dune/node_state.py b/src/dunes/node_state.py
similarity index 100%
rename from src/dune/node_state.py
rename to src/dunes/node_state.py
diff --git a/src/dune/version_selector.py b/src/dunes/version_selector.py
similarity index 100%
rename from src/dune/version_selector.py
rename to src/dunes/version_selector.py
diff --git a/src/plugin/dunes_hello/main.py b/src/plugin/dunes_hello/main.py
new file mode 100644
index 00000000..013c15b6
--- /dev/null
+++ b/src/plugin/dunes_hello/main.py
@@ -0,0 +1,7 @@
+def handle_args(args):
+ if args.hello:
+ print('Hello from DUNES plugin!')
+
+def add_parsing(parser):
+ parser.add_argument('--hello', action='store_true',
+ help='outputs "Hello World"')
diff --git a/tests/common.py b/tests/common.py
index b7666f5c..2adb14a9 100644
--- a/tests/common.py
+++ b/tests/common.py
@@ -6,8 +6,8 @@
TEST_PATH = os.path.dirname(os.path.abspath(__file__))
# Set path for executable:
-DUNE_EXE = os.path.split(TEST_PATH)[0] + "/dune"
-print("Executable path: ", DUNE_EXE)
+DUNES_EXE = os.path.split(TEST_PATH)[0] + "/dune"
+print("Executable path: ", DUNES_EXE)
# Default addresses
DEFAULT_HTTP_ADDR="0.0.0.0:8888"
diff --git a/tests/container.py b/tests/container.py
index 4b15b735..0407a6bd 100644
--- a/tests/container.py
+++ b/tests/container.py
@@ -7,7 +7,7 @@ class container:
_container_name = ""
_image_name = ""
- def __init__(self, container_name='dune_container', image_name='dune:latest'):
+ def __init__(self, container_name='dunes_container', image_name='dunes:latest'):
self._container_name = container_name
self._image_name = image_name
self._debug = True
@@ -75,7 +75,7 @@ def get_container_name(self):
return self._container_name
def commit(self):
- self.execute_docker_cmd(['commit', 'dune', 'dune'])
+ self.execute_docker_cmd(['commit', 'dunes', 'dunes'])
def start(self):
print("Starting docker container [" + self._container_name + "]")
@@ -115,7 +115,7 @@ def execute_bg_cmd(self, cmd):
# possible values for the status: created, restarting, running, removing, paused, exited, dead
def check_status(self, status):
stdout, _, _ = self.execute_docker_cmd(['ps', '--filter',
- 'status=' + status])
+ 'status=' + status])
for line in stdout.splitlines(True):
if "CONTAINER ID" in line:
continue
@@ -126,7 +126,7 @@ def check_status(self, status):
# check if the container is still exists and was not deleted
def exists(self):
stdout, _, _ = self.execute_docker_cmd(['ps', '--filter',
- 'name=' + self._container_name])
+ 'name=' + self._container_name])
for line in stdout.splitlines(True):
if "CONTAINER ID" in line:
continue
diff --git a/tests/show_untested_options.sh b/tests/show_untested_options.sh
index 6aa60fef..f07d5262 100755
--- a/tests/show_untested_options.sh
+++ b/tests/show_untested_options.sh
@@ -3,14 +3,14 @@
# This file MUST remain co-located with the files to work.
-# Find paths to the tests and the dune executable.
+# Find paths to the tests and the DUNES executable.
SCRIPT=`readlink -f "$0"`
TEST_DIR=`dirname "$SCRIPT"`
-DUNE_DIR=`dirname "$TEST_DIR"`
-DUNE="$DUNE_DIR/dune"
+DUNES_DIR=`dirname "$TEST_DIR"`
+DUNES="$DUNES_DIR/dunes"
# Get a list of the options.
-options=`$DUNE --help | grep -o "^ --[a-z\-]*"`
+options=`$DUNES --help | grep -o "^ --[a-z\-]*"`
# Get a list of the test files.
files=`find "$TEST_DIR" | grep "[.]py\$"`
diff --git a/tests/test_antler_proj.py b/tests/test_antler_proj.py
index 184cbf0a..9a2ff49b 100644
--- a/tests/test_antler_proj.py
+++ b/tests/test_antler_proj.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
-"""Test of intergration of antler-proj to DUNE
+"""Test of intergration of antler-proj to DUNES
This script tests following keys:
--create-project
@@ -23,7 +23,7 @@
import subprocess
import pytest
-from common import DUNE_EXE, TEST_PATH
+from common import DUNES_EXE, TEST_PATH
TEST_PROJECT_DIR = TEST_PATH + "/" + "antler_test_dir"
@@ -38,31 +38,31 @@ def remove_existing():
@pytest.mark.skip(reason="Skipped until the release of antler-proj. "
- "See details in https://github.com/AntelopeIO/DUNE/issues/134")
+ "See details in https://github.com/AntelopeIO/DUNES/issues/134")
def test_antler():
remove_existing()
- subprocess.run([DUNE_EXE, "--create-project", "test_proj", TEST_PROJECT_DIR], check=True)
+ subprocess.run([DUNES_EXE, "--create-project", "test_proj", TEST_PROJECT_DIR], check=True)
# Add ------------
- subprocess.run([DUNE_EXE, "--add-app", TEST_PROJECT_DIR, "test_app", "c++",
+ subprocess.run([DUNES_EXE, "--add-app", TEST_PROJECT_DIR, "test_app", "c++",
"compiler_opts", "linker_opts"], check=True)
- res = subprocess.run([DUNE_EXE, "--debug", "--add-app", TEST_PROJECT_DIR, "test_app", "c++",
+ res = subprocess.run([DUNES_EXE, "--debug", "--add-app", TEST_PROJECT_DIR, "test_app", "c++",
"compiler_opts", "linker_opts"], stdout=subprocess.PIPE, check=True)
assert b'already exists in project' in res.stdout
- subprocess.run([DUNE_EXE, "--add-lib", TEST_PROJECT_DIR, "test_lib", "c++",
+ subprocess.run([DUNES_EXE, "--add-lib", TEST_PROJECT_DIR, "test_lib", "c++",
"compiler_opts", "linker_opts"], check=True)
- res = subprocess.run([DUNE_EXE, "--debug", "--add-lib", TEST_PROJECT_DIR, "test_lib", "c++",
+ res = subprocess.run([DUNES_EXE, "--debug", "--add-lib", TEST_PROJECT_DIR, "test_lib", "c++",
"compiler_opts", "linker_opts"], stdout=subprocess.PIPE, check=True)
assert b'already exists in project' in res.stdout
# this test is commented because adding of dependencies doesn't work
- # subprocess.run([DUNE_EXE, "--add-dep", TEST_PROJECT_DIR, "test_app", "test_dep",
+ # subprocess.run([DUNES_EXE, "--add-dep", TEST_PROJECT_DIR, "test_app", "test_dep",
# "larryk85/sample_contract", "0.0.1", "hash"], check=True)
- # res = subprocess.run([DUNE_EXE, "--debug", "--add-dep", TEST_PROJECT_DIR, "test_app", "test_dep",
+ # res = subprocess.run([DUNES_EXE, "--debug", "--add-dep", TEST_PROJECT_DIR, "test_app", "test_dep",
# "larryk85/sample_contract", "0.0.1", "hash"],
# stdout=subprocess.PIPE)
# assert b'already exists for' in res.stdout
@@ -70,13 +70,13 @@ def test_antler():
# Remove ------------
- subprocess.run([DUNE_EXE, "--remove-app", TEST_PROJECT_DIR, "test_app"], check=True)
- res = subprocess.run([DUNE_EXE, "--debug", "--add-app", TEST_PROJECT_DIR, "test_app", "c++",
+ subprocess.run([DUNES_EXE, "--remove-app", TEST_PROJECT_DIR, "test_app"], check=True)
+ res = subprocess.run([DUNES_EXE, "--debug", "--add-app", TEST_PROJECT_DIR, "test_app", "c++",
"compiler_opts", "linker_opts"], stdout=subprocess.PIPE, check=True)
assert b'already exists in project' not in res.stdout
- subprocess.run([DUNE_EXE, "--remove-lib", TEST_PROJECT_DIR, "test_lib"], check=True)
- res = subprocess.run([DUNE_EXE, "--debug", "--add-lib", TEST_PROJECT_DIR, "test_lib", "c++",
+ subprocess.run([DUNES_EXE, "--remove-lib", TEST_PROJECT_DIR, "test_lib"], check=True)
+ res = subprocess.run([DUNES_EXE, "--debug", "--add-lib", TEST_PROJECT_DIR, "test_lib", "c++",
"compiler_opts", "linker_opts"], stdout=subprocess.PIPE, check=True)
assert b'already exists in project' not in res.stdout
diff --git a/tests/test_bootstrap.py b/tests/test_bootstrap.py
index 9cc21439..97f6914a 100644
--- a/tests/test_bootstrap.py
+++ b/tests/test_bootstrap.py
@@ -11,7 +11,7 @@
import subprocess
-from common import DUNE_EXE
+from common import DUNES_EXE
# Globals
NODE_NAME = "my_node"
@@ -22,21 +22,21 @@
def test_booststrap():
# Remove any existing containers.
- subprocess.run([DUNE_EXE, "--destroy-container"], check=True)
+ subprocess.run([DUNES_EXE, "--destroy-container"], check=True)
# Start the new node.
- subprocess.run([DUNE_EXE, "--start",NODE_NAME], check=True)
+ subprocess.run([DUNES_EXE, "--start", NODE_NAME], check=True)
# Create an account.
- subprocess.run([DUNE_EXE, "--create-account",ACCT_NAME], check=True)
+ subprocess.run([DUNES_EXE, "--create-account", ACCT_NAME], check=True)
- account_results = subprocess.run([DUNE_EXE, "--", "cleos", "get", "account", ACCT_NAME], check=True, stdout=subprocess.PIPE)
+ account_results = subprocess.run([DUNES_EXE, "--", "cleos", "get", "account", ACCT_NAME], check=True, stdout=subprocess.PIPE)
assert b'created:' in account_results.stdout
# Create a key. Get it to a var as well.
public_key = None
private_key = None
- stdout_result = subprocess.run([DUNE_EXE,"--create-key"], check=True, stdout=subprocess.PIPE)
+ stdout_result = subprocess.run([DUNES_EXE, "--create-key"], check=True, stdout=subprocess.PIPE)
result_list = stdout_result.stdout.decode().split("\n")
for entry in result_list:
# ignore empty entries.
@@ -51,18 +51,18 @@ def test_booststrap():
assert private_key is not None
# Import the key.
- subprocess.run([DUNE_EXE, "--import-dev-key",private_key], check=True)
+ subprocess.run([DUNES_EXE, "--import-dev-key", private_key], check=True)
# Bootstrap the system.
- subprocess.run([DUNE_EXE, "--bootstrap-system"], check=True)
+ subprocess.run([DUNES_EXE, "--bootstrap-system"], check=True)
# Create a second account
- subprocess.run([DUNE_EXE, "--create-account",ACCT_NAME2], check=True)
+ subprocess.run([DUNES_EXE, "--create-account", ACCT_NAME2], check=True)
# Creation of second account should now be successful
- second_account_results = subprocess.run([DUNE_EXE, "--", "cleos", "get", "account",ACCT_NAME2], check=True, stdout=subprocess.PIPE)
+ second_account_results = subprocess.run([DUNES_EXE, "--", "cleos", "get", "account", ACCT_NAME2], check=True, stdout=subprocess.PIPE)
assert b'created:' in second_account_results.stdout
#Verify that "Create New Account" has been deployed
- results = subprocess.run([DUNE_EXE, "--", "cleos", "get", "abi", "eosio"], check=True, stdout=subprocess.PIPE)
+ results = subprocess.run([DUNES_EXE, "--", "cleos", "get", "abi", "eosio"], check=True, stdout=subprocess.PIPE)
assert b'Create New Account' in results.stdout
diff --git a/tests/test_bootstrap_full.py b/tests/test_bootstrap_full.py
index 8c7ef483..4b1af75b 100644
--- a/tests/test_bootstrap_full.py
+++ b/tests/test_bootstrap_full.py
@@ -11,7 +11,7 @@
import subprocess
-from common import DUNE_EXE
+from common import DUNES_EXE
# Globals
NODE_NAME = "my_node"
@@ -22,21 +22,21 @@
def test_booststrap():
# Remove any existing containers.
- subprocess.run([DUNE_EXE, "--destroy-container"], check=True)
+ subprocess.run([DUNES_EXE, "--destroy-container"], check=True)
# Start the new node.
- subprocess.run([DUNE_EXE, "--start",NODE_NAME], check=True)
+ subprocess.run([DUNES_EXE, "--start", NODE_NAME], check=True)
# Create an account.
- subprocess.run([DUNE_EXE, "--create-account",ACCT_NAME], check=True)
+ subprocess.run([DUNES_EXE, "--create-account", ACCT_NAME], check=True)
- account_results = subprocess.run([DUNE_EXE, "--", "cleos", "get", "account", ACCT_NAME], check=True, stdout=subprocess.PIPE)
+ account_results = subprocess.run([DUNES_EXE, "--", "cleos", "get", "account", ACCT_NAME], check=True, stdout=subprocess.PIPE)
assert b'created:' in account_results.stdout
# Create a key. Get it to a var as well.
public_key = None
private_key = None
- stdout_result = subprocess.run([DUNE_EXE,"--create-key"], check=True, stdout=subprocess.PIPE)
+ stdout_result = subprocess.run([DUNES_EXE, "--create-key"], check=True, stdout=subprocess.PIPE)
result_list = stdout_result.stdout.decode().split("\n")
for entry in result_list:
# ignore empty entries.
@@ -51,25 +51,25 @@ def test_booststrap():
assert private_key is not None
# Import the key.
- subprocess.run([DUNE_EXE, "--import-dev-key",private_key], check=True)
+ subprocess.run([DUNES_EXE, "--import-dev-key", private_key], check=True)
# Bootstrap the system.
- subprocess.run([DUNE_EXE, "--bootstrap-system-full"], check=True)
+ subprocess.run([DUNES_EXE, "--bootstrap-system-full"], check=True)
# Create a second account should fail because of not enough RAM
- subprocess.run([DUNE_EXE, "--create-account",ACCT_NAME2], check=False)
+ subprocess.run([DUNES_EXE, "--create-account", ACCT_NAME2], check=False)
- second_account_results = subprocess.run([DUNE_EXE, "--", "cleos", "get", "account",ACCT_NAME2], check=False, stdout=subprocess.PIPE)
+ second_account_results = subprocess.run([DUNES_EXE, "--", "cleos", "get", "account", ACCT_NAME2], check=False, stdout=subprocess.PIPE)
assert b'created:' not in second_account_results.stdout
# Create an example account with RAM
- subprocess.run([DUNE_EXE, "--system-newaccount", ACCT_NAME2, "eosio", "EOS8C5BLCX2LrmcRLHMC8bN5mML4aFSHrZvyijzfLy48tiije6nTt",
+ subprocess.run([DUNES_EXE, "--system-newaccount", ACCT_NAME2, "eosio", "EOS8C5BLCX2LrmcRLHMC8bN5mML4aFSHrZvyijzfLy48tiije6nTt",
"5KNitA34Usr2EVLQKtFrwAJVhyB2F3U7fDHEuP2ee2zZ16w7PeB",
- "--", "--stake-net", "1.0000 SYS", "--stake-cpu", "1.0000 SYS", "--buy-ram-bytes", "3000" ], check=True)
+ "--", "--stake-net", "1.0000 SYS", "--stake-cpu", "1.0000 SYS", "--buy-ram-bytes", "3000"], check=True)
# Creation of second account should now be successful
- second_account_results = subprocess.run([DUNE_EXE, "--", "cleos", "get", "account",ACCT_NAME2], check=True, stdout=subprocess.PIPE)
+ second_account_results = subprocess.run([DUNES_EXE, "--", "cleos", "get", "account", ACCT_NAME2], check=True, stdout=subprocess.PIPE)
assert b'created:' in second_account_results.stdout
- results = subprocess.run([DUNE_EXE, "--get-table", "eosio.token", "eosio", "accounts"], check=True, stdout=subprocess.PIPE)
+ results = subprocess.run([DUNES_EXE, "--get-table", "eosio.token", "eosio", "accounts"], check=True, stdout=subprocess.PIPE)
assert b'"rows"' in results.stdout
diff --git a/tests/test_container.py b/tests/test_container.py
index 367a3c28..fe93d6c5 100644
--- a/tests/test_container.py
+++ b/tests/test_container.py
@@ -1,36 +1,36 @@
#!/usr/bin/env python3
-"""Test DUNE container controls
+"""Test DUNES container controls
This script test works with the Docker container.
"""
import subprocess
-from common import DUNE_EXE
+from common import DUNES_EXE
from container import container
def test_container_actions():
""" Test the start, stop, and destroy action for containers. """
- cntr = container('dune_container', 'dune:latest')
+ cntr = container('dunes_container', 'dunes:latest')
# Remove any container that already exists.
if cntr.exists():
- subprocess.run([DUNE_EXE, "--destroy-container"], check=True)
+ subprocess.run([DUNES_EXE, "--destroy-container"], check=True)
# Create/start the container.
- subprocess.run([DUNE_EXE, "--start-container"], check=True)
+ subprocess.run([DUNES_EXE, "--start-container"], check=True)
assert cntr.check_status("running") is True
# Stop the container.
- subprocess.run([DUNE_EXE, "--stop-container"], check=True)
+ subprocess.run([DUNES_EXE, "--stop-container"], check=True)
assert cntr.check_status("exited") is True
# Restart the container.
- subprocess.run([DUNE_EXE, "--start-container"], check=True)
+ subprocess.run([DUNES_EXE, "--start-container"], check=True)
assert cntr.check_status("running") is True
# Destroy the container.
- subprocess.run([DUNE_EXE, "--destroy-container"], check=True)
+ subprocess.run([DUNES_EXE, "--destroy-container"], check=True)
assert cntr.exists() is False
diff --git a/tests/test_debug.py b/tests/test_debug.py
index 330dc037..333aebb6 100644
--- a/tests/test_debug.py
+++ b/tests/test_debug.py
@@ -11,7 +11,7 @@
import subprocess
-from common import DUNE_EXE
+from common import DUNES_EXE
def test_version_debug():
@@ -19,4 +19,4 @@ def test_version_debug():
# Call DUNE, we only care that `--debug` is available, not that it
# does anything. For now.
- subprocess.run([DUNE_EXE,"--version","--debug"], check=True)
+ subprocess.run([DUNES_EXE, "--version", "--debug"], check=True)
diff --git a/tests/test_deploy.py b/tests/test_deploy.py
index 66d1b8f8..917b18a3 100644
--- a/tests/test_deploy.py
+++ b/tests/test_deploy.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
-"""Test DUNE Functions.
+"""Test DUNES Functions.
This script tests work with the smart contract related keys:
--deploy
@@ -11,7 +11,7 @@
import shutil
import subprocess
-from common import DUNE_EXE,TEST_PATH
+from common import DUNES_EXE, TEST_PATH
# Globals
NODE_NAME = "my_node"
@@ -27,25 +27,26 @@ def test_deploy():
"""Test `--deploy` key."""
# Remove any existing containers and old build directories.
- subprocess.run([DUNE_EXE,"--destroy-container"], check=True)
+ subprocess.run([DUNES_EXE, "--destroy-container"], check=True)
if os.path.exists(TEST_APP_DIR):
print("Removing TEST_APP_DIR: ", TEST_APP_DIR)
shutil.rmtree(TEST_APP_DIR)
# Create a new node and an account.
- subprocess.run([DUNE_EXE, "--start", NODE_NAME], check=True)
- subprocess.run([DUNE_EXE, "--create-account", ACCT_NAME], check=True)
+ subprocess.run([DUNES_EXE, "--start", NODE_NAME], check=True)
+ subprocess.run([DUNES_EXE, "--create-account", ACCT_NAME], check=True)
# Create and build a test app.
- subprocess.run([DUNE_EXE, "--create-cmake-app", PROJECT_NAME, TEST_PATH], check=True)
- subprocess.run([DUNE_EXE, "--cmake-build", TEST_APP_DIR], check=True)
+ subprocess.run([DUNES_EXE, "--create-cmake-app", PROJECT_NAME, TEST_PATH], check=True)
+ subprocess.run([DUNES_EXE, "--cmake-build", TEST_APP_DIR], check=True)
assert os.path.isfile(TEST_APP_WASM) is True
- subprocess.run([DUNE_EXE, "--deploy", TEST_APP_BLD_DIR, ACCT_NAME], check=True)
+ subprocess.run([DUNES_EXE, "--deploy", TEST_APP_BLD_DIR, ACCT_NAME], check=True)
# Send the action and search for a response in the result.
- # ./dune --debug --send-action myaccount hi ["test"] eosio@active
- results = subprocess.run([DUNE_EXE, "--send-action", ACCT_NAME, "hi", '["test"]', "eosio@active"], check=True, stdout=subprocess.PIPE)
+ # ./dunes --debug --send-action myaccount hi ["test"] eosio@active
+ results = subprocess.run([DUNES_EXE, "--send-action", ACCT_NAME, "hi", '["test"]', "eosio@active"],
+ check=True, stdout=subprocess.PIPE)
assert b'>> Name : test' in results.stdout
# Clean up after tests.
diff --git a/tests/test_help.py b/tests/test_help.py
index 74cfe332..9eb66171 100644
--- a/tests/test_help.py
+++ b/tests/test_help.py
@@ -1,31 +1,29 @@
#!/usr/bin/env python3
-"""Test DUNE Help
+"""Test DUNES Help
This script tests that the compiled binary produce expected output
in response to `-h`, `--help`, and `` options.
"""
-
-
import subprocess
-from common import DUNE_EXE
+from common import DUNES_EXE
def test_invalid_option():
- """Test that the output of `dune ` is as expected."""
+ """Test that the output of `dunes ` is as expected."""
# List of expected values.
expect_list = \
[
- b'usage: dune',
- b'dune: error: unrecognized arguments: --some-invalid-option'
+ b'usage: dunes',
+ b'dunes: error: unrecognized arguments: --some-invalid-option'
]
# Call the tool, check for failed return code
# pylint: disable=subprocess-run-check
- completed_process = subprocess.run([DUNE_EXE,"--some-invalid-option"], stderr=subprocess.PIPE)
+ completed_process = subprocess.run([DUNES_EXE, "--some-invalid-option"], stderr=subprocess.PIPE)
assert completed_process.returncode != 0
# Test for expected values in the captured output.
@@ -34,13 +32,13 @@ def test_invalid_option():
def test_help():
- """Test that the output of `dune -h` and `dune --help` is as expected."""
+ """Test that the output of `dunes -h` and `dunes --help` is as expected."""
# List of expected values.
expect_list = \
[
- b'usage: dune',
- b'DUNE: Docker Utilities for Node Execution',
+ b'usage: dunes',
+ b'DUNES: Docker Utilities for Node Execution',
b'-h, --help',
b'--monitor',
b'--start',
@@ -51,11 +49,11 @@ def test_help():
]
- # Call DUNE.
- completed_process_h = subprocess.run([DUNE_EXE,"-h"], check=True, stdout=subprocess.PIPE)
+ # Call DUNES.
+ completed_process_h = subprocess.run([DUNES_EXE, "-h"], check=True, stdout=subprocess.PIPE)
- # Call DUNE.
- completed_process_help = subprocess.run([DUNE_EXE,"--help"], check=True, stdout=subprocess.PIPE)
+ # Call DUNES.
+ completed_process_help = subprocess.run([DUNES_EXE, "--help"], check=True, stdout=subprocess.PIPE)
# Test that the output of all the above executions is the same
assert completed_process_h.stdout == completed_process_help.stdout
diff --git a/tests/test_keys.py b/tests/test_keys.py
index bb9b6dc8..b897b4f3 100644
--- a/tests/test_keys.py
+++ b/tests/test_keys.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
-"""Test DUNE Version
+"""Test DUNES Version
This script tests work with the crypto keys:
--create-key
@@ -9,7 +9,7 @@
"""
import subprocess
-from common import DUNE_EXE
+from common import DUNES_EXE
from container import container
@@ -17,14 +17,14 @@ def test_create_and_import_keys():
"""Test `--create-key` and `--import-dev-key` key."""
# Ensure a container exists.
- cntr = container('dune_container', 'dune:latest')
+ cntr = container('dunes_container', 'dunes:latest')
if not cntr.exists():
cntr.create()
# Create a key. Get it to a var as well.
public_key = None
private_key = None
- stdout_result = subprocess.run([DUNE_EXE,"--create-key"], check=True, stdout=subprocess.PIPE)
+ stdout_result = subprocess.run([DUNES_EXE, "--create-key"], check=True, stdout=subprocess.PIPE)
result_list = stdout_result.stdout.decode().split("\n")
for entry in result_list:
# ignore empty entries.
@@ -40,4 +40,4 @@ def test_create_and_import_keys():
assert private_key is not None
# Import the key.
- subprocess.run([DUNE_EXE,"--import-dev-key",private_key], check=True)
+ subprocess.run([DUNES_EXE, "--import-dev-key", private_key], check=True)
diff --git a/tests/test_list_features.py b/tests/test_list_features.py
index d85e9b19..d05e32f0 100644
--- a/tests/test_list_features.py
+++ b/tests/test_list_features.py
@@ -1,22 +1,21 @@
#!/usr/bin/env python3
-"""Test DUNE List Features
+"""Test DUNES List Features
This script tests that the compiled binary produce expected output in
response to the `--list-features` option.
"""
-
import subprocess
-from common import DUNE_EXE
+from common import DUNES_EXE
def test_list_features():
- """Test that the output of `dune --list-features` is as expected."""
+ """Test that the output of `dunes --list-features` is as expected."""
- # List of expected output lines from `dune --list-features`.
+ # List of expected output lines from `dunes --list-features`.
expect_list = \
[b"GET_CODE_HASH",
b"CRYPTO_PRIMITIVES",
@@ -43,6 +42,6 @@ def test_list_features():
expect = expect + temp + b'\n'
# Call the tool, check return code, check expected value.
- completed_process = subprocess.run([DUNE_EXE,"--list-features"],
+ completed_process = subprocess.run([DUNES_EXE, "--list-features"],
check=True, stdout=subprocess.PIPE)
assert completed_process.stdout == expect
diff --git a/tests/test_monitor.py b/tests/test_monitor.py
index 8e9153db..590dec1c 100644
--- a/tests/test_monitor.py
+++ b/tests/test_monitor.py
@@ -1,33 +1,32 @@
#!/usr/bin/env python3
-"""Test DUNE Version
+"""Test DUNES Version
This script tests --monitor key
"""
import subprocess
-from common import DUNE_EXE
+from common import DUNES_EXE
from container import container
def test_monitor():
"""Test `--monitor` key."""
-
# Remove any container that already exists.
- cntr = container('dune_container', 'dune:latest')
+ cntr = container('dunes_container', 'dunes:latest')
if cntr.exists():
- subprocess.run([DUNE_EXE, "--destroy-container"], check=True)
+ subprocess.run([DUNES_EXE, "--destroy-container"], check=True)
# This will start a container; however, there will be NO active node, so it will fail.
- results = subprocess.run([DUNE_EXE, "--monitor"], capture_output=True, check=False)
+ results = subprocess.run([DUNES_EXE, "--monitor"], capture_output=True, check=False)
assert results.returncode != 0
assert cntr.check_status("running") is True
# Start a node.
- subprocess.run([DUNE_EXE,"--start", "my_node"], check=True)
+ subprocess.run([DUNES_EXE, "--start", "my_node"], check=True)
# Now try to monitor again.
- results = subprocess.run([DUNE_EXE, "--monitor"], capture_output=True, check=False)
+ results = subprocess.run([DUNES_EXE, "--monitor"], capture_output=True, check=False)
assert b'server_version' in results.stdout
diff --git a/tests/test_nodes.py b/tests/test_nodes.py
index 0c821c82..cd64d83c 100644
--- a/tests/test_nodes.py
+++ b/tests/test_nodes.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
-"""Test various DUNE commands.
+"""Test various DUNES commands.
This script tests that the compiled binary produce expected output for these commands:
--start
@@ -16,7 +16,6 @@
"""
-import os # mkdir
import shutil # rmtree
import subprocess
@@ -39,11 +38,12 @@
ALT_P2P_ADDR="0.0.0.0:9992"
ALT_SHIP_ADDR="0.0.0.0:9993"
+
def remove_all():
""" Remove any existing nodes. """
- # Call dune, check the return is True.
- completed_process = subprocess.run([DUNE_EXE,"--simple-list"],
+ # Call dunes, check the return is True.
+ completed_process = subprocess.run([DUNES_EXE, "--simple-list"],
check=True, stdout=subprocess.PIPE)
# Convert the captured stdin to a list.
@@ -60,11 +60,11 @@ def remove_all():
# Remove the entry
name = entry.split('|')[0]
print("Removing: ", name)
- subprocess.run([DUNE_EXE,"--remove",name], check=True)
+ subprocess.run([DUNES_EXE, "--remove", name], check=True)
def validate_node_state( node_name, active_state, running_state ):
- """Validate the result of a call to `dune --simple-list` contains the
+ """Validate the result of a call to `dunes --simple-list` contains the
node in a given state.
:param node_name: The node to search for.
@@ -87,8 +87,8 @@ def validate_node_state( node_name, active_state, running_state ):
expect += "N|"
expect += DEFAULT_HTTP_ADDR + "|" + DEFAULT_P2P_ADDR + "|" + DEFAULT_SHIP_ADDR
- # Call dune, check the return is True.
- completed_process = subprocess.run([DUNE_EXE,"--simple-list"],
+ # Call dunes, check the return is True.
+ completed_process = subprocess.run([DUNES_EXE, "--simple-list"],
check=True, stdout=subprocess.PIPE)
# Convert the captured stdin to a list for comparison with expected output.
@@ -99,7 +99,7 @@ def validate_node_state( node_name, active_state, running_state ):
# pylint: disable=too-many-branches
def validate_node_list( node_list ):
- """Validate the result of a call to `dune --simple-list` contains all
+ """Validate the result of a call to `dunes --simple-list` contains all
the nodes and states in node_list.
:param node_list: A list of lists with the form:
@@ -120,7 +120,7 @@ def validate_node_list( node_list ):
# Valid the array count in the entry.
is_valid = True
- if not len(entry) in (1,2,3,4,5,6):
+ if not len(entry) in (1, 2, 3, 4, 5, 6):
print("len() should be a value between 1 and 6 but is: ", len(entry), " value: ", entry)
is_valid = False
@@ -128,7 +128,7 @@ def validate_node_list( node_list ):
active = False
if len(entry) > 1:
active = entry[1]
- if not active in (True,False):
+ if active not in (True, False):
print("Invalid value for Active. Expect True/False, received: ", active)
is_valid = False
@@ -136,7 +136,7 @@ def validate_node_list( node_list ):
running = False
if len(entry) > 2:
running = entry[2]
- if not running in (True,False):
+ if running not in (True, False):
print("Invalid value for Running. Expect True/False, received: ", running)
is_valid = False
@@ -147,7 +147,7 @@ def validate_node_list( node_list ):
p2p_addr=DEFAULT_P2P_ADDR
if len(entry) > 4:
p2p_addr = entry[4]
- ship_addr=DEFAULT_SHIP_ADDR
+ ship_addr = DEFAULT_SHIP_ADDR
if len(entry) > 5:
ship_addr = entry[5]
@@ -166,9 +166,8 @@ def validate_node_list( node_list ):
temp += http_addr + "|" + p2p_addr + "|" + ship_addr
expect_list.append(temp)
-
- # Call dune, check the return is True.
- completed_process = subprocess.run([DUNE_EXE,"--simple-list"],
+ # Call dunes, check the return is True.
+ completed_process = subprocess.run([DUNES_EXE, "--simple-list"],
check=True, stdout=subprocess.PIPE)
# Convert the captured stdin to a list for comparison with expected output.
@@ -190,13 +189,13 @@ def validate_node_list( node_list ):
def expect_empty_verbose_list():
"""Test that the output of list options are empty."""
- # List of expected output lines from `dune --list`.
+ # List of expected output lines from `dunes --list`.
empty_verbose_list = \
"Node Name | Active? | Running? | HTTP | P2P | SHiP \n" + \
"---------------------------------------------------------------------------------\n"
# Call the tool, check expected value.
- completed_process = subprocess.run([DUNE_EXE,"--list"], check=True, stdout=subprocess.PIPE)
+ completed_process = subprocess.run([DUNES_EXE, "--list"], check=True, stdout=subprocess.PIPE)
assert completed_process.stdout.decode() == empty_verbose_list
@@ -205,10 +204,10 @@ def test_nodes():
"""Run the tests."""
# Remove any container that already exists and create a fresh one.
- cntr = container('dune_container', 'dune:latest')
+ cntr = container('dunes_container', 'dunes:latest')
if cntr.exists():
- subprocess.run([DUNE_EXE, "--destroy-container"], check=True)
- subprocess.run([DUNE_EXE, "--start-container"], check=True)
+ subprocess.run([DUNES_EXE, "--destroy-container"], check=True)
+ subprocess.run([DUNES_EXE, "--start-container"], check=True)
# Ensure there are no existing nodes.
# Tests `--simple-list` and `--list`
@@ -218,60 +217,60 @@ def test_nodes():
# Create a node and test its state.
# Tests `--start` when the node needs to be created.
- subprocess.run([DUNE_EXE,"--start", NODE_ALPHA], check=True)
+ subprocess.run([DUNES_EXE, "--start", NODE_ALPHA], check=True)
validate_node_state(NODE_ALPHA, True, True)
# Stop the node and test its state.
# Tests `--stop`
- subprocess.run([DUNE_EXE,"--stop", NODE_ALPHA], check=True)
+ subprocess.run([DUNES_EXE, "--stop", NODE_ALPHA], check=True)
validate_node_state(NODE_ALPHA, True, False)
# Restart the node and test its state.
# Tests `--start` when the node already exists.
- subprocess.run([DUNE_EXE,"--start", NODE_ALPHA], check=True)
+ subprocess.run([DUNES_EXE, "--start", NODE_ALPHA], check=True)
validate_node_state(NODE_ALPHA, True, True)
# Create a 2nd node and test the state of both nodes.
# Tests the behavior of `--start` on an already active, running node.
- subprocess.run([DUNE_EXE,"--start", NODE_BRAVO], check=True)
+ subprocess.run([DUNES_EXE, "--start", NODE_BRAVO], check=True)
validate_node_state(NODE_BRAVO, True, True)
validate_node_list([[NODE_ALPHA, False, False],[NODE_BRAVO, True, True]])
# Test --get-active shows NODE_BRAVO
# Tests `--get-active`.
- assert subprocess.run([DUNE_EXE,"--get-active"], check=True, stdout=subprocess.PIPE).stdout.decode() == (NODE_BRAVO + "\n")
+ assert subprocess.run([DUNES_EXE, "--get-active"], check=True, stdout=subprocess.PIPE).stdout.decode() == (NODE_BRAVO + "\n")
# Test --set-active works to switch to NODE_ALPHA and --get active returns the correct value.
# Tests `--set-active` switch active node while run state is left unchanged.
- subprocess.run([DUNE_EXE,"--set-active", NODE_ALPHA], check=True)
+ subprocess.run([DUNES_EXE, "--set-active", NODE_ALPHA], check=True)
validate_node_list([[NODE_ALPHA, True, False],[NODE_BRAVO, False, True]]) # Note this is TF,FT
- assert subprocess.run([DUNE_EXE,"--get-active"], check=True, stdout=subprocess.PIPE).stdout.decode() == (NODE_ALPHA + "\n")
+ assert subprocess.run([DUNES_EXE, "--get-active"], check=True, stdout=subprocess.PIPE).stdout.decode() == (NODE_ALPHA + "\n")
# Remove NODE_ALPHA, ensure it is no longer in the list.
# Tests `--remove`.
- subprocess.run([DUNE_EXE,"--remove", NODE_ALPHA], check=True)
+ subprocess.run([DUNES_EXE, "--remove", NODE_ALPHA], check=True)
validate_node_list([[NODE_BRAVO, False, True]]) # Note the state of NODE_BRAVO is FT
# Remove anything to get to a clean slate.
remove_all()
# Test `--start` where start includes a config path.
- subprocess.run([DUNE_EXE,"--start", NODE_ALPHA, "--config", CONFIG_PATH], check=True)
+ subprocess.run([DUNES_EXE, "--start", NODE_ALPHA, "--config", CONFIG_PATH], check=True)
validate_node_list([[NODE_ALPHA, True, True, ALT_HTTP_ADDR, ALT_P2P_ADDR, ALT_SHIP_ADDR]])
# Test `--start` where start includes a config file.
- subprocess.run([DUNE_EXE,"--start", NODE_BRAVO, "--config", CONFIG_FILE], check=True)
+ subprocess.run([DUNES_EXE, "--start", NODE_BRAVO, "--config", CONFIG_FILE], check=True)
validate_node_list([[NODE_ALPHA, False, False, ALT_HTTP_ADDR, ALT_P2P_ADDR, ALT_SHIP_ADDR],
[NODE_BRAVO, True, True, ALT_HTTP_ADDR, ALT_P2P_ADDR, ALT_SHIP_ADDR]])
# Test `--start` with invalid config file path.
# pylint: disable=subprocess-run-check
- completed_process = subprocess.run([DUNE_EXE,"--start", NODE_ALPHA, "--config", "unknown_config"], check=False)
+ completed_process = subprocess.run([DUNES_EXE, "--start", NODE_ALPHA, "--config", "unknown_config"], check=False)
assert completed_process.returncode != 0
validate_node_list([[NODE_ALPHA, False, False, ALT_HTTP_ADDR, ALT_P2P_ADDR, ALT_SHIP_ADDR],
[NODE_BRAVO, True, True, ALT_HTTP_ADDR, ALT_P2P_ADDR, ALT_SHIP_ADDR]])
# Test `--config` alone.
# pylint: disable=subprocess-run-check
- completed_process = subprocess.run([DUNE_EXE,"--config", "unknown_config"], check=False)
+ completed_process = subprocess.run([DUNES_EXE, "--config", "unknown_config"], check=False)
assert completed_process.returncode != 0
validate_node_list([[NODE_ALPHA, False, False, ALT_HTTP_ADDR, ALT_P2P_ADDR, ALT_SHIP_ADDR],
[NODE_BRAVO, True, True, ALT_HTTP_ADDR, ALT_P2P_ADDR, ALT_SHIP_ADDR]])
@@ -287,9 +286,8 @@ def test_nodes():
shutil.rmtree(EXPORT_DIR)
os.mkdir(EXPORT_DIR)
-
# Just add an additional node for export.
- subprocess.run([DUNE_EXE,"--start", NODE_CHARLIE], check=True)
+ subprocess.run([DUNES_EXE, "--start", NODE_CHARLIE], check=True)
validate_node_list([[NODE_ALPHA, False, False, ALT_HTTP_ADDR, ALT_P2P_ADDR, ALT_SHIP_ADDR],
[NODE_BRAVO, False, True, ALT_HTTP_ADDR, ALT_P2P_ADDR, ALT_SHIP_ADDR],
[NODE_CHARLIE, True, True, DEFAULT_HTTP_ADDR, DEFAULT_P2P_ADDR, DEFAULT_SHIP_ADDR]])
@@ -298,17 +296,17 @@ def test_nodes():
# export to TEST_PATH, TEST_PATH/my_file.tgz, TEST_PATH/does_not_exist_yet/my_file.tgz
# Test --export-node using standard filename.
- subprocess.run([DUNE_EXE,"--export-node", NODE_ALPHA, EXPORT_DIR], check=True)
+ subprocess.run([DUNES_EXE, "--export-node", NODE_ALPHA, EXPORT_DIR], check=True)
assert os.path.exists(EXPORT_DIR + "/" + NODE_ALPHA + ".tgz")
# Below check documents current behavior: node_bravo is active, however before exporting node_charlie was active.
- # Fix this in issue https://github.com/AntelopeIO/DUNE/issues/159
+ # Fix this in issue https://github.com/AntelopeIO/DUNES/issues/159
validate_node_list([[NODE_ALPHA, False, False, ALT_HTTP_ADDR, ALT_P2P_ADDR, ALT_SHIP_ADDR],
[NODE_BRAVO, True, True, ALT_HTTP_ADDR, ALT_P2P_ADDR, ALT_SHIP_ADDR],
[NODE_CHARLIE, False, True, DEFAULT_HTTP_ADDR, DEFAULT_P2P_ADDR, DEFAULT_SHIP_ADDR]])
# Test --export-node using provided filename.
- subprocess.run([DUNE_EXE,"--export-node", NODE_BRAVO, EXPORT_DIR + "/bravo_export.tgz"], check=True)
+ subprocess.run([DUNES_EXE, "--export-node", NODE_BRAVO, EXPORT_DIR + "/bravo_export.tgz"], check=True)
assert os.path.exists(EXPORT_DIR + "/bravo_export.tgz")
validate_node_list([[NODE_ALPHA, False, False, ALT_HTTP_ADDR, ALT_P2P_ADDR, ALT_SHIP_ADDR],
@@ -316,7 +314,7 @@ def test_nodes():
[NODE_CHARLIE, False, True, DEFAULT_HTTP_ADDR, DEFAULT_P2P_ADDR, DEFAULT_SHIP_ADDR]])
# Test --export-node using non-existing path.
- subprocess.run([DUNE_EXE,"--export-node", NODE_CHARLIE, EXPORT_DIR + "/new_path/charlie_export.tgz"], check=True)
+ subprocess.run([DUNES_EXE, "--export-node", NODE_CHARLIE, EXPORT_DIR + "/new_path/charlie_export.tgz"], check=True)
assert os.path.exists(EXPORT_DIR + "/new_path/charlie_export.tgz")
validate_node_list([[NODE_ALPHA, False, False, ALT_HTTP_ADDR, ALT_P2P_ADDR, ALT_SHIP_ADDR],
@@ -328,14 +326,14 @@ def test_nodes():
# Test --import-node
# Import each node from the export tests and
- subprocess.run([DUNE_EXE,"--import-node", EXPORT_DIR + "/ALPHA_NODE.tgz", NODE_ALPHA], check=True)
+ subprocess.run([DUNES_EXE, "--import-node", EXPORT_DIR + "/ALPHA_NODE.tgz", NODE_ALPHA], check=True)
validate_node_list([[NODE_ALPHA, True, True, ALT_HTTP_ADDR, ALT_P2P_ADDR, ALT_SHIP_ADDR]])
- subprocess.run([DUNE_EXE,"--import-node", EXPORT_DIR + "/bravo_export.tgz", NODE_BRAVO], check=True)
+ subprocess.run([DUNES_EXE, "--import-node", EXPORT_DIR + "/bravo_export.tgz", NODE_BRAVO], check=True)
validate_node_list([[NODE_ALPHA, False, False, ALT_HTTP_ADDR, ALT_P2P_ADDR, ALT_SHIP_ADDR],
[NODE_BRAVO, True, True, ALT_HTTP_ADDR, ALT_P2P_ADDR, ALT_SHIP_ADDR]])
- subprocess.run([DUNE_EXE,"--import-node", EXPORT_DIR + "/new_path/charlie_export.tgz", NODE_CHARLIE], check=True)
+ subprocess.run([DUNES_EXE, "--import-node", EXPORT_DIR + "/new_path/charlie_export.tgz", NODE_CHARLIE], check=True)
validate_node_list([[NODE_ALPHA, False, False, ALT_HTTP_ADDR, ALT_P2P_ADDR, ALT_SHIP_ADDR],
[NODE_BRAVO, False, True, ALT_HTTP_ADDR, ALT_P2P_ADDR, ALT_SHIP_ADDR],
[NODE_CHARLIE, True, True, DEFAULT_HTTP_ADDR, DEFAULT_P2P_ADDR, DEFAULT_SHIP_ADDR]])
@@ -343,14 +341,15 @@ def test_nodes():
# Finally, clean everything up before final return.
remove_all()
+
def test_start_active_node():
"""start_active_node"""
# Remove any container that already exists and create a fresh one.
- cntr = container('dune_container', 'dune:latest')
+ cntr = container('dunes_container', 'dunes:latest')
if cntr.exists():
- subprocess.run([DUNE_EXE, "--destroy-container"], check=True)
- subprocess.run([DUNE_EXE, "--start-container"], check=True)
+ subprocess.run([DUNES_EXE, "--destroy-container"], check=True)
+ subprocess.run([DUNES_EXE, "--start-container"], check=True)
# Ensure there are no existing nodes.
# Tests `--simple-list` and `--list`
@@ -360,32 +359,31 @@ def test_start_active_node():
# Create a node and test its state.
# Tests `--start` when the node needs to be created.
- subprocess.run([DUNE_EXE,"--start", NODE_ALPHA], check=True)
+ subprocess.run([DUNES_EXE, "--start", NODE_ALPHA], check=True)
validate_node_state(NODE_ALPHA, True, True)
-
# Create a 2nd node and test the state of both nodes.
- subprocess.run([DUNE_EXE,"--start", NODE_BRAVO], check=True)
+ subprocess.run([DUNES_EXE, "--start", NODE_BRAVO], check=True)
validate_node_state(NODE_BRAVO, True, True)
validate_node_list([[NODE_ALPHA, False, False], [NODE_BRAVO, True, True]])
# Create a 3rd node
- subprocess.run([DUNE_EXE,"--start", NODE_CHARLIE], check=True)
+ subprocess.run([DUNES_EXE, "--start", NODE_CHARLIE], check=True)
validate_node_state(NODE_CHARLIE, True, True)
validate_node_list([[NODE_ALPHA, False, False], [NODE_BRAVO, False, False], [NODE_CHARLIE, True, True]])
# Test --get-active shows NODE_BRAVO
# Tests `--get-active`.
- assert subprocess.run([DUNE_EXE,"--get-active"], check=True, stdout=subprocess.PIPE).stdout.decode() == (NODE_CHARLIE + "\n")
+ assert subprocess.run([DUNES_EXE, "--get-active"], check=True, stdout=subprocess.PIPE).stdout.decode() == (NODE_CHARLIE + "\n")
# Test --set-active works to switch to NODE_ALPHA and --get active returns the correct value.
# Tests `--set-active` switch active node while run state is left unchanged.
- subprocess.run([DUNE_EXE,"--set-active", NODE_ALPHA], check=True)
+ subprocess.run([DUNES_EXE, "--set-active", NODE_ALPHA], check=True)
validate_node_list([[NODE_ALPHA, True, False], [NODE_BRAVO, False, False], [NODE_CHARLIE, False, True]]) # Note this is TF,FT
- assert subprocess.run([DUNE_EXE,"--get-active"], check=True, stdout=subprocess.PIPE).stdout.decode() == (NODE_ALPHA + "\n")
+ assert subprocess.run([DUNES_EXE, "--get-active"], check=True, stdout=subprocess.PIPE).stdout.decode() == (NODE_ALPHA + "\n")
# Make sure you can start active node
- subprocess.run([DUNE_EXE,"--start", NODE_ALPHA], check=True)
+ subprocess.run([DUNES_EXE, "--start", NODE_ALPHA], check=True)
validate_node_state(NODE_ALPHA, True, True)
validate_node_list([[NODE_ALPHA, True, True], [NODE_BRAVO, False, False], [NODE_CHARLIE, False, False]])
diff --git a/tests/test_plugin.py b/tests/test_plugin.py
index ff143027..9d3c6a6a 100644
--- a/tests/test_plugin.py
+++ b/tests/test_plugin.py
@@ -9,7 +9,7 @@
import shutil
import subprocess
-from common import DUNE_EXE
+from common import DUNES_EXE
current_script_path = os.path.abspath(__file__)
current_script_dir = os.path.dirname(current_script_path)
@@ -33,7 +33,7 @@ def test_plugin_help():
]
# Call DUNE.
- completed_process = subprocess.run([DUNE_EXE,"--help"], check=True, stdout=subprocess.PIPE)
+ completed_process = subprocess.run([DUNES_EXE, "--help"], check=True, stdout=subprocess.PIPE)
# Test for expected values in the captured output.
for expect in expect_list:
@@ -51,7 +51,7 @@ def test_plugin_execution():
]
# Call DUNE.
- completed_process = subprocess.run([DUNE_EXE,"--hello"], check=True, stdout=subprocess.PIPE)
+ completed_process = subprocess.run([DUNES_EXE, "--hello"], check=True, stdout=subprocess.PIPE)
# Test for expected values in the captured output.
for expect in expect_list:
diff --git a/tests/test_project.py b/tests/test_project.py
index b4f12f42..3936b8bc 100644
--- a/tests/test_project.py
+++ b/tests/test_project.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
-"""Test DUNE Version
+"""Test DUNES Version
This script tests work with the a smart contract project keys:
--create-cmake-app
@@ -15,7 +15,7 @@
import shutil
import subprocess
-from common import DUNE_EXE,TEST_PATH
+from common import DUNES_EXE,TEST_PATH
from container import container
@@ -28,7 +28,7 @@
def remove_existing():
""" Remove an existing `./test_app` dir. """
- cntr = container('dune_container', 'dune:latest')
+ cntr = container('dunes_container', 'dunes:latest')
cntr.stop()
if os.path.exists(TEST_APP_DIR):
@@ -55,7 +55,7 @@ def test_create_cmake_app():
TEST_APP_DIR + '/README.txt']
# Create the test app.
- completed_process = subprocess.run([DUNE_EXE, "--create-cmake-app", PROJECT_NAME, TEST_PATH], check=True)
+ completed_process = subprocess.run([DUNES_EXE, "--create-cmake-app", PROJECT_NAME, TEST_PATH], check=True)
assert completed_process.returncode == 0
assert os.path.isdir(TEST_APP_DIR) is True
@@ -83,8 +83,7 @@ def test_create_bare_app():
TEST_APP_DIR + '/' + PROJECT_NAME + '.contracts.md',
TEST_APP_DIR + '/README.txt']
-
- subprocess.run([DUNE_EXE, "--create-bare-app", PROJECT_NAME, TEST_PATH], check=True)
+ subprocess.run([DUNES_EXE, "--create-bare-app", PROJECT_NAME, TEST_PATH], check=True)
assert os.path.isdir(TEST_APP_DIR) is True
# Actual file list.
@@ -99,25 +98,24 @@ def test_create_bare_app():
shutil.rmtree(TEST_APP_DIR)
-
def test_cmake_and_ctest():
"""Test `--cmake` and `--ctest` key."""
remove_existing()
# Create the cmake app, test it exists.
- subprocess.run([DUNE_EXE, "--create-cmake-app", PROJECT_NAME, TEST_PATH], check=True)
+ subprocess.run([DUNES_EXE, "--create-cmake-app", PROJECT_NAME, TEST_PATH], check=True)
assert os.path.isdir(TEST_APP_DIR) is True
# Build the app, test that the expected output file is created.
- subprocess.run([DUNE_EXE, "--cmake-build", TEST_APP_DIR], check=True)
+ subprocess.run([DUNES_EXE, "--cmake-build", TEST_APP_DIR], check=True)
assert os.path.isfile(TEST_APP_WASM) is True
# Test that CTest files are run.
# @TODO - This should be updated to create and test some PASSING tests.
# @TODO - This should be updated to create and test some FAILING tests.
with subprocess.Popen(
- [DUNE_EXE, "--debug", "--ctest", TEST_APP_DIR, "--", "--no-tests=ignore"],
+ [DUNES_EXE, "--debug", "--ctest", TEST_APP_DIR, "--", "--no-tests=ignore"],
stdout=subprocess.PIPE, stderr=subprocess.PIPE, encoding="utf-8") as proc:
stdout, _ = proc.communicate()
@@ -130,5 +128,5 @@ def test_gdb():
"""Test `--gdb` key."""
# Simply ensure gdb is run.
- proc = subprocess.run([DUNE_EXE, "--gdb", "/bin/sh"], capture_output=True, encoding="utf-8", check=True)
+ proc = subprocess.run([DUNES_EXE, "--gdb", "/bin/sh"], capture_output=True, encoding="utf-8", check=True)
assert "GNU gdb" in proc.stdout
diff --git a/tests/test_remainder.py b/tests/test_remainder.py
index 87d1a558..f7adf773 100644
--- a/tests/test_remainder.py
+++ b/tests/test_remainder.py
@@ -1,14 +1,14 @@
#!/usr/bin/env python3
-"""Test DUNE args remainder
+"""Test DUNES args remainder
This script tests if there is a warning if user passes
-unused arguments to DUNE
+unused arguments to DUNES
"""
import subprocess
-from common import DUNE_EXE
+from common import DUNES_EXE
from container import container
@@ -16,9 +16,9 @@ def test_unused():
"""Test the warning for unused arguments"""
# Remove any container that already exists.
- cntr = container('dune_container', 'dune:latest')
+ cntr = container('dunes_container', 'dunes:latest')
if cntr.exists():
- subprocess.run([DUNE_EXE, "--destroy-container"], check=True)
+ subprocess.run([DUNES_EXE, "--destroy-container"], check=True)
# List of expected values.
expect_list = \
@@ -26,13 +26,15 @@ def test_unused():
b"Warning: following arguments were possibly unused: ['config.ini']",
]
- # Call DUNE with improper arguments
- completed_process = subprocess.run([DUNE_EXE,"--start", "my_node", "config.ini"], check=True, stdout=subprocess.PIPE)
+ # Call DUNES with improper arguments
+ completed_process = subprocess.run([DUNES_EXE, "--start", "my_node", "config.ini"],
+ check=True, stdout=subprocess.PIPE)
# Test for expected values in the captured output.
for expect in expect_list:
assert expect in completed_process.stdout
+
def test_no_warning():
"""Test there is no warning for arguments using remainder in i.e. gdb case"""
@@ -42,8 +44,9 @@ def test_no_warning():
b'Warning: following arguments were possibly unused:',
]
- # Call DUNE.
- completed_process = subprocess.run([DUNE_EXE,"--gdb", "/usr/bin/echo", "Hello"], check=True, stdout=subprocess.PIPE)
+ # Call DUNES.
+ completed_process = subprocess.run([DUNES_EXE, "--gdb", "/usr/bin/echo", "Hello"],
+ check=True, stdout=subprocess.PIPE)
# Test values are NOT in the captured output.
for unexpected in unexpected_list:
diff --git a/tests/test_version.py b/tests/test_version.py
index ec0ac035..6ce230ca 100644
--- a/tests/test_version.py
+++ b/tests/test_version.py
@@ -10,7 +10,7 @@
import subprocess
-from common import DUNE_EXE
+from common import DUNES_EXE
def test_version():
@@ -23,7 +23,7 @@ def test_version():
]
# Call DUNE.
- completed_process = subprocess.run([DUNE_EXE,"--version"], check=True, stdout=subprocess.PIPE)
+ completed_process = subprocess.run([DUNES_EXE, "--version"], check=True, stdout=subprocess.PIPE)
# Test for expected values in the captured output.
for expect in expect_list:
diff --git a/tests/test_version_selector.py b/tests/test_version_selector.py
index a68fd41d..ca3864fe 100644
--- a/tests/test_version_selector.py
+++ b/tests/test_version_selector.py
@@ -7,7 +7,7 @@
from unittest import TestCase
from os.path import dirname, realpath
-sys.path.insert(1, sys.path.append(dirname(realpath(__file__)) + "/../src/dune"))
+sys.path.insert(1, sys.path.append(dirname(realpath(__file__)) + "/../src/dunes"))
# pylint: disable=wrong-import-position
import version_selector
diff --git a/tests/test_wallet.py b/tests/test_wallet.py
index 57529ff3..41acb201 100644
--- a/tests/test_wallet.py
+++ b/tests/test_wallet.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
-"""Test DUNE Version
+"""Test DUNES Version
This script tests export and import of the wallet
"""
@@ -10,7 +10,7 @@
import subprocess
from container import container
-from common import DUNE_EXE
+from common import DUNES_EXE
def tar_dir(file_name, directory):
@@ -24,7 +24,7 @@ def untar(file_name):
def test_export():
"""Test `--export-wallet` key."""
- subprocess.run([DUNE_EXE, "--export-wallet"], check=True)
+ subprocess.run([DUNES_EXE, "--export-wallet"], check=True)
assert os.path.exists("wallet.tgz") is True
@@ -32,7 +32,7 @@ def test_export():
def test_import():
"""Test `--import-wallet` key."""
- cntr = container('dune_container', 'dune:latest')
+ cntr = container('dunes_container', 'dunes:latest')
cntr.rm_file("/app/wallet.tgz")
@@ -48,7 +48,7 @@ def test_import():
tar_dir("wallet", "_wallet")
# Use wallet.tgz created by successfully finished test of export
- subprocess.run([DUNE_EXE, "--debug", "--import-wallet", "./wallet.tgz"], check=True)
+ subprocess.run([DUNES_EXE, "--debug", "--import-wallet", "./wallet.tgz"], check=True)
os.remove("wallet.tgz")
shutil.rmtree("_wallet")