Skip to content

Commit

Permalink
feat(channels): Plug in the eth channel to the au setup and make node…
Browse files Browse the repository at this point in the history
… work well with it
  • Loading branch information
koriaf committed Nov 6, 2020
1 parent 354fae2 commit 54116ae
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
12 changes: 6 additions & 6 deletions docker/node.igl-node-au.env
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ IGL_PROC_BCH_MESSAGE_RX_API_URL=http://172.17.0.1:18009
IGL_JURISDICTION_DOCUMENT_REPORTS={"AU": "http://172.17.0.1:18003/","SG": "http://172.17.0.1:18103"}

# This env variable...
IGL_MCHR_ROUTING_TABLE=[{"Id": "077a81bc-536e-4797-a26f-67f60f222b48", "Name": "shared db channel to Singapore", "Jurisdiction": "SG", "Predicate": "UN.CEFACT.", "ChannelUrl": "http://172.17.0.1:8180/", "ChannelAuth": "None"}, {"Id": "9e587efe-401a-42f3-813a-e6101ddfbb2a", "Name": "Local FR channel", "Jurisdiction": "FR", "Predicate": "UN.CEFACT.", "ChannelUrl": "http://docker-host:7500/", "ChannelAuth": "None"}]
IGL_MCHR_ROUTING_TABLE=[{"Id":"077a81bc-536e-4797-a26f-67f60f222b48","Name":"test shared db channel to Singapore","Jurisdiction":"SG","Predicate":"UN.CEFACT.","ChannelUrl":"http://172.17.0.1:8180/","ChannelAuth":"None"},{"Id":"9e587efe-401a-42f3-813a-e6101ddfbb2a","Name":"Eth GB test channel","Jurisdiction":"GB","Predicate":"UN.CEFACT.","ChannelUrl":"http://docker-host:9090/","ChannelAuth":"None"}]

# contains the next minified JSON
# contains some JSON like that
# which WON'T WORK FOR YOU ANYWAY untill you update the secrets to the valid ones
# or just replace endpoint to some local one (see FR as example)
# [{
Expand All @@ -34,11 +34,11 @@ IGL_MCHR_ROUTING_TABLE=[{"Id": "077a81bc-536e-4797-a26f-67f60f222b48", "Name": "
# }
# },
# {
# "Id": "9e587efe-401a-42f3-813a-e6101ddfbb2a",
# "Name": "Local FR channel",
# "Jurisdiction": "FR",
# "Id": "9e587efe-401a-42f3-813a-e6101ddfbb2a",
# "Name": "Eth GB test channel",
# "Jurisdiction": "GB",
# "Predicate": "UN.CEFACT.",
# "ChannelUrl": "http://docker-host:7500/",
# "ChannelUrl": "http://docker-host:9090/",
# "ChannelAuth": "None"
# }
# ]
4 changes: 2 additions & 2 deletions intergov/use_cases/enqueue_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ def __init__(self, bc_inbox_repo):
def execute(self, message):
logger.info("Posting the message %s", message)
if not message.is_valid():
raise EnqueueMessageFailure("can't enqueue invalid message")
raise EnqueueMessageFailure("Can't enqueue invalid message (%s)", message.validation_errors())
if not message.sender_ref:
raise EnqueueMessageFailure("received messages must have sender_ref")
raise EnqueueMessageFailure("Received messages must have sender_ref")

posted = self.bc_inbox.post(message)

Expand Down
6 changes: 3 additions & 3 deletions intergov/use_cases/request_channel_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ def subscribe_by_jurisdiction(self, callback_url, jurisdiction, secret=''):
}
endpoint = self.CHANNEL_API_SUBSCRIBE_BY_JURISDICTION_ENDPOINT
response = self.post(endpoint, data=params)
if not response.status_code == 202:
if response.status_code not in (200, 202):
logger.error(
"Non-202 response from a channel %s, %s", endpoint, str(response.content)
"Non-202 or 200 response from a channel %s, %s", endpoint, str(response.content)
)
raise SubscriptionFailure("Non-202 response from a channel")
raise SubscriptionFailure("Non-200 or 202 response from a channel")

def get(self, endpoint):
url = self.get_url(endpoint)
Expand Down

0 comments on commit 54116ae

Please sign in to comment.