资讯

精准传达 • 有效沟通

从品牌网站建设到网络营销策划,从策略到执行的一站式服务

ios启动私有链查询区块信息的方法是什么

本篇内容介绍了“ios启动私有链查询区块信息的方法是什么”的有关知识,在实际案例的操作过程中,不少人都会遇到这样的困境,接下来就让小编带领大家学习一下如何处理这些情况吧!希望大家仔细阅读,能够学有所成!

成都创新互联公司是一家专业的成都网站建设公司,我们专注成都网站建设、做网站、网络营销、企业网站建设,卖链接一元广告为企业客户提供一站式建站解决方案,能带给客户新的互联网理念。从网站结构的规划UI设计到用户体验提高,创新互联力求做到尽善尽美。

一、新建一个ios swift项目

二、下载并安装CocoaPods.app-1.5.2.tar.bz2

三、通过pod安装geth插件

$ cd /Users/shijun/Desktop/iosWorkspace/BlockChain

$ pod init

生成Podfile文件,并修改内容

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代码

创建新帐号

========================================

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!)")

========================================

四、问题汇总

真机build faile

解决:all + Combined ,搜索bitcode,enable bitcode讲yes修改为no

========================================

“ios启动私有链查询区块信息的方法是什么”的内容就介绍到这里了,感谢大家的阅读。如果想了解更多行业相关的知识可以关注创新互联网站,小编将为大家输出更多高质量的实用文章!


文章名称:ios启动私有链查询区块信息的方法是什么
标题链接:http://cdkjz.cn/article/ggihpj.html
多年建站经验

多一份参考,总有益处

联系快上网,免费获得专属《策划方案》及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

业务热线:400-028-6601 / 大客户专线   成都:13518219792   座机:028-86922220