ios启动私有链查询区块信息
2018-07-09 17:32
344 查看
一、新建一个ios swift项目
二、下载并安装CocoaPods.app-1.5.2.tar.bz2
https://github.com/CocoaPods/CocoaPods-app/releases/download/1.5.2/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!)")
========================================
四、问题汇总
1、真机build faile
解决:all + Combined ,搜索bitcode,enable bitcode讲yes修改为no
========================================
二、下载并安装CocoaPods.app-1.5.2.tar.bz2
https://github.com/CocoaPods/CocoaPods-app/releases/download/1.5.2/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!)")
========================================
四、问题汇总
1、真机build faile
解决:all + Combined ,搜索bitcode,enable bitcode讲yes修改为no
========================================
相关文章推荐
- Use MusicBrainz in iOS(二)通过歌曲名查询信息
- [iOS]如何向 appstore 查询已发布 APP 的信息?
- iOS 基本设备信息查询
- [iOS]如何向 appstore 查询已发布 APP 的信息?
- Use MusicBrainz in iOS(三)查询专辑的完整信息
- [iOS]如何向 appstore 查询已发布 APP 的信息?
- iOS.定位服务与地图应用.03.地理信息编码查询
- chkconfig命令主要用来更新(启动或停止)和查询系统服务的运行级信息
- 查询能启动的应用的流量信息
- iOS定位服务与地图开发(3)---地理信息编码查询
- Hyperledger Fabric SDK 示例fabric-samples-《balance-transfer》之八《查询指定的区块信息》
- IOS 学习(基于 iOS 8.0 以上的地理信息查询)
- 07 Activity启动另一个Activity 及 进程的信息查询
- IOS第三十天——利用xml解析查询火车票信息
- iOS中如何查询当前网络信息
- [iOS]如何向 appstore 查询已发布 APP 的信息?
- [iOS]如何向 appstore 查询已发布 APP 的信息?
- iOS中如何查询当前网络信息
- [iOS]如何向 appstore 查询已发布 APP 的信息?
- Use MusicBrainz in iOS(三)查询专辑的完整信息