In most cases, chaincode interacts ONLY with the database component of the ledger, the world state (querying it, for example), and NOT the transaction log.

Chaincode can be implemented in several programming languages. The currently supported chaincode language is Go with support for Java and other languages coming in future releases.

3

Blockchain Ledger 账本

细心的童靴应该注意到了 the world state 这个词。这个就是账本的意思么？跟账本是什么关系呢？

Ledger

原来，一个账本里面包含了两部分： the world state 和 Blockchain

The world state represents the current values of all ledger states.

简单粗暴的说，就是区块链里面记录的信息，最终的状态，是由 the world state 来储存的。主要用于上面chaincode的快速查询使用。不用反推所有区块链里面的交易真假。百无聊赖的时候，就可以从 Blockchain 来计算一下，得到新的 the world state。目前存储 the world state可以用： an embedded LevelDB 或者 an external CouchDB。

而账本里面的区块链是： 任何操作的记录

The blockchain is a transaction log, structured as interlinked blocks, where each block contains a sequence of transactions, each of which represents a query or update to the world state.