Cloud-to-Cloud integration is part of a <a href="https://www.voxxed.com/blog/2016/08/the-need-for-a-hybrid-integration-architecture/" target="_blank">hybrid integration architecture</a>. It enables to <strong>implement quick and agile integration scenarios</strong> without the burden of setting up complex VM- or container-based infrastructures. One key use case for cloud-to-cloud integration is innovation using a fail-fast methodology where you realize new ideas quickly. You typically think in days or weeks, not in months. <strong>If an idea fails, you throw it away and start another new idea.</strong> If the idea works well, you scale it out and bring it into production to a on premise, cloud or hybrid infrastructure. Finally, you make expose the idea and make it easily available to any interested service consumer in your enterprise, partners or public end users.
Cloud-to-Cloud integration is part of a hybrid integration architecture. It enables to implement quick and agile integration scenarios without the burden of setting up complex VM- or container-based infrastructures. One key use case for cloud-to-cloud integration is innovation using a fail-fast methodology where you realize new ideas quickly. You typically think in days or weeks, not in months. If an idea fails, you throw it away and start another new idea. If the idea works well, you scale it out and bring it into production to a on premise, cloud or hybrid infrastructure. Finally, you make expose the idea and make it easily available to any interested service consumer in your enterprise, partners or public end users.
A great example where you need agile, fail-fast development is blockchain because it is a very hot topic, but frameworks are immature and change very frequently these days. Note that blockchain is not just about Bitcoin and finance industry. This is just the tip of the iceberg. Blockchain, which is the underlying infrastructure of Bitcoin, will change various industries, beginning with banking, manufacturing, supply chain management, energy, and others.
Middleware and Integration as Key for Success in Blockchain Projects
A key for successful blockchain projects is middleware as it allows integration with the rest of an enterprise architecture. Blockchain only adds value if it works together with your other applications and services. See an example of how to combine streaming analytics with TIBCO StreamBase and Ethereum to correlate blockchain events in real time to act proactively, e.g. for fraud detection.
The drawback of blockchain is its immaturity today. APIs change with every minor release, development tools are buggy and miss many required features for serious development, and new blockchain cloud services, frameworks and programming languages come and go every quarter.
This blog post shows how to leverage cloud integration with iPaaS and API Management to realize innovative projects quickly, fail fast, and adopt changing technologies and business requirements easily. We will use TIBCO Cloud Integration (TCI), TIBCO Mashery and Hyperledger Fabric running as IBM Bluemix cloud service.
IBM Hyperledger Fabric as Bluemix Cloud Service
Hyperledger is a vendor independent open source blockchain project which consists of various components. Many enterprises and software vendors committed to it for building different solutions for various problems and use cases. One example is IBM’s Hyperledger Fabric. The benefit of being a very flexible construction kit makes Hyperledger much more complex for getting started than other blockchain platforms, like Ethereum, which are less flexible but therefore easier to set up and use.
This is the reason why I use the BlueMix BaaS (Blockchain as a Service) to get started quickly without spending days on just setting up my own Hyperledger network. You can start a Hyperledger Fabric blockchain infrastructure with four peers and a membership service with just a few clicks. It takes around two minutes. Hyperledger Fabric is evolving fast. Therefore, a great example for quickly changing features, evolving requirements and (potentially) fast failing projects.
My project uses version Hyperledger Fabric 0.6 as free beta cloud service. I leverage its Swagger-based REST API in my middleware microservice to interconnect other cloud services with the blockchain:
However, when I began the project, it was already clear that the REST interface is deprecated and will not be included in the upcoming 1.0 release anymore. Thus, we are aware that an easy move to another API is needed in a few weeks or months.
Cloud-to-Cloud Integration, iPaaS and API Management for Agile and Fail-Fast Development
As mentioned in the introduction, middleware is key for success in blockchain projects to interconnect it with the existing enterprise architecture. This example leverages the following middleware components:
I implemented the following technical scenario with the goal of showing agile cloud-to-cloud integration with fail-fast methodology from a technical perspective (and not to build a great business case): The scenario implements a new REST microservice with TCI via visual coding and configuration. This REST service connects to two cloud services: Salesforce and Hyperledger Fabric. The following picture shows the architecture:
Here are the steps to realize this scenario:
This section discusses the relevant steps of the implementation in more detail, including development and deployment of the chain code (Hyperledger’s term for smart contracts in blockchain), implementation of the REST integration service with visual coding in the IDE of TCI, and exposing the service as API via TIBCO Mashery.
Chain Code for Hyperledger Fabric on IBM Bluemix Cloud
Hyperledger Fabric has some detailed “getting started” tutorials. I used a “Hello World” Tutorial and adopted it to our use case so that you can store, update and query customer data on the blockchain network. Hyperledger Fabric uses Go for chain code and will allow other programming languages like Java in future releases. This is both a pro and con. The benefit is that you can leverage your existing expertise in these programming languages. However, you also have to be careful not to use “wrong” features like threads, indefinite loops or other functions which cause unexpected behavior on a blockchain. Personally, I prefer the concept of Ethereum. This platform uses Solidity, a programming language explicitly designed to develop smart contracts (i.e. chain code).
Cloud-to-Cloud Integration via REST Service with TIBCO Cloud Integration
The following steps were necessary to implement the REST microservice:
The last point is very important in blockchain projects. A blockchain infrastructure does not have millisecond response latency. Furthermore, every blockchain update costs money – Bitcoin, Ether, or whatever currency you use to “pay for mining” and to reach consensus in your blockchain infrastructure. Therefore, you can leverage caching and throttling in blockchain projects much more than in some other projects (only if it fits into your business scenario, of course).
Here is the implemented REST service in TCI’s graphical development environment:
And the caching configuration in TCI’s web user interface:
Exposing the REST Service to Service Consumers through API Management via TIBCO Mashery
The deployed TCI microservice can either be accessed directly by service consumers or you expose it via API Management, e.g. with TIBCO Mashery. The latter option allows to define rules, payment plans and security configuration in a centralized manner with easy-to-use tooling.
Note that the deployment to TCI and exposing its API to Mashery can also be done in one single step. Both products are loosely coupled, but highly integrated. Also note that this is typically not done manually (like in this technical demonstration), but integrated into a DevOps infrastructure leveraging frameworks like Maven or Jenkins to automate the deployment and testing steps.
Agile Cloud-to-Cloud Integration with Fail-Fast Methodology
Our scenario is now implemented successfully. However, it is already clear that the REST interface is deprecated and not included in the upcoming 1.0 release anymore. In blockchain frameworks, you can expect changes very frequently.
While implementing this example, IBM announced on its big user conference IBM Interconnect in Las Vegas that Hyperledger Fabric 1.0 is now publicly available. Well, it is really available on Bluemix since that day, but if you try to start the service you get the following message: “Due to high demand of our limited beta, we have reached capacity.” A strange error as I thought we are using public cloud infrastructures like Amazon AWS, Microsoft Azure, Google Cloud Platform or IBM Bluemix for exactly this reason to scale out easily… J
This blog post focuses just on a small example, and Hyperledger Fabric 1.0 will bring other new features and concept changes with it, of course. Same is true for SaaS cloud offerings such as Salesforce. You cannot control when they change their API and what exactly they change. But you have to adopt it within a relative short timeframe or your service will not work anymore. An iPaaS is the perfect solution for these scenarios as you do not have a lot of complex setup in your private data center or a public cloud platform. You just use it “as a service”, change it, replace logic, or stop it and throw it away to start a new project. The implicit integration into API Management and DevOps support also allow to expose new versions for your service consumers easily and quickly.
Conclusion: Be Innovative by Failing Fast with Cloud Solutions
Blockchain is very early stage. This is true for platforms, tooling, and even the basic concepts and theories (like consensus algorithms or security enforcement). Don’t trust the vendors if they say Blockchain is now 1.0 and ready for prime time. It will still feel more like a 0.5 beta version these days. This is not just true for Hyperledger and its related projects such as IBM’s Hyperledger Fabric, but also for all others, including Ethereum and all the interesting frameworks and startups emerging around it.
Therefore, you need to be flexible and agile in blockchain development today. You need to be able to fail fast. This means set up a project quickly, try out new innovative ideas, and throw them away if they do not work; to start the next one. The same is true for other innovative ideas – not just for blockchain.
In my previous article, I tried to described the concept of a blockchain with code. This time, I'll try to describe the structure of a single block. I will use the Bitcoin blockchain to explain blocks, but keep in mind that the concepts will remain more or less the same. It could be useful to read my <a href="https://dev.to/damcosset/trying-to-understand-blockchain-by-making-one-ce4" target="_blank">last article</a>to understand a few things first.Introduction
In my previous article, I tried to described the concept of a blockchain with code. This time, I'll try to describe the structure of a single block. I will use the Bitcoin blockchain to explain blocks, but keep in mind that the concepts will remain more or less the same. It could be useful to read my last articleto understand a few things first.Structure of a block
A block is a container data structure. In the Bitcoin world, a block contains more than 500 transactions on average. The average size of a block seems to be 1MB (source). In Bitcoin Cash ( a hard fork from the Bitcoin blockchain ), the size of a block can go up to 8MB. This enables more transactions to be processed per second.
Anyway, a block is composed of a header and a long list of transactions. Let's start with the header.Block Header
The header contains metadata about a block. There are three different sets of metadata:
To identify a block, you have a cryptographic hash, a digital signature if you will. This is created by hashing the block header twice with the SHA256 algorithm. For example, this is a block. I will refer to this block as an example for this article.
The block header hash for this particular block is (right column): 000000000000000000301fcfeb141088a93b77dc0d52571a1185b425256ae2fb
We also can see the previous block's hash (right column): 0000000000000000004b1ef0105dc1275b3adfd067aed63a43324929bed64fd7
Remember that we used the second hash to create the first. Every block uses the previous block's hash to construct its own hash. The block hash is a unique identifier. You won't find two blocks with the same hash.
The other way to identify a specific block is the block height. The is the position of the block in the blockchain. Our example's block is in the 500312 position. This means that there are 500311 blocks before this one. Since the creation of the Bitcoin blockchain in 2009, 500312 blocks have been created ( at the time of writing obviously ).
A block height is not unique. Several blocks can compete for the same position in the case of a fork, like Bitcoin Cash for example.Merkle Trees
The transactions in a block are contained in a structure called a merkle tree or binary hash tree.
I feel that topics like that are easier to understand with actual examples. So we'll go coding for this. A merkle tree is constructed by recursively hashing pairs of nodes ( in this case, transactions ), until there is only one hash, called the root or merkle root. If we stay in the Bitcoin world, the cryptographic hash algorithm used is SHA256. This is applied twice each time.
An example: We have a block with 4 transactions. For the sake of simplicity, each transaction is a string:
const tA = 'Hello' const tB = 'How are you?' const tC = 'This is Thursday' const tD = 'Happy new Year'
To construct our merkle tree, we start from the bottom. We take each transaction and double-hash them. I'll use the js-sha256 package here.
const sha256 = require('js-sha256').sha256
// Double-hashing here
const hA = sha256(sha256(tA))
const hB = sha256(sha256(tB))
const hC = sha256(sha256(tC))
const hD = sha256(sha256(tD))
Ok, great. Now remember that I wrote a merkle tree is constructed hashing pairs of nodes. So, we will pair our transactions and concatenate their hashes. Then, we will double hash them too. We will create a hash using the hashes hA and hB, and another for hC and hD. Then, we repeat that process until we have only one hash left and no more pairs to work with. The last hash will be our merkle root.
With only four transactions, this will be rather quick:
//Pairing hA and hB
const hAB = sha256(sha256(hA + hB))
//Pairing hC and hD
const hCD = sha256(sha256(hC + hD))
// We do it again. We pair hAB and hCD
// This is our root!
const hABCD = sha256(sha256(hAB + hCD))
The node at the top of the merkle tree is called the root. This is the information that is stored in the block header in each block on the blockchain. This is how transactions are summarized in each block. In our example block given earlier, the merkle root can be found in the right column:
It doesn't matter how many transactions are contained in a block, they always will be summarized by a 32 bytes hash.
Note: The merkle tree is a binary tree. If there is an odd number of transactions, the last one will be duplicated so we can construct our tree.
Because all the leaves in our tree depends on other leaves, it is impossible to alter one leaf without altering others. If you change only one leaf ( one transaction ), the hash changes, therefore the hash you constructed by pairing it with another leaf changes, therefore the merkle root will be different.
You can prove that any transaction is included in a block by creating a authentification path or merkle path. You only need to know log base 2(N) 32-byte hashes. For example:
-For my 4 transactions merkle tree:
log base 2( 4 ) = 2 => If I have a path of 2 hashes for a tree of 4 transactions, I can manage to prove if a transaction belongs to this merkle tree.
For a 16 transactions merkle tree:
log base 2( 16 ) = 4 => If I have a path of 4 hashes for a tree of 16 transactions, I can manage to prove if a transaction belongs to this merkle tree.
log base 2( 1500 ) = 10.55 => If I have a path of 11 hashes for a tree of 1500 transactions, I can manage to prove if a transaction belongs to this merkle tree.
Perhaps a little diagram will help.
There are 16 leaves in this tree. We construct our tree from the bottom up by pairing each leaf. Now, anybody can prove that the leaf I ( in orange ) is part of this block by having the path given in green. We have only 4 hashes, but that is enough to know if the leaf I belongs here. That is because with those informations, we are able to construct every single leaf we need( in yellow ). We can create IJ, IJKL, IJKLMNOP and the root and check if those hashes correspond. This is why it is very complicated to cheat a blockchain. To change one thing means you must change everything.
Well, that's pretty much what a block contains in the Bitcoin blockchain. Hope it helped!
If you’re a tech-oriented person like me, chances are you’ve wondered at least once about all those latest fusses regarding blockchain and cryptocurrencies. So, what is this blockchain and why’d you be tempted to learn more about it? Blockchain, as the name suggests, is a chain of blocks; connected sequentially using complex cryptographic logic.
This technology was implemented first by Satoshi Nakamoto and was first used in the implementation of the popular BitCoin cryptocurrency. The blockchain technology is being used heavily in the industry, thanks to the high-level of security it provides in business transactions. From corporate firms to industrial banks, blockchain developers are sought everywhere equally. So, wielding this modern-day skill by learning the best blockchain programming language guarantee you an edge over your fellow developers.
Which are the best programming languages for blockchain? Developers are presently utilizing prevalent programming languages like C++ and Java to manufacture custom blockchain programs. What’s more, digital money specialists have made languages like Simplicity and Solidity that are explicitly intended for blockchain improvement.
The worldwide Blockchain market is right now worth an expected $1.2 billion and specialists foresee that it will arrive at a $57 billion valuation by 2025, developing at over 69% every year.
Significant enterprises and investors are teaming up with Blockchain counseling organizations to grow new digital currency innovation, savvy contracts, conveyed records for customary banks, gaming tokens, and inventory network the executives frameworks.
What Is Blockchain?
Customary financial uses a bank as the record and mediator. To move cash to a companion, an individual should initially contact their own bank and request that they move cash to a particular record number. The bank checks the sender’s record for assets, moves those assets to the goal, and records the exchange on the sender’s record. The accepting bank must accomplish something very similar.
In any case, the issue with this customary financial framework is that records are put away inside and are defenseless against hacking and control.
Blockchain disposes of this hazard by putting away all records online in a decentralized, unknown record that can be gotten to by anybody. Blockchain uses squares, or accumulations of information, like spreadsheet lines and segments, to store information. Squares are added to the “chain” in successive request.
In contrast to conventional bank records, which are put away inside, each blockchain client has a total record of the whole blockchain on their PC. This implies they can rapidly discover any exchange that has ever happened in the event that they have the comparing hash code. Since that information is put away freely, it can never be changed or erased — giving clients genuine feelings of serenity and trust in the framework.
Organizations keen on exploiting the blockchain upset should scan for up-and-comers with skill in the accompanying programming languages.Here are the best programming languages for Blockchain
C++ keeps on being one of the most famous programming languages in the tech world and is a prevailing power in the blockchain business also. The article arranged language is ideal for blockchain improvement, since it utilizes similar standards, for example, epitome, deliberation, polymorphism, and information covering up, as blockchain to avoid incidental alters to information.
Engineers additionally prize C++ in view of its memory control abilities. The language helps keep squares secure and deal with an enormous number of asset demands by enabling each system hub to acknowledge or dismiss individual squares.
C++ is additionally utilized broadly by blockchain advancement administrations due to the manner in which it handles parallel undertakings and stringing. The language is equipped for taking care of both parallel and non-parallel assignments, notwithstanding improving single-string execution.
EOS is an awesome case of a blockchain program worked with C++. The open source programming was discharged by Square in 2018 and is intended to process exchanges more rapidly than choices by restricting the product to only 21 square creating hubs. This enables the product to affirm an exchange in under a second and settle it in only two minutes.
By running numerous activities on the double, offbeat code can improve programming responsiveness and application execution. This empowers blockchain projects to deal with the enormous volume of activities without hindering execution and disappointing clients.
The only language that can challenge the reign of C++ in the industry is Java, and for good reasons so. Java is in many ways similar to C++ regarding its object-oriented approach and a vast community of third-party applications and platforms. The main reason to use Java as the de-facto blockchain programming language in the industry is, however, its highly-capable portability.
Programs written in Java are portable across any computational device, as they don’t rely on system-specific architecture, instead uses the universal JVM(Java Virtual Machine) for execution. This makes Java one of the best programming languages for blockchain.
Python is probably THE most trending programming language you can learn these days!
It's very popular because it's easy to learn and use, runs on all operating systems and allows you to build a broad variety of programs: Be that web applications, desktop applications, utility scripts or using it for data science and machine learning.
You'll do so whilst building your own Blockchain and Cryptocurrency. These are of course also highly trending topics and not a lot of people understand what a Blockchain really is, you'll learn a lot about the core concepts of the Blockchain and you'll see how Python can be used for the many aspects that make up a Blockchain and Cryptocurrency.
You may also like: Building a Blockchain with Python.
Engineers lean toward the language since it enables them to compose elevated level code for the Ethereum blockchain arrange, the second-most famous blockchain digital currency, which can be assembled into low-level machine code. It additionally enables people to use the Ethereum advanced exchange record to make brilliant agreements between organizations.
The agreement situated language utilizes invariants, preconditions, and post-conditions to streamline the advancement procedure and to make the agreement age process easier for clients.
Solidity is at present accessible on a scope of blockchain stages, including Ethereum, Ethereum Great, Tendermint, and Counterparty. It’s utilized for a scope of utilizations, including business contracts, barters, crowdfunding, and that’s just the beginning.
Although quite old and tested by the industry, Ruby gained momentum as a blockchain programming language in the last couple of years or so. Ruby, an interpreted high-level language with object-oriented features, much like Python, can be a viable blockchain coding language for uncountable reasons. It offers developers the ability to prototype their vision rapidly using open source third-party APIs and plugins.
The Ruby ecosystem is thriving with loyal contributors since its inception as the de-facto web language starting from the first half of this millennium. It’s especially prevalent within the Asian developers, the most substantial fraction of open source blockchain developers.
Simplicity is a fresh out of the plastic new programming language that was discharged in November 2017 and planned explicitly for shrewd agreements and blockchain improvement. The language conceals low-level consistent parts from architects so as to expand efficiency and stay away from engineer interruptions, which is one motivation behind why it is quickly winding up well known in the network.
Like C++, Effortlessness is an item arranged language that uses indistinguishable standards from blockchain to forestall blunders and changes to information. It additionally utilizes Merklized Theoretical Sentence structure Trees to sort out the projects into trees — along these lines taking into account littler exchange sizes and lessening square space prerequisites.
The language’s makers, Blockstream, are as yet extending the language and its abilities. Designers can hope to see Simplicity being utilized in more applications towards mid-2020 once the language is incorporated into Bitcoin and its highlights are concluded.
The brainchild of Robert Griesemer, Rob Pike, and Ken Thompson, pioneer of modern programming languages, Go is the best blockchain programming language for building hyper ledger fabric. The statically-typed yet compiled language is on par the performance level needed by a blockchain coding language. Go comes with every advanced feature you’d need when building your first blockchain, namely classes and inheritance, generics, annotations, constructors, and exceptions.
Go offers top-notch concurrency support in blockchain applications, thanks to its smart implementation of channels and interfaces. So, it’s one of the best programming languages for blockchain when it comes to developing a system that is not only efficient but also lightning fast.
The newest blockchain programming language on the block currently, Rust aims at providing open source devs the capability to build fast and efficient blockchain systems. We found Rust to be exceptionally good when it comes to CPU-bound tasks. You can take either a functional approach or an imperative one with Rust for developing your blockchain.
It’s one of the best programming languages for blockchain due to its highly-capable mechanism of handling mutable states. The Rust compiler provides awe-inspiring optimization of your blockchain. The fast, memory safe, and exclusively concurrent nature of this blockchain coding language makes it most suitable for developing real-world blockchains.
Although dimmed not suitable for modern web anymore, PHP still covers the majority of web systems. It can be utilized to build simple to complex blockchain systems as well, thanks to its object-oriented features and a vast active open source community.
If you’re a new programmer looking for getting your hands dirty at blockchain coding, PHP might turn out to be the best option for you. A considerable number of PHP developers will guarantee a ready workforce in case you develop something highly capable and intend on going corporate.
Blockchain is here to stay. The popular record-keeping technology is what makes cryptocurrency exchanges possible and is widely used by corporations, individuals, and blockchain consulting services for software development.
Developers can easily use popular programming languages like C++ and Java for blockchain development. Alternatively, the community has recently created blockchain-specific languages like Solidity and Simplicity which make cryptocurrency development a smooth process.
Expect to see more original languages spring up over the next several years, as the blockchain market continues to grow rapidly and cryptocurrency begins to be used by ever-larger numbers of people.
Thank for reading!