Skip to content

Commit

Permalink
made hub address an environment variable #32
Browse files Browse the repository at this point in the history
  • Loading branch information
wynstrol committed Mar 10, 2021
1 parent d80f4fc commit 96f5765
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
1 change: 1 addition & 0 deletions backend/.example.env
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ NODE1_ETH_ADDRESS=<put-your-eth-node-address-here>
NODE2_ETH_ADDRESS=<put-your-eth-node-address-here>
NODE3_ETH_ADDRESS=<put-your-eth-node-address-here>
RAIDEN_NODE_VERSION=raidennetwork/raiden:develop
HUB_ADDRESS=http://raiden1:5001

DEPLOY_ENV=dev
# Prefix used for container names (default: current directory name)
Expand Down
1 change: 1 addition & 0 deletions backend/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ services:
environment:
PORT: ${ACTIONS_PORT}
GRAPHQL_ENDPOINT: graphql-engine:8080/v1/graphql
HUB_ADDRESS: ${HUB_ADDRESS}
command: ${ACTIONS_START_COMMAND}
restart: always

Expand Down
10 changes: 8 additions & 2 deletions backend/hasura-actions/src/Scheduler.bs.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions backend/hasura-actions/src/Scheduler.res
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
Dotenv.config()
@val external hubAddress: option<string> = "process.env.HUB_ADDRESS"

open BsCron

@decco.encode
Expand Down Expand Up @@ -49,9 +52,9 @@ let makePayment = (~recipientAddress, ~paymentData: streamData) => {
~lastPayment=paymentData.nextPayment->BN.toNumber,
)
}
let address = hubAddress->Option.getWithDefault("http://raiden1:5001")
let requestString =
"http://raiden1:5001/api/v1/payments/0xC563388e2e2fdD422166eD5E76971D11eD37A466/" ++
recipientAddress
address ++ "/api/v1/payments/0xC563388e2e2fdD422166eD5E76971D11eD37A466/" ++ recipientAddress
Js.log2(requestString, finalAmount->BN.toString)
Fetch.fetchWithInit(
requestString,
Expand Down

0 comments on commit 96f5765

Please sign in to comment.