From 213a14b0c8bd8d97af36201b0571eb7391a62280 Mon Sep 17 00:00:00 2001 From: Hadar Rottenberg Date: Thu, 21 May 2020 23:26:20 +0300 Subject: [PATCH] add: better RN docs --- README.md | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d96f9c2b..1db8451c 100644 --- a/README.md +++ b/README.md @@ -208,10 +208,26 @@ some of the performance issues are related to the javascript engine, which can b enabled versions of v8 or jsc for window.crypto.getRandomValues you can use either react-native-crypto or react-native-get-random-values - +### Installation Instructions - `npm install buffer text-encoding react-native-webview-bridge react-native-get-random-values --save` -- follow instructions to install [WebviewCrypto](https://github.com/saulshanabrook/react-native-webview-crypto) +- follow instructions to install [WebviewCrypto](https://github.com/webview-crypto/react-native-webview-crypto) +- for persistent storage you'll need to include RAD + asyncstorage adapter like so + you can pass any storage adapter to the Store that implements the AsyncStorage setItem,getItem API + ```javascript + import {AsyncStorage} from 'react-native' + import Gun from 'gun/gun' + import SEA from 'gun/sea' + import 'gun/lib/radix.js' + import 'gun/lib/radisk.js' + import 'gun/lib/store.js' + import Store from 'gun/lib/ras.js' + //rad asyncstorage adapter, on Android asyncstorage has 6mb limit by default + const asyncStore = Store({AsyncStorage}); + //start gun + Gun({peers:[...],store:asyncStore}) + ``` +### React Native Example (SEA+RAD) see working [example repo](https://github.com/gooddollar/gun-webcrypto-react-native) ## Deploy