Connecting to Local version of Hyperledger Fabric through VSCode extension - ibm-blockchain

Following the tutorial here and trying to run a local version of Commercial Paper using the basic-network running on my local system:
https://marketplace.visualstudio.com/items?itemName=IBMBlockchain.ibm-blockchain-platform
Running against VSC 1.37.1 on Mac OSX 10.14.6 with all the requisite software installed.
The docs clearly say:
Connecting to another instance of Hyperledger Fabric
The extension allow you to connect to any Hyperledger Fabric instance and perform some operational tasks. The tasks available are: install, instantiate and registering and enrolling identities.
To connect to a Hyperledger Fabric instance on the Fabric Environments panel click the + button. This will ask you for JSON node files that describe how to connect to a Hyperledger Fabric Node i.e. peer, orderer, or certificate authority.
I have basic network running with active docker containers for ca, couchdb, orderer and peer0
Question -- how do I connect to this fabric -- what JSON files do I add to the Fabric Environments panel?
I'm not interested in using the local fabric the extension has -- I want to use my local fabric.
How? Thank you.

The readme https://github.com/IBM-Blockchain/blockchain-vscode-extension/blob/master/README.md provides details about how to create node files that represent your orderers/peers/cas for your own remote fabric.
However if your remote fabric uses TLS then the information is a bit sparse, see https://github.com/IBM-Blockchain/blockchain-vscode-extension/issues/1319 for more information.

Related

Remote development (from PhpStorm with JetBrains Gateway) without internet possible?

Here is my working context;
no internet (I use my company's intranet)
Linux CentOS 7.9 remote server with my source files
PhpStorm 2021.3.2 on my development PC
My wish is to develop on my PC on remote sources. Your new JetBrains Gateway solution seems to meet my expectations on paper.
However, in practice, I have the impression that it is not possible to use this solution without internet ? Indeed, the connection process stops on this failure:
Looks like your solution is trying to download an IDE client to install on my machine. Which from my point of view is a weird behavior because I already have a client to install on my machine: PhpStorm. Why not use my PhpStorm client already installed on my machine ?
Thank you for your reply
The "Jetbrains Client" mentioned in the error message is not for your local machine, but for the Linux server:
Once the IDE version and project directory are selected, Gateway will download the IDE to the remote server, unpack it, and launch it with your project loaded.
It acts on the remote server as a "backend IDE" to which the client on your local machine connects:
The JetBrains Client runs locally and provides the user interface for the IDE backend.
You would not even require the full PHPStorm IDE, the Jetbrains Gateway is a standalone app that comes with a "thin client" that can connect to the backend IDE:
This whole process is managed by JetBrains Gateway, a new, compact, standalone app that provides everything you need to get started with remote development. Since it’s standalone, it’s the only thing you need to install locally to start working and is ideal for less powerful laptops and in cases where a full IDE install isn’t desired.
See https://blog.jetbrains.com/blog/2021/12/03/dive-into-jetbrains-gateway/ for a more detailed look at how it works.
To answer your question: it is not possible to use Jetbrains Gateway without an internet connection.

IoT Hub emulator? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 2 years ago.
Improve this question
Is there an emulator or any suggestions for setting up developer environments with IoT Hub. Having a single IoT Hub in our dev environment shared by all our developers is problematic because messages from each developer are handled by all developers. Setting up unique IoT Hub instances for each developer is also problematic because of the local configuration changes required to connect to each IoT Hub.
An Emulator would be AWESOME! but if that's not available some other way to segregate traffic per developer would be extremely useful.
Regards,
Eli
I'm afraid there's no Azure IoT Hub emulator yet.
If by emulator, you're talking about something like a local server and keeps all the storage in the local RAM or HDD, this might sound like a good idea.
However, when you think about it, it's no easy task for such emulator. Under the hood, we're talking about multiple communication protocol support(http, mqtt, ampq, etc), custom gateway support and seamless integration with other Azure offerings like Stream Analytics, etc...
Not saying it's impossible, but it's complicated.
Anyway, if you want to keep away from receiving unwanted messages from IoT Hub, there's some workaround you can try for now. For example, with mqtt protocol, you can subscribe to some so-called "topic", identified by unique "device id".
If you look forward to having a minimum IoT Hub emulator, go ahead an open up a request in the Azure IoT Hub user voices.
There are few solutions to ease contention when using a single hub. Here are two suggestions:
(Recommended) Unit testing - instead of relying on live data and connecting to a real hub structure your code in a way that you can debug and test it using test input. It usually requires only one layer or separation. For example: http_trigger_azure_function calling a piece of code that can be called from a unit test.
If you structure your code this way the Iot Hub specific code should be minimal.
When using a shared hub you could use custom routes so that only telemetry from developer A's devices goes to developer A's consumer.
Official Azure IoT EdgeHub Dev Tool
The Azure IoT EdgeHub Dev Tool provides a local development experience with a simulator for creating, developing, testing, running, and debugging Azure IoT Edge modules and solutions.
The simulator allows you to run, test and debug your own custom IoT Edge modules locally, without the IoT Edge Runtime, and with the following benefits:
Your custom Edge module code is the same whether running on the simulator or the full IoT Edge Runtime.
Your Edge solution can be run locally without the need to push new images or create IoT Edge deployment manifests.
The only credential required to run your Edge solution on the simulator is the IoT Edge Device Connection String. The IoT Hub Connection String is not needed.
It helps you debug your custom Edge modules on the host and not just in the container.
The following table compares the requirements to run your solution on the IoT Edge Runtime and iotedgehubdev tool:
IoT Edge Runtime
iotedgehubdev
Device Credential Needed
YES
YES
IoT Hub Credential Needed
YES
NO
Build Image
YES
YES
Push Image
YES
NO
Create Deployment
YES
NO
Support native debug scenario
NO
YES
Installing
Install Docker CE (18.02.0+) on
Windows, macOS or Linux
Install Docker Compose (1.20.0+) (Linux only. Compose has already been included in Windows/macOS Docker CE installation)
Install Python (2.7/3.5/3.6/3.7/3.8) and Pip
Install iotedgehubdev by running the following command in your terminal:
pip install --upgrade iotedgehubdev
Note: Please install iotedgehubdev to root on Linux/macOS (Don't use '--user' option in the 'pip install' command).
Please make sure there is no Azure IoT Edge runtime running on the same machine as iotedgehubdev since they require the same ports.
Quickstart
1. Setup
Windows
iotedgehubdev setup -c "<edge-device-connection-string>"
Linux/macOS
sudo iotedgehubdev setup -c "<edge-device-connection-string>"
2. Start/Stop an IoT Edge solution in simulator
Windows
iotedgehubdev start -d <path/to/deployment-manifest>
iotedgehubdev stop
Linux/macOS
sudo iotedgehubdev start -d <path/to/deployment-manifest>
sudo iotedgehubdev stop
3. Start and debug a single module natively
Start the module with specific input(s) and/or environment variable(s)
Windows
iotedgehubdev start -i "<module-inputs>"
// OR
iotedgehubdev start -i "<module-inputs>" -e "<environment-variable>"
Linux/macOS
sudo iotedgehubdev start -i "<module-inputs>"
// OR
sudo iotedgehubdev start -i "<module-inputs>" -e "<environment-variable>"
For example:
iotedgehubdev start -i "input1,input2" -e "TestEnv1=Value1" -e "TestEnv2=Value2"
Output the module credential environment variables
iotedgehubdev modulecred
Start your module natively with the environment variables from the previous step
Send a message to your module through the RESTful API
For example:
curl --header "Content-Type: application/json" --request POST --data '{"inputName": "input1","data": "hello world"}' http://localhost:53000/api/v1/messages
Stop the simulator
Windows
iotedgehubdev stop
Linux/macOS
sudo iotedgehubdev stop
Other resources
Azure IoT Edge for Visual Studio Code
Azure IoT Edge Dev CLI Tool
Data/Telemetry
This project collects usage data and sends it to Microsoft to help improve our products and services. Read our privacy statement to learn more.
If you don’t wish to send usage data to Microsoft, you can change your telemetry settings by updating collect_telemetry to no in the ini file.
Concerns
While our friend commented he is worried the official link changes, I am hoping the official Microsoft's repo link on GitHub never changes (unless while it still useful). At least, I dont know how other way I can post binary files here.
Here is the repo https://github.com/Azure/iotedgehubdev
Cheers To everyone

The best way of develop with Open shift origin: VM or local installation

What is the best way to develop with open shift origin? Is it using vm or install it locally? I have tried installing the vm and I could not login to the vm. What is the default credential used to login to fedora vm.
Default credentials
Depending on which route you follow (see below) there might or might not be real authorization in place.
If you have the AllowAllPasswordIdentityProvider in place you can get away with test/test or whatever.
If you take the binary version (see below) this is what you'll have by default. I changed it to be HTPasswdPasswordIdentityProvider instead.
For the other options I think you will have a user called system, with the password admin coming with the setup.
Docker container version
You can quickly get OpenShift running in a Docker container using
images from Docker Hub on a Linux system. This method is supported on
Fedora, CentOS, and Red Hat Enterprise Linux (RHEL) hosts only.
Link: https://docs.openshift.org/latest/getting_started/administrators.html#running-in-a-docker-container
As per the origin folks, this setup is not (yet) a full example, but very easy to get started with. You should be able to follow the instructions to get an all-in-one instance up and running in no time. However, this approach cannot teach you how to create a cluster (master(s) and node(s))
Vagrant VM
This image is based off of OpenShift Origin and is a fully functioning
OpenShift instance with an integrated Docker registry. The intent of
this project is to allow Web developers and other interested parties
to run OpenShift V3 on their own computer. Given the way it is
configured, the VM will appear to your local machine as if it was
running somewhere off the machine.
The OpenShift Master, Node, Docker Registry, and other pieces are running in one VM. Given it's focus on application developers, it should NOT be used in production.
Link: https://www.openshift.org/vm
Binary option
Red Hat periodically publishes binaries to GitHub, which you can
download on the OpenShift Origin Releases page.
Link: https://github.com/openshift/origin/releases
This is the option I follow currently. You download the binaries, install GO, then setup the OC client tools. Next step you generate the configuration files and start adding your system components (router, ...).
Follow this page to understand the basics:
Link: https://github.com/openshift/origin/blob/master/examples/sample-app/README.md
Ansible route
For production installation you probably want to install your cluster via Ansible.
My humble advice is to do this once you got a bit of an experience via configuring by hand (see previous point). Let's hear some people with more experience though.
Link: https://docs.openshift.org/latest/install_config/install/index.html
Documentation in general
Link: https://docs.openshift.org/latest/install_config/master_node_configuration.html#creating-new-configuration-files
Spin up a Centos.7 VM, download the latest origin tools:
wget https://github.com/openshift/origin/releases/download/v1.3.0-alpha.2/openshift-origin-client-tools-v1.3.0-alpha.2-983578e-linux-64bit.tar.gz
tar xzvf openshift-origin-client-tools-v1.3.0-alpha.2-983578e-linux-64bit.tar.gz
ln -s /root/openshift-origin-client-tools-v1.3.0-alpha.2-983578e-linux-64bit/oc /usr/local/bin/oc
chmod 755 /root/openshift-origin-client-tools-v1.3.0-alpha.2-983578e-linux-64bit/oc
Bring up your single node origin cluster:
oc cluster up --use-existing-config --host-data-dir=/var/tmp/etcd
Login using the instructions provided.

How to deploy a local eclipse worklight project in cloud server?

I developed an android based hybrid app in the IBM MFP-7.0., My app is fetching the data from the Java service which is running in Tomcat Server. Here the app adapters are running in my local system MFP server to get the data from the Java service, So that I can only run the app in my local system android emulator. Now, we want to deploy the app in the cloud so that we can give this app to our users. Can some body help me how to run our MFP app in the cloud? Is it required to place eclipse in the cloud to run my MFP server like the way I am running in my local system?
Thanks in advance.
It looks to me like your understanding is completely lacking in this subject matter. Also note that this question has got nothing to do with programming.
You need a host machine. On this server you will run an application server (Tomcat, WebSphere Full profile, WebSphere Liberty profile - either single or a farm, depending on your required network topology and security & scalability needs).
On this application server you deploy MobileFirst
You will also need a database
This host machine needs to be accessible (with appropriate security) to the public Internet so that it could serve apps installed in end-users' devices
The application needs to be configured to send requests to the server (or to any front-side server like a Load Balancer, again, depending on your topology)
The generated application needs to be submitted to an App Store so that users could download and install it on their devices
I suggest that you will do some reading before asking any question. Since you're using IBM MobileFirst, start by reading the user documentation: http://www-01.ibm.com/support/knowledgecenter/SSNJXP/welcome.html

OpenMEAP hosted on Apache Tomcat Server via OpenShift Community

I'm preparing a development environment primarily for developing enterprise class cross-platform mobile hybrid apps and after much research I've decided to implement OpenMEAP on an Apache RedHat Cloud OpenShift container for advanced app management and services. The combination of these two could be interesting competition to commercial Mobile Enterprise Application Platforms.
I have my Eclipse setup properly to publish OpenMEAP to OpenShift Community Cloud and I can successfully create, build and deploy the OpenMEAP SLIC to Android devices and emulators after carefully following the instructions in these guides and videos:
OpenMEAP Windows Installation Video
Get free Apache Tomcat Hosting in the Cloud for Java Applications at OpenShift Video
I have only warnings in the Eclipse project. When I publish openmeap-admin-web and openmeap-services-web to the OpenShift container the WAR files are published but they don't expand and therefore cannot be accessed from the tomcat server over the web. If I could get past this problem I could proceed with actual development instead of the exhausting environment prep.
I know it's a long shot but is anyone attempting to use OpenMEAP with OpenShift (or any other cloud based Tomcat server)? I would also like to discuss OpenMEAP database requirements for an OpenShift (or Cloud) Apache Tomcat setup.
Any comment is extremely appreciated.
I don't have any experience onboarding OpenMEAD to OpenShift, but there are some things on the OpenShift Online community that you can review to see if it helps:
1) Troubleshooting with Logs: https://www.openshift.com/faq/how-to-troubleshoot-application-issues-using-logs
2) Onboarding vanilla Tomcat: https://www.openshift.com/blogs/free-apache-tomcat-hosting-in-the-cloud-for-java-applications-its-called-openshift
The later is onboarding Tomcat with a DIY cartridge. What cartridges are you using?
Feel free to post to feedback to the OpenShift forums as well: https://www.openshift.com/forums/openshift
You can deploy OpenMEAP on OpenShift from their quickstart page.
Once you've created the quickstart, you'll need to add your authorization information to your Git repository. Making code changes will require you to set a public SSH key, and then to clone your new application Git repository onto your local machine. See the Getting Started page for more steps in this flow.
Step 1. Get Your Application UUID
Get your application uuid by going to the OpenShift Management Console and select the app name to copy the UUID or run this command: rhc app show $appname | grep -i uuid
Go to the administrative interface of the OpenMEAP instance: https://$appname-$yournamespace.rhcloud.com/openmeap-admin-web/interface/
Log in using the default credentials (userid/password): openshift/openmeap
From the Main Menu, navigate to Settings.
Under Global Settings & Preferences and Cluster Nodes set the following values:
External Service URL: https://$appname-$yournamespace.rhcloud.com/openmeap-services-web
File-system Storage Path Prefix: /var/lib/openshift/<application-uuid>/app-root/data
Admin Server Accessible Service Url Prefix: https://$appname-$yournamespace.rhcloud.com/openmeap-services-web
File-system Storage Path Prefix: /var/lib/openshift/<application-uuid>/app-root/data
Step 2. Build Your Mobile Clients!
Use: openmeap.slic.appMgmtServiceUrl=https://$appname-$yournamespace.rhcloud.com/openmeap-services-web/application-management
More Information
For OpenMEAP developer resources visit http://wiki.openmeap.com
For more info on OpenMEAP in general visit http://www.openmeap.com
Uses jbossews-2.0 with code from https://github.com/OpenMEAP/openshift-openmeap-quickstart