textileio / community

Textile community repo. Includes a sub-project for documentation 📚 and a discussion board for ideas & questions.
https://docs.textile.io/
MIT License
99 stars 44 forks source link

Hard to get started #286

Open haf opened 2 years ago

haf commented 2 years ago

Hi,

So far I've spent about six hours trying to get started with a single sample.

I'm trying to run a sample and integrate Textile with my p2p outdoor app, however I can't get it running properly with react-native from the samples folder.

To start with there are many broken links; from blog entries from 2018 on textile.io as well as from the actual docs. E.g. many links are linking to archived github repositories and the old thread library. Some docs mention that the chat sample has been blocked on the rewrite of the threads code (which now seems done, but the chat sample is still gone).

As for trying the sample react-native-hub-app, it doesn't install when following the instructions:

npm i
npm run ios # or run android

For ios (which is my main target) it crashes with "Missing threadsdb_app.xcworkspace" from xcode. After doing a cd threadsdb_app.xcworkspace/ios && sudo gem install cocoapods && pod install && cd .. && npm run ios it still crashes. After following the deprecated version error message (seems v8 is deprecated: https://github.com/CocoaPods/CocoaPods/issues/9884 — and applying a workaround / overwriting the sublibraries' target — the build STILL fails.

On top of this, I find the docs unclear about the separation between the hub and the standalone / self-hosted software. I'm sure I could read my way to it (hasn't passively done so far in six hours and counting, though, trying to run your sample); but it would be nicer to allow a choice:

  1. Create an account here, at our hub, get 5 GiB for free, or;
  2. Run this docker compose up with docker-compose.yml file and ensure you specify --api http://127.0.0.1:9000/v1/hub when interacting with the CLI
  3. Alternatively; here's a kustomize-ready folder you can run on docker-desktop with Kubernetes

I see p2p for my use-case as an extension of the wearable computing concept; therefore it's a requirement for me to be able to build and run this sort of library outside of a desktop browser.

The documentation could also use an overview page that's not as verbose but rather more visual; i.e. showing with 2-3 diagrams;

  1. The interactions between clients/peers/hub/server, IPFS nodes, other blockchains and how pinning works
  2. A sequence diagram of the calls that is in checklist.tsx in the react-native app sample — in particular focusing on tying the different concepts together coherently; Database, Thread, User, Account, Organisation

Furthermore, when only following your examples (albeit with Expo), you get into this issue when trying to loading the app:

If you are sure the module exists, try these steps:
 1. Clear watchman watches: watchman watch-del-all
 2. Delete node_modules and run yarn install
 3. Reset Metro's cache: yarn start --reset-cache
 4. Remove the cache: rm -rf /tmp/metro-*
  22 | module.exports = global.StreamModule = Stream
  23 |
> 24 | var EE = require('events').EventEmitter;
     |                   ^
  25 | var inherits = require('inherits');
  26 |
  27 | inherits(Stream, EE);

Either it's because I'm using Expo or it might be something else. Using Expo has its upsides; like online code-push for example, so maybe this might be a good target for a sample?

I realise this is written mostly as a wish list; but the one key take-away should be:

Please make your examples work.

haf commented 2 years ago

This may be due to lack of RAM when compiling... I've tried this multiple times with one laptop, and it didn't work, but with another laptop it did. I'm going to close this as I zero in on the problem.

haf commented 2 years ago

Ok, so back to where I was; installing textile from scratch works, but not following the samples (react-native-hub-app)

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! threadsdb_app@0.0.1 ios: `react-native run-ios`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the threadsdb_app@0.0.1 ios script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.