From 30917f890ff8e01cf40a9d9e686c33bce278d123 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Mon, 22 Jul 2019 13:32:26 +0200 Subject: [PATCH] document usage with barge and Spree --- .gitignore | 1 + README.md | 45 +++++++++++++++++++++++++++------------------ scripts/keeper.sh | 6 ++++-- 3 files changed, 32 insertions(+), 20 deletions(-) diff --git a/.gitignore b/.gitignore index a2ec474..f0d1969 100644 --- a/.gitignore +++ b/.gitignore @@ -26,3 +26,4 @@ yarn-error.log* cypress/screenshots cypress/videos cypress/fixtures/did.txt +artifacts diff --git a/README.md b/README.md index 7f0b1ef..cbc5b71 100644 --- a/README.md +++ b/README.md @@ -22,21 +22,21 @@ If you're a developer and want to contribute to, or want to utilize this marketplace's code in your projects, then keep on reading. -- [🏄 Get Started](#-Get-Started) - - [🏖 Remote Ocean: Pacific](#-Remote-Ocean-Pacific) - - [🐳 Use with Barge](#-Use-with-Barge) - - [⛵️ Environment Variables](#️-Environment-Variables) - - [Client](#Client) - - [Server](#Server) -- [👩‍🔬 Testing](#-Testing) - - [Unit Tests](#Unit-Tests) - - [End-to-End Integration Tests](#End-to-End-Integration-Tests) -- [✨ Code Style](#-Code-Style) -- [🛳 Production](#-Production) -- [⬆️ Releases](#️-Releases) -- [📜 Changelog](#-Changelog) -- [🎁 Contributing](#-Contributing) -- [🏛 License](#-License) +- [🏄 Get Started](#-get-started) + - [🏖 Remote Ocean: Pacific](#-remote-ocean-pacific) + - [🐳 Use with Barge](#-use-with-barge) + - [⛵️ Environment Variables](#️-environment-variables) + - [Client](#client) + - [Server](#server) +- [👩‍🔬 Testing](#-testing) + - [Unit Tests](#unit-tests) + - [End-to-End Integration Tests](#end-to-end-integration-tests) +- [✨ Code Style](#-code-style) +- [🛳 Production](#-production) +- [⬆️ Releases](#️-releases) +- [📜 Changelog](#-changelog) +- [🎁 Contributing](#-contributing) +- [🏛 License](#-license) ## 🏄 Get Started @@ -68,16 +68,25 @@ By default, the client uses a burner wallet connected to the correct network aut ### 🐳 Use with Barge -If you prefer to connect to locally running components instead of remote connections to Ocean's Nile network, you can spin up [`barge`](https://github.com/oceanprotocol/barge) and use a local network: +If you prefer to connect to locally running components instead of remote connections to Ocean's Nile network, you can spin up [`barge`](https://github.com/oceanprotocol/barge) and use a local Spree network: ```bash git clone git@github.com:oceanprotocol/barge.git cd barge -./start_ocean.sh --latest --no-pleuston --local-spree-node +# startup with local Spree node +./start_ocean.sh --latest --no-pleuston ``` -Modify `./client/src/config.ts` or set environment variables to use those local connections. +Then set [environment variables](#️-environment-variables) to use those local connections. + +Finally, you need to copy the generated contract artifacts out of the Docker container. To do this, execute this script in another terminal: + +```bash +./scripts/keeper.sh +``` + +The script will wait for all contracts to be generated in the `keeper-contracts` Docker container, then will copy the artifacts in place. ### ⛵️ Environment Variables diff --git a/scripts/keeper.sh b/scripts/keeper.sh index 392d83b..e34f2ea 100755 --- a/scripts/keeper.sh +++ b/scripts/keeper.sh @@ -5,7 +5,7 @@ RETRY_COUNT=0 COMMAND_STATUS=1 -printf '\n\e[33mWaiting for contracts to be generated...\e[0m\n' +printf '\n\e[33m◯ Waiting for contracts to be generated...\e[0m\n' mkdir -p artifacts @@ -17,7 +17,7 @@ until [ $COMMAND_STATUS -eq 0 ] || [ $RETRY_COUNT -eq 120 ]; do (( RETRY_COUNT=RETRY_COUNT+1 )) done -printf '\e[32mFound new contract artifacts.\e[0m\n' +printf '\e[32m✔ Found new contract artifacts.\e[0m\n' rm -rf ./artifacts/ @@ -27,3 +27,5 @@ if [ $COMMAND_STATUS -ne 0 ]; then fi docker cp "${keeper_contracts_docker_id}":/keeper-contracts/artifacts/. ./client/node_modules/@oceanprotocol/keeper-contracts/artifacts/ + +printf '\e[32m✔ Copied new contract artifacts.\e[0m\n'