How to get the data from the blockchain?


Hi. I've successfully set up one application on Azure Blockchain Workbench following the documents.

However, when I edit data in the SQL database, the DLT watcher of the Web app shows the changed records. I suppose that the SQL database is a copy of the Ledger, and the web simply reads from the database.

So how can I get the actual info, which is stored on the Ethereum Ledger, using corresponding BlockHash or TransactionHash? I'm concerned about the safe and unchangeable characteristics of data, which seems not clarified in the public preview documents.

11 Replies

Hi Cheng. The database is meant to be a duplicate of the data stored in the attached blockchain. The database makes it easy to visualize and analyze data on the blockchain. We have a backlog item to add additional information in the database to allow customers to verify whether the data in the database has been modified.  

Thanks a lot for your helpful reply. Since neither administrators nor members of the application have  access to data stored in the blockchain, does it mean that data are absolutely safe? In other words, how could Azure Blockchain Workbench guarantee that the distributed ledger residing on VMs cannot be changed?

I guess there is no such guarantee in place, unless access to the replicated storage is strictly write-only and read-only (no updates/deletes) as in the recently announced Azure Storage.

Thanks. I think the real data of workbenches are stored in a public blockchain, instead of private ones for each. I can see from the DB that the blockchain numbers of my several contract actions vary from 183 to 28441. If so, it is safe just like Bitcoin so far.

However, I still have two questions. Since Azure Blockchain Workbench utilizes the proof-of-work strategy, who actually mines the blocks?

Besides, I wonder if Azure Blockchain Workbench has a blockchain explorer to query the real data stored in the blockchain, which is just like that of Ethereum (the Log Analytics shows only Highest Reported Block and Avg Block Time).

Workbench actually uses Ethereum PoA (Parity) and not PoW. In terms of exploring the blockchain, you can open up the RPC endpoint and connect an explorer directly to the blockchain. 

Would be great to get some documentation on how to open the RPC endpoint, please.
It looks like the RPC endpoint is not accessible.

Can you provide more details on what you want to do with the RPC endpoint?

Same conversation we are having on the Azure Advisor Yammer channel.
I want to make monetary transfers, although simulated (I.e. not on the public Ethereum), between a smart contract owner and the smart contract itself, using Solidity's command address.transfer(amount).
This doesn't seem to be working for a smart contract deployed in Workbench, and none of the smart contract examples in the GitHub repository have any similar instruction.
So my thought is to get into the EVM via RPC and do a geth to unlock the account, if that's the problem, or Metamask into it to add some funds, if lack of funds is the issue here.
For example, when provisioning Ethereum in Azure, it comes with 1 trillion weis, if I'm not wrong. I'm unclear on what funds users in Workbench have.
Anyway, at the end, all I want to achieve is writing a smart contract that processes payments. Is that possible in Workbench?
We have a call tomorrow to discuss this and other points together.

Thanks for your reply. I have the same problem to directly connect the ethereum-rpc-endpoint (it shows ERR_CONNECTION_TIMED_OUT). Is there any settings to do before this? I appreciate it if there's any document. 

Edit : Rather than open the eth VMSS publically, it would probably be more secure to SSH to the Worker node with Putty and then create tunnel into the Eth VM:


Re : How to open up the private network with the Ethereum VMSS is described here and confirmed works well:


Obviously for dev + debugging purposes only, not for your production private chain!


You can then connect a Geth javascript REPL to the 8545 port.


You can also SSH into the ABW worker node VMSS directly using the worker load balancer public IP (xxx-lb-public-ip) using the username / password or cert you configured during the deploy. The worker node seems to house ~7 docker containers running various DLT and SQL interaction microservices.

I use Putty and Pageant to make the SSH hop easy.  The process is defined in the link below.