forked from hyperledger-cacti/cacti
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(cactus-example-electricity-trade): use openapi ethereum connector
- Refactor electricity trade sample to use openapi ethereum connector instead of ethereum-socketio. - Sample still uses offline signing from cmd-socketio-server - Handle case in ethereum connector where receipt doesn't contain status. - Add sawtooth test-ledger script to wait until docker is fully started before proceeding forward. - Remove periodicExecuter from sample app (didn't work and not used Signed-off-by: Michal Bajer <[email protected]>
- Loading branch information
Showing
26 changed files
with
322 additions
and
586 deletions.
There are no files selected for viewing
63 changes: 0 additions & 63 deletions
63
examples/cactus-example-electricity-trade/BalanceManagement.ts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,6 @@ In this example, we use the Sawtooth intkey transaction processor as an applicat | |
|
||
- Available ports: | ||
- `5034`: the port of `cactus-cmd-socketio-server` | ||
- `5050`: the port of `cactus-plugin-ledger-connector-go-ethereum-socketio` | ||
- `5140`: the port of `cactus-plugin-ledger-connector-sawtooth-socketio` | ||
- You can modify port exported to the host in `./docker-compose.yml` | ||
- Available directory (This directory must be empty): | ||
|
@@ -60,11 +59,6 @@ In this example, we use the Sawtooth intkey transaction processor as an applicat | |
``` | ||
cmd-socketio-base-dummy | OK - Exit | ||
cmd-socketio-base-dummy exited with code 0 | ||
cactus-example-electricity-trade-ethereum-validator | | ||
cactus-example-electricity-trade-ethereum-validator | > @hyperledger/[email protected] start /root/cactus | ||
cactus-example-electricity-trade-ethereum-validator | > cd ./dist && node common/core/bin/www.js | ||
cactus-example-electricity-trade-ethereum-validator | | ||
cactus-example-electricity-trade-ethereum-validator | listening on *:5050 | ||
cactus-example-electricity-trade-sawtooth-validator | | ||
cactus-example-electricity-trade-sawtooth-validator | > @hyperledger/[email protected] start /root/cactus | ||
cactus-example-electricity-trade-sawtooth-validator | > cd ./dist && node common/core/bin/www.js | ||
|
@@ -83,8 +77,7 @@ For development purposes, it might be useful to run the sample application outsi | |
|
||
1. Configure cactus and start the ledgers as described above. | ||
1. Run `./script-dockerless-config-patch.sh` from `cactus-example-electricity-trade/` directory. This will patch the configs and copy it to global location. | ||
1. Start validators (each in separate cmd window). | ||
1. `cd packages/cactus-plugin-ledger-connector-go-ethereum-socketio/ && npm run start` | ||
1. Start sawtooth validators (in separate cmd window, ethereum connector started as part of BLP). | ||
1. `cd packages/cactus-plugin-ledger-connector-sawtooth-socketio/ && npm run start` | ||
1. Start electricity-trade: `npm run start-dockerless` | ||
|
||
|
@@ -103,10 +96,10 @@ For development purposes, it might be useful to run the sample application outsi | |
|
||
``` | ||
# Source Eth balance: | ||
{"status":200,"amount":100000} | ||
100000 | ||
# Destination Eth balance: | ||
{"status":200,"amount":0} | ||
0 | ||
# Electricity usage | ||
``` | ||
|
@@ -155,18 +148,18 @@ For development purposes, it might be useful to run the sample application outsi | |
} | ||
``` | ||
|
||
1. (Optional) Check the balance on Ethereum accounts using the following script | ||
1. (Optional) Check the balance on Ethereum accounts using the following script (after `##remittanceTransaction sendAsyncRequest finish` is printed) | ||
|
||
- `./script-get-app.sh` | ||
|
||
The result looks like the following: | ||
|
||
``` | ||
# Source Eth balance: | ||
{"status":200,"amount":99976} | ||
99976 | ||
# Destination Eth balance: | ||
{"status":200,"amount":24} | ||
24 | ||
# Electricity usage | ||
MI000001: 74 | ||
|
Oops, something went wrong.