您好,登錄后才能下訂單哦!
本篇內(nèi)容介紹了“ios啟動私有鏈查詢區(qū)塊信息的方法是什么”的有關(guān)知識,在實(shí)際案例的操作過程中,不少人都會遇到這樣的困境,接下來就讓小編帶領(lǐng)大家學(xué)習(xí)一下如何處理這些情況吧!希望大家仔細(xì)閱讀,能夠?qū)W有所成!
一、新建一個ios swift項(xiàng)目
二、下載并安裝CocoaPods.app-1.5.2.tar.bz2
三、通過pod安裝geth插件
$ cd /Users/shijun/Desktop/iosWorkspace/BlockChain
$ pod init
生成Podfile文件,并修改內(nèi)容
target 'BlockChain' do
pod 'Geth', '1.8.12' #加這行
use_frameworks!
target 'BlockChainTests' do
pod 'Geth', '1.8.12' #加這行
inherit! :search_paths
end
target 'BlockChainUITests' do
pod 'Geth', '1.8.12' #加這行
inherit! :search_paths
end
end
$ pod install
========================================
Analyzing dependencies
Downloading dependencies
Installing Geth (1.8.12)
Generating Pods project
Integrating client project
[!] Please close any current Xcode sessions and use `BlockChain.xcworkspace` for this project from now on.
Sending stats
Pod installation complete! There is 1 dependency from the Podfile and 1 total pod installed.
[!] Automatically assigning platform `ios` with version `11.4` on target `BlockChain` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.
========================================
四、ios代碼
創(chuàng)建新帳號
========================================
import Geth
let keyStorePath = "/Users/shijun/Desktop/blockChain/ethereum/private/data0/keystore"
print("keyStorePath: \(keyStorePath)")
let keyStoreManager = GethNewKeyStore(keyStorePath, GethLightScryptN, GethLightScryptP)
let account = try! keyStoreManager?.newAccount("password")
let address = account?.getAddress().getHex()
print("address: \(address!)")
let url = account?.getURL()
print("url: \(url!)")
========================================
四、問題匯總
真機(jī)build faile
解決:all + Combined ,搜索bitcode,enable bitcode講yes修改為no
========================================
“ios啟動私有鏈查詢區(qū)塊信息的方法是什么”的內(nèi)容就介紹到這里了,感謝大家的閱讀。如果想了解更多行業(yè)相關(guān)的知識可以關(guān)注億速云網(wǎng)站,小編將為大家輸出更多高質(zhì)量的實(shí)用文章!
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。