How another user can connect to my Hyperledger network in Playground - hyperledger-composer

I created sample blockchain network. How to allow another user connect to it and make transactions?

If you used the online playground then your network is stored under a "Web Browser" connection and your Business Network is run and stored only within your browser's local storage. However you could Export your network (definition only not data) and share the BNA file with another user who can then import it - but you have separate copies.
If you want to completely share with another user you will need to share an underlying Hyperledger Fabric - then both download and install Playground locally and share Business Network Cards to connect to the same Fabric.

Related

Can I make an Azure storage account go offline to test my fallback code?

I am developing an Azure application (C#, .NET 6, ASP.NET Core) that uses Azure blob storage as well as table storage.
I have geo-redundancy enabled on my storage account (RA_GRS) so that if my main storage account goes down, a read-only copy will be available in another Azure region.
When reading from blob storage, as far as I understand, I should be able to get it to automatically fall back to the secondary address by setting the GeoRedundantSecondaryUri property like this:
return new BlobServiceClient(
new Uri($"https://{accountName}.blob.core.windows.net/"),
sharedKeyCredential,
new BlobClientOptions
{
GeoRedundantSecondaryUri = new Uri($"https://{accountName}-secondary.blob.core.windows.net/")
});
How can I end-to-end test that I am doing this correctly?
Can I tell the storage account to go offline so that my application should fall back to the read-only backup? I know I can stop an app service using az webapp stop from the command line. Can I do anything similar for storage accounts? Otherwise, how can I test my fallback logic?
(I am asking not only because I want to test the built-in geo-redundancy functionality. I have other failover-related code I want to test.)
EDIT 1: I do not want to use Azure's built-in "initiate account failover" functionality. At least not at this time. I want to test that my application can continue in a kind of "read-only mode" while the primary storage is down.
EDIT 2-3: I have tried to block the primary address ({accountName}.blob.core.windows.net/) using C:\Windows\System32\drivers\etc\hosts. My blob client does not seem to fall back.
If I redirect to IP 0.0.0.0, the blob client throws this: "The requested name is valid, but no data of the requested type was found."
If I redirect to IP 127.0.0.1, the blob client throws this: "No connection could be made because the target machine actively refused it."
If you just want to test the geo-redundancy of your Storage Account, you can initiate an account failover manually from Azure portal & see if your application resumes back the functionality via secondary endpoints.
This documentation might help you out in this scenario: Initiate Azure Storage Account Failover
Note that there will be a certain minimal amount of data loss if you perform a failover, so I'd recommend you to go through the implications of a failover before performing it.

Azure Deployment Firewall Problems

I want to publish my Azure function through VS 2017.
It works fine, but after I activate the firewall on the linked Storage Account I can't deploy my project anymore.
I already checked the FW-Settings, it seems okay (no proxy etc.).
I got some ERROR_INSUFFICIENT_ACCESS_TO_SITE_FOLDER Errors.
The given advice from topic doesn't works for me.
Not able to publish website on Windows Azure using publish through VS2010.
Any other advice?
Solution:
Create a Storage Account which is not in the same region as your function app. For example, if your Function is in Central US, the Storage Account should select a different one like East US. Then modify the following three parameters(in Application settings) with new created Storage Account Connection String.
AzureWebJobsDashboard
AzureWebJobsStorage
WEBSITE_CONTENTAZUREFILECONNECTIONSTRING (only used for Consumption plan)
Configure its Firewall with Function app outbound IP addresses.
On Platform features panel of your Function app, click Resource Explorer.
Find outboundIpAddresses and add all of them to Firewall IP list.
Don't forget to add your local IP if you want to visit Storage Account using Azure Portal. (Not necessary for deployment from VS).
Explanation:
Can only reproduce the INSUFFICIENT_ACCESS for a Function hosted on Consumption plan.
About this problem, the biggest difference between App service and Consumption plan is how they host function files.
For an App service plan, function files we publish or create on portal are stored on some Azure server. Adding firewall settings to Storage Account used by AzureWebJobsDashboard(store function logs in tables) and AzureWebJobsStorage(store function host locks in container), has no influence on function deployment.
While for Consumption plan, function files are stored on the Storage Account specified by WEBSITE_CONTENTAZUREFILECONNECTIONSTRING. When we publish from VS or create functions on portal, function files are deployed from function site to Storage Account. We met the error as we don't add function app IPs to Storage firewall white list.
As for why we have to create the Storage in a region different from Function app's, based on my tests, function seems not leverage the outbound IPs when they two locate at the same region. See some one on GitHub got the same result.

Accessing a Firebase-deployed App over a VPN

I built an app to offer a client of the company I work for that I deployed to Firebase. It uses Firebase storage for retrieving files as well as the realtime database. It's actually just the front-end portion of a two-app suite I made; the backend portion is used by an admin for uploading files, checking data, etc --- which data then becomes available to view over the frontend. Both use firebase.
It turns out the devices that would need to access the app (tablets mostly) are inside of an extranet with a server that can establish VPN connections only. Now I'm being asked how I can build the app so these devices can access the app.
I don't know much about the inner-workings of Firebase but it seems to me I may have couple of options:
1) Figure out how to make the FB database accessible over VPN (preferable)
2) Reconfigure the app to use something like MongoDB. Instead of deploying on a remote server, let the on-site server service the devices using the app. Send files that are needed by the server via FTP over the VPN, then process these files on-site.
Problem: I'm using a Mac and the on-site server uses Windows. It will be a pain to install things on a Windows machine remotely, let alone set up the VPN.
Any ideas? I'm sure there are parts of this question where I've made wrong assumptions --- I've never needed to do things over a VPN before.

Could Hyperledger composer handle more than one CA (MSP)?

I have a fabric network with two organizations with its individual MSP hence 2 MSP. Each organization manages 1 peer, I want to create a channel and have the peer of each Org to join this channel, would composer be able to handle two MSP? The createComposerProfile.sh is able to create multiple peers but not multiple MSP. How do I create a composer profile to associate the different MSP for the individual peer?
With hyperledger composer, a connection profile represents a connection from one organisation to a specific channel where a business network has been deployed. Each organisation in a multi-organisation fabric topology will have connection profiles representive of their individual MSP. An organisation may also have more than one connection profile as well, for example one to perform composer runtime installations, one to transact on a business network and even one to query a business network.
createComposerProfile.sh creates a connection profile for the developer server provided by hyperledger composer and only creates a reference to the single peer defined by that developer server.

Creating an android studio project to run queries on a google cloud sql server using jdbc driver

I have an cloud sql instance up and running and have made a link using a jdbc driver to the instance ip using android studio project. I can successfully run queries from an ip address that I insert manually into the google cloud sql settings and not any other network. This makes my app accessible only from certain ip addresses. Is there a way i can authenticate my google cloud sql to all ip addresses. I do not wish to use the google app engine if possible as I believe it will only complicate my application. My app works well enough is there an easy way to access my sql from any network having supplied my username and password in the code itself?
You can use the console to authorize 0.0.0.0, which will allow connections from any IP address. However, this is not necessarily a good solution. If you embed your database's username and password in your Android app, it can be found by someone else taking apart the apk. If they do that, they will then have complete access to your database. It is more complicated, but you should put some kind of server in front of your database, and have the user authenticate with that server/application, and only have that server communicate directly with your database.

Resources