Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the method for ios to start private chain to query block information?

2025-04-07 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article introduces the knowledge about "what is the method to start ios private chain query block information". In the actual case operation process, many people will encounter such difficulties. Next, let Xiaobian lead you to learn how to deal with these situations! I hope you can read carefully and learn something!

Create a new ios swift project

Download and install CocoaPods.app-1.5.2.tar.bz2

3. Install geth plug-in through pod

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

$ pod init

Generate Podfile and modify content

target 'BlockChain' do

pod 'Geth', '1.8.12' #Add this line

use_frameworks!

target 'BlockChainTests' do

pod 'Geth', '1.8.12' #Add this line

inherit! :search_paths

end

target 'BlockChainUITests' do

pod 'Geth', '1.8.12' #Add this line

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`.

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

IV. Ios Code

Create New Account

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

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

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

IV. Summary of issues

Real build faile

Solution: all + Combined, search bitcode, enable bitcode say yes modify to no

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

The content of "ios starts the private chain query block information is what" is introduced here, thank you for reading. If you want to know more about industry-related knowledge, you can pay attention to the website. Xiaobian will output more high-quality practical articles for everyone!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report