Skip to content

Commit 0b6103b

Browse files
committedJan 31, 2024
cleanup readme
1 parent b5a5288 commit 0b6103b

File tree

1 file changed

+21
-89
lines changed

1 file changed

+21
-89
lines changed
 

‎README.md

+21-89
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ Encointer wallet and client for mobile phones
2222
## Overview
2323

2424
<p align="left">
25-
<img src="./app/fastlane/metadata/android/en-US/images/phoneScreenshots/1.png" width="32%">
26-
<img src="./app/fastlane/metadata/android/en-US/images/phoneScreenshots/2.png" width="32%">
27-
<img src="./app/fastlane/metadata/android/en-US/images/phoneScreenshots/3.png" width="32%">
25+
<img src="./fastlane/metadata/android/en-US/images/phoneScreenshots/1.png" width="32%">
26+
<img src="./fastlane/metadata/android/en-US/images/phoneScreenshots/2.png" width="32%">
27+
<img src="./fastlane/metadata/android/en-US/images/phoneScreenshots/3.png" width="32%">
2828
</p>
2929

3030
### Requirements
@@ -64,74 +64,53 @@ Now: run!
6464

6565
### Additional Info
6666

67+
#### Flutter wrapper and the .flutter git submodule
68+
6769
This project uses [flutter_wrapper](https://github.com/passsy/flutter_wrapper). Flutter wrapper is a tool that enables
6870
having the same flutter version across multiple developers. It installs automatically the flutter version form the
6971
pubspec.yml into the `.flutter` submodule.
7072

7173
Vscode automatically uses the `.flutter` as we have checked in the `.vscode` folder. For setting up the Android Studio,
7274
please refer to the [documentation](https://github.com/passsy/flutter_wrapper#ide-setup).
7375

74-
Further info can be found in the [Medium Article](https://passsy.medium.com/flutter-wrapper-bind-your-project-to-an-explicit-flutter-release-4062cfe6dcaf).
75-
76-
**Note:** On windows, Git fails to update the flutter submodule when it has been changed on remote. This can be fixed with:
77-
```shell
78-
git submodule update --init
79-
```
8076
#### Linux and MacOs
8177
Linux and MacOs users can simply replace all `flutter` CLI commands with `./flutterw` and it will just work.
8278

8379
#### Windows
84-
In windows, this does unfortunately not work, but you can still set up your IDE to use the flutter version in from the `.flutter` git submodule. And you can do the following workaround:
85-
86-
[Melos](https://melos.invertase.dev/) splitting up large code bases into separate independently versioned packages is extremely useful for code sharing. However, making changes across many repositories is messy and difficult to track, and testing across repositories gets complicated really fast.
87-
To solve these (and many other) problems, some projects will organize their code bases into multi-package repositories (sometimes called [monorepos](https://en.wikipedia.org/wiki/Monorepo)).
88-
89-
## Build js dependencies
90-
91-
Encointer wallet connects to the chains with [polkadot-js/api](https://polkadot.js.org/api/), running in a hidden webview.
92-
You'll need `Nodejs` and `yarn` installed to build the bundled `main.js` file:
93-
94-
See the js_service_encointer [Readme](app/js_service_encointer/README.md) for more documentation.
80+
In windows, this does unfortunately not work, but `.flutter` you can refer to the executables directly with:
81+
`./flutter/bin/flutter` and `./flutter/bin/dart`.
9582

83+
**Note:** On windows, Git fails to update the flutter submodule when it has been changed on remote. This can be fixed with:
9684
```shell
97-
melos yarn-build
98-
# windows
99-
pub global run melos yarn-build
85+
git submodule update --init
10086
```
87+
10188
### Run App
10289
Run Android platform
10390
```shell
104-
melos run-android
105-
# windows
106-
pub global run melos run-android
91+
./.flutter\bin\dart melos run run-android
10792
```
10893
Run IOS platform
10994
```shell
110-
melos run-ios
111-
# windows
112-
pub global run melos run-ios
95+
./.flutter\bin\dart run melos run-ios
11396
```
11497
If you have an AVD or real device attached, you can do
11598
```shell
116-
./flutterw run --flavor dev
99+
./.flutter\bin\flutter run --flavor dev
117100
```
118101
### Build APK
119102

120103
You may build the App with Flutter's [Deployment Documentation](https://flutter.dev/docs).
121104

122105
In order to build a fat APK, you can do
123106
```shell
124-
melos build-apk-fdroid
125-
# windows
126-
pub global run melos build-apk-fdroid
107+
.\.flutter\bin\dart run melos build-apk-fdroid
127108
```
128109
and find the output in `build/app/outputs/apk/fdroid/release/app-fdroid-release.apk`
129110

130111
For the play store, an appbundle is preferred:
131112
```shell
132-
melos build-appbundle
133-
# windows
134-
pub global run melos build-appbundle
113+
.\.flutter\bin\dart run melos build-appbundle
135114
```
136115
and find the output in `build/app/outputs/bundle/release/app-release.aab`
137116

@@ -147,28 +126,22 @@ The following file contains the supported flutter version:
147126
* run all tests from the command line:`./flutterw test`
148127
* exclude e2e-tests that need a running encointer node:
149128
```shell
150-
melos unit-test-app-exclude-encointer-node-e2e
129+
.\.flutter\bin\dart run melos unit-test-app-exclude-encointer-node-e2e
151130
```
152131
* run e2e-tests that need a running encointer node:
153132
```shell
154-
melos unit-test-app-with-encointer-node-e2e
155-
# windows
156-
pub global run melos unit-test-app-with-encointer-node-e2e
133+
.\.flutter\bin\dart run melos unit-test-app-with-encointer-node-e2e
157134
```
158135

159136
### Integration tests
160137
* run all integration tests in `test_driver` directory:
161138
Integration test app.dart for Android system
162139
```shell
163-
melos integration-app-test-android
164-
# windows
165-
pub global run melos integration-app-test-android
140+
.\.flutter\bin\dart run melos integration-app-test-android
166141
```
167142
Integration test app.dart for IOS system
168143
```shell
169-
melos integration-app-test-ios
170-
# windows
171-
pub global run melos integration-app-test-ios
144+
.\.flutter\bin\dart run melos integration-app-test-ios
172145
```
173146

174147
### Automated screenshots
@@ -177,45 +150,8 @@ pub global run melos integration-app-test-ios
177150
#### Android Studio
178151
To run the in Android Studio a build flavor must be specified. Go to Run/Debug configurations and add the build flavor `dev` in the appropriate field. Other available values are in the in the android/app/src/build.gradle file.
179152

180-
>Note that this project can be compiled both in Android and IOS,
181-
>But there is an Issue running it on an IOS simulator, that the
182-
>substrate `sr25519` keyPair is generated within an `WASM` virtual
183-
>machine which is **not supported** by IOS simulators.
184-
185153
## Developer Remarks
186154

187-
### Windows Local Dev-setup
188-
Setup to talk from emulators and/or cellphones with an encointer-node in the same local network. In windows 10/11 some
189-
OS fixes are needed to get this working. I don't know if all of these steps are required.
190-
191-
1. Make PC discoverable in local network.
192-
2. Enable inbound connections in windows firewall:
193-
* Search: `Windows Defender Firewall with Advanced Security`.
194-
* Inbound Rules > New Rule > Rule Type: Port > Tick TCP and specify the node's port, e.g. 9944.
195-
* Click next until finished and give the rule a distinct name, e.g. `Substrate Node`.
196-
* Double check if the rule is activated.
197-
3. Find your local IP in the network and enter it in the encointer-wallet's [config](https://github.com/encointer/encointer-wallet-flutter/blob/1abb8a1f54ef551f19598fb809dfd6378cf1ac43/lib/config/consts.dart#L16-L23).
198-
4. Restart the computer to be sure that the new configs are active.
199-
5. Run the node with the flags:
200-
```shell
201-
./target/release/encointer-node-notee --dev --enable-offchain-indexing true --rpc-methods unsafe -lencointer=debug --ws-external --rpc-external
202-
```
203-
204-
If the node is run in WSL2 (WSL1 should be fine), some extra steps are needed:
205-
206-
6. WSL2 does only expose ports on the local interface, which means they only listen to `127.0.0.1`, hence WSL2 can't be
207-
accessed on `hostname/-ip` on other devices in the LAN. This can be fixed with a simple tool [WSLHostPatcher](https://github.com/CzBiX/WSLHostPatcher).
208-
* Download the release.zip
209-
* Run `WSLHostPatcher.exe`
210-
* (Re-)start the service in WSL2. A firewall warning will pop-up the first time and access must be granted.
211-
212-
7. Now you should be able to access the node with both, the emulator and a cellphone in the local network.
213-
214-
**Note**: The `WSLHostPatcher.exe` must be run after every OS restart. You can automatically run it with the following steps:
215-
* Download the release.zip, unzip it and put it into the ProgramFiles folder, giving it a more suitable name.
216-
* Press `windows key + r` and type `shell:startup`.
217-
* Add a shortcut to the `WSLHostPatcher.exe` in the windows startup folder.
218-
219155
### Fmt
220156
`dartfmt` lacks config file support, which implies that customizations need to be done by users individually. The default
221157
limit of 80 characters line length conflicts with the deeply nested structure of flutter's declarative code for designing
@@ -227,9 +163,7 @@ length of the code to 120.
227163
* Format the whole codebase with:
228164
format all Dart code
229165
```shell
230-
melos format
231-
# windows
232-
pub global run melos format
166+
.\.flutter\bin\dart run melos format
233167
```
234168

235169
#### Other fmt hints:
@@ -244,9 +178,7 @@ e.g. `@JsonSerializable` or the mobx annotations. Whenever annotations are added
244178
command must be run to update the `*.g` files.
245179

246180
```shell
247-
melos run-build-runner
248-
# windows
249-
pub global run melos run-build-runner
181+
.\.flutter\bin\dart run melos run-build-runner
250182
```
251183

252184
## GitHub Actions Hints

0 commit comments

Comments
 (0)