1

I am new to Hyperledger Fabric. Just created a new application by following a tutorial available at https://medium.freecodecamp.org/how-to-build-a-blockchain-network-using-hyperledger-fabric-and-composer-e06644ff801d

Now I am running the application with http://localhost:8080/ on my local machine, but I need to deploy that application with a public URL/IP. How can I do that in Ubuntu 18.04?

I am not much familiar with Apache and Ubuntu. But I tried a way available to host the application I created in Apache from the tutorial available at: https://www.ostechnix.com/configure-apache-virtual-hosts-ubuntu-part-1/ But I am confused in between that how can I accomplish this task.

I need to host this application with a URL or either with an IP so other users on my network can access the API and use that.

Khaksar
  • 333
  • 3
  • 17
  • this might be helpful: https://hyperledger.github.io/composer/v0.19/integrating/deploying-the-rest-server – Md. Tazbir Ur Rahman Bhuiyan Apr 23 '19 at 12:22
  • 1
    The APis created by `composer-rest-server` are accessibly on your `localhost:8080`. You need to now access that IP from the internet? If that is your question, you can get your computer's IP address and use that to connect to it from a different computer. You could also use `ngrok` for the same. I personally use `ngrok` for this purpose. – Varun Agarwal Apr 24 '19 at 10:30
  • @VarunAgarwal Thanks for the help, it worked. But how the API methods can be accessed? Like I want to access the GET method by using the PostMan. The URL I am getting from the composer-rest-server is like "http://192.168.174.132:3000/explorer/#!/TradeCard/TradeCard_find" and this URL is not working in the PostMan. – Khaksar Apr 24 '19 at 14:39
  • 1
    What are you using to generate/ find the url 192.168.174. Seems like your IP for a wifi and not an IP for internet access. If postman is on the same computer just use localhost, if its on a different one then you should refer to this solution https://stackoverflow.com/questions/5108483/access-localhost-from-the-internet . I personally just use ngrok and save myself the headache. – Varun Agarwal Apr 24 '19 at 15:41
  • @VarunAgarwal : I installed **NGROK** and forward my localhost to that. This is so easy to use and worked for me. – Khaksar Apr 25 '19 at 10:33
  • 1
    good to know. If you got any further questions let me know. Note unless you pay for ngrok the IP might change if you restart ngrok application. Just got to watch out for that. – Varun Agarwal Apr 25 '19 at 12:20
  • @VarunAgarwal : Yes, I read about changing of IP in free NGROK. – Khaksar Apr 26 '19 at 13:11
  • @VarunAgarwal : I have a question about Hyperledger Fabric Blockchain, while following a tutorial, I noticed there is no use of Public/Private keys (SHA256) neither the use of Peers/Nodes. But when I was learning about Blockchain I heard these things are used. Can you please tell me something about this? – Khaksar Apr 26 '19 at 13:22
  • BLockchain requires a cryptographically secure way of ensuring a person who sends a transaction can prove his identity by a private key without revealing it. This leads to a public-private key pair. They can be created in many ways and the use of `sha256` is just one of them. If you see the public keys of Bitcoin, Ethereum and other chains, you will notice they are vastly different, but still uphold the properties of ensuring cryptographic proof – Varun Agarwal Apr 26 '19 at 22:24

0 Answers0