How can I use a hyperledger fabric network in IBM Blockchain Platform? - visual-studio-code

I am trying to get a locally hosted Hyperledger Fabric network (the test-network from Fabric itself) connected via the vscode plugin "IBM Blockchain Platform". I have been able to extract the wallet (added under "wallet" in vscode) and connection.json (added under "gateway" in vscode), but I still need to add the network itself (under "environments").
I can click the plus icon to add an environment, but I need to provide "node JSON files" to connect to it. I don't know what this is, and I can't find information on which format this is.
For the wallet and the gateway I can export them from the plugin to see what the desired format is, but for environments this is not possible.
Can someone tell me what format these "node JSON files" need to be in?

The node json format information can be accessed through the extension README, here

Related

How do I deploy .BNA file on IBM cloud blockchain 2.0 resource?

I am trying to set up a rest API that is connected to an IBM blockchain resource. I have developed a model file, logic file, and acl file.
I have it all packed up in a nice tidy .BNA, and now i would like to deploy it to a channel of my IBM cloud blockchain 2.0 resource, running on a free kubernetes cluster.
Everything on the cloud blockchain resource is set up perfectly, and all orgs, peers, orderers, msps, and CAs are set up correctly. The channel is set up properly, and has nodes and an MSP connected. I have all the admin cred .jsons
The channel only accepts smart contract files, so I tried repackaging the files (logic.js, permissions.acl, and model.cto) by putting them in a contract folder, and using the IBM Blockchain vsCode plugin to package them as a smart contract, but trying to install on the IBM cloud crashes the browser.
I am thinking maybe I have to remote connect into the IBM kubernetes cluster that the blockchain resource is sitting on, and use the hyperledger composer CLI to install the .BNA
Seems very unintuitive, but thats the one thing I can think to try while I wait for this question to get answered.
I expected to just be able to install the .BNA as a smart contract, like a .cds.
In August 2018, IBM announced that we are no longer investing in Hyperledger Composer, and instead focusing 100% on Hyperledger Fabric. As a result, IBM Blockchain Platform v2.0 will not provide any support or tooling around Hyperledger Composer.
The good news is that we've significantly invested in the programming model (APIs and SDKs) used to write smart contracts and applications in Fabric v1.4, and we've also released some great developer tooling in the form of an extension for Visual Studio Code: https://marketplace.visualstudio.com/items?itemName=IBMBlockchain.ibm-blockchain-platform
The extension offers an extensive set of capabilities for writing smart contracts - with tooling for creating new projects, packaging them, deploying them, testing them, and debugging them - all from within one of the most popular IDEs around.
To get started - just install Visual Studio Code, and then the IBM Blockchain Platform extension (there are a few prereqs, check the README first). After that, you will be presented with a homepage that links you to tutorials and samples to help you get started.
For the first one, I can't really suggest a solution. At best, try installing and using the composer CLI and the latest version to make the bna file. Composer playground isn't maintained as well imo.
For the second part, in the connection.json file and docker there will be a bunch of IP addresses that look something like localhost:7040 and so on for the CA, orderer, org and peer. You will need to replace these using the IPs given by IBM. The examples on github that demonstrate integration are to do with nodejs SDK and not composer, however you can refer to https://github.com/IBM-Blockchain/vehicle-manufacture to get the idea.
This link is the only I could find for Hyperledger Composer and IBM platform.
(comments were getting too long to fit)

Connecting to my own Hyperledger Fabric instance

I am new to IBM Blockchain Platform VSCode Extension and using IBM Blockchain Platform Extension Version: 0.3.2 and Visual Studio Code version: 1.32.3.
In this extension there is a feature "Connecting to your own Hyperledger Fabric instance". I tried this by using the command "Add Gateway" in VSCode. I have provided connection profile, cert and private key. It successfully connected and showing only channel name under "FABRIC GATEWAYS". No peers are showing. But now my question is, how to install and initiate smart contract using the extension? Nothing is showing under "LOCAL FABRIC OPS" which was showing when I connect to pre-configured local fabric instance. Please help me to understand.
It's not possible to install chaincode or instantiate chaincode on an external network (ie one that isn't managed by the vscode plugin itself), although as you have already discovered you can connect a gateway to it to test your running chaincode. So you can perform an install/instantiate on your external network then use the plugin to interact with it.
If the network provided by the plugin isn't suitable for you to use for your local testing then I would suggest raising an issue at
https://github.com/IBM-Blockchain/blockchain-vscode-extension/issues
describing why the in built network isn't suitable and what sort of inbuilt network would be suitable.

Can't find Blockchain Cloud Foundry app

I followed the instructions on IoT Asset Tracking on a Hyperledger Blockchain . BUILD and DEPLOY finished successfully, but I can't find the composer-rest-server- app under Cloud Foundry Applications.
I can use the CF Blockchain services, enter the Monitor and open the Swagger UI. The question is, where can I find the application-specific APIs mentioned in the tutorial:
If everything deployed correctly, you can find the app in the IBM Cloud dashboard at https://console.bluemix.net. If you have many apps and services deployed, make sure to filter correctly or to be aware of paging.
If you suspect that something got wrong during build and deploy, go to the toolchain and check the logs. The toolchains can also be reached from the dashboard.

Securing a Node Red GUI on IBM WATSON Cloud

I've got a Node-RED Dashboard running on Bluemix, but I want to secure it using the standard Node-RED security, i.e., editing the settings.js file.
Does anyone know how I can actually access this on BlueMix?
On the IBM Cloud dashboard for your application you need to enable the Continuous Delivery feature. That will get you a git repository containing the application code which you can edit in your browser and have changes automatically deploy back into your running application.
You will then need to edit the file called bluemix-settings.js to add the required settings to secure the Node-RED dashboard.

How do you connect an IBM Cloud Functions (OpenWhisk) to a custom domain?

I had successfully setup a custom domain with IBM Cloud Functions in the past, but now suddenly it seems to be broken.
Here is how I was able to do it in the past: You first need to install a SSL cert in IBM Cloud by going to:
Log in to IBM Cloud
Go to Manage>Accounts>Cloud Foundry Orgs.
Click on your Org and then click Edit Org.
Choose the Domain tab, add a domain, and install the SSL cert that was purchased or obtained for free by letsencrypt.org
Go to Cloud Functions page by clicking on the Hamburger menu
and then click Functions.
Click APIs on the sidebar.
Choose an existing API you would like to map to the domain.
Choose Definitions from the sidebar.
Select Domain for API and change it your new domain!
YAY, IBM Cloud says it is now connecting your custom domain. You get a warning about how it takes a bit of time, but the task never finishes.
This actually worked until about a month or so ago. Now it just sits there and it will not route your domain to your API.
If you hit the site you which is routed, it will say:
404 Not Found: Requested route ('yourdomain.com') does not exist.
Am I missing something? Or has IBM again crapped out on me.
There was a bug affecting this feature, but it has since been fixed. Give it another try.