-
Notifications
You must be signed in to change notification settings - Fork 12
/
register_event_source_polkadot.sh
executable file
·25 lines (18 loc) · 1.21 KB
/
register_event_source_polkadot.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#register event source and link with balance filter
# To run this command
# ./deploy.sh --openwhiskApiHost <openwhiskApiHost> --openwhiskApiKey <openwhiskApiKey> --openwhiskNamespace <openwhiskNamespace>
openwhiskApiHost=${openwhiskApiHost:-https://localhost:31001}
openwhiskApiKey=${openwhiskApiKey:-23bc46b1-71f6-4ed5-8c54-816aa4f8c502:123zO3xZCLrMN6v2BKK1dXYFpXlPkccOFqm12CdAsMgRU4VrNZ9lyGVCGuMDGIwP}
openwhiskNamespace=${openwhiskNamespace:-guest}
eventRegistrationAction=${eventRegistrationAction:-event-registration}
name=${name:-workflow-invoker}
polkaDotPayout=${polkaDotPayout:-workflow-invoker}
SCRIPTS_DIR="$PWD/scripts"
source "$SCRIPTS_DIR/accept_params.sh"
source "$SCRIPTS_DIR/check_dependencies.sh"
check wsk
check jq
TRIGGER=$($WSK_CLI -i --apihost "$openwhiskApiHost" action invoke "/${openwhiskNamespace}/${eventRegistrationAction}" \
--auth "$openwhiskApiKey" --param name "$name" --blocking --result | $JSON_PARSER -r '.trigger')
$WSK_CLI -i --apihost "$openwhiskApiHost" rule update "$TRIGGER-polkadot-payout" $TRIGGER $polkaDotPayout --auth "$openwhiskApiKey"
echo "Add TOPICS=<section>=$TRIGGER as environment variable for the substrate based event feed service, where <section> can be balances, system etc"