diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 156bad48..4884109e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,13 +21,13 @@ env: jobs: cancel_previous_runs: name: Cancel Previous Runs - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - uses: styfle/cancel-workflow-action@0.11.0 with: access_token: ${{ secrets.GITHUB_TOKEN }} build: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v3 @@ -39,15 +39,9 @@ jobs: - name: Setup Rust toolchain run: rustup show - - name: Cache Rust Dependecies - uses: actions/cache@v3 + - uses: Swatinem/rust-cache@v2 with: - path: | - ~/.cargo/registry - ~/.cargo/git - target - enclave/target - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + shared-key: "release" - name: Build run: cargo build --release @@ -63,7 +57,7 @@ jobs: path: target/release/encointer-client-notee build-try-runtime-and-benchmarks: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v3 @@ -75,15 +69,9 @@ jobs: - name: Setup Rust toolchain run: rustup show - - name: Cache Rust Dependecies - uses: actions/cache@v3 + - uses: Swatinem/rust-cache@v2 with: - path: | - ~/.cargo/registry - ~/.cargo/git - target - enclave/target - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + shared-key: "release" - name: Build run: cargo build --release --features try-runtime,runtime-benchmarks @@ -100,7 +88,7 @@ jobs: build-runtimes: name: Build Runtimes - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 strategy: matrix: runtime: [ "encointer-node-notee" ] @@ -115,6 +103,7 @@ jobs: restore-keys: | srtool-target-${{ matrix.runtime }}- srtool-target- + - name: Srtool build id: srtool_build uses: chevdor/srtool-actions@v0.9.2 @@ -166,7 +155,6 @@ jobs: ${{ matrix.runtime }}-metadata.json # ${{ matrix.runtime }}-diff.txt - - name: Upload ${{ matrix.runtime }} runtime uses: actions/upload-artifact@v4 with: @@ -176,7 +164,7 @@ jobs: ${{ steps.srtool_build.outputs.wasm_compressed }} unit-tests: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v3 @@ -188,15 +176,9 @@ jobs: - name: Setup Rust toolchain run: rustup show - - name: Cache Rust Dependecies - uses: actions/cache@v3 + - uses: Swatinem/rust-cache@v2 with: - path: | - ~/.cargo/registry - ~/.cargo/git - target - enclave/target - key: ${{ runner.os }}-cargo-test-${{ hashFiles('**/Cargo.lock') }} + shared-key: "debug" - name: cargo test run: cargo test --all @@ -206,7 +188,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ ubuntu-latest ] + os: [ ubuntu-22.04 ] rust: [ stable ] rust-target: [ x86_64-unknown-linux-gnu ] check: [ +nightly fmt --all -- --check, clippy -p encointer-client-notee ] @@ -235,13 +217,13 @@ jobs: - uses: Swatinem/rust-cache@v2 with: - key: ${{ matrix.rust-target }}-${{ matrix.check }} + shared-key: "debug" - name: ${{ matrix.check }} run: cargo ${{ matrix.check }} cargo-toml-fmt: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 container: "tamasfe/taplo:0.7.0-alpine" steps: - uses: actions/checkout@v3 @@ -255,7 +237,7 @@ jobs: integration-test: name: ${{ matrix.test }} - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 needs: build strategy: matrix: @@ -310,10 +292,120 @@ jobs: working-directory: ./scripts/ci run: source ./init_env.sh && ./${{ matrix.test }} + integration-test-docker: + name: ${{ matrix.test }} + runs-on: ubuntu-22.04 + needs: build + strategy: + fail-fast: false + matrix: + test: + - bootstrap_demo_community.py --signer //Bob --test + - bot-community-test -f http://host.docker.internal:5000/api + # Todo: #386 + # - test-register-businesses -f http://host.docker.internal:5000/api + steps: + - uses: actions/checkout@v3 + + - name: download build artifacts + uses: actions/download-artifact@v4 + with: + name: encointer-node-notee-${{ github.sha }} + # for debugging the integration tests, we can just download an image from a previous run + # name: encointer-node-notee-4d0313f614223edf63cd0a5f0ad3d5ce16b81e6c + # github-token: ${{ github.token }} + # run-id: 12787265993 + + - name: download build artifacts + uses: actions/download-artifact@v4 + with: + name: encointer-client-notee-${{ github.sha }} + # for debugging the integration tests, we can just download an image from a previous run + # name: encointer-client-notee-4d0313f614223edf63cd0a5f0ad3d5ce16b81e6c + # github-token: ${{ github.token }} + # run-id: 12787265993 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Login to Dockerhub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKER_HUB_USERNAME }} + password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} + + - name: Cache Docker layers + uses: actions/cache@v3 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Cache Docker layers + uses: actions/cache@v3 + with: + path: /tmp/.buildx-cache-node + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Docker build client + run: | + docker build \ + --cache-from=type=gha \ + -t encointer-client-test . + + - name: Docker build node + run: | + docker build \ + --cache-from=type=gha \ + -f Dockerfile-node \ + -t encointer-node-test . + + - name: Set up ipfs + uses: ibnesayeed/setup-ipfs@master + with: + run_daemon: true + + - name: start dev node + run: | + docker run -p 30333:30333 -p 9944:9944 -p 9615:9615 \ + encointer-node-test \ + --dev \ + --enable-offchain-indexing=true \ + --rpc-methods=unsafe \ + -lencointer=debug,parity_ws=warn \ + --rpc-external & + + - name: start faucet service + run: | + docker run -p 5000:5000 \ + --add-host host.docker.internal:host-gateway \ + encointer-client-test faucet.py \ + -u ws://host.docker.internal \ + --port 9944 & + + - name: start phase accelerator service + run: | + docker run \ + --add-host host.docker.internal:host-gateway \ + encointer-client-test phase.py \ + -u ws://host.docker.internal \ + --port 9944 --idle-blocks 3 & + + - name: Test ${{ matrix.test }} + run: | + docker run \ + --add-host host.docker.internal:host-gateway \ + encointer-client-test ${{ matrix.test }} \ + -u ws://host.docker.internal \ + --port 9944 \ + release: name: Draft Release if: startsWith(github.ref, 'refs/tags/') - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 needs: [ build, unit-tests, check, integration-test ] outputs: release_url: ${{ steps.create-release.outputs.html_url }} @@ -357,7 +449,7 @@ jobs: publish-runtimes: name: Publish Runtimes - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 needs: [ release, build-runtimes ] strategy: matrix: diff --git a/Dockerfile b/Dockerfile index d6dee4ec..3c3b53d6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ FROM ubuntu:22.04 LABEL description="This is the 2nd stage: a very small image where we copy the Substrate binary." -RUN apt-get update && \ +RUN apt-get update && \ apt-get install -y jq python3 python3-pip RUN python3 -m pip install --upgrade pip @@ -24,9 +24,17 @@ COPY encointer-client-notee / RUN mkdir /client COPY client/py_client /py_client +COPY client/test-data /test-data + +# all python scripts (some of them aren supported by the entryfile.sh yet). COPY client/bootstrap_demo_community.py / +COPY client/bot-community.py / +COPY client/bot-stats-golden.csv / COPY client/cli.py / -COPY client/test-data /test-data +COPY client/faucet.py / +COPY client/phase.py / +COPY client/typedefs.json / +COPY client/register-random-businesses-and-offerings.py / RUN chmod +x /encointer-client-notee #RUN chmod +x /usr/local/bin/healthcheck9933.sh @@ -40,7 +48,7 @@ RUN ldd /encointer-client-notee && \ # rm -rf /usr/bin /usr/sbin /usr/share/man #USER encointer -EXPOSE 30333 9933 9944 9615 +EXPOSE 30333 9933 9944 9615 5000 VOLUME ["/data"] ENTRYPOINT ["/entryscript.sh"] diff --git a/client/bazaar.py b/client/bazaar.py index cf93e536..d3b628d2 100755 --- a/client/bazaar.py +++ b/client/bazaar.py @@ -30,25 +30,25 @@ import os - - @click.group() -@click.option('--cid', required=True, help='the community identifier of the community you want to register your business in (11 digits).') +@click.option('--cid', required=True, + help='the community identifier of the community you want to register your business in (11 digits).') @click.option('--bizaccount', required=False, help='the account of the owner in ss58 format or raw_seed.') @click.option('--price', default='0', help='price of your offering.') -@click.option('--client', default='../target/release/encointer-client-notee', help='Client binary to communicate with the chain.') +@click.option('--client', default='../target/release/encointer-client-notee', + help='Client binary to communicate with the chain.') @click.option('--port', default='9944', help='ws-port of the chain.') -@click.option('-r', '--remote_chain', default=None, help='choose remote chain: gesell.') +@click.option('-u', '--url', default='ws://127.0.0.1', help='URL of the chain, or `gesell` alternatively.') @click.pass_context -def cli(ctx, client, port, cid, bizaccount, price, remote_chain): +def cli(ctx, client, port, cid, bizaccount, price, url): ctx.ensure_object(dict) - cl = set_local_or_remote_chain(client, port, remote_chain) + cl = set_local_or_remote_chain(client, port, url) ctx.obj['client'] = cl ctx.obj['port'] = port ctx.obj['cid'] = cid ctx.obj['bizaccount'] = bizaccount # ctx.obj['ipfs_local'] = ipfs_local - ctx.obj['remote_chain'] = remote_chain + ctx.obj['url'] = url ctx.obj['price'] = price @@ -132,6 +132,7 @@ def register_offering(ctx, specfile): except: print("error creating an offering entry") + @cli.command() @click.pass_obj def list_businesses(ctx): @@ -143,6 +144,7 @@ def list_businesses(ctx): client = ctx['client'] print(client.list_businesses(ctx['cid'])) + @cli.command() @click.pass_obj def list_offerings(ctx): @@ -159,5 +161,6 @@ def list_offerings(ctx): else: print(client.list_offerings_for_business(ctx['cid'], ctx["bizaccount"])) + if __name__ == '__main__': cli(obj={}) diff --git a/client/bootstrap_demo_community.py b/client/bootstrap_demo_community.py index ce7fb3be..41baa143 100755 --- a/client/bootstrap_demo_community.py +++ b/client/bootstrap_demo_community.py @@ -405,7 +405,7 @@ def test_democracy(client, cid): @click.option('--client', default='../target/release/encointer-client-notee', help='Client binary to communicate with the chain.') @click.option('--signer', help='optional account keypair creating the community') -@click.option('-u', '--url', default='ws://127.0.0.1', help='URL of the chain.') +@click.option('-u', '--url', default='ws://127.0.0.1', help='URL of the chain, or `gesell` alternatively.') @click.option('-p', '--port', default='9944', help='ws-port of the chain.') @click.option('-l', '--ipfs-local', is_flag=True, help='if set, local ipfs node is used.') @click.option('-s', '--spec-file', default=f'{TEST_DATA_DIR}{TEST_LOCATIONS_MEDITERRANEAN}', diff --git a/client/bot-community.py b/client/bot-community.py index c3afcc84..40f50a8e 100755 --- a/client/bot-community.py +++ b/client/bot-community.py @@ -51,22 +51,26 @@ @click.option('--client', default='../target/release/encointer-client-notee', help='Client binary to communicate with the chain.') @click.option('--port', default='9944', help='ws-port of the chain.') +@click.option('-u', '--url', default='ws://127.0.0.1', help='URL of the chain, or `gesell` alternatively.') @click.option('-l', '--ipfs_local', is_flag=True, help='if set, local ipfs node is used.') -@click.option('-r', '--remote_chain', default=None, help='choose one of the remote chains: gesell.') +@click.option('-f', '--faucet_url', default='http://localhost:5000/api', + help='url for the faucet (only needed for test/benchmark cmd)') @click.pass_context -def cli(ctx, client, port, ipfs_local, remote_chain): +def cli(ctx, client, port, ipfs_local, url, faucet_url): ctx.ensure_object(dict) - cl = set_local_or_remote_chain(client, port, remote_chain) + cl = set_local_or_remote_chain(client, port, url) ctx.obj['client'] = cl ctx.obj['port'] = port ctx.obj['ipfs_local'] = ipfs_local - ctx.obj['remote_chain'] = remote_chain + ctx.obj['url'] = url + ctx.obj['faucet_url'] = faucet_url @cli.command() @click.pass_obj def init(ctx): client = ctx['client'] + faucet_url = ctx['faucet_url'] purge_keystore_prompt() root_dir = os.path.realpath(ASSETS_PATH) @@ -76,7 +80,7 @@ def init(ctx): except: print("add image to ipfs failed") print('initializing community') - b = init_bootstrappers(client) + b = init_bootstrappers(client, faucet_url) client.await_block() specfile = random_community_spec(b, ipfs_cid, NUMBER_OF_LOCATIONS) print(f'generated community spec: {specfile} first bootstrapper {b[0]}') @@ -103,10 +107,10 @@ def purge_communities(): @cli.command() @click.pass_obj def execute_current_phase(ctx): - return _execute_current_phase(ctx['client']) + return _execute_current_phase(ctx['client'], ctx['faucet_url']) -def _execute_current_phase(client: Client): +def _execute_current_phase(client: Client, faucet_url: str): client = client cid = read_cid() phase = client.get_phase() @@ -124,12 +128,12 @@ def _execute_current_phase(client: Client): total_supply = write_current_stats(client, accounts, cid) if total_supply > 0: - init_new_community_members(client, cid, len(accounts)) + init_new_community_members(client, cid, len(accounts), faucet_url=faucet_url) # updated account list with new community members accounts = client.list_accounts() - register_participants(client, accounts, cid) + register_participants(client, accounts, cid, faucet_url=faucet_url) client.await_block() if phase == "Assigning": @@ -153,9 +157,10 @@ def _execute_current_phase(client: Client): @click.pass_obj def benchmark(ctx): py_client = ctx['client'] + faucet_url = ctx['faucet_url'] print('will grow population forever') while True: - phase = _execute_current_phase(py_client) + phase = _execute_current_phase(py_client, faucet_url=faucet_url) while phase == py_client.get_phase(): print("awaiting next phase...") py_client.await_block() @@ -165,18 +170,19 @@ def benchmark(ctx): @click.pass_obj def test(ctx): py_client = ctx['client'] + faucet_url = ctx['faucet_url'] print('will grow population for fixed number of ceremonies') for i in range(3 * 2 + 1): - phase = _execute_current_phase(py_client) + phase = _execute_current_phase(py_client, faucet_url=faucet_url) while phase == py_client.get_phase(): print("awaiting next phase...") py_client.await_block() -def init_bootstrappers(client: Client): +def init_bootstrappers(client: Client, faucet_url: str): bootstrappers = client.create_accounts(10) print('created bootstrappers: ' + ' '.join(bootstrappers)) - client.faucet(bootstrappers) + client.faucet(bootstrappers, faucet_url=faucet_url) client.await_block() return bootstrappers @@ -260,7 +266,12 @@ def write_current_stats(client: Client, accounts, cid): return total -def init_new_community_members(client: Client, cid: str, current_community_size: int): +def init_new_community_members( + client: Client, + cid: str, + current_community_size: int, + faucet_url: str +): """ Initializes new community members based on the `current_community_size` and the amount of endorsements we can perform. @@ -285,7 +296,7 @@ def init_new_community_members(client: Client, cid: str, current_community_size: new_members = newbies + endorsees - client.faucet(new_members) + client.faucet(new_members, faucet_url=faucet_url) client.await_block() print(f'Fauceted new community members {len(new_members)}') @@ -293,7 +304,7 @@ def init_new_community_members(client: Client, cid: str, current_community_size: return new_members -def register_participants(client: Client, accounts, cid): +def register_participants(client: Client, accounts, cid, faucet_url: str): print(f'registering {len(accounts)} participants') need_refunding = [] for p in accounts: @@ -307,7 +318,7 @@ def register_participants(client: Client, accounts, cid): if len(need_refunding) > 0: print(f'the following accounts are out of funds and will be refunded {need_refunding}') - client.faucet(need_refunding) + client.faucet(need_refunding, faucet_url=faucet_url) client.await_block() diff --git a/client/faucet.py b/client/faucet.py index 57965b95..7983f51e 100755 --- a/client/faucet.py +++ b/client/faucet.py @@ -12,14 +12,19 @@ from flask import request, jsonify import subprocess from time import sleep +import click + from py_client.client import Client app = flask.Flask(__name__) app.config['DEBUG'] = True -CLIENT = Client() +CLIENT = None def faucet(accounts): + if CLIENT is None: + raise RuntimeError("CLIENT is not initialized.") + for x in range(0, 1): # try multiple try: CLIENT.faucet(accounts, is_faucet=True) @@ -50,4 +55,17 @@ def faucet_service(): return "no accounts provided to drip to\n" -app.run() +@click.command() +@click.option('--client', default='../target/release/encointer-client-notee', + help='Client binary to communicate with the chain.') +@click.option('-u', '--url', default='ws://127.0.0.1', help='URL of the chain.') +@click.option('-p', '--port', default='9944', help='ws-port of the chain.') +def main(client, url, port): + global CLIENT # Declare CLIENT as global to modify the global variable + CLIENT = Client(rust_client=client, node_url=url, port=port) + # make the app listen from outside the docker container + app.run(host="0.0.0.0") + + +if __name__ == "__main__": + main() diff --git a/client/phase.py b/client/phase.py index 0abb418a..073713ae 100755 --- a/client/phase.py +++ b/client/phase.py @@ -22,20 +22,21 @@ global patience + @click.command() -@click.option('-r', '--remote-chain', default=None, help='choose one of the remote chains: gesell.') -@click.option('--client', default='../target/release/encointer-client-notee', help='Client binary to communicate with the chain.') +@click.option('--client', default='../target/release/encointer-client-notee', + help='Client binary to communicate with the chain.') +@click.option('-u', '--url', default='ws://127.0.0.1', help='URL of the chain, or `gesell` alternatively.') @click.option('--port', default='9944', help='ws-port of the chain.') @click.option('--idle-blocks', default=10, help='how many idle blocks to await before moving to next phase') -def main(remote_chain, client, port, idle_blocks): - localhost = None - client = set_local_or_remote_chain(client, port, remote_chain) +def main(client, url, port, idle_blocks): + client = set_local_or_remote_chain(client, port, url) global COUNT, patience patience = idle_blocks with open('typedefs.json') as f: custom_type_registry = json.load(f) substrate = SubstrateInterface( - url= f"wss://gesell.encointer.org:{443}" if localhost is not None else f"ws://127.0.0.1:{port}", + url=get_node_url(node_url=url, port=port), ss58_format=42, type_registry_preset='substrate-node-template', type_registry=custom_type_registry @@ -58,5 +59,12 @@ def subscription_handler(event_count, update_nr, subscription_id): COUNT = 0 +def get_node_url(node_url, port): + if node_url == "gesell": + return f"wss://gesell.encointer.org:{443}" + else: + return f"{node_url}:{port}" + + if __name__ == '__main__': main() diff --git a/client/py_client/client.py b/client/py_client/client.py index f63eb545..2f23f9f9 100644 --- a/client/py_client/client.py +++ b/client/py_client/client.py @@ -114,6 +114,7 @@ def create_accounts(self, amount): return [self.new_account() for _ in range(0, amount)] def faucet(self, accounts, faucet_url='http://localhost:5000/api', is_faucet=False, pay_fees_in_cc=False): + print(f"connecting to faucet: {faucet_url}") if is_faucet: self.await_block(1) ret = self.run_cli_command( diff --git a/client/py_client/helpers.py b/client/py_client/helpers.py index 6ed392e7..7b8a2ce5 100644 --- a/client/py_client/helpers.py +++ b/client/py_client/helpers.py @@ -7,6 +7,7 @@ from .client import Client import warnings + def purge_prompt(path: str, file_description: str): files = glob.glob(path + '/*') if files: @@ -39,18 +40,18 @@ def mkdir_p(path): # this method takes the last content identifier, which is the one of the whole folder, for a file, there is only one cid so it works, too. def take_only_last_cid(ret_cids): - # last line contains the directory cid - last = ret_cids.stdout.splitlines()[-1] - p = re.compile('Qm\\w*') - cids = p.findall(str(last)) - - if cids: - print(cids[0]) - return cids[0] - else: - warnings.warn('No cid returned. Something happened. stderr: ') - warnings.warn(str(ret_cids.stderr)) - return '' + # last line contains the directory cid + last = ret_cids.stdout.splitlines()[-1] + p = re.compile('Qm\\w*') + cids = p.findall(str(last)) + + if cids: + print(cids[0]) + return cids[0] + else: + warnings.warn('No cid returned. Something happened. stderr: ') + warnings.warn(str(ret_cids.stderr)) + return '' def generate_file_list(path_to_files): @@ -71,11 +72,7 @@ def generate_file_list(path_to_files): def set_local_or_remote_chain(client: str, port: str, node_url: str): - if node_url is None: - client = Client(rust_client=client, port=port) + if node_url == "gesell": + return Client(rust_client=client, node_url='wss://gesell.encointer.org', port=443) else: - if node_url == "gesell": - client = Client(rust_client=client, node_url='wss://gesell.encointer.org', port=443) - else: - raise Exception("You need to choose a valid remote chain") - return client + return Client(rust_client=client, node_url=node_url, port=port) diff --git a/client/register-random-businesses-and-offerings.py b/client/register-random-businesses-and-offerings.py index 60ea6582..2711e8f4 100755 --- a/client/register-random-businesses-and-offerings.py +++ b/client/register-random-businesses-and-offerings.py @@ -3,7 +3,6 @@ This is a test script that registers random businesses and offerings in a community which has been previously created with ./bot-community.py init """ - import glob import json import random @@ -23,13 +22,15 @@ global IPFS_LOCAL + @click.command() -@click.option('--client', default='../target/release/encointer-client-notee', help='Client binary to communicate with the chain.') +@click.option('--client', default='../target/release/encointer-client-notee', + help='Client binary to communicate with the chain.') @click.option('--port', default='9944', help='ws-port of the chain.') +@click.option('-u', '--url', default='ws://127.0.0.1', help='URL of the chain, or `gesell` alternatively.') @click.option('-l', '--ipfs_local', is_flag=True, help='if set, local ipfs node is used.') -@click.option('-r', '--remote_chain', default=None, help='choose one of the remote chains: gesell.') -def register_businesses_and_offerings(client, port, ipfs_local, remote_chain): - client = set_local_or_remote_chain(client, port, remote_chain) +def register_businesses_and_offerings(client, port, ipfs_local, url): + client = set_local_or_remote_chain(client, port, url) global IPFS_LOCAL IPFS_LOCAL = ipfs_local owners = shop_owners() @@ -84,6 +85,7 @@ def register_businesses_and_offerings(client, port, ipfs_local, remote_chain): exit(1) print(client.list_offerings_for_business(cid, owners[0])) + def create_businesses(amount: int): """ Create some businesses and dump them to the test-data dir. diff --git a/scripts/docker/entryscript.sh b/scripts/docker/entryscript.sh index 75376ed5..85a3c1ae 100755 --- a/scripts/docker/entryscript.sh +++ b/scripts/docker/entryscript.sh @@ -13,9 +13,31 @@ case $1 in /bootstrap_demo_community.py --client /encointer-client-notee $PARAMS ;; -# Does not work yet because the script wants the options like: cli.py --client -u url -p port -# cli.py) -# /cli.py $PARAMS + bot-community-test) + # Example: + # docker run -it --add-host host.docker.internal:host-gateway test-client bot-community-test -u ws://host.docker.internal --port 9944 -f http://host.docker.internal:5000/api + + /bot-community.py --client /encointer-client-notee $PARAMS init + /bot-community.py --client /encointer-client-notee $PARAMS test + diff bot-stats.csv bot-stats-golden.csv + ;; + + phase.py) + # Example: + # docker run -it --add-host host.docker.internal:host-gateway test-client phase.py -u ws://host.docker.internal --port 9944 --idle-blocks 3 + /phase.py --client /encointer-client-notee $PARAMS + ;; + + faucet.py) + # Example: Note: we have to expose the port + # docker run -it -p 5000:5000 --add-host host.docker.internal:host-gateway test-client faucet.py -u ws://host.docker.internal --port 9944 + /faucet.py --client /encointer-client-notee $PARAMS + ;; + +# Todo #386: Not working yet; bot-community, and register-random-businesses-and-offering have different interface. +# test-register-businesses) +# /bot-community.py --client /encointer-client-notee $PARAMS init +# /register-random-businesses-and-offerings.py --client /encointer-client-notee $PARAMS # ;; *)