In this guide, we are going to map out your journey for becoming a Blockchain Developer. To ease things up for you, we are going to divide this guide into various milestones and give you action steps at the end of every section.node
在本指南中,咱們將一步步籌劃你的區塊鏈開發之旅。爲了易於你接受,咱們將分步驟設置若干學習里程碑,而且在每一章節最後告訴你具體作什麼。git
It goes without saying that we are living in the 「era of the blockchain」. The impact that it can have on our future is truly scary and magnanimous. So, how can you get a piece of that 「blockchain action」? If you are to become a blockchain developer, then there are certain steps that you need to take.程序員
毫無疑問咱們正處在「區塊鏈時代」。它對咱們將來的衝擊真的會很驚人,但也充滿機遇。因此,你如何能在其中分到一杯羹?若是你打算成爲一名區塊鏈開發者,那本文列出的步驟應該正是你須要的。web
Hopefully, at the end of the guide, you will have the tools required to kick-start your journey. If you are serious about becoming a developer then we need to set some expectations for you. Firstly, it is going to take time and you will need to dedicate your time and resources to your education. Secondly, do not expect immediate results, becoming a blockchain developer is not a magic pill.編程
但願您在讀完本文後,能組建一套裝備來助你展開區塊鏈的旅程。若是你認真的想成爲一名開發者,這裏先給你打個預防針:第一,學習區塊鏈很花時間,你須要投入你的時間和資源來學習。第二,別期望速成,成爲區塊鏈開發人員不是一朝一夕的事。安全
So, having said that, let’s start your journey.服務器
那,說了這麼多,讓咱們開始吧。網絡
One of the biggest hurdles with anything as new and revolutionary, such as the blockchain technology, is familiarizing oneself with various concepts integral to the system.多線程
要理解像區塊鏈——這種新的革命性事物——的最大障礙,就是熟悉該系統的各類概念。併發
If you are a beginner, then there are certain terms that you need to be familiar with:
若是你是初學者,那麼如下概念須要你熟知:
Blockchain: The blockchain is a chain of blocks where each block contains data of value without any central supervision. It is cryptographically secure and immutable.
區塊鏈: 區塊鏈是一系列區塊組成的鏈表。每個區塊包含着數據,這些數據並不是被某個中央系統監管。數據是加密的而且不可改變。
Decentralized: Blockchain is said to be decentralized because there is no central authority supervising anything.
分散: 區塊鏈是分散的,是由於並無一箇中央權威作任何監督。
Consensus Mechanism: The mechanism by which a decentralized network comes to a consensus on certain matters.
協商機制: 該機制是說這個分散的網絡能協商討論一些事情,並最終達成共識。
Miners: Users who use their computational power to mine for blocks.
礦工: 消耗計算能力來發掘區塊的人。
It could be advisable to learn more about these terms that are widely used in the crypto-sphere. It is highly recommended that you go through our comprehensive glossary. It is important to learn these basic terms otherwise you will be very lost further on in your education. Now, up next, it is time to educate yourself some more on the technical aspects of the blockchain.
更明智的作法是從密碼領域中深刻學習以上術語。強烈建議你過一遍咱們的綜合術語表。學習這些基本術語十分重要,否則你會在將來的學習中不知所措(譯者注:連老師講的什麼都聽不懂)。好,接下來該學習更多關於區塊鏈技術方面的知識了。
If you are interested in the technical aspects of how to create a fin-tech application on top of the Blockchain then you should definitely learn the ins and outs of cryptoeconomics. Most developers are usually well-versed in the 「crypto」 part of the equation but their knowledge of the 「economics」 part is extremely lacking.
若是對基於區塊鏈作一些金融科技應用感興趣,那你必定要學透密碼經濟學。大部分開發者通曉上文的「密碼」,不過對於另外一半「經濟學」的知識則十分缺少。
This difference in knowledge is extremely apparent when you study some of these ICOs floating around. It is very obvious to see that the economics side of their ICO’s are not well thought out.
這種知識上的差別形成的影響,在你研究諸如首次幣發行這類概念時會很明顯。君不見不少數字貨幣的首次幣發行,在經濟學方面都沒有通過深思熟慮。
So, in light of that, it can be a good idea to read up a bit on economics and have a general idea of it.If you want to learn about cryptoeconomics in general, then you may checkout our article here.
因此,學點經濟學,對經濟學有個總的概念是個好主意。若是你想簡要學習密碼經濟學,能夠看這篇文章。
If you are intrigued by the cryptography specifically and want to know how signatures work and what public key cryptography means, then read this.
若是你對密碼學十分感興趣,並且想了解簽名的原理、公鑰加密技術的含義,那麼讀這篇文章。
After that, it is highly recommended that you understand how bitcoin works. Bitcoin is the most widespread, finest and one of the more elegant applications of the blockchain technology. You can even call it the finest example of what the blockchain technology can achieve purely because of the impact that it has had.
以後,十分建議你瞭解一下比特幣是如何運行的。比特幣是最好、最普遍、最優雅的區塊鏈應用之一。你甚至能夠稱之爲區塊鏈技術能實現的最好的樣例,由於它真的是太有影響力了。
So, it is advisable that you read Satoshi Nakamoto’s whitepaper of bitcoin. You can find it over here. Now that completes the first milestone.
因此,最好去閱讀中本聰的比特幣白皮書吧。能夠在這裏讀。而後第一個里程碑就結束了。
Let’s check out the action steps that you need to take over here:
做業
It is pretty surprising to see how many budding 「developers」 have not had any real world first-hand experience with cryptocurrency at all. How can you possibly innovate and improve upon a platform when you have not used it even once?
使人吃驚的是,大量的新手「開發人員」歷來沒真正的親身使用過加密貨幣。若是你連一次都沒用過,何談對其進行創新與改進呢?
It Is strongly recommended that you start getting acquainted with the system today.
強烈建議你今天就開始熟悉這套系統。
Go to Coinbase or any other exchange that you are comfortable with or is accessible in your country and buy some coins. You don’t need to create an extensive portfolio straightaway, just buy a few coins and see how the whole process works.
去 Coinbase 或其餘任何你習慣的、能訪問的交易網站,買點幣。你不須要構建普遍的投資組合,就買幾個幣感覺下整個流程。
It is extremely straightforward. Since you are not going to be buying a lot of coins then simply use a basic online wallet.
按最簡單的來。既然你也不是要買一堆幣,那就用的基本的在線錢包就行。
These wallets are the easiest to use among all. The creation is super simple because it’s basically creating your own account on any of the exchange services. Furthermore, you can access this wallet from any server or any device in the world as long as it is connected to the net. Having said that, there is one big problem when it comes to online wallets. Your private key is going to be saved on another server. This is basically like serving up your key to hackers on a silver platter. Do NOT use online wallets to store huge amounts of your money. Store the bare minimum that you need for exchange purposes.
區塊鏈貨幣錢包是最容易使用的。建立錢包十分簡單,由於基本上都是將你的賬號創建在交易服務網站上。此外,只要鏈接上了網絡,你就能夠從任何服務器或任何設備來訪問你的錢包。話雖如此,在線錢包卻有一個大問題。你的私鑰是被儲存在另外一臺服務器的,這基本上就是將你的密鑰拱手相送給黑客了。不要 使用在線錢包儲存大額財產,只儲存你須要兌換的最小值便可。
As you create an extensive portfolio, you must learn how to utilize cold wallets to store your money. You can learn how to do so here. Later on, if you create your ICO then you MUST know how wallets and, in particular, multi-sig wallets work.
當你有了一個普遍的投資組合後,你必須學習如何利用冷錢包來儲存你的財產。你能夠在這裏學習如何作。以後,若是你打算作首次幣發行,那你必需要懂錢包,特別是多重簽名錢包的工做機制。
We are bringing this section to a close here, the tough part starts from the next milestone.
本節就介紹到這裏,下個里程碑開始要提升難度了。
You action steps are here:
做業:
As a blockchain developer, you will face tons of challenges in the back-end. Creating and maintaining a public blockchain is not easy because of a number of reasons.
做爲一名區塊鏈開發者,你會在後臺開發遇到不少挑戰。有各類各樣的緣由,使得建立和維護一個公共的區塊鏈系統並不容易。
(Before we continue, a huge shoutout to David Schwartz for his keynote address regarding C++ use in blockchain software development in CPPCON 2016.)
(在咱們繼續以前,來看看 2016 年的 CPPCON 中,David Schwartz 在他的關於用 C++ 開發區塊鏈的主題演講上是怎麼說的。)
Blockchains, as David Schwartz puts it, should be fortresses. Firstly, the code is public and open for all to see. Anyone can look at the code and check for bugs and vulnerabilities. However, unlike other open code resources, the downside of finding vulnerabilities on blockchain code is massive. Any programmer can hack in and get away with potentially millions and millions of dollars. Because of these legitimate security concerns, development on blockchain is usually very slow.
正如 David Schwartz 所說,區塊鏈應當是一座堡壘。首先,代碼公開誰都能看。任何人均可以查看代碼檢查 Bug 和漏洞。然而這並不像其餘的開源代碼,因找到區塊鏈系統的漏洞,而形成的不利影響每每很嚴重。任何程序員均可以侵入該系統、掠走數百萬美圓而後溜之大吉。正由於這些安全上的考量,使得區塊鏈開發每每很緩慢。
It is important to keep pace with the network. You cannot fall too far behind and not keep up with all the network demands. You should be well equipped to handle remote and local queries.
跟上網絡的發展步伐是很重要的。你不能落後太遠,以致於跟不上網絡的需求發展。你應當具有處理遠程和本地查詢的能力。
The blockchain must always perform at its highest possible capabilities, but for that to happen the language chosen must be extremely versatile. The thing is that there are certain tasks in the blockchain which are parallelizable whilst there are some tasks which can’t be done in parallel.
區塊鏈總應當以其最高性能指標來運行,不過爲了達到這個目標,用來開發的編程語言必須是很全能的。由於有些區塊鏈的任務要求並行執行,而還有一些任務必須按順序執行。
A good example of 「parallelizable」 task is digital signature verification. All that you need for signature verification is the key, transaction and the signature. With just three data you can conduct verifications in a parallelized manner.
關於「並行」任務,數字簽名驗證就是個好例子。驗證一個簽名,你須要:密鑰、交易還有簽名。只要三種數據你就能以並行的方式執行驗證操做。
However, not all the functions on a blockchain should be done that way. Think of transaction execution itself. Multiple transactions can’t be executed in parallel; it needs to be done one at a time to avoid errors like double spends. Some languages are good at parallel operations while some are good in non-parallel operations.
然而,並不是全部區塊鏈的功能都應當並行執行。考慮交易執行自己。複數的交易行爲不能夠被並行執行;他們須要保證在同一時間只能執行一個交易,這樣才能避免相似雙重扣款這樣的錯誤。有些語言擅長並行操做,另外一些語言擅長非並行操做。
What is deterministic behavior?
什麼是可肯定的行爲?
If A + B = C, then no matter what the circumstances, A+B will always be equal to C. That is called deterministic behavior.
若是 A+B=C,那麼不論在任何情形下,A+B 都老是等於 C。這就是可肯定的行爲。
Hash functions are deterministic, meaning A’s hash will always be H(A).
哈希函數也是一種可肯定性的行爲,這意味着值 A 的哈希結果老是等於 H(A)。
So, in blockchain development, all transaction operations must be deterministic. You cannot have a transaction that behaves one way and then behaves another way the next day. Similarly, you cannot have smart contracts that work in two different ways on two different machines.
因此,在區塊鏈開發中,全部的交易行爲都必須是可肯定的。你不能說一個交易今天執行是一個套路,明天執行又是另外一個套路。一樣的,一個智能合約不能在兩個不一樣的機器上有着不一樣的運行效果。
The only solution to this is isolation. Basically, you isolate your smart contracts and transactions from non-deterministic elements.
惟一的解決方案就是隔離狀態。最起碼,你要把智能合約和交易邏輯與其餘非肯定的元素隔離開。
There are some languages which fulfill most of these needs. If you are a blockchain developer, then you definitely need to have some basic knowledge of C++ and JavaScript.
有一些編程語言知足了以上大部分需求。若是你是一個區塊鏈開發者,那麼你絕對須要對 C++ 和 JavaScript 有基本的知識 。
While C++ may seem a little outdated, the truth is that it wonderfully satisfies all the functionalities that we have described above. In fact, Satoshi Nakamoto wrote the Bitcoin source code in C++.
可能 C++ 看上去有點過期,實際上它很是符合以上咱們描述的功能。中本聰其實就是用 C++ 編寫的比特幣源代碼。
Along with HTML and CSS it is one of the three core technologies in World Wide Web Content Production. Javascript is usually used to create highly interactive web pages.
JavaScript,HTML 和 CSS 同樣,是開發萬維網產品的三項核心科技。JavaScript 一般用於建立高互動性的 Web 頁面。
So, now we will see how to create a very simple blockchain using Javascript.
因此,接下來咱們將看到如何用 JavaScript 來建立一個很是簡單的區塊鏈。
Huge shoutout to savjee.be for the content below.
如下內容轉載自 savjee.be
How do we make a block? What does a simple block consist of? In our simple cryptocoin that we are going to make (Let’s call it 「BlockGeeksCoin」), each block will have the following pieces of information:
如何建立一個區塊?一個簡單的區塊由什麼組成?咱們將要開發一種簡單的加密貨幣(就叫「BlockGeeksCoin"吧),其每個區塊將包含下列信息:
Before we continue. You need to understand certain terms that we are going to use in our program:
在咱們繼續以前,你須要理解一些接下來 JavaScript 程序中用到的術語:
This: The 「this」 keyword is invoked inside a function and enables you to access the values inside a specific object that calls that particular function.
This: 你調用了一個對象的一個函數,在該函數中可使用「this"關鍵字,而後能夠經過該關鍵字訪問該對象的各類屬性和其餘函數。
Constructor: A constructor is a special function which can help create and initialize an object within a class. Each class is restricted to only one constructor.
Constructor: constructor (構造函數)是一個特殊的函數,能幫咱們建立且初始化一個類的對象。每個類都要求只能有一個該函數。
Now that that’s done, let’s start making our block.
說完了,開始製做咱們本身的區塊吧!
Creating the Block
創造區塊
const SHA256 = require("crypto-js/sha256"); class Block { constructor(index, timestamp, data, previousHash = '') { this.index = index; this.previousHash = previousHash; this.timestamp = timestamp; this.data = data; this.hash = this.calculateHash(); } calculateHash() { return SHA256(this.index + this.previousHash + this.timestamp + JSON.stringify(this.data)).toString(); } }
Code Analysis
代碼分析
Ok, so this right here is out a block. So, in the first line of the code, we called the crypto-js library because the sha256 hash function is not available in JavaScript.
好,這就是一個區塊了。那麼代碼第一行,咱們引入了 crypto-js 庫,由於 JavaScript 並無內置 sha256 哈希函數。
Next, we invoked a constructor inside the class to call for objects which will have certain values. The thing that probably catches your eye is the calculateHash() function. Let’s see what exactly is it doing.
接下來,該類的構造函數裏爲不少屬性進行了賦值。你確定注意到下面的 calculateHash() 函數了,我們來看看它具體幹什麼的。
In a block, we take all the contents and hash them to get the hash of that particular block. We are using the JSON.stringify function to turn the data of the block into a string to hash it.
在一個區塊裏,咱們將全部內容匯聚在一塊兒,而後對其取哈希值,這就是該區塊的哈希值。咱們使用 JSON.stringify 函數來將區塊的全部數據轉換成字符串,而後取哈希值。
Ok, so we have the block ready and good to go. Now let’s connect the blocks together into a blockchain.
好的,咱們第一個區塊已經準備好了。接下來咱們將多個區塊連成一條區塊鏈。
class Blockchain { //Section 1 Genesis block creation // 第一: 生成創世區塊 constructor() { this.chain = [this.createGenesisBlock()]; } createGenesisBlock() { return new Block(0, "01/01/2017", "Genesis block", "0"); } //section 2 adding new blocks //第二:添加新的區塊 getLatestBlock() { return this.chain[this.chain.length - 1]; } addBlock(newBlock) { newBlock.previousHash = this.getLatestBlock().hash; newBlock.hash = newBlock.calculateHash(); this.chain.push(newBlock); } //section 3 validating the chain //第三:驗證鏈條 isChainValid() { for (let i = 1; i < this.chain.length; i++) { const currentBlock = this.chain[i]; const previousBlock = this.chain[i - 1]; if (currentBlock.hash !== currentBlock.calculateHash()) { return false; } if (currentBlock.previousHash !== previousBlock.hash) { return false; } } return true; } }
Code Analysis
代碼分析
Ok, so a lot of things are going on in the chain above, let’s break it down into sections.
好,上面的鏈條定義了好些東西,我們來一點一點分析。
What is the genesis block?
什麼是創世區塊?
The genesis block is the first block of the blockchain, and the reason why it is special is that while every bock points to the block previous to it, the genesis block doesn’t point at anything. So, the moment a new chain is created, the genesis block is invoked immediately.
創世區塊是一個區塊鏈系統的第一個區塊,它的特殊之處在於它不指向任何前序區塊。除此以外任何其餘的區塊都要指向一個特定的前序區塊的。因此,當一個新的鏈條產生時,創世區塊也會當即產生。
Also, you can see a 「createGenesisBlock()」 function wherein we have given the data of the block manually:
另外你看函數「createGenesisBlock()」,咱們給它手動賦值了。
createGenesisBlock() { return new Block(0, "01/01/2017", "Genesis block", "0"); }
Firstly, we will need to know what the last block in the blockchain currently is. For that we use the getLatestBlock() function.
首先,咱們須要知道這個鏈條目前最後一個區塊是什麼。因此咱們定義了 getLatestBlock() 函數。
getLatestBlock() { return this.chain[this.chain.length - 1]; }
Now that we have determined the latest block, let’s see how we are going to add new blocks.
如今咱們能定位到最後一個區塊了,來看看如何添加新區塊。
addBlock(newBlock) { newBlock.previousHash = this.getLatestBlock().hash; newBlock.hash = newBlock.calculateHash(); this.chain.push(newBlock); }
So, what is happening here? How are we adding the blocks? How are we checking if the given block is valid or not?
這裏都發生了什麼?咱們怎麼添加區塊的?咱們怎麼知道添加的區塊是否合法?
Remember the contents of a block? A block has the hash of the previous block right?
還記得區塊的內容麼?一個區塊不是有前序區塊的哈希值麼?
So, what we are going to do here is simple. Compare the previous hash value of the new block with the hash value of the latest block.
因此這裏作的其實很簡單。比較新區塊的前序哈希值和鏈條最後一個區塊的哈希值便可。 (譯者注:其實這裏的 addBlock 函數並無作驗證,它只是自動將新區塊的前序哈希設置爲鏈條最後一個區塊的哈希值。能夠理解爲使用該函數添加的區塊,都將自動轉換爲合法的區塊。)
Image Courtesy: Lauri Hartikka medium article
圖片來源:Lauri Hartikka medium article
If these two values match, then this means that the new block is legit and it gets added to the blockchain.
若是這兩個哈希值匹配,那這意味着新區塊是合法的,能夠被添加到區塊鏈中。
Now, we need to check that nobody has been messing with our blockchain and that everything is stable.
如今咱們須要檢查沒有人搞亂咱們的區塊鏈系統,保證一切穩定。
We are using the 「for」 loop to go from the block 1 to the last block. Genesis block is block 0.
咱們使用「for」語句,從第一個區塊遍歷到最後一個區塊。創世區塊是第零個。
isChainValid() { for (let i = 1; i < this.chain.length; i++) { const currentBlock = this.chain[i]; const previousBlock = this.chain[i - 1]; //In this part of the code we are defining two terms, current block and previous block. And now we are simply going to find the hash of these two values. //這部分代碼定義了兩個術語:當前區塊和前序區塊。接下來只要比較這兩個區塊的哈希值。 if (currentBlock.hash !== currentBlock.calculateHash()) { return false; } if (currentBlock.previousHash !== previousBlock.hash) { return false; } } return true; }
If the 「previousHash」 of the current block is not equal to the 「Hash」 of the previous block, then this function will return False, else it will return True.
若是當前區塊的「前序哈希值」不等於前序區塊的「哈希值」,那麼函數將返回 false,不然會返回 true
Using the blockchain
使用區塊鏈
Now, we are going to finally use the blockchain to create our BlockGeeksCoin.
如今咱們終於要使用區塊鏈來生產咱們的 BlockGeeksCoin 了。
let BlockGeeksCoin = new Blockchain(); BlockGeeksCoin.addBlock(new Block(1, "20/07/2017", { amount: 4 })); BlockGeeksCoin.addBlock(new Block(2, "20/07/2017", { amount: 8 }));
And that’s it!
這就好了!
So what happened here?
到底發生了什麼?
We created a new cryptocurrency based on the blockchain and named it BlockGeeksCoin. By invoking this new object, I activated the constructor, which in turn created the Genesis block automatically.
咱們建立了一個新的基於區塊鏈的加密貨幣,稱之爲 BlockGeeksCoin。經過建立這個新對象,我激活了鏈條的構造函數,而後自動建立了創世區塊。
We simply added two more blocks to it and gave them some data.
而後咱們添加了兩個新的區塊,賦給了它們一些數據。
It is that simple.
就這麼簡單。
(Thank you savjee.be for the amazing and simple explanation.)
感謝 savjee.be 提供瞭如此出色且簡明的解釋
That’s it for this milestone. Let’s look at the action steps. It is very simple but it definitely isn’t easy:
以上就是這個里程碑的內容了。下面佈置做業,很少但也要花些功夫的:
How do you define a smart contract?
你如何定義一個智能合約?
According to Wikipedia, a smart contract is 「a computer protocol intended to facilitate, verify, or enforce the negotiation or performance of a contract」. While it was first proposed by American cryptographer Nick Szabo in 1996, Ethereum is often credited with popularizing the concept and making it mainstream.
根據維基百科的說法,智能合約是「旨在促進、覈實或增強合同談判或履行的計算機協議"。雖然本概念是由美國密碼學家 Nick Szabo 於 1996 年第一次提出,但一般認爲是 以太坊 以太坊 將此概念推廣併成爲主流。
You can learn more about smart contracts in our in-depth guide here.
你能夠看咱們的深刻指南來學習智能合約更多的知識。
So, what are the desirable properties that we want in our smart contract?
因此咱們但願一個智能合約具備哪些性質呢?
Anything that runs on a blockchain needs to be immutable and must have the ability to run through multiple nodes without compromising on its integrity. As a result of which, smart contract functionality needs to be three things:
任何運行在一個區塊鏈系統上的東西,都必須是不可變的,數據流過任何節點也不能對數據的完整性有半點妥協。所以,智能合約要有如下三點性質:
A program is deterministic if it gives the same output to a given input every single time. Eg. If 3+1 = 4 then 3+1 will ALWAYS be 4 (assuming the same base). So when a program gives the same output to the same set of inputs in different computers, the program is called deterministic.
一個具備肯定性的程序,只要你給他一樣的輸入,每次都會輸出一樣的結果。例如:若是 3+1 = 4 那麼 3+1 將總爲 4(假設進制不變)。因此若是給予一個程序一樣的輸入,不論什麼時候該程序都會輸出一樣的結果,那麼咱們稱該程序具備肯定性。
There are various moments when a program can act in an un-deterministic manner:
不少時候,程序會表現出不肯定性:
In mathematical logic, we have an error called 「halting problem」. Basically, it states that there is an inability to know whether or not a given program can execute its function in a time limit. In 1936, Alan Turing deduced, using Cantor’s Diagonal Problem, that there is no way to know whether a given program can finish in a time limit or not.
在數學邏輯中有一種稱之爲「中止問題」的錯誤。簡單說,該問題指出沒法知道給定的程序可否在時限內執行其功能。在 1936 年, 阿蘭圖靈從康託對角線問題推出,沒有辦法知道給定的程序可否在時限內完成任務。
This is obviously a problem with smart contracts because, contracts by definition, must be capable of termination within a given time limit. There are some measures taken to ensure that there is a way to externally 「kill」 the contract and to not enter into an endless loop which will drain resources:
對於智能合約來講,這毫無疑問是個問題,由於根據定義,合約必須能在有限的時間內終止。有一些方法能夠保證能從外部「殺掉」合約,使其免於進入無限循環,耗盡資源:
In a blockchain, anyone and everyone can upload a smart contract. However, because of this the contracts may, knowingly and unknowingly contain virus and bugs. If the contract is not isolated, this may hamper the whole system. Hence, it is critical for a contract to be kept isolated in a sandbox to save the entire ecosystem from any negative effects.
在一個區塊鏈中,任何人均可以上傳一個智能合約。然而因爲這一點,合約可能有意無心的包含着病毒和 Bug。若是一個合約沒有隔離性,那可能會影響到整個系統。所以將合約隔離在單獨的沙箱中來保護整個生態遠離任何負面效應是相當重要的。
Now that we have seen these features, it is important to know how they are executed. Usually the smart contracts are run using one of the two systems:
好咱們看到這些性質了,瞭解它們如何運行是很重要的。一般智能合約是運行在下面兩個系統之一上的:
Let’s compare these two and determine which makes for a better ecosystem. For simplicity’s sake, we are going to compare Ethereum (Virtual Machine) to Fabric (Docker).
讓咱們比較一下這兩個,看看哪個能創造一個更好的生態系統。爲了簡單起見,咱們將比較 以太坊(Virtual Machines)和 Fabric (Docker)。
If you are interested in Ethereum development specifically then it is important that you learn solidity as well.
若是你對 以太坊 開發感興趣,那麼對 solidity 的學習也很重要。
For anyone who wants learn how to make DAPPs (Decentralized Applications) or get into the ICO game, learning Solidity is an absolute must. We already have a detailed guide to it which you can read here. However, here we are going to give you a basic overview. Solidity was developed by Gavin Wood, Christian Reitwiessner, Alex Beregszaszi, Yoichi Hirai and several former Ethereum core contributors to enable writing smart contracts on blockchain platforms such as Ethereum.
對於想要學習如何使用 DAPPs(分散應用程序)或者想參與首次幣發行的人,必定要好好研究 Solidity 。咱們已經有詳細的指南,能夠來這裏讀。這裏咱們給你一個基本的概述。Solidity 是由 Gavin Wood, Christian Reitwiessner, Alex Beregszaszi, Yoichi Hirai 和幾位前 以太坊 核心貢獻者開發的,用於在相似 以太坊 這樣的區塊鏈平臺上編寫智能合約。
Solidity is a purposefully slimmed down, loosely-typed language with a syntax very similar to ECMAScript (Javascript). There are some key points to remember from the Ethereum Design Rationale document, namely that we are working on a stack-and-memory model with a 32-byte instruction word size, the EVM (Ethereum Virtual Machine) gives us access to the program 「stack」 which is like a register space where we can also stick memory addresses to make the Program Counter loop/jump (for sequential program control), an expandable temporary 「memory」 and a more permanent 「storage」 which is actually written into the permanent blockchain, and most importantly, the EVM requires total determinism within the smart contracts.
Solidity 是一種刻意簡化的、弱類型語言,語法很相似 ECMAScript (JavaScript)。還記得一些 以太坊 設計原理文檔上的關鍵點,說咱們工做在一個32字節的指令長度的堆棧內存模型上,EVM(以太坊 Virtual Machine)給咱們提供訪問程序的「堆棧」的能力,就像是寄存器空間同樣,咱們能夠將內存地址貼進去使得程序計數器能夠循環、跳轉(程序順序控制)。有一個可擴展的臨時「內存」還有更大的永久「儲存」也就是實際向區塊連永久寫入。最重要的是,EVM 要求總決定權在智能合約內。
If you are interested in learning solidity then you can check our in-depth course here.
若是你對學習 Solidity 感興趣,那能夠看這篇深刻教程。
So, let’s see the action steps now:
下面留做業:
One of the most important things that you can do as a budding developer is to constantly stay in the mix.
做爲一個新人,最重要的是融入整個區塊鏈開發的世界。
Go and join the Reddit forums, GitHub pages, and StackExchange and connect with other developers and always be on the lookout for any news regarding the technology.
去加入 Reddit 論壇、GitHub 頁面,StackExchange 等等地方,多接觸其餘開發者。始終對新技術保持敏感。
Along with that, it will be helpful for you to know what people look for in blockchain developer. What qualities are companies looking for when they are looking to hire? You can find that information here.
同時,去了解哪些人須要區塊鏈開發人員,哪些特色是公司招聘所關注的。這些都對你會有用處。你能夠在這裏找到更多相關信息。
This information can be very useful in you fine-tuning your skills enough to appeal to the companies.
這些信息在你完善你的技能來知足公司需求時很是有用。
So, this is a rough roadmap for you and your journey to becoming a blockchain developer. This alone won’t be enough, of course, you will need to show your own initiative and always be in the mix.
那麼這就是成爲一個區塊鏈開發人員的一個粗略路線圖。僅僅讀完這篇文章固然是不夠的,你須要發揮你的主觀能動性,時刻參與其中。
If you are looking for a resource of information on blockchain development then click here.
We wish you all the best on your journey!
祝您一帆風順!