當前位置:
首頁 > 最新 > 最新版EOS開發入門手冊:The EOS Wiki

最新版EOS開發入門手冊:The EOS Wiki

感謝

首先我們要感謝Jason Pan完成了漫長的翻譯工作與為開發者群體做出的貢獻。

這是開始,不是結束。

同時,除了下文中奉獻的圖文版本,我們也準備了PDF版本,你可以這樣得到

當然這個行為在傳播知識的同時也充滿了宣傳性質。

也請體諒所有貢獻者的私心,感謝!

目錄

Contents

OVERVIEW[概述]1

Glossary[辭彙]1

SETTING UP A LOCAL ENVIRONMENT[設置本地環境]7

Overview[概述]7

Getting the Code[獲取代碼]8

Building EOSIO[構建 EOSIO]8

Automated build script[自動化構建腳本]9

System Requirements (all platforms)[系統需求(所有平台)]9

Run the build script[運行構建腳本]9

Build validation[構建驗證]9

Install the executables[安裝可執行文件]10

Creating and Launching a Single Node Testnet[創建和啟動單節點測試網路]10

Advanced Steps[高級步驟]11

Docker13

Install Dependencies[安裝依賴關係]13

Build EOSIO image[構建 EOSIO 鏡像]13

Start nodeos docker container only[僅僅在 docker 容器中啟動 nodeos]13

Get chain info[獲取鏈的信息]13

Start both nodeos and keosd containers[啟動 nodeos 和 keosd 容器]14

Execute cleos commands[運行 cleos 命令]14

Change default configuration[修改默認配置]14

Clear data-dir[清除數據文件夾]15

Troubleshooting Guide15

PROGRAMS & TOOLS[程序和工具]17

Programs[程序]17

nodeos17

cleos17

keosd19

launcher19

Tools[工具]19

eosiocpp19

Using eosiocpp to generate the ABI specification file[使用 eosiocpp 產生 abi 規格文件]19

Examples20

Declaring an action[聲明一個操作]20

Declaring a table[定義一個表]20

Example of typedef exporting[重定義導出的例子]21

Using the generated serialization/deserialization functions and explicit user defined apply[使用生成的序列化/反 序列化函數和顯式用戶定義請求]22

Calling contract with test values[用測試值調用合約]23

PUBLIC TESTNET [公共測試網路]24

ACCOUNTS & PERMISSIONS[賬戶和許可權]25

Wallets[錢包]25

Accounts[賬戶]25

Authorities and Permissions[授權和許可權]26

Putting it all Together[融會貫通]26

Default Account Configuration (Single-Sig)[默認賬戶配置(單個簽名)]26

Multi-sig Account & Custom Permissions[多簽名賬戶和自定義許可權]27

Observations[意見]29

CLI WALLET[命令行錢包]30

Overview[概述]30

Overview[概述]3

How to Run keosd[如何運行 keosd]30

Command Reference[命令參考]30

Create[創建錢包]30

Open[打開錢包]31

Lock[鎖定錢包]31

Unlock wallet[解鎖錢包]31

Import private key into wallet[導入私鑰到錢包]31

Create a key pair within the wallet[在錢包里創建一個密鑰對]32

List[列出錢包]32

Public Keys[列出公鑰]32

Public/Private Key Pairs[查詢公私鑰]32

Auto locking[自動鎖定]33

Launching keosd manually[手動啟動 keosd]33

Managing Wallets with nodeos[使用 nodeos 管理錢包]33

Multiple keosd running[運行多個 keosd]34

COMMAND REFERENCE[命令行參考]35

cleos command[cleos 命令]35

eos-wallets command[錢包命令]36

Examples[例子]37

All command[所有命令]37

All subcommand[所有子命令]37

Connect to node[鏈接節點]38

Query blockchain state[查詢區塊鏈狀態]38

Get Transaction by transaction_id[通過 transaction_id 獲取交易]38

Get Actions by account[通過賬戶獲取操作]40

Transfer Currency[轉賬貨幣]41

Create wallet[創建錢包]41

List wallets[列出錢包]42

Import key to wallet[導入密鑰到錢包]42

List wallet keys[列出錢包密鑰]42

Lock wallet[鎖定錢包]42

Unlock wallet[解鎖錢包]43

Open wallet[打開錢包]43

Create keys[創建密鑰]43

Create account[創建賬戶]44

Account servants[子賬戶]45

Check account balance[檢查賬戶餘額]45

Get account details[獲取賬戶詳細信息]45

Create or Modify Permissions[創建和修改許可權]46

Deploy Contract[部署合約]47

Query Contract ABI[查詢合約的 ABI]49

Push Message to Contract[推送消息到合約]50

4Overview[概述]

Querying Contract[查詢合約]52

Using Separate Wallet App[使用獨立的錢包應用]52

Error Examples[錯誤的例子]53

PERSISTENCE API[持久化 API]54

Overview[概述]54

The Need for Persistence Services[持久化服務的需求]54

The EOSIO Multi-Index API[EOSIO 多索引 API]55

EOSIO Multi-Index Iterators[EOSIO 多索引迭代器]56

Putting It All Together[融會貫通]57

How to Create Your EOSIO Multi-Index Table[如何創建你自己的 EOSIO 多索引表]57

How to Use Your EOSIO Multi-Index Table[如何使用 EOSIO 的多索引表]58

Vehicle Maintenance Tracker Example[車輛維護跟蹤器示例]58

Vehicle Maintenance Tracker service Table[車輛維修跟蹤服務表]59

Vehicle Maintenance Tracker customer Table[車輛維護跟蹤器客戶表]62

C++ API Reference[C++API 參考]65

eosio::multi_index65

Constructor[構造函數]66

Copy and Assignment[複製和分配]67

Table Manipulation[表操作]67

emplace67

get68

find69

modify70

erase71

Member Access[成員訪問]72

get_code72

Overview[概述]5

get_scope73

Utilities[實用程序]73

available_primary_key73

Iterators[迭代器]73

begin and cbegin74

end and cend74

rbegin and crbegin74

rend and crend74

lower_bound75

upper_bound75

get_index76

iterator_to77

indexed_by77

The eosio::multi_index::index API (Secondary Indices[二級索引])78

Constructor[構造函數]79

Copy and Assignment[複製和分配]79

Table Manipulation[表操作]80

get80

find80

modify81

erase82

Member Access[成員訪問]83

get_code83

get_scope84

name84

number84

Iterators[迭代器]84

const_iterator85

const_reverse_iterator85

begin and cbegin85

end and cend85

rbegin and crbegin86

rend and crend86

lower_bound86

upper_bound87

iterator_to87

Utilities[實用程序]88

extract_secondary_key88

SMART CONTRACT[智能合約]89

Introduction to EOSIO Smart Contracts[EOSIO 智能合約介紹]89

Required Background Knowledge[必須的背景知識]89

C / C++ Experience[C/C++技能]89

Linux / Mac OS Experience[LINUX/MAC OS 技能]90

Command Line Knowledge[命令行知識]90

Basics of EOSIO Smart Contracts[EOSIO 智能合約基礎]90

Overview[概述]90

Action vs Transaction[操作與交易區別]91

Transaction Confirmation[交易確認]92

Action Name Restricti 約束 ons[Action 名稱]93

Overview[概述]7

Action Handlers and Action "Apply" Context[Action 操作者和「應用」上下文]93

Communication Model and Execution Flow[通信模型和執行流程]95

Inline Communication[內聯通信]95

Deferred Communication[延期通信]95

Example Transaction Flow[交易流示例]96

Example Deferred Transaction Flow[延遲交易流示例]98

Smart Contract Files[智能合約文件]99

hpp99

cpp99

apply action handler and the EOSIO_ABI macro[apply 操作和 EOSIO_ABI 宏]100

The EOSIO_ABI macro[EOSIO_ABI 宏]101

wast101

abi102

Debugging Smart Contracts[調試智能合約]103

Method[方法]103

Print API104

Example[示例]105

debug.cpp105

debug.wast105

debug.abi105

Deploy and Apply an Action[部署並應用一個操作]106

TUTORIALS[教程]108

Getting Started with Contracts[合約入門]108

Starting a Private Blockchain[啟動私有區塊鏈]108

Creating a Wallet[創建一個錢包]109

Loading the Bios Contract[載入 BIOS 合約]110

Creating Accounts[創建賬戶]111

Create Two User Accounts[創建兩個用戶賬戶]112

Eosio.token, Exchange, and Eosio.msig Contracts114

Create the Currency Token[創建當前 Token]114

Issue Tokens to Account "User"[向「User 賬戶發行 token」]116

Transfer Tokens to Account "Tester"[向「tester」賬戶轉賬]117

Deploy Exchange Contract[部署交換合約]118

Deploy Eosio.msig Contract[部署 Eosio.msig 合約]118

Exchange Deposit and Withdrawal[存取交易]120

Setup[部署]120

Prerequisites[預備知識]120

Ensure eosio::history_api_plugin is running[確保 eosio::history_api_plugin 已經運行]120

Activate log filtering[激活日誌過濾]121

Replay the blockchain[重放區塊鏈]121

Set up additional accounts[設置額外的賬戶]122

Accepting Deposits[接受存款]122

Initial Condition[初始條件]122

Polling Account History[查詢賬戶歷史]123

Fetching only "New" Actions[抓取「最新」的操作]125

Machine Readable Account History (JSON)[機器可讀帳戶歷史記錄(JSON)]126

WARNING[警告]127

Validating Balance[驗證餘額]127

Processing Withdrawals[處理取款]127

Handling Errors[錯誤處理]129

Exchange Security[交易安全]130

Hello World Contract[Hello World 合約]132

hello/hello.cpp132

Hello World Ricardian Contract[李嘉圖式 Hello World 合約]134

Comprehensive Accounts & Wallets Tutorial[全面的帳戶和錢包教程]137

Tutorial Audience[教程的讀者]137

What You"ll Learn[你將學習]137

Prerequisites[預備知識]137

Overview[概述]9

EOSIO Accounts and Wallets Conceptual Overview[EOSIO 賬戶和錢包概念概述]138

Creating and Managing Wallets[創建和管理錢包]139

Managing Multiple Wallets and Wallet Names[管理多個錢包和錢包名稱]140

Generating and Importing EOSIO Keys[產生並導入 EOSIO 密鑰]143

Backing up your wallet[備份你的錢包]144

Creating an Account[創建賬戶]145

Account Related Operations[賬戶相關操作]147

Bios Boot Sequence Tutorial[Bios 引導順序教程]149

Manual Execution of the Boot Sequence[手動執行啟動順序]149

Configure the initial set of nodeos nodes[配置 nodeos 節點的初始集]151

Create config and data directories for each nodeos[為每個 nodeos 創建配置和數據目錄]151

Prepare IP addresses for peer-to-peer communication[準備對等通信的 IP 地址]152

Start the "genesis" node[啟動創世節點]153

Create a wallet[創建錢包]153

Configure the genesis.json file.[配置 genesis.json 文件]153

Create the key for the eosio account[為 eosio 賬戶創建密鑰]154

Start the genesis nodeos node[啟動 genesis nodeos 節點]154

Create important system accounts[創建重要的系統賬戶]154

Install the eosio.token contract[安裝 eosio.token 合約]155

Set the eosio.msig contract[配置 eosio.msig 合約]156

Create and allocate the SYS currency[創建和分配 SYS 貨幣]156

Set the eosio.system contract[設置 eosio.system 合約]157

Transition from single producer to multiple producers[從單一生產者轉變為多個生產者]158

Make eosio.msig a privileged account[使 eosio.msig 成為特權帳戶]158

Stake tokens and expand the network[標記代幣並擴展網路]158

Create staked accounts[創建放款賬戶]159

Select the producers[選擇生產者]161

Register as a producer[註冊成為一個生產者]161

List the producers[列出生產者]162

Start the producers[啟動生產者]162

Vote for producers[為生產者投票]165

Producers can claim rewards[生產者可以要求獎勵]165

Register proxies and proxy voting[註冊代理和代理投票]165

eosio resigns[eosio 辭職]166

Tic-Tac-Toe[井字棋]167

Objective[目的]167

Assumption[假設]167

Board[棋盤]167

Action[操作]168

Contract account[合約賬戶]168

Start![啟動]169

Defining Structure[結構定義]169

Games Table[遊戲表]169

Game Structure[遊戲結構]170

Action Structure[操作的結構]171

Create[創建]171

Restart[重啟]171

Close[關閉]172

Move[移動]172

Overview[概述]

Main173

Action handler[操作處理程序]173

Create Action Handler[創建操作處理程序]175

Restart Action Handler[重新啟動操作處理程序]176

Close Action Handler[關閉操作處理程序]177

Move Action Handler[移動操作處理程序]177

Movement Validation[運動驗證]179

Get Winner[獲取贏家]180

Creating ABI[創建 ABI]181

Table ABI182

Actions ABI183

Compile![編譯]184

Deploy![部署]185

Play!185

Create185

Move185

Restart185

Close186

See the game status186

Upgrading the system contract[升級系統合約]187

Indirect method using eosio.msig contract[使用 eosio.msig 合約的間接方法]187

Direct method (avoids using eosio.msig contract)187

TESTNET SINGLE HOST MULTINODE[單主機多節點測試網路]194

Create a Default Wallet[創建一個默認錢包]194

Start the First Producer Node[啟動第一個生產者節點]195

Start the Second Producer Node[啟動第二個生產者節點]195

RELEASES[發布版]202

CODING STANDARDS[編碼規範]205


喜歡這篇文章嗎?立刻分享出去讓更多人知道吧!

本站內容充實豐富,博大精深,小編精選每日熱門資訊,隨時更新,點擊「搶先收到最新資訊」瀏覽吧!


請您繼續閱讀更多來自 商業共識 的精彩文章:

TAG:商業共識 |