Skip to content

Commit

Permalink
README updated as per Jan 28th src code updates
Browse files Browse the repository at this point in the history
Video guidelines and configuration steps added.
  • Loading branch information
simbadMarino authored Jan 29, 2022
1 parent cb07da4 commit 2b857f2
Showing 1 changed file with 36 additions and 14 deletions.
50 changes: 36 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ As a Google Play / F-Droid version is not ready yet you will need to install dCl

**a) Compiling from Android Studio by cloning this repo and performing the following actions:**

1. Perform a `yarn install` in the dCloud root folder to install ALL react-native dependencies ( "react": "16.13.1","react-native": "0.63.4" versions were tested and currently working, any other version might have some unknown issues)
1. Perform a `yarn install` in the dCloud root folder to install ALL react-native dependencies ( "react": "16.13.1" OR "17.0.2","react-native": "0.63.4" OR "0.67.1" versions were tested and currently working, any other version might have some unknown issues)
2. Open the android project using Android Studio and select updatedDebug or updatedRelease![image](https://user-images.githubusercontent.com/11146636/137638913-77649e84-cfca-4cd0-aa4a-214ac6114263.png)

3. Perform a "make project" to verify all dependencies are available and configured.
Expand Down Expand Up @@ -65,52 +65,74 @@ In order to upload files to BTFS1 you need to transfer OLDBTT tokens to your TRO
5. Switch to Files tab
6. Select the desired file and wait for the upload to finish.

![deposit_BTFS](https://user-images.githubusercontent.com/11146636/151491882-ee693fa6-ba9c-47e3-99d4-f66da8af037a.gif)
![BTFS_deposit_loading](https://user-images.githubusercontent.com/11146636/151491913-be4468bd-839b-42aa-8106-a9c521e9cd27.gif)
![dCloud_uploadAndErase](https://user-images.githubusercontent.com/11146636/151491938-b93066f4-d834-48f0-a1bf-8b58d54bbe54.gif)
After this please restart your dCloud app and the GUI should show you the Host UI and your current balance in the Renter tab. From here you can use your app as a full BTFS node.

Above steps are ilustrated in the following videos:

https://user-images.githubusercontent.com/11146636/151635921-921235fa-4cf6-4897-8b70-6670563d2983.mp4


https://user-images.githubusercontent.com/11146636/151636837-2d5acae1-2373-4d85-83ae-d52f5327bbbd.mp4



https://user-images.githubusercontent.com/11146636/151637957-4f082c4e-c7cd-4c67-a309-53ce81888a35.mp4




*Troubleshooting*

- If the upload keeps failing it is possible your Internet Service Provider(ISP) is blocking P2P uploads, use a VPN to overcome this situation or change your ISP.
- If balance erros appear during the upload you can verify on the terminal window to check if TronGrid is down, if that's the case you'll need to wait for some time and then try again.

Optionally, if you already have a private key with some BTT do the following instead:
Optionally, if you already have a private key with some BTT do the following instead to import it:

1. `btfs init -i "PASTE_YOUR_PRIVATE_KEY_HERE"`
2. `btfs wallet password "YOUR_PASSWORD_HERE_NO_SPECIAL_CHARACTERS_ALLOWED"`
3. `btfs daemon`


Steps to use use BTFS2:

WARNING: Currently only BTFS 1 is able to interact with the storage User Interface, BTFS2 is not yet integrated, if you want to experiment with BTFS2 make sure to BACKUP your Mnemonic/Private Key and CIDs of your already uploaded files. If something goes wrong the dCloud team will not be able to retrieve your private key/mnemonic neither your uploaded files. Also consider BTFS binaries use the same PATH for the repo and other configurations might be interfering. It is recommended not to use both BTFS versions at the same time, if you know what your doing proceed with caution.

1. Open the terminal windoe within dCloud
2. Run the following command to initialize BTFS 2.0 `btfs2 init` it will automatically select the test network.
3. `btfs2 daemon`
4. Fill your BTFS node wallet with test tokens requesting them at: https://testfaucet.bt.io/#/
5. Once your node detects enough balance is available in your wallet it will start daemon.
6. Follow the official guidelines (https://docs.btfs.io/v2.0/docs/introduction-setup20) to explore the use cases of BTFS 2.0 in your mobile device. So far I tested the storage side and its working as expected
7. The Renter feature of BTFS requires WBTT(BTTC) besides BTT(BTTC) which you can request as specified in: https://github.com/bittorrent/go-btfs/issues/43#issuecomment-1018025697





Note: Currently only BTFS 1 is able to interact with the storage User Interface, BTFS2 is not yet integrated, if you want to experiment with BTFS2 make sure to BACKUP your Mnemonic/Private Key and CIDs of your already uploaded files. If something goes wrong the dCloud team will not be able to retrieve your private key/mnemonic neither your uploaded files.




After this please restart your dCloud app and the GUI should show you the Host UI and your current balance in the Renter tab. From here you can use your app as a full BTFS node.

**HOW TO BUILD CUSTOM BOOTSTRAP PACKAGE FOR ANDROID 10 (EXPERIMENTAL procedure credit goes to: agnostic-apollo from Termux)**

This method is currently under experimental usage, there is not guarantee this will work forever.

`build-bootstraps.sh` script locally cross-compile the bootstrap package debs and create bootstrap zips. It is working for a different PREFIX to be ported to the official termux app without reworing termux code. On-device (termux in mobile) builds are not supported currently, so use PC (cross-compile in docker).

Firstly, you need to pull the latest changes from [termux-packages](https://github.com/termux/termux-packages) repo, I just committed some stuff. (package source urls got outdated since old versions were removed by respective hosters)
Firstly, you need to pull the latest changes from [termux-packages](https://github.com/termux/termux-packages) repo.

Then

1. Set the TERMUX_APP_PACKAGE value in properties.sh to your app's package name.
1. Set the TERMUX_APP_PACKAGE value in properties.sh to your app's package name ("com.justshare" for dCloud).
2. Place the [build-bootstraps.zip](https://github.com/simbadMarino/dCloud/files/7174712/build-bootstraps.zip)
in termux-packages/scripts directory.
3. Run cd termux-packages
4. Run ./scripts/run-docker.sh ./scripts/build-bootstraps.sh &> build.log to compile for all archs. You should find the bootstrap-*.zip in the termux-packages directory. If you want to compile only for a specific arch like aarch64, then run ./scripts/run-docker.sh ./scripts/build-bootstraps.sh --architectures aarch64 &> build.log. You can pass additional comma-separated list of packages that should be included in the bootstrap in addition to the default ones with the -add option.
5. Replace/place the zips in termux-app/app/src/main/cpp.
6. Add a return statement at start of downloadBootstrap() function in termux-app/app/build.gradle so that the custom bootstrap-*.zip files don't get replaced with termux ones.
7. Then build an APK.
4. Run ./scripts/run-docker.sh ./scripts/build-bootstraps.sh --android10 -f -a btfs,btfs2 &> build.log to compile for all archs. You should find the bootstrap-*.zip in the termux-packages directory. If you want to compile only for a specific arch like aarch64, then run ./scripts/run-docker.sh ./scripts/build-bootstraps.sh --android10 --architectures aarch64 -f -a btfs,btfs2 &> build.log.
5. Replace/place the zips in termux-app/app/src/main/cpp and make sure BTFS bootstrap release packages URLs are updated in the source code: https://github.com/simbadMarino/dCloud/blob/cb07da42d25afe7e2120c6ca10bb0be6d327797e/android/app/build.gradle#L397 as well as their sha256 checksums at: https://github.com/simbadMarino/dCloud/blob/cb07da42d25afe7e2120c6ca10bb0be6d327797e/android/app/build.gradle#L430
6. Then build an APK.

**Note:**
It would be better if you run ./clean.sh before building for a different prefix to start fresh, or pass -f option to build-bootstraps.sh script at least once (for each arch).

If you get curl: (18) transfer closed with x bytes remaining to read. while running build-bootstraps.sh when its downloading a package source, then just run the script again, it should hopefully work.

Expand Down

0 comments on commit 2b857f2

Please sign in to comment.