溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點(diǎn)擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

ios啟動私有鏈查詢區(qū)塊信息的方法是什么

發(fā)布時間:2022-01-06 16:51:38 來源:億速云 閱讀:115 作者:iii 欄目:互聯(lián)網(wǎng)科技

本篇內(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í)用文章!

向AI問一下細(xì)節(jié)
AI