Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add extra info on how to use this from host #10

Open
kakoma opened this issue Nov 14, 2020 · 4 comments
Open

Add extra info on how to use this from host #10

kakoma opened this issue Nov 14, 2020 · 4 comments

Comments

@kakoma
Copy link
Contributor

kakoma commented Nov 14, 2020

On reviewing the config script, I see that the setup currently forwards traffic on the guest from port 80 to port 8080 on the host and 8181 on the guest to 2223 on the host.

This means that it is possible to use PostMan on the host machine to access the setup. For example, on the host, a quick test to check the payer FSP position can be done using:

curl --fail -X GET     http://localhost:8080/participants/payerfsp/positions     -H 'Host: central-ledger.local'

Expected response is similar to this:

[{"currency":"USD","value":2.11,"changedDate":"2020-11-14T20:54:11.000Z"}]

If /etc/hosts has the mojaloop hosts:

127.0.0.1 central-ledger forensic-logging-sidecar central-kms.local central-ledger.local central-settlement.local central-event-processor.local ml-api-adapter.local email-notifier.local account-lookup-service.local quoting-service.local moja-simulator.local

That 'localhost' can even be replaced with an appropriate name. What this does is it makes it possible to work with the postman collections directly from the host without needing to modify anything.

I think it would be great to add something like this to the documentation to make it easier to go ahead and use the setup after it is up and running.

This bit should probably come as another issue but I'll bundle it here:
We could consider assigning an IP to the guest:
https://www.vagrantup.com/docs/networking/private_network

The DHCP route is fail-safe. It means though that the user will need to ssh into the machine, get its IP and then update /etc/hosts with something like:

192.168.50.5 central-ledger forensic-logging-sidecar central-kms.local central-ledger.local central-settlement.local central-event-processor.local ml-api-adapter.local email-notifier.local account-lookup-service.local quoting-service.local moja-simulator.local

Assuming 192.168.50.5 is the assigned IP.

Again, that way, now, the user can comfortably use the PostMan collections directly from their host without changing much else.

@lewisdaly
Copy link
Collaborator

Thanks Peter, this is a great recommendation. Feel free to open a PR with those documentation notes for the README.md if you have the chance.

One thing to note is that Mojaloop is moving away from Postman, and instead towards the Testing Toolkit, which I think is postman compatible.

@kakoma
Copy link
Contributor Author

kakoma commented Jan 20, 2021

Cool. I'll add the changes to the README. Ahh didn't know about that upcoming switch. Since that's the direction, this would be a change that would be revisited as the testing toolkit's adoption takes shape.

@tdaly61
Copy link
Collaborator

tdaly61 commented Jan 20, 2021

hi @kakoma @lewisdaly , well I did setup the vagrantfile to configure the port forwards for VirtualBox and initially I was using postman to run the tests as you say from the HOST. However as we automated the tests via scripts and ran them from the guest I didn't bother to run from postman nor from the host so I didn't think there was a great value in doing it that way. I guess there is no harm in telling folks about this ability , but given your comments Lewis about the new testing toolkit, wouldn't it be prudent to mention this as a feature folks should not rely on because it might go away in future updates to the mini-loop project ?

@kakoma
Copy link
Contributor Author

kakoma commented Feb 3, 2021

@tdaly61 I haven't used the new testing toolkit yet but I'm imagining someone doing development will likely not rely entirely on automated tests - they'll use Postman to occasionally make API calls to make certain changes or check certain things. It really depends on individual workflows - mine currently involves Postman a lot. Maybe it'll change when I try out the toolkit. Nonetheless, we can mention, as you said, that it will be deprecated in future

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants