From 62967b7d392ff72f17878b3d587cc38bcc6701e3 Mon Sep 17 00:00:00 2001 From: Javier Cortejoso Date: Thu, 15 Nov 2018 10:17:25 +0100 Subject: [PATCH 1/9] Added new accounts with balance --- parity/parity/config/chain.json | 9 ++++++--- parity/secret_store/config/chain.json | 8 ++++++-- parity/secret_store/keys/account1.json | 22 ++++++++++++++++++++++ parity/secret_store/keys/account2.json | 22 ++++++++++++++++++++++ 4 files changed, 56 insertions(+), 5 deletions(-) create mode 100644 parity/secret_store/keys/account1.json create mode 100644 parity/secret_store/keys/account2.json diff --git a/parity/parity/config/chain.json b/parity/parity/config/chain.json index 5d266e4..93accc3 100644 --- a/parity/parity/config/chain.json +++ b/parity/parity/config/chain.json @@ -93,11 +93,14 @@ "0x0011598De1016A350ad719D23586273804076774": { "balance": "100500" }, - - + "0x068ed00cf0441e4829d9784fcbe7b9e26d4bd8d0": { + "balance": "100000000" + }, + "0xa99d43d86a0758d5632313b8fa3972b6088a21bb": { + "balance": "100000000" + }, "0x00Bd138aBD70e2F00903268F3Db08f2D25677C9e": { "balance": "10000000111000111000111000" } - } } \ No newline at end of file diff --git a/parity/secret_store/config/chain.json b/parity/secret_store/config/chain.json index a069cca..e991c3d 100644 --- a/parity/secret_store/config/chain.json +++ b/parity/secret_store/config/chain.json @@ -93,8 +93,12 @@ "0x0011598De1016A350ad719D23586273804076774": { "balance": "100500" }, - - + "0x068ed00cf0441e4829d9784fcbe7b9e26d4bd8d0": { + "balance": "100000000" + }, + "0xa99d43d86a0758d5632313b8fa3972b6088a21bb": { + "balance": "100000000" + }, "0x00Bd138aBD70e2F00903268F3Db08f2D25677C9e": { "balance": "10000000111000111000111000" } diff --git a/parity/secret_store/keys/account1.json b/parity/secret_store/keys/account1.json new file mode 100644 index 0000000..2226e59 --- /dev/null +++ b/parity/secret_store/keys/account1.json @@ -0,0 +1,22 @@ +{ + "id": "50aa801a-8d66-1402-1fa4-d8987868c2ce", + "version": 3, + "crypto": { + "cipher": "aes-128-ctr", + "cipherparams": { + "iv": "a874e6fe50a5bb088826c45560dc1b7e" + }, + "ciphertext": "2383c6aa50c744b6558e77b5dcec6137f647c81f10f71f22a87321fd1306056c", + "kdf": "pbkdf2", + "kdfparams": { + "c": 10240, + "dklen": 32, + "prf": "hmac-sha256", + "salt": "eca6ccc9fbb0bdc3a516c7576808ba5031669e6878f3bb95624ddb46449e119c" + }, + "mac": "14e9a33a45ae32f88a0bd5aac14521c1fcf14f56fd55c1a1c080b2f81ddb8d44" + }, + "address": "068ed00cf0441e4829d9784fcbe7b9e26d4bd8d0", + "name": "", + "meta": "{}" +} diff --git a/parity/secret_store/keys/account2.json b/parity/secret_store/keys/account2.json new file mode 100644 index 0000000..7409b18 --- /dev/null +++ b/parity/secret_store/keys/account2.json @@ -0,0 +1,22 @@ +{ + "id": "ce455fdd-11fd-5a71-0a31-9d0bec6a605d", + "version": 3, + "crypto": { + "cipher": "aes-128-ctr", + "cipherparams": { + "iv": "56b27c187d45aab59377869042b948aa" + }, + "ciphertext": "c774b879793e2e54b85071d929cc7fbb11b47f6bab6e590edf3997fe4373eaf8", + "kdf": "pbkdf2", + "kdfparams": { + "c": 10240, + "dklen": 32, + "prf": "hmac-sha256", + "salt": "33b3b99e4c6f7f6d7d804555d40c08e4a2acba20e1e46aca712c82c3b9bab749" + }, + "mac": "10ee295ce6b1553887413f0e717ccedc1bddb62572bb9208ec3bd091085990db" + }, + "address": "a99d43d86a0758d5632313b8fa3972b6088a21bb", + "name": "", + "meta": "{}" +} From d846c7a6fa0f7b82a6d8a6b6d9559e6f7f97b08f Mon Sep 17 00:00:00 2001 From: Troy McConaghy Date: Thu, 15 Nov 2018 11:34:21 +0100 Subject: [PATCH 2/9] Copyedited README.md, fixed minor errors, added more examples --- README.md | 71 +++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 46 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index 8e26832..c0a3ac8 100644 --- a/README.md +++ b/README.md @@ -53,35 +53,63 @@ To get the `latest` versions of all components, referring to their `develop` bra After getting everything running, you can open the **Pleuston Frontend** application in your browser: -``` -http://localhost:3000 -``` +[http://localhost:3000](http://localhost:3000) ### Script Options -The script provides the following options: +The `start_ocean.sh` script provides the following options: -Option | Description ---- | --- +Option | Description +--- | --- `--latest` | Get the `latest` versions of all components, referring to their `develop` branches. `--no-pleuston` | Start up Ocean without an instance of `pleuston`. Helpful for development on `pleuston`. `--local-parity-node` | Runs a local parity POA node and Secret Store instead of ganache-cli. `--reuse-database` | Start up Ocean and reuse the Database from ganache. Helpful for development. -For example, the following command would run the latest version of the stack, without Pleuston and with the Parity + Secret Store nodes: +For example, if you do: -`./start_ocean.sh --latest --no-pleuston --local-parity-node` +```bash +./start_ocean.sh --latest +``` -## Ocean Protocol components +then the main/default [docker-compose.yml](docker-compose.yml) will be used, so the following Docker images will all be started: -The Ocean Docker compose starts the following components: +- mongo:3.6 +- oceanprotocol/keeper-contracts:latest +- oceanprotocol/aquarius:latest +- oceanprotocol/brizo:latest +- oceanprotocol/pleuston:latest -* [🦄 pleuston](https://github.com/oceanprotocol/pleuston). Frontend listening on port `3000`. -* [🐋 aquarius](https://github.com/oceanprotocol/aquarius). Backend listening on port `5000`. -* [💧 keeper-contracts](https://github.com/oceanprotocol/keeper-contracts). RPC client listening on port `8545`. -* [💧 secret-store](https://github.com/oceanprotocol/parity-ethereum). HTTP client listening on port `12001`. +To see what ports each of those listens on, read [docker-compose.yml](docker-compose.yml). Note that `keeper-contracts` runs a local Ganache node (not a local Parity Ethereum POA node). -![Ocean Protocol Components](doc/img/ocean-components@2x.png) +If you do: + +```bash +./start_ocean.sh --no-pleuston +``` + +then [docker-compose-no-pleuston.yml](docker-compose-no-pleuston.yml) will be used, so these images will be started: + +- mongo:3.6 +- oceanprotocol/keeper-contracts:stable +- oceanprotocol/aquarius:stable +- oceanprotocol/brizo:stable + +If you do: + +```bash +./start_ocean.sh --latest --local-parity-node +``` + +then [docker-compose-local-parity-node.yml](docker-compose-local-parity-node.yml) will be used. Read it to see what images it starts. Note that it _doesn't_ start Pleuston, and it _does_ start a Parity Secret Store. + +If you do: + +```bash +./start_ocean.sh --latest --no-pleuston --local-parity-node +``` + +then the last-selected Docker Compose file will be used, i.e. the one selected by `--local-parity-node`: [docker-compose-local-parity-node.yml](docker-compose-local-parity-node.yml). ### Parity Client Accounts @@ -102,20 +130,13 @@ export REUSE_DATABASE="true" docker-compose --project-name=ocean -f docker-compose-no-pleuston.yml up ``` -Variable | Description ---- | --- +Variable | Description +--- | --- `REUSE_DATABASE` | The keeper-contracts component runs with ganache by default and every run will produce and deploy new instances of the keeper contracts. Ganache can be run with a specific database path by setting the env var `REUSE_DATABASE` to `"true"`. By default, the ganache database will be setup in the cwd. `DEPLOY_CONTRACTS` | skip deploying smart contracts by setting this to `"false"`, in this case `REUSE_DATABASE` should be set to `"true"` in the previous run when using ganache `KEEPER_NETWORK_NAME` | set to one of `"ganache"` (default), `"kovan"`, or `"ocean_poa_net_local"` `ARTIFACTS_FOLDER` | this is where the deployed smart contracts abi files will be available. This can be pointed at any path you like. -A subset of the components can be run by modifying the docker-compose file directly or by using one of the other pre-built compose files: - -Compose file | Description ---- | --- -`docker-compose-no-pleuston.yml` | runs all components without the pleuston. This is useful for developing/debugging the front-end app. So first the docker compose container can be started then pleuston can be started separately from source. You can also use `./start_ocean.sh --no-pleuston` to do this -`docker-compose-local-parity-node.yml` | similar to the above with no pleuston, but runs a local parity POA node instead of ganache-cli. You can also use `./start_ocean.sh --local-parity-node` instead - ## Contributing We use GitHub as a means for maintaining and tracking issues and source code development. @@ -126,7 +147,7 @@ Ocean Protocol uses [C4 Standard process](https://github.com/unprotocols/rfc/blo ## License -``` +```text Copyright 2018 Ocean Protocol Foundation Licensed under the Apache License, Version 2.0 (the "License"); From b78e90b4e0d29886779781edc34a61e4233374ff Mon Sep 17 00:00:00 2001 From: Javier Cortejoso Date: Thu, 15 Nov 2018 12:20:39 +0100 Subject: [PATCH 3/9] Added account keys to client --- parity/parity/keys/account1.json | 22 ++++++++++++++++++++++ parity/parity/keys/account2.json | 22 ++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 parity/parity/keys/account1.json create mode 100644 parity/parity/keys/account2.json diff --git a/parity/parity/keys/account1.json b/parity/parity/keys/account1.json new file mode 100644 index 0000000..2226e59 --- /dev/null +++ b/parity/parity/keys/account1.json @@ -0,0 +1,22 @@ +{ + "id": "50aa801a-8d66-1402-1fa4-d8987868c2ce", + "version": 3, + "crypto": { + "cipher": "aes-128-ctr", + "cipherparams": { + "iv": "a874e6fe50a5bb088826c45560dc1b7e" + }, + "ciphertext": "2383c6aa50c744b6558e77b5dcec6137f647c81f10f71f22a87321fd1306056c", + "kdf": "pbkdf2", + "kdfparams": { + "c": 10240, + "dklen": 32, + "prf": "hmac-sha256", + "salt": "eca6ccc9fbb0bdc3a516c7576808ba5031669e6878f3bb95624ddb46449e119c" + }, + "mac": "14e9a33a45ae32f88a0bd5aac14521c1fcf14f56fd55c1a1c080b2f81ddb8d44" + }, + "address": "068ed00cf0441e4829d9784fcbe7b9e26d4bd8d0", + "name": "", + "meta": "{}" +} diff --git a/parity/parity/keys/account2.json b/parity/parity/keys/account2.json new file mode 100644 index 0000000..7409b18 --- /dev/null +++ b/parity/parity/keys/account2.json @@ -0,0 +1,22 @@ +{ + "id": "ce455fdd-11fd-5a71-0a31-9d0bec6a605d", + "version": 3, + "crypto": { + "cipher": "aes-128-ctr", + "cipherparams": { + "iv": "56b27c187d45aab59377869042b948aa" + }, + "ciphertext": "c774b879793e2e54b85071d929cc7fbb11b47f6bab6e590edf3997fe4373eaf8", + "kdf": "pbkdf2", + "kdfparams": { + "c": 10240, + "dklen": 32, + "prf": "hmac-sha256", + "salt": "33b3b99e4c6f7f6d7d804555d40c08e4a2acba20e1e46aca712c82c3b9bab749" + }, + "mac": "10ee295ce6b1553887413f0e717ccedc1bddb62572bb9208ec3bd091085990db" + }, + "address": "a99d43d86a0758d5632313b8fa3972b6088a21bb", + "name": "", + "meta": "{}" +} From 14dd4f83193ae44e596ff99b3a7c4addb1c4c760 Mon Sep 17 00:00:00 2001 From: Jernej Pregelj Date: Fri, 16 Nov 2018 16:37:58 +0100 Subject: [PATCH 4/9] secret store api cors proxy --- cors-proxy.conf | 29 ++++++++++++++++++++++++++++ docker-compose-local-parity-node.yml | 15 +++++++++++++- 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 cors-proxy.conf diff --git a/cors-proxy.conf b/cors-proxy.conf new file mode 100644 index 0000000..a57cd59 --- /dev/null +++ b/cors-proxy.conf @@ -0,0 +1,29 @@ +events {} +http { + upstream ss { + server secret-store:12001; + } + server { + listen 12001; + location ~ ^/ { + if ($request_method = 'OPTIONS') { + add_header 'Access-Control-Allow-Origin' '*'; + add_header 'Access-Control-Allow_Credentials' 'true'; + add_header 'Access-Control-Allow-Headers' 'Origin, X-Requested-With, Content-Type, Accept'; + add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS'; + add_header 'Content-Type' 'text/plain; charset=utf-8'; + add_header 'Content-Length' 0; + return 204; + } + add_header 'Access-Control-Allow-Origin' '*'; + add_header 'Access-Control-Allow_Credentials' 'true'; + add_header 'Access-Control-Allow-Headers' 'Origin, X-Requested-With, Content-Type, Accept'; + add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS'; + proxy_pass http://ss; + proxy_redirect off; + proxy_set_header Origin ""; + } + access_log off; + error_log off; + } +} \ No newline at end of file diff --git a/docker-compose-local-parity-node.yml b/docker-compose-local-parity-node.yml index cfb51ba..36bf3a5 100644 --- a/docker-compose-local-parity-node.yml +++ b/docker-compose-local-parity-node.yml @@ -53,11 +53,24 @@ services: - ./parity/secret_store/keys/:/parity_data/keys/ocean-network/ ports: - 12000:12000 - - 12001:12001 + - 12001 networks: backend: ipv4_address: 172.15.0.13 + secret-store-cors-proxy: + image: nginx:alpine + volumes: + - ./cors-proxy.conf:/etc/nginx/nginx.conf:ro + depends_on: + - secret-store + ports: + - 12001:12001 + networks: + backend: + ipv4_address: 172.15.0.16 + command: nginx -g 'daemon off;' + keeper-contracts: image: oceanprotocol/keeper-contracts:${OCEAN_VERSION:-stable} networks: From 11c4c6bb59b2e8e0ea024cd90390cc7115f8c6b8 Mon Sep 17 00:00:00 2001 From: Javier Cortejoso Date: Mon, 19 Nov 2018 08:43:45 +0100 Subject: [PATCH 5/9] Increased balance of test accounts --- parity/parity/config/chain.json | 10 +++++----- parity/secret_store/config/chain.json | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/parity/parity/config/chain.json b/parity/parity/config/chain.json index 93accc3..c4176c8 100644 --- a/parity/parity/config/chain.json +++ b/parity/parity/config/chain.json @@ -88,19 +88,19 @@ } }, "0x6B0c56d1Ad5144b4d37fa6e27DC9afd5C2435c3B": { - "balance": "1000" + "balance": "0x200000000000000000000000000000000000000000000000" }, "0x0011598De1016A350ad719D23586273804076774": { - "balance": "100500" + "balance": "0x200000000000000000000000000000000000000000000000" }, "0x068ed00cf0441e4829d9784fcbe7b9e26d4bd8d0": { - "balance": "100000000" + "balance": "0x200000000000000000000000000000000000000000000000" }, "0xa99d43d86a0758d5632313b8fa3972b6088a21bb": { - "balance": "100000000" + "balance": "0x200000000000000000000000000000000000000000000000" }, "0x00Bd138aBD70e2F00903268F3Db08f2D25677C9e": { - "balance": "10000000111000111000111000" + "balance": "0x200000000000000000000000000000000000000000000000" } } } \ No newline at end of file diff --git a/parity/secret_store/config/chain.json b/parity/secret_store/config/chain.json index e991c3d..7c63abb 100644 --- a/parity/secret_store/config/chain.json +++ b/parity/secret_store/config/chain.json @@ -88,19 +88,19 @@ } }, "0x6B0c56d1Ad5144b4d37fa6e27DC9afd5C2435c3B": { - "balance": "1000" + "balance": "0x200000000000000000000000000000000000000000000000" }, "0x0011598De1016A350ad719D23586273804076774": { - "balance": "100500" + "balance": "0x200000000000000000000000000000000000000000000000" }, "0x068ed00cf0441e4829d9784fcbe7b9e26d4bd8d0": { - "balance": "100000000" + "balance": "0x200000000000000000000000000000000000000000000000" }, "0xa99d43d86a0758d5632313b8fa3972b6088a21bb": { - "balance": "100000000" + "balance": "0x200000000000000000000000000000000000000000000000" }, "0x00Bd138aBD70e2F00903268F3Db08f2D25677C9e": { - "balance": "10000000111000111000111000" + "balance": "0x200000000000000000000000000000000000000000000000" } } } From e6d5fd9e8057276f2001f84ab16588ef99ef9c73 Mon Sep 17 00:00:00 2001 From: Javier Cortejoso Date: Mon, 19 Nov 2018 11:20:44 +0100 Subject: [PATCH 6/9] Fix typo in volume --- docker-compose-no-pleuston.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose-no-pleuston.yml b/docker-compose-no-pleuston.yml index 12c8db1..8a19ca2 100644 --- a/docker-compose-no-pleuston.yml +++ b/docker-compose-no-pleuston.yml @@ -54,7 +54,7 @@ services: KEEPER_URL: http://keeper-contracts:8545 LOCAL_CONTRACTS: "true" volumes: - - ${ARTIFACTS_FOLDER}:/usr/local/keeper-contracs/:ro + - ${ARTIFACTS_FOLDER}:/usr/local/keeper-contracts/:ro networks: backend: From 614a7da2f5e24a50215e8363e2e66c3687e5aed6 Mon Sep 17 00:00:00 2001 From: Javier Cortejoso Date: Tue, 20 Nov 2018 14:43:48 +0100 Subject: [PATCH 7/9] Changed networkId to avoid collision --- parity/parity/config/chain.json | 2 +- parity/secret_store/config/chain.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/parity/parity/config/chain.json b/parity/parity/config/chain.json index 93accc3..49657e1 100644 --- a/parity/parity/config/chain.json +++ b/parity/parity/config/chain.json @@ -20,7 +20,7 @@ "params": { "maximumExtraDataSize": "0x20", "minGasLimit": "0x1388", - "networkID": "0x2323", + "networkID": "0x2324", "gasLimitBoundDivisor": "0x400", "eip140Transition": 0, "eip211Transition": 0, diff --git a/parity/secret_store/config/chain.json b/parity/secret_store/config/chain.json index e991c3d..753f9d1 100644 --- a/parity/secret_store/config/chain.json +++ b/parity/secret_store/config/chain.json @@ -20,7 +20,7 @@ "params": { "maximumExtraDataSize": "0x20", "minGasLimit": "0x1388", - "networkID": "0x2323", + "networkID": "0x2324", "gasLimitBoundDivisor": "0x400", "eip140Transition": 0, "eip211Transition": 0, From 4ad2f240170596627285a04542d7fc2ca94a29d9 Mon Sep 17 00:00:00 2001 From: Javier Cortejoso Date: Wed, 21 Nov 2018 17:30:05 +0100 Subject: [PATCH 8/9] Added Parity client accounts to readme --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index c0a3ac8..739d467 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,7 @@ - [Script Options](#script-options) - [Ocean Protocol components](#ocean-protocol-components) - [Environment Variables](#environment-variables) + - [Parity Client Accounts](#parity-client-accounts) - [Contributing](#contributing) - [License](#license) From d6418e746aa9f37b948fb4676b76e80db4c2d884 Mon Sep 17 00:00:00 2001 From: "aitor@oceanprotocol.com" Date: Thu, 22 Nov 2018 17:40:28 +0100 Subject: [PATCH 9/9] adding brizo to parity docker compose --- docker-compose-local-parity-node.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/docker-compose-local-parity-node.yml b/docker-compose-local-parity-node.yml index cfb51ba..33afb43 100644 --- a/docker-compose-local-parity-node.yml +++ b/docker-compose-local-parity-node.yml @@ -90,6 +90,21 @@ services: volumes: - ${ARTIFACTS_FOLDER}:/usr/local/keeper-contracts/:ro + brizo: + image: oceanprotocol/brizo:${OCEAN_VERSION:-stable} + ports: + - 8030:8030 + networks: + backend: + ipv4_address: 172.15.0.16 + depends_on: + - keeper-contracts + environment: + KEEPER_URL: http://keeper-contracts:8545 + LOCAL_CONTRACTS: "true" + KEEPER_NETWORK_NAME: ${KEEPER_NETWORK_NAME} + volumes: + - ${ARTIFACTS_FOLDER}:/usr/local/keeper-contracts/:ro networks: backend: