How is a hyperledger fabric blockchain stored on a PC? - blockchain

I'm trying to get my head around blockchain and I'm finding it difficult to get a straight forward answer to this. Say I create a web application that interacts with a blockchain. A user opens my web app, logs in and uses that web application and so a transaction occurs and a new block is added to the chain. How is that blockchain stored on their PC, since the point of blockchain is that it is stored on every participating node? In what format is it stored?

Your web application will interact with the blockchain as a client (likely using one of the Hyperledger Fabric SDKs). The "blocks" will be stored on one or more peer nodes (depending on how many peers are connected to a given channel) not on your client nor on the server hosting your web application.
I'd recommend looking at this to understand the overall transaction flow and this to understand the ledger.

Related

Should blockchain technology be handled on the client side or the server side?

I'm a full-stack developer (specifically Django web developer).
I want to allow people to send Bitcoin and Ethereum in my website
Blockchain is new to me. I heard that blockchain applications can be written with both python (on the server side) and javascript (on the client side).
So, what programming langue is to write Blockchain? Do I write it on the server side or the server side? My guess is handling it in the server would be more secure because hackers can read client code and inject malicious javascript code through the console panel. Am I right?
To be concise, my question is Should blockchain technology be handled on the client side or the server side?
The correct question is
Should I use blockchain? And what problems it actually will solve?
And about
To be concise, my question is Should blockchain technology be handled on the client side or the server side?
Where do you plan to store trusted blockchain data? Inside your server behind the backend logic? Just use standard database for these purposes. Here is no difference in security and trust aspects. You will be only one owner of blockchain data and will be able change it as you wish and no difference is that DB or blockchain (yes, in theory you have to overwrite whole blockchain even if you want to change only one block. It is little bit complex than overwrite one row in DB but not impossible). If you plan to store blockchain data at client side it is no matter what logic you have inside frontend/backend code. Anyone will be able to change it directly, so blockchain should be protected by blockchain mechanisms.

How to make a communication between Arduino, Web app and AWS?

I'm making a project where temperature and humidity levels are sensored by Arduino and send those data to AWS with ESP-8266-01s. At the same time, those data are also shown on the web application (it may be on Node.js/Java, etc.).
So what I'm asking is how the architecture should be. What is the best practice? Does AWS also provide a web app where I can use it for both database cloud as a web application or should I make a separate project as a web app to connect to AWS?
I searched on Google but the only answers I can find are two ways: Arduino and AWS without another aspect connected to it in my case the web app.
Make use of MQTT protocol.
Components required -
Pubsubclient.h library on esp8266 that will be used to publish temp and humidity data to MQTT Broker on AWS
mosquitto MQTT broker setup on AWS used to accept data from esp8266
Python script that will subscribe to data from the mosquitto broker and dumps into any database(my suggestion is influxdb)
Graphing platform to query database and display visual timeseries-graphs(my suggestion grafana)
Use AWS only for purchasing a virtual machine. Rest can be taken care using open-source Platforms.
Assuming you want to display graphs of temperature and humidity, Using grafana is the best practice.
You will not find a silver bullet here. A proper architecture for your case depends on many things and there can be different approaches with their own pros and cons.
There are many aspects to cover including connectivity, security, update, availability, costs.
Usually IoT devices are not connected directly to the cloud, because they don't have a constant connection, or any network connection. There is a hub (or middleware) that collects data from sensors/devices and send them to the cloud for processing.
But many cloud vendors provide some out of the box complex solutions here (including AWS).
I listed just examples.

How to avoid Hyper ledger Composer Rest server restart while upgrading(with change in model files) composer network installed?

We have a working setup of 3 peer nodes and a multi user rest server running on 1 of the peers. Now there are multiple user cards created and imported in the rest server(using web based client) which is working fine. I can trigger transactions and query the blockchain with it.
However In case I need to upgrade my network and there is some change in model file(i.e. any participant/asset/transaction parameters changes). I need to restart rest server so that effect can be observed by WEB based client application. So my questions are:
1. Is there a way to upgrade Rest interfaces without restarting the server.
2. In case Rest server crashed or restarted is there some way to use the old cards that were created before server shutdown.
When the REST server starts you can see that it "discovers" the Business Network and then generates the End Points. The discovery is not dynamic, so that when you change the model or other element of a BNA you need to restart the REST server to re-discover the updated network. (In a live scenario I would think changes to the model are infrequent.)
Are you using multi-user mode for the REST server? Assuming that you are, then Configuring the REST server with a persistent Data Source as described in the documentation, or this tutorial should solve the problem of re-importing the cards. You could also "backup" the cards after they have been used the first time by Exporting them.

Making Transaction from remote device (e.g. Mobile) to make Transaction or call data from Blockain

I was thinking of developing a mobile application which can make transaction in private network nodes of which are located at a server.
How this objective can be achieved?
What should be the technologies I should learn to implement?
I understand that you are talking about developing a permissioned Blockchain, i.e. a private network where everyone can't access. So, if I were you, I'd learn about the Fabric project by Hyperledger, which is an implementation of Blockchain for permissioned networks. You have more information about it here
Fabric allows you to create a permissioned Blockchain. Then, you will develop the clients that will call the Blockchain. In the Blockchain, you deploy your smartcontract, i.e. the code that you want to be executed.

Accessing Ethereum Dapp

Is their a way to access ethereum Dapps other than the mist browser. I was thinking along the lines of a normal browser like chrome. Also, as a sub question how are some Android and IOS apps connecting to the blockchain?
You can do that through Ethereum JSON-RPC: https://github.com/ethereum/wiki/wiki/JSON-RPC
You have to use
eth_call - read from contract
eth_sendTransaction - send transaction to a contract
You must understand that you'll also need to have an Ethereum node started, most probably with unlocked account to execute transactions from it. Which means you don't want to run it on public networks, but rather in local network. That's what Mist do for you essentially.
Also, take a look at MetaMask, it provides same API for browser based app, but requires an additional plugin to be installed into a browser