Current chaincode development best practices and application samples leverages JSON data model, simple chaincode method routing and
REST API architecture as the de-facto technology stack. This article proposes methods and tools for blockchain application development with well known specification formats like Protocol Buffers messages and
gRPC services definitions.
Blockchain network consists of multiple components, on-chain (chaincodes) and off-chain (API’s, oracles and other external applications, interacts with smart contracts).
For example, official Commercial paper chaincode example includes smart contract implementation and CLI tools for interacting with deployed сhaincodes. …
Testing stage is a critical requirement for software quality assurance, doesn’t matter is this web application or a smart contract. Tests must be fast enough to run on every commit to repository. CCKit, programming toolkit for developing and testing Hyperledger Fabric Golang chaincode, enhances the development experience with extended version of MockStub for chaincode testing.
A smart contract defines the different states of a business object and governs the processes that move the object between these different states. …
How specifying world state data model with protocol buffers can help in developing smart contracts
Chaincode is a domain-specific program that relates to specific business process. It programmatically accesses two distinct pieces of the ledger — a blockchain, which immutably records the history of all transactions and a world state that holds a cache of the current value of these states. The job of a smart contract developer is to take an existing business process that might govern financial prices or delivery conditions and express it as a smart contract in a programming language.
Protobuf (short for Protocol buffers) are the language-neutral, platform-neutral, extensible mechanism for serializing structured data. …
As well as Ethereum blockchain, Hyperledger Fabric platform (HLF) can be used for token creation, implemented as smart contract (chaincode in HLF terminology), that holds user balances. Unlike Ethereum, HLF chaincodes can’t work with user addresses as a holder key, thus we will use a combination of Membership Service Provider (MSP) Identifier and user certificate identifier. Below is a simple example of how to create a token as Golang chaincode on the Hyperledger Fabric platform using CCKit chaincode library.
The ERC20 token standard came about as an attempt to standardize token smart contracts in Ethereum, it describes the functions and…
There are a lot of examples and tutorials about Hyperledger Fabric chaincode development. This article describes the methods that simplify and accelerate the chaincode development through the usage of the CCKit library, containing implementation of basic chaincode building components — routing, middleware and chaincode invocation context, as well as provide chaincode testing utilities.
Init method is called when a chaincode…
Simple solution is to use solc binary package, that works much faster. You can install this package by commands:
sudo add-apt-repository ppa:ethereum/ethereum
sudo apt-get update
sudo apt-get install solc
https://github.com/vitiko/truffle-fast-compile — command line utility for compiling solidity contracts via solc binary package