Git Product home page Git Product logo

iroha-ios's Introduction

Hyperledger Iroha iOS library

Please pay attention! Current version of the library was tested and compatible with Iroha 1.1.1.

The library was created to provide convienent interface for iOS applications to communicate with Iroha blockchain including sending transactions/query, streaming transaction statuses and block commits.

Example

For new iroha users we recommend to checkout iOS example project. It tries to establish connection with Iroha peer which should be also run locally on your computer to create new account and send some asset quantity to it. To run the project, please, go through steps below:

  1. Follow instructions from Iroha documentation to setup and run iroha peer in Docker container.

  2. Clone current repository.

  3. cd Example directory and run pod install.

  4. Open IrohaCommunication.xcworkspace in XCode

  5. Build and Run IrohaExample target.

  6. Consider logs to see if the scenario completed successfully.

Feel free to experiment with example project and don't hesistate to ask any questions.

Integration Tests

Integration tests is a good place to check existing scenarious or to introduce new ones. To run integration tests, please, go through steps below:

  1. Follow instructions from Iroha documentation to setup and run iroha peer in Docker container. However make sure you run iroha using following command (consider additional --overwrite_ledger flag):
docker run --name iroha -d -p 50051:50051 -v $(pwd)/iroha/example:/opt/iroha_data -v blockstore:/tmp/block_store --network=iroha-network -e KEY='node0 --overwrite_ledger' hyperledger/iroha:latest
  1. Launch proxy for docker daemon to make it available through http. For example, one can use socat utility:
brew install socat
socat TCP-LISTEN:49721,fork UNIX-CONNECT:/var/run/docker.sock
  1. Clone current repository.

  2. cd Example directory and run pod install.

  3. Open IrohaCommunication.xcworkspace in XCode

  4. Run tests under IntegrationTests target.

Need Help?

Cocoapods Installation

Iroha iOS library is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'IrohaCommunication'

Author

Ruslan Rezin, [email protected]
Andrei Marin, [email protected]

License

Copyright 2018 Soramitsu Co., Ltd.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

iroha-ios's People

Contributors

cre-ed avatar dendoronin avatar erussel avatar mukhinalexey avatar ryjones avatar satoshi-kaji avatar stayer avatar takemiyamakoto avatar unklayman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

iroha-ios's Issues

Could not build "Fearless Wallet" project on m1

`Ld /Users/lpatolya/Library/Developer/Xcode/DerivedData/fearless-gdanpnshkzyxpyhifolhbauvynqn/Build/Products/Debug-iphonesimulator/IrohaCrypto/IrohaCrypto.framework/IrohaCrypto normal (in target 'IrohaCrypto' from project 'Pods')
cd /Users/lpatolya/XcodeProjects/fearless-iOS/Pods
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -target x86_64-apple-ios11.0-simulator -dynamiclib -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk -L/Users/lpatolya/Library/Developer/Xcode/DerivedData/fearless-gdanpnshkzyxpyhifolhbauvynqn/Build/Products/Debug-iphonesimulator/IrohaCrypto -L/Users/lpatolya/XcodeProjects/fearless-iOS/Pods/IrohaCrypto/blake2Imp -L/Users/lpatolya/XcodeProjects/fearless-iOS/Pods/IrohaCrypto/ed25519Imp -L/Users/lpatolya/XcodeProjects/fearless-iOS/Pods/IrohaCrypto/sr25519Imp -F/Users/lpatolya/Library/Developer/Xcode/DerivedData/fearless-gdanpnshkzyxpyhifolhbauvynqn/Build/Products/Debug-iphonesimulator/IrohaCrypto -F/Users/lpatolya/Library/Developer/Xcode/DerivedData/fearless-gdanpnshkzyxpyhifolhbauvynqn/Build/Products/Debug-iphonesimulator/scrypt.c -F/Users/lpatolya/Library/Developer/Xcode/DerivedData/fearless-gdanpnshkzyxpyhifolhbauvynqn/Build/Products/Debug-iphonesimulator/secp256k1.c -filelist /Users/lpatolya/Library/Developer/Xcode/DerivedData/fearless-gdanpnshkzyxpyhifolhbauvynqn/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/IrohaCrypto.build/Objects-normal/x86_64/IrohaCrypto.LinkFileList -install_name @rpath/IrohaCrypto.framework/IrohaCrypto -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @loader_path/Frameworks -dead_strip -Xlinker -object_path_lto -Xlinker /Users/lpatolya/Library/Developer/Xcode/DerivedData/fearless-gdanpnshkzyxpyhifolhbauvynqn/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/IrohaCrypto.build/Objects-normal/x86_64/IrohaCrypto_lto.o -Xlinker -export_dynamic -Xlinker -no_deduplicate -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -fprofile-instr-generate -lblake2 -led25519_sha2 -lsr25519crust -framework Foundation -framework scrypt -framework secp256k1 -Xlinker -no_adhoc_codesign -compatibility_version 1 -current_version 1 -Xlinker -dependency_info -Xlinker /Users/lpatolya/Library/Developer/Xcode/DerivedData/fearless-gdanpnshkzyxpyhifolhbauvynqn/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/IrohaCrypto.build/Objects-normal/x86_64/IrohaCrypto_dependency_info.dat -o /Users/lpatolya/Library/Developer/Xcode/DerivedData/fearless-gdanpnshkzyxpyhifolhbauvynqn/Build/Products/Debug-iphonesimulator/IrohaCrypto/IrohaCrypto.framework/IrohaCrypto

ld: warning: ignoring file /Users/lpatolya/Library/Developer/Xcode/DerivedData/fearless-gdanpnshkzyxpyhifolhbauvynqn/Build/Products/Debug-iphonesimulator/scrypt.c/scrypt.framework/scrypt, building for iOS Simulator-x86_64 but attempting to link with file built for iOS Simulator-arm64
ld: warning: ignoring file /Users/lpatolya/Library/Developer/Xcode/DerivedData/fearless-gdanpnshkzyxpyhifolhbauvynqn/Build/Products/Debug-iphonesimulator/secp256k1.c/secp256k1.framework/secp256k1, building for iOS Simulator-x86_64 but attempting to link with file built for iOS Simulator-arm64
Undefined symbols for architecture x86_64:
"_secp256k1_ecdsa_sign_recoverable", referenced from:
-[SECSigner sign:error:] in SECSigner.o
"_secp256k1_ecdsa_recover", referenced from:
-[SECSignatureVerifier recoverFromSignature:forOriginalData:error:] in SECSignatureVerifier.o
"_secp256k1_ec_pubkey_create", referenced from:
-[SECKeyFactory deriveFromPrivateKey:error:] in SECKeyFactory.o
"_secp256k1_ec_pubkey_serialize", referenced from:
-[SECKeyFactory deriveFromPrivateKey:error:] in SECKeyFactory.o
-[SECSignatureVerifier recoverFromSignature:forOriginalData:error:] in SECSignatureVerifier.o
"_secp256k1_context_destroy", referenced from:
-[SECKeyFactory deriveFromPrivateKey:error:] in SECKeyFactory.o
-[SECSignatureVerifier recoverFromSignature:forOriginalData:error:] in SECSignatureVerifier.o
-[SECSigner sign:error:] in SECSigner.o
"_secp256k1_context_create", referenced from:
-[SECKeyFactory deriveFromPrivateKey:error:] in SECKeyFactory.o
-[SECSignatureVerifier recoverFromSignature:forOriginalData:error:] in SECSignatureVerifier.o
-[SECSigner sign:error:] in SECSigner.o
"_secp256k1_ecdsa_recoverable_signature_serialize_compact", referenced from:
-[SECSigner sign:error:] in SECSigner.o
"_secp256k1_ecdsa_recoverable_signature_parse_compact", referenced from:
-[SECSignatureVerifier recoverFromSignature:forOriginalData:error:] in SECSignatureVerifier.o
"_crypto_scrypt", referenced from:
-[IRScryptKeyDeriviation deriveKeyFrom:salt:scryptN:scryptP:scryptR:length:error:] in IRScryptKeyDeriviation.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
`

Screenshot 2021-06-08 at 15 55 15

message: "query signatories did not pass validation" when making new account on example

I tried to follow build the code at simulator.

Steps to reproduce error:

  1. Compile the code
  2. Run it on simulator
  3. See the logs ๐Ÿ˜„
 ==================================== Keypair ====================================
| Public key: [889f6b881e331be21487db77dcf32c5f8d3d5e8066e78d2feac4239fe91d416f]  |
| Private key: [0f0ce16d2afbb8eca23c7d8c2724f0c257a800ee2bbd54688cec6b898e3f7e33] |
 =================================================================================

Transaction to Iroha: 

{"commands":[{"createAccount":{"accountName":"lexa","domainId":"test","mainPubkey":"cmNlhnQvsUnxMMmnriN8/H5firRoYEUZePFdguTnmEs="}}],"creatorAccountId":"admin@test","createdTime":"1542337977000","quorum":1} 

{}
Query to Iroha: 

{"meta":{"createdTime":"1542337983000","creatorAccountId":"admin@test","queryCounter":"1"},"getAccount":{"accountId":"lexa@test"}} 

SwiftyIrohaExample.Iroha_Protocol_QueryResponse:
error_response {
  reason: STATEFUL_INVALID
  message: "query signatories did not pass validation"
}
query_hash: "f7bcb22ae8c8dbcd856ba63f6dd82dc919d341802723d6fd7918b68aa817ad25"

What should I do to create new account?

Iroha v2 CocoaPod library

  • Implement Swift code generator from JSON schema
  • Implement SCALE coding
  • Implement API SDK for Iroha v2 server

Example don't work.

Trying to launch IrohaSwifty example.
Getting invalid transactions. Also timestamp is not timestamp but transaction counter.

[2018-06-04 18:27:10.452054845][th:71][warning] CommandService Stateless invalid tx: Signature: [[Wrong signature [ece91bae02bd02ff32812565aa3472dbaa895ffe0bf8dc780452c52340f78043c6f29ed15e5f82aa3b49f6c17af9cfaa197e9e81838f36a669451ee3fd78eb03;407e57f50ca48969b08ba948171bb2435e035d82cec417e18e4a38f5fb113f83] ]]
Transaction: [[bad timestamp: too old, timestamp: 1, now: 1528126030442 ]]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.