Skip to content

Commit

Permalink
Merge pull request #30 from berty/node-manager
Browse files Browse the repository at this point in the history
feat: add IPFS node manager
  • Loading branch information
zxxma authored Jan 13, 2022
2 parents 4b81e20 + 1845c57 commit 69086a1
Show file tree
Hide file tree
Showing 38 changed files with 4,200 additions and 1,083 deletions.
1 change: 0 additions & 1 deletion rn/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ unlink:

node_modules/.fresh: yarn.lock package.json
$(MAKE) unlink
rm -fr node_modules
yarn
$(MAKE) .link
touch $@
Expand Down
4 changes: 4 additions & 0 deletions rn/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@

import 'text-encoding'
import { AppRegistry } from 'react-native'
import Constants from 'expo-constants'

import App from './src/App'
import { name as appName } from './app.json'

console.log(Constants.systemFonts ? 'Expo enabled' : 'WARNING: Expo constant not found')

AppRegistry.registerComponent(appName, () => App)
48 changes: 40 additions & 8 deletions rn/ios/BertyLabs.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; };
9471DEA1278471C800186ED2 /* CoreBluetooth.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9471DEA0278471C800186ED2 /* CoreBluetooth.framework */; };
9471DEA3278471D100186ED2 /* MultipeerConnectivity.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9471DEA2278471D100186ED2 /* MultipeerConnectivity.framework */; };
ADD449188196630D379B44C4 /* ExpoModulesProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = DBC3EB67675AD648E7229FC5 /* ExpoModulesProvider.swift */; };
FAA4DE4083AB0380F4CBB844 /* ExpoModulesProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC222A8922B8F2BEA33D3877 /* ExpoModulesProvider.swift */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -66,7 +68,9 @@
9471DEA2278471D100186ED2 /* MultipeerConnectivity.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MultipeerConnectivity.framework; path = System/Library/Frameworks/MultipeerConnectivity.framework; sourceTree = SDKROOT; };
ABFE59519B596E51CEFDCCC0 /* libPods-BertyLabs-BertyLabsTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-BertyLabs-BertyLabsTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
C0A881CF5CF3F2B244570E2A /* Pods-BertyLabs.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-BertyLabs.debug.xcconfig"; path = "Target Support Files/Pods-BertyLabs/Pods-BertyLabs.debug.xcconfig"; sourceTree = "<group>"; };
CC222A8922B8F2BEA33D3877 /* ExpoModulesProvider.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ExpoModulesProvider.swift; path = "Pods/Target Support Files/Pods-BertyLabs-BertyLabsTests/ExpoModulesProvider.swift"; sourceTree = "<group>"; };
D00AAFFCFCFDA5787532823F /* Pods-BertyLabs.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-BertyLabs.release.xcconfig"; path = "Target Support Files/Pods-BertyLabs/Pods-BertyLabs.release.xcconfig"; sourceTree = "<group>"; };
DBC3EB67675AD648E7229FC5 /* ExpoModulesProvider.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ExpoModulesProvider.swift; path = "Pods/Target Support Files/Pods-BertyLabs/ExpoModulesProvider.swift"; sourceTree = "<group>"; };
ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };
/* End PBXFileReference section */

Expand Down Expand Up @@ -109,6 +113,14 @@
name = "Supporting Files";
sourceTree = "<group>";
};
05E614BB0DF15543DEE062DD /* BertyLabsTests */ = {
isa = PBXGroup;
children = (
CC222A8922B8F2BEA33D3877 /* ExpoModulesProvider.swift */,
);
name = BertyLabsTests;
sourceTree = "<group>";
};
13B07FAE1A68108700A75B9A /* BertyLabs */ = {
isa = PBXGroup;
children = (
Expand All @@ -123,6 +135,15 @@
name = BertyLabs;
sourceTree = "<group>";
};
22F251C12EFEA6644857DA40 /* ExpoModulesProviders */ = {
isa = PBXGroup;
children = (
B298FCFFA0ADF76A60C883F9 /* BertyLabs */,
05E614BB0DF15543DEE062DD /* BertyLabsTests */,
);
name = ExpoModulesProviders;
sourceTree = "<group>";
};
2D16E6871FA4F8E400B85C8A /* Frameworks */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -168,6 +189,7 @@
83CBBA001A601CBA00E9B192 /* Products */,
2D16E6871FA4F8E400B85C8A /* Frameworks */,
E233CBF5F47BEE60B243DCF8 /* Pods */,
22F251C12EFEA6644857DA40 /* ExpoModulesProviders */,
);
indentWidth = 2;
sourceTree = "<group>";
Expand All @@ -183,6 +205,14 @@
name = Products;
sourceTree = "<group>";
};
B298FCFFA0ADF76A60C883F9 /* BertyLabs */ = {
isa = PBXGroup;
children = (
DBC3EB67675AD648E7229FC5 /* ExpoModulesProvider.swift */,
);
name = BertyLabs;
sourceTree = "<group>";
};
E233CBF5F47BEE60B243DCF8 /* Pods */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -459,6 +489,7 @@
buildActionMask = 2147483647;
files = (
00E356F31AD99517003FC87E /* BertyLabsTests.m in Sources */,
FAA4DE4083AB0380F4CBB844 /* ExpoModulesProvider.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -468,6 +499,7 @@
files = (
13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */,
13B07FC11A68108700A75B9A /* main.m in Sources */,
ADD449188196630D379B44C4 /* ExpoModulesProvider.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -492,7 +524,7 @@
"$(inherited)",
);
INFOPLIST_FILE = BertyLabsTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand All @@ -516,7 +548,7 @@
BUNDLE_LOADER = "$(TEST_HOST)";
COPY_PHASE_STRIP = NO;
INFOPLIST_FILE = BertyLabsTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand All @@ -540,7 +572,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = WMBQ84HN4T;
DEVELOPMENT_TEAM = BD3SV5P3NX;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = BertyLabs/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
Expand All @@ -552,7 +584,7 @@
"-ObjC",
"-lc++",
);
PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_BUNDLE_IDENTIFIER = tech.berty.labs.ios.debug;
PRODUCT_NAME = BertyLabs;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
Expand Down Expand Up @@ -620,7 +652,7 @@
COPY_PHASE_STRIP = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "";
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "arm64 ";
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
Expand All @@ -636,7 +668,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = (
/usr/lib/swift,
"$(inherited)",
Expand Down Expand Up @@ -686,7 +718,7 @@
COPY_PHASE_STRIP = YES;
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "";
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "arm64 ";
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
Expand All @@ -695,7 +727,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = (
/usr/lib/swift,
"$(inherited)",
Expand Down
3 changes: 2 additions & 1 deletion rn/ios/BertyLabs/AppDelegate.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#import <React/RCTBridgeDelegate.h>
#import <Expo/Expo.h>
#import <UIKit/UIKit.h>

@interface AppDelegate : UIResponder <UIApplicationDelegate, RCTBridgeDelegate>
@interface AppDelegate : EXAppDelegateWrapper <UIApplicationDelegate, RCTBridgeDelegate>

@property (nonatomic, strong) UIWindow *window;

Expand Down
7 changes: 4 additions & 3 deletions rn/ios/BertyLabs/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
InitializeFlipper(application);
#endif

RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
RCTBridge *bridge = [self.reactDelegate createBridgeWithDelegate:self launchOptions:launchOptions];
RCTRootView *rootView = [self.reactDelegate createRootViewWithBridge:bridge
moduleName:@"BertyLabs"
initialProperties:nil];

Expand All @@ -43,10 +43,11 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
}

self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
UIViewController *rootViewController = [UIViewController new];
UIViewController *rootViewController = [self.reactDelegate createRootViewController];
rootViewController.view = rootView;
self.window.rootViewController = rootViewController;
[self.window makeKeyAndVisible];
[super application:application didFinishLaunchingWithOptions:launchOptions];
return YES;
}

Expand Down
4 changes: 3 additions & 1 deletion rn/ios/Podfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
require File.join(File.dirname(`node --print "require.resolve('expo/package.json')"`), "scripts/autolinking")
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

platform :ios, '11.0'
platform :ios, '12.0'

target 'BertyLabs' do
pod 'Gomobile-IPFS-Bridge', :podspec => "./vendored_pods/Gomobile-IPFS-Bridge.podspec"
pod 'Gomobile-IPFS-Core', :podspec => "./vendored_pods/Gomobile-IPFS-Core.podspec"

use_expo_modules!
config = use_native_modules!

use_react_native!(
Expand Down
69 changes: 59 additions & 10 deletions rn/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,23 @@ PODS:
- boost (1.76.0)
- CocoaAsyncSocket (7.6.5)
- DoubleConversion (1.1.6)
- EXApplication (4.0.1):
- ExpoModulesCore
- EXConstants (13.0.0):
- ExpoModulesCore
- EXErrorRecovery (3.0.4):
- ExpoModulesCore
- EXFileSystem (13.2.0):
- ExpoModulesCore
- EXFont (10.0.4):
- ExpoModulesCore
- EXKeepAwake (10.0.1):
- ExpoModulesCore
- Expo (44.0.4):
- ExpoModulesCore
- ExpoModulesCore (0.6.4):
- React-Core
- ReactCommon/turbomodule/core
- FBLazyVector (0.66.4)
- FBReactNativeSpec (0.66.4):
- RCT-Folly (= 2021.06.28.00-v2)
Expand Down Expand Up @@ -72,9 +89,9 @@ PODS:
- FlipperKit/FlipperKitNetworkPlugin
- fmt (6.2.1)
- glog (0.3.5)
- Gomobile-IPFS-Bridge (1.1.2):
- Gomobile-IPFS-Core (~> 1.1.2)
- Gomobile-IPFS-Core (1.1.2)
- Gomobile-IPFS-Bridge (1.1.4):
- Gomobile-IPFS-Core (~> 1.1.4)
- Gomobile-IPFS-Core (1.1.4)
- libevent (2.1.12)
- OpenSSL-Universal (1.1.180)
- RCT-Folly (2021.06.28.00-v2):
Expand Down Expand Up @@ -276,11 +293,11 @@ PODS:
- React-logger (0.66.4):
- glog
- react-native-gomobile-ipfs (0.1.0):
- Gomobile-IPFS-Bridge (~> 1.1.2)
- Gomobile-IPFS-Bridge (~> 1.1.4)
- React
- react-native-safe-area-context (3.3.2):
- React-Core
- react-native-webview (11.15.1):
- react-native-webview (11.16.0):
- React-Core
- React-perflogger (0.66.4)
- React-RCTActionSheet (0.66.4):
Expand Down Expand Up @@ -359,6 +376,14 @@ PODS:
DEPENDENCIES:
- boost (from `../node_modules/react-native/third-party-podspecs/boost.podspec`)
- DoubleConversion (from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`)
- EXApplication (from `../node_modules/expo-application/ios`)
- EXConstants (from `../node_modules/expo-constants/ios`)
- EXErrorRecovery (from `../node_modules/expo-error-recovery/ios`)
- EXFileSystem (from `../node_modules/expo-file-system/ios`)
- EXFont (from `../node_modules/expo-font/ios`)
- EXKeepAwake (from `../node_modules/expo-keep-awake/ios`)
- Expo (from `../node_modules/expo/ios`)
- ExpoModulesCore (from `../node_modules/expo-modules-core/ios`)
- FBLazyVector (from `../node_modules/react-native/Libraries/FBLazyVector`)
- FBReactNativeSpec (from `../node_modules/react-native/React/FBReactNativeSpec`)
- Flipper (= 0.99.0)
Expand Down Expand Up @@ -440,6 +465,22 @@ EXTERNAL SOURCES:
:podspec: "../node_modules/react-native/third-party-podspecs/boost.podspec"
DoubleConversion:
:podspec: "../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec"
EXApplication:
:path: "../node_modules/expo-application/ios"
EXConstants:
:path: "../node_modules/expo-constants/ios"
EXErrorRecovery:
:path: "../node_modules/expo-error-recovery/ios"
EXFileSystem:
:path: "../node_modules/expo-file-system/ios"
EXFont:
:path: "../node_modules/expo-font/ios"
EXKeepAwake:
:path: "../node_modules/expo-keep-awake/ios"
Expo:
:path: "../node_modules/expo/ios"
ExpoModulesCore:
:path: "../node_modules/expo-modules-core/ios"
FBLazyVector:
:path: "../node_modules/react-native/Libraries/FBLazyVector"
FBReactNativeSpec:
Expand Down Expand Up @@ -515,6 +556,14 @@ SPEC CHECKSUMS:
boost: a7c83b31436843459a1961bfd74b96033dc77234
CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99
DoubleConversion: 831926d9b8bf8166fd87886c4abab286c2422662
EXApplication: bdc8dc27713235565da1029a34385229f31b8e08
EXConstants: 5d18484e38e8eacef7695a82214b6ac90133dedf
EXErrorRecovery: deea88a01d38f8b1c1181b4e1d179b0ba0e4bb5b
EXFileSystem: 7bcd3c1428698150d5c8ca140c8183f2ee204048
EXFont: 1fb13af43dc517c01c0ff21a6e32f9f9bf2ea602
EXKeepAwake: b571c2ad8323b2fced6e907766e2549f75119471
Expo: d9b8b5e49c200471fc473a652a84fe30dee73027
ExpoModulesCore: 64abda7af7cf659d2fa092934e29c6f4ea7e849f
FBLazyVector: e5569e42a1c79ca00521846c223173a57aca1fe1
FBReactNativeSpec: fe08c1cd7e2e205718d77ad14b34957cce949b58
Flipper: 30e8eeeed6abdc98edaf32af0cda2f198be4b733
Expand All @@ -528,8 +577,8 @@ SPEC CHECKSUMS:
FlipperKit: d8d346844eca5d9120c17d441a2f38596e8ed2b9
fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9
glog: 5337263514dd6f09803962437687240c5dc39aa4
Gomobile-IPFS-Bridge: 766021f9e07526743f54ecc2908aa9f4611b4fe8
Gomobile-IPFS-Core: 0efc4c03fbcf8fdcddba8363b0932092e2bdef26
Gomobile-IPFS-Bridge: 4b3c4fef35106683bdcec5e7f33402d5df14340b
Gomobile-IPFS-Core: fd4c7e55f6722e3ee141460ba1d7462c47852efd
libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913
OpenSSL-Universal: 1aa4f6a6ee7256b83db99ec1ccdaa80d10f9af9b
RCT-Folly: a21c126816d8025b547704b777a2ba552f3d9fa9
Expand All @@ -544,9 +593,9 @@ SPEC CHECKSUMS:
React-jsiexecutor: 94ce921e1d8ce7023366873ec371f3441383b396
React-jsinspector: d0374f7509d407d2264168b6d0fad0b54e300b85
React-logger: 933f80c97c633ee8965d609876848148e3fef438
react-native-gomobile-ipfs: c5491024e2386c69def23c4eab59a1ef141ed452
react-native-gomobile-ipfs: 59eb3c4317d55b87562e93afe4480d38752f293c
react-native-safe-area-context: 584dc04881deb49474363f3be89e4ca0e854c057
react-native-webview: ea4899a1056c782afa96dd082179a66cbebf5504
react-native-webview: 28a8636d97ee641f2ee8f20492d7a6c269c1d703
React-perflogger: 93075d8931c32cd1fce8a98c15d2d5ccc4d891bd
React-RCTActionSheet: 7d3041e6761b4f3044a37079ddcb156575fb6d89
React-RCTAnimation: 743e88b55ac62511ae5c2e22803d4f503f2a3a13
Expand All @@ -564,6 +613,6 @@ SPEC CHECKSUMS:
Yoga: e7dc4e71caba6472ff48ad7d234389b91dadc280
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a

PODFILE CHECKSUM: 85bdcf85b433ff0695ffbef09134d05c97936950
PODFILE CHECKSUM: 8d0ae7a8e793952adb5423bf9d9ef0ed97cab00d

COCOAPODS: 1.11.2
6 changes: 3 additions & 3 deletions rn/ios/vendored_pods/Gomobile-IPFS-Bridge.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |spec|
spec.name = 'Gomobile-IPFS-Bridge'
spec.version = '1.1.2'
spec.version = '1.1.4'
spec.summary = 'Swift module offering a simple interface to the underlying Gomobile-IPFS-Core objects'
spec.homepage = 'https://github.com/ipfs-shipyard/gomobile-ipfs'

Expand All @@ -11,11 +11,11 @@ http://www.apache.org/licenses/LICENSE-2.0.txt - http://www.opensource.org/licen
spec.authors = { 'Antoine Eddi' => '[email protected]', 'Guilhem Fanton' => '[email protected]' }

spec.platform = :ios, '10.0'
spec.source = { :http => 'https://github.com/n0izn0iz/gomobile-ipfs/releases/download/v1.1.2/bridge-1.1.2.zip' }
spec.source = { :http => 'https://github.com/n0izn0iz/gomobile-ipfs/releases/download/v1.1.4/bridge-1.1.4.zip' }
spec.swift_version = '5.0'
spec.static_framework = true
spec.source_files = '*.swift'
spec.header_dir = 'GomobileIPFS'

spec.dependency 'Gomobile-IPFS-Core', '~> 1.1.2'
spec.dependency 'Gomobile-IPFS-Core', '~> 1.1.4'
end
Loading

0 comments on commit 69086a1

Please sign in to comment.