1
0
mirror of https://github.com/oceanprotocol-archive/squid-js.git synced 2024-02-02 15:31:51 +01:00

using spree for running examples

This commit is contained in:
Pedro Gutiérrez 2019-02-08 15:52:25 +01:00 committed by Pedro Gutiérrez
parent 34745f3b66
commit 3cf578cfae
4 changed files with 29 additions and 6 deletions

View File

@ -21,7 +21,7 @@ before_script:
- ganache-cli --port 18545 > ganache-cli.log &
- git clone https://github.com/oceanprotocol/barge
- cd barge
- bash -x start_ocean.sh --latest --no-brizo --no-pleuston --local-nile-node 2>&1 > start_ocean.log &
- bash -x start_ocean.sh --latest --no-brizo --no-pleuston --local-spree-node 2>&1 > start_ocean.log &
- cd ..
script:
@ -29,6 +29,7 @@ script:
- npm run report-coverage
- npm run build
- npm run doc
- ./scripts/wait_for_migration_and_extract_keeper_artifacts.sh
- npm run integration
after_script:

View File

@ -0,0 +1,21 @@
#!/bin/bash
RETRY_COUNT=0
COMMAND_STATUS=1
mkdir -p artifacts
until [ $COMMAND_STATUS -eq 0 ] || [ $RETRY_COUNT -eq 120 ]; do
keeper_contracts_docker_id=$(docker container ls | grep keeper-contracts | awk '{print $1}')
docker cp ${keeper_contracts_docker_id}:/keeper-contracts/artifacts/ready ./artifacts/
COMMAND_STATUS=$?
sleep 5
let RETRY_COUNT=RETRY_COUNT+1
done
if [ $COMMAND_STATUS -ne 0 ]; then
echo "Waited for more than two minutes, but keeper contracts have not been migrated yet. Did you run an Ethereum RPC client and the migration script?"
exit 1
fi
docker cp ${keeper_contracts_docker_id}:/keeper-contracts/artifacts/. ./node_modules/@oceanprotocol/keeper-contracts/artifacts/

View File

@ -4,14 +4,12 @@ import * as config from "./config/config.json"
if (process.env.SEED_WORDS) {
const seedphrase = process.env.SEED_WORDS
// There are 20 accounts availabe (19 + 1)
const accountIndex = Math.floor(Math.random() * 19)
// @ts-ignore
config.web3Provider = new HDWalletProvider(
seedphrase,
config.nodeUri,
accountIndex,
0,
2,
)
}

View File

@ -2,12 +2,15 @@
set -e
# this has to go first
# First of all to log the accounts
npm run run src/examples/GetAccounts.ts
# Before rest of examples
npm run run src/examples/RegisterServiceAgreementTemplates.ts
# Examples
npm run run src/examples/BuyAsset.ts
npm run run src/examples/ExecuteAgreement.ts
npm run run src/examples/GetAccounts.ts
npm run run src/examples/GetBalance.ts
# npm run run src/examples/GrantAccess.ts
npm run run src/examples/RegisterAsset.ts