【乾貨分享】開放原子超級鏈動態內核XuperCore核心技術揭祕

{"type":"doc","content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"如果說百度超級鏈XuperChain是構建區塊鏈網絡的操作系統,那麼開放原子超級鏈內核XuperCore就相當於類Linux類操作系統的Linux kernel。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong","attrs":{}}],"text":"| 背景","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"區塊鏈行業在持續的快速發展,區塊鏈技術發展初期主要的應用場景是以數字貨幣和遊戲爲主。2020年國家發改委把區塊鏈技術納入了數字新基建發展規劃中;2021年在第十三屆全國人民代表大會第四次會議上,正式審議通過了“十四五”規劃剛要,十四五”規劃“剛要將加快數字發展、建設數字中國”作爲獨立篇章,指出要進一步明確發展雲計算、大數據、物聯網、區塊鏈、人工智能等七大數字經濟重點產業。","attrs":{}},{"type":"text","marks":[{"type":"strong","attrs":{}}],"text":"區塊鏈技術開始從支撐數字貨幣的底層技術,進入了全面探索賦能產業的新階段。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"不同於數字貨幣的單一場景,實際產業落地中,不同的應用場景對區塊鏈技術的訴求是多樣的,需要可以低成本的靈活擴展訂製、多場景適用的區塊鏈技術。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"面向不同應用場景的鏈,實現差異也會比較大,比如:公鏈場景更加側重於去中心化,聯盟場景通常更側重於高性能,這些差異導致面向不同場景的區塊鏈實現,在交易的核心流程、共識機制等上面會存在差異,一套實現很難適用各種場景。目前業界主流的區塊鏈實現,比如比特幣、以太坊、fabric等,也基本上都有明確的適用場景定位。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"從數字貨幣單一場景,到全面賦能產業,在多行業、多業務場景落地,需要更適合產業落地的區塊鏈底鏈技術,需要區塊鏈技術具備更高的適用性、更好的可擴展性、更強的性能和更低的應用門檻。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong","attrs":{}}],"text":"| 開放原子超級鏈XuperCore的誕生","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"在2021年4月,百度超級鏈XuperChain在北京、深圳、上海三城舉辦了技術沙龍活動,在技術沙龍上重磅發佈了全新設計實現的開放原子超級鏈內核框架XuperCore。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"超級鏈工程師給參加沙龍活動的開發者現場演示瞭如何基於超級鏈內核框架XuperCore,十分鐘快速構建全新區塊鏈實現,並深入介紹了開放原子超級鏈內核的設計理念。展現了“技術的力量”,讓原本需要數月甚至數年的時間才能完成的研發工作,在十分鐘內完成。標誌着國內首個,並且具備完全自主知識產權的獨立區塊鏈內核框架XuperCore正式誕生。","attrs":{}}]},{"type":"image","attrs":{"src":"https://static001.geekbang.org/infoq/42/424fb2d7e7b87a312542d45d8a651803.png","alt":"圖片","title":null,"style":[{"key":"width","value":"75%"},{"key":"bordertype","value":"none"}],"href":null,"fromPaste":true,"pastePass":true}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"百度是國內最早一批進行區塊鏈核心技術自主研發的企業,百度超級鏈XuperChain是國內最早的自主研發、具備完全自主知識產權的區塊鏈開源技術之一,建起了國內最大的區塊鏈開源技術社區。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"爲了更好的支撐區塊鏈技術全面賦能產業的需要。XuperChain提出了","attrs":{}},{"type":"text","marks":[{"type":"strong","attrs":{}}],"text":"“抽象基礎內核共用,切合場景輕量級訂製發行版,基於發行版構建區塊鏈網絡和SaaS服務”","attrs":{}},{"type":"text","text":"的方案。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"從原來XuperChain單一產品,發展到XuperCore、XuperChain、XuperOS多個開源產品,分別來解決不同緯度的問題,構建起廣域場景適用的區塊鏈技術。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"把XuperChain多年自主研發積累的區塊鏈核心技術,獨立了出來,全新設計了獨立區塊鏈內核框架XuperCore,極大程度的降低區塊鏈技術的研發成本,促進區塊鏈技術在各行各業低成本落地。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"開放原子超級鏈內核Xupercore作爲整個超級鏈技術體系的基礎底座,起到Linux內核在Linux生態中的地位。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"|","attrs":{}},{"type":"text","marks":[{"type":"strong","attrs":{}}],"text":" XuperCore是什麼","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"超級鏈鏈內核XuperCore,定位爲廣域適用、高可擴展、超高性能、高度易用,並且完全的自由開放的區塊鏈內核框架。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"基於自主研發的“動態內核技術”,實現無內核代碼侵入的自由擴展內核核心組件和輕量級的擴展訂製內核引擎,滿足面向各類場景的區塊鏈實現的需要;並且提供了全面的、高性能的標準內核組件和引擎實現。全面降低區塊鏈研發成本,實現非常輕量級的訂製自己的區塊鏈實現。","attrs":{}}]},{"type":"image","attrs":{"src":"https://static001.geekbang.org/infoq/5c/5c747f7e18a6689f3ddc196ef9fc0df1.png","alt":"圖片","title":null,"style":[{"key":"width","value":"75%"},{"key":"bordertype","value":"none"}],"href":null,"fromPaste":true,"pastePass":true}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"可以用我們常接觸的Linux內核來做下類比理解:Linux內核對下以一套統一的方式抽象與集成了cpu、內存、磁盤等不同的硬件設備,對上則爲程序員暴露出統一的一套開發接口,使開發者能夠以一套統一的抽象去使用這些硬件提供的能力。同時還可以根據不同的場景和喜好,訂製多種不同的發行版。Linux內核服務的是程序軟件的開發者,XuperCore服務的是區塊鏈開發者;Linux內核是對不同的硬件做抽象,XuperCore是對區塊鏈各核心組件做抽象。同時也可以像Linux有很多不同的發行版一樣,XuperCore也具備非常好的可擴展性,讓區塊鏈開發者可以根據具體場景的需要,輕量級的訂製不同的發行版。","attrs":{}}]},{"type":"image","attrs":{"src":"https://static001.geekbang.org/infoq/1c/1c2950dfdcca3a135015fd8b73259a76.png","alt":"圖片","title":null,"style":[{"key":"width","value":"75%"},{"key":"bordertype","value":"none"}],"href":null,"fromPaste":true,"pastePass":true}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"基於超級鏈內核XuperCore,就可以非常輕量級的結合實際的業務場景需要,訂製自己的全新區塊鏈實現。基於XuperCore開發的區塊鏈標準發行版實現XuperChain和XuperOS,在多行業、多場景得到了廣泛的落地驗證。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong","attrs":{}}],"text":"| XuperCore核心特性","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"超級鏈內核XuperCore具備廣域適用、高可擴展、超高性能、高度易用四大特性。","attrs":{}}]},{"type":"image","attrs":{"src":"https://static001.geekbang.org/infoq/04/040b2352be47216ccb99e203da4241a5.png","alt":"圖片","title":null,"style":[{"key":"width","value":"75%"},{"key":"bordertype","value":"none"}],"href":null,"fromPaste":true,"pastePass":true}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong","attrs":{}}],"text":"01. 廣域適用","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"XuperCore通過極致的可擴展性,做到“廣域場景適用”的區塊鏈技術。基於XuperCore可以多緯度的自由擴展訂製,非常便捷、快速的構建起適用於各類場景的區塊鏈。","attrs":{}}]},{"type":"image","attrs":{"src":"https://static001.geekbang.org/infoq/f6/f68d71e8067e8df9819d1890b2d5992c.png","alt":"圖片","title":null,"style":[{"key":"width","value":"75%"},{"key":"bordertype","value":"none"}],"href":null,"fromPaste":true,"pastePass":true}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"整個設計中,最核心的就是區塊鏈內核、區塊鏈核心組件、區塊鏈引擎、區塊鏈發行版實現這四大部分。如上圖所示,在這四層中越在上面的抽象程度越高,擴展自由度也就越高;越在下面的實現的越具體,功能也就更加的全面。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"讓開發者可以根據自己實際場景的需要,非常自由、多緯度的擴展。可選擇對部分內核組件做訂製;也可以基於標準組件訂製自己的區塊鏈引擎;也可以基於標準引擎,輕量級的訂製自己的區塊鏈實現。從而滿足開發者的各緯度的需要,做到廣域場景適用。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong","attrs":{}}],"text":"02. 高可擴展","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"XuperCore通過“動態內核技術”,做到了區塊鏈內核核心流程和核心組件,都可以沒有內核框架代碼侵入的自由擴展替換,支持多緯度的自由擴展,讓整個內核具備極好的可擴展性。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"XuperCore作爲超級鏈技術體系的基礎底座,需要內核具備極高的可擴展性。目前主流的區塊鏈開源框架,基本上都有明確的適用場景定位,大多都是面向數字貨幣類的應用場景,在實際業務場景落地中會遇到適用性的問題,通常需要深入框架做改造,改造成本很高。","attrs":{}}]},{"type":"image","attrs":{"src":"https://static001.geekbang.org/infoq/b5/b56a39dda4795de937af0749457b96cf.png","alt":"圖片","title":null,"style":[{"key":"width","value":"75%"},{"key":"bordertype","value":"none"}],"href":null,"fromPaste":true,"pastePass":true}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"XuperCore首創提出了“動態內核”技術。如上圖所示,通過對共識、賬本、合約等這些內核組件做抽象,制定了區塊鏈內核組件編程規範,這些規範就像主板上的插槽,起到承上啓下的作用,讓內核各核心組件可以自由的擴展替換,同時讓引擎訂製變得非常的輕量級。再在內核核心組件編程規範的基礎上,設計了多引擎架構,讓內核核心處理流程和技術選型也可以無內核代碼侵入的自由擴展替換。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong","attrs":{}}],"text":"03. 超高性能","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"XuperCore在架構上做到高可擴展的同時,還提供了超高性能的內核組件和標準區塊鏈引擎的實現。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"比如:通過XuperCore提供的標準組件,就可以實現智能合約的並行預執行、和並行的驗證,可以很好的提升智能合約的性能。","attrs":{}}]},{"type":"image","attrs":{"src":"https://static001.geekbang.org/infoq/47/47167ab9ca3618402b7a90e5346ccba2.png","alt":"圖片","title":null,"style":[{"key":"width","value":"75%"},{"key":"bordertype","value":"none"}],"href":null,"fromPaste":true,"pastePass":true}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"XuperCore的智能合約標準組件實現採用的是預執行模型。先預執行、本地組裝交易,然後再提交上鍊。在預執行的過程中,XuperCore自研的XuperModel會爲每次合約調用分配一個獨立的Cache空間,來隔離不同合約的執行環境。通過這種設計,實現合約全併發的預執行。預執行生成讀寫集後,本地組裝交易後提交到鏈上,在做交易驗證時,XuperModel通過交易的讀集構建起獨立的沙盒環境,來執行驗證寫集的正確性,做好並行的驗證,從而確保合約性能。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"基於XuperCore實現全新的區塊鏈時,可以選用XuperCore提供的標準組件,當然也可以自定義更優的實現。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong","attrs":{}}],"text":"04. 高度易用","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"XuperCore提供了非常完備的內核標準組件實現和易用性工具,可以做到一鍵生成完整區塊鏈實現,對開發者屏蔽區塊鏈技術的核心複雜度,讓區塊鏈開發變成和寫普通的業務API一樣的便捷。","attrs":{}}]},{"type":"image","attrs":{"src":"https://static001.geekbang.org/infoq/07/076838c50bc61dbc0a5f02a550dbeee9.png","alt":"圖片","title":null,"style":[{"key":"width","value":"75%"},{"key":"bordertype","value":"none"}],"href":null,"fromPaste":true,"pastePass":true}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"智能合約方向,XuperCore提供了自研的xvm虛擬機、兼容以太坊的EVM虛擬機和基於docker實現的native虛擬機,實現了c++、go、java、solidity等主流語言全覆蓋;共識機制方面,XuperCore提供了適合測試或者私鏈場景使用的single共識,有適合公開網絡場景的xpos共識,有適合聯盟網絡場景的xpoa共識,還有經典的pow共識;賬本方面,XuperCore提供了基於utxo和自研的XuperModel技術實現的賬本組件xledger;另外,密碼學、網絡等組件也都提供了非常完備的標準組件實現,可以根據具體場景的需要自由選擇使用。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"基於XuperCore,可以非常方便的訂製全新的區塊鏈實現。XuperCore提供了區塊鏈代碼自動生成工具、編譯工具、測試網絡部署工具,非常簡單就可以開發一條全新的區塊鏈實現。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong","attrs":{}}],"text":"| XuperCore架構設計","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"image","attrs":{"src":"https://static001.geekbang.org/infoq/eb/eb819cd403e4a0cdf112e29716c3e07d.png","alt":"圖片","title":null,"style":[{"key":"width","value":"75%"},{"key":"bordertype","value":"none"}],"href":null,"fromPaste":true,"pastePass":true}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"整個超級鏈內核XuperCore的架構設計如圖,總共分爲四層,分別是:","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"bulletedlist","content":[{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong","attrs":{}}],"text":"內核引擎層:","attrs":{}},{"type":"text","text":"定義區塊鏈內核核心流程,採用了讀寫分離的設計來降低複雜度。採用了多引擎架構,讓區塊鏈內核核心流程也可以根據具體場景需要,無內核框架代碼侵入的擴展定製。","attrs":{}}]}]}],"attrs":{}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"bulletedlist","content":[{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong","attrs":{}}],"text":"內核組件編程規範層:","attrs":{}},{"type":"text","text":"這部分對內核核心組件做了抽象,承上啓下,對上面的內核引擎提供標準組件功能接口,對下面的組件實現制定開發規範約束。只要實現了這些規範的組件,就可以無縫接入到內核使用。從而讓內核組件可以自由擴展訂製。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong","attrs":{}}],"text":"內核核心組件實現層:","attrs":{}},{"type":"text","text":"這部分就是對內核組件編程規範的具體實現,XuperCore提供了非常完備的標準組件的實現,供開發者選用。同時開發者也可以低成本的按照規範實現適合自己場景的組件,無縫接入到內核中。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong","attrs":{}}],"text":"基礎組件層:","attrs":{}},{"type":"text","text":"這部分就是一些完全業務無關的基礎公共組件的實現。","attrs":{}}]}]}],"attrs":{}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"整體上,通過核心的”動態內核技術”,讓整個框架具備了極好的可擴展性,做到廣域場景適用;同時,提供了非常完備的標準組件實現,很好降低區塊鏈技術的研發成本。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong","attrs":{}}],"text":"| 基於XuperCore快速建鏈說明","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"基於開放原子超級鏈內核XuperCore,只需要四步就可以非常簡單的訂製開發一條全新的區塊鏈實現,並且搭建起一個多節點的測試網絡。通過XuperCore提供的工具,可以一鍵自動生成全新區塊鏈實現代碼倉庫,然後在這個倉庫上做一些個性化的訂製。訂製完成後,XuperCore也提供了測試網絡部署的工具,可以非常簡單的搭建起一個測試網絡,對這條新鏈做測試驗證。相比從頭研發一條區塊鏈鏈,或者基於以太坊或者fabric去改造,成本要低了很多。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong","attrs":{}}],"text":"01. 操作說明","attrs":{}}]},{"type":"image","attrs":{"src":"https://static001.geekbang.org/infoq/59/59aceb5af1084fd07ef025e1d464dde5.png","alt":"圖片","title":null,"style":[{"key":"width","value":"75%"},{"key":"bordertype","value":"none"}],"href":null,"fromPaste":true,"pastePass":true}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"第一步:準備下基礎環境,克隆XuperCore代碼倉庫。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"codeblock","attrs":{"lang":"text"},"content":[{"type":"text","text":"// 克隆代碼倉庫\ngit clone [email protected]:xuperchain/xupercore.git","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"第二步:通過XuperCore提供的一鍵生成全新區塊鏈實現的工具,指定新鏈名等參數,自動生成全新區塊鏈實現。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"codeblock","attrs":{"lang":"text"},"content":[{"type":"text","text":"\n// 工具說明\nsh ./tools/autogen_chain.sh\nautogen_chain.sh is a tool for automatic generation of new chain framework.\nUsage:\n sh ./tools/autogen_chain.sh [arguments]\nThe commands are:\n -n chain name\n -r git repositories\n -o output dir\n// 使用示例\nsh ./tools/autogen_chain.sh -n chunhui -r chunhui01 -o /home/rd/blockchain","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"第三步:在新生成的倉庫中做個性化的訂製開發,XuperCore支持無內核框架代碼侵入的訂製擴展內核核心流程、內核核心組件,支持自定義API和命令行工具。訂製完成後通過make工具編譯。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"codeblock","attrs":{"lang":"text"},"content":[{"type":"text","text":"\n// 編譯新鏈\nmake all","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"第四步:通過XuperCore提供的一鍵部署區塊鏈網絡的工具,一鍵部署一條多節點的測試網絡,對新鏈功能做驗證測試。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"codeblock","attrs":{"lang":"text"},"content":[{"type":"text","text":"\n// 部署測試網絡\nsh ./tools/deploy_testnet.sh\n// 逐節點,分別啓動每個節點(請確保使用到的端口未被佔用)\nsh ./control.sh start","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"如此,就可以構建一條滿足業務個性化場景需要的全新區塊鏈實現,對開發者屏蔽區塊鏈技術的核心複雜度,極大的降低區塊鏈研發難度和成本。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"xupercore的代碼倉庫是:","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"link","attrs":{"href":"https://github.com/xuperchain/xupercore","title":"","type":null},"content":[{"type":"text","text":"https://github.com/xuperchain/xupercore ","attrs":{}}]}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong","attrs":{}}],"text":"02. 擴展說明","attrs":{}}]},{"type":"image","attrs":{"src":"https://static001.geekbang.org/infoq/ed/eda20e1eb1991b28f3572d025014e843.png","alt":"圖片","title":null,"style":[{"key":"width","value":"75%"},{"key":"bordertype","value":"none"}],"href":null,"fromPaste":true,"pastePass":true}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"通過超級鏈內核XuperCore實現的“動態內核技術”,讓整個框架可以多緯度自由擴展:","attrs":{}}]},{"type":"bulletedlist","content":[{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"可以基於標準的區塊鏈發行版,快速的部署搭建起自己的區塊鏈網絡;","attrs":{}}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"可以基於內核提供的標準區塊鏈引擎,輕量級的訂製滿足自己場景需要的區塊鏈發行版;","attrs":{}}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"可以基於內核組件編程規範,結合自己應用場景的需要,訂製區塊鏈引擎,定義不同的內核核心流程和做不同技術選型。","attrs":{}}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"可以跟進自己的實際場景,對內核組件做訂製,按照內核組件編程規範實現的組件,可以無縫接入內核中使用。","attrs":{}}]}]}],"attrs":{}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"XuperCore的內核引擎和內核核心組件都採用的是註冊制加載,導入包時在對應包的初始化方法中自動完成該組件註冊。從而實現無內核框架代碼侵入的自由擴展內核引擎和內核核心組件,內核引擎和內核核心組件的實現代碼也可以自由管理。只要是按XuperCore定義的規範實現的組件,都可以無縫的接入到內核XuperCore中使用,非常的方便自由。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"可參考示例實現:","attrs":{}},{"type":"link","attrs":{"href":"https://github.com/xuperchain/xupercore/tree/master/example/xchain https://github.com/xuperchain/xuperos","title":"","type":null},"content":[{"type":"text","text":"https://github.com/xuperchain/xupercore/tree/master/example/xchain https://github.com/xuperchain/xuperos ","attrs":{}}]}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong","attrs":{}}],"text":"更多精彩內容歡迎關注百度開發者中心公衆號。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"image","attrs":{"src":"https://static001.geekbang.org/infoq/db/db4e117abea670fd43ad7ee5bc9683e8.png","alt":null,"title":null,"style":[{"key":"width","value":"75%"},{"key":"bordertype","value":"none"}],"href":null,"fromPaste":true,"pastePass":true}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}}]}
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章