Ğ1nkgo
Ğ1nkgo (aka Ginkgo) is a lightweight Ğ1 wallet for Duniter v1 written in Flutter. The app allows users to manage their Ğ1 currency on their mobile device using just a browser.
Features
- Introduction for beginners
- Generation of Cesium wallet and persistence (if you refresh the page, it should display the same wallet address).
- A point-of-sale device that generates a QR code for the public address and other QR codes with amounts (which lightweight wallets will understand).
- Send Ğ1 transactions
- Transactions history page and Balance with persistence to load last transactions on boot
- Contact management and cache (to avoid too much API petitions)
- Internationalization (i18n)
- QR code reader
- Import/export of your wallet
- Automatic discover and selection of nodes, error recovery & retry
- Customizable via env file
- Inline tutorials
- Pagination of transactions
- Some contextual help (for example, by tapping on "Validity").
Screenshots
Wallet | Terminal card |
---|---|
![]() |
![]() |
Demo
This is a demo used for testing a development, please use a production server for stability:
Ğ1nkgo in production
Translations
First of all, you can contribute translating Ğ1nkgo to your language:
https://weblate.duniter.org/projects/g1nkgo/g1nkgo/
Docker
mkdir -p ~/.ginkgo/nginx-conf mkdir -p ~/.ginkgo/www
Dev contributions
Prerequisites
This repository requires Flutter to be installed and present in your development environment.
Clone the project and enter the project folder.
git clone https://git.duniter.org/vjrj/ginkgo.git
cd ginkgo
Get the dependencies.
flutter pub get
Launch all the tests
flutter test
Build & deploy
Build for web
Use first this command to enable web support:
flutter config --enable-web
Then, build the app:
flutter build web --no-tree-shake-icons
NB: Add --release
for a production build.
If you are using a web browser different from Chrome, you should first find your browser's executable (example for Brave):
which brave-browser
Then, you should add the executable path to the environment variable CHROME_EXECUTABLE
by typing the following command:
export CHROME_EXECUTABLE=/usr/bin/brave-browser
NB: This is a temporary solution that will be reset when you close your terminal. If you want to make it permanent, you should add this variable to your .bashrc
or .zshrc
file:
nano ~/.bashrc
Then, add the following line at the end of the file:
export CHROME_EXECUTABLE=/usr/bin/brave-browser
Finally, reload your terminal:
source ~/.bashrc
Build and deploy to your server
rsync --progress=info2 --delete -aH build/web/ youruser@yourserver:/var/www/ginkgo/
Run dev environment
Run the app via command line or through your development environment. It will run the default built version.
flutter run
NB: If there are more than one built version, there will be a prompt asking for the version you want to use (for example, web or desktop)
If you want to directly run a specific version (for example, the web version), use:
flutter run -d "chrome"
In order to do gva operations, you should disable cors in the flutter run config:
--web-browser-flag "--disable-web-security"
Easy Localization
To add translations, add a .json translation file in the assets/translations
folder, by prefixing the file with the language code (for example, en.json
for English).
The file should be in the format:
{
"key": "value"
}
Then, add the language in the main.dart file:
supportedLocales: const <Locale>[
Locale('en', ''),
],
Go to ios/Runner/Info.plist and update the following code adding the language:
<key>CFBundleLocalizations</key>
<array>
<string>en</string>
</array>
Finally, add the language to the User Interface in the screen file:
DropdownMenuItem<Locale>(
value: Locale('en'),
child: Text('English'),
),
Troubleshooting
- If you cannot build the app, try to run
flutter clean
and thenflutter pub get
. - If it still doesn't work, try to delete the
build
folder and runflutter pub get
again. - At least, you can try to run
flutter pub upgrade
to upgrade all the dependencies. - And in last resort, you can try to delete the
pubspec.lock
file and runflutter pub get
again. - Finally, there is a troubleshooting command in flutter:
flutter doctor -v
.
Credits
Translations
- ast: dixebral
- ca: calbasi
- de: FW
- eo: flodef
- eu: Anna Ayala Alcalá
- fr: flodef, Hugo, Maaltir, poka and vincentux
- gl: Vijitâtman
- it: Anna Ayala Alcalá
- nl: Maria Rosa Costa i Alandi
- pt: Carlos Neto
Thanks!
Others
- Ğ1 logos from duniter.org
- undraw intro images: https://undraw.co/license
- Chipcard https://commons.wikimedia.org/wiki/File:Chipcard.svg under the Creative Commons Attribution-Share Alike 3.0 Unported license.
- POS svg from wikimedia CC-BY-SA 4.0
Pub packages used
This repository makes use of the following pub packages:
Package | Version | Usage |
---|---|---|
Durt | ^0.1.6 | Duniter crypto lib |
Bloc | ^8.1.0 | State management |
Flutter Bloc | ^8.1.1 | State management |
Hydrated Bloc | ^9.0.0 | Persists Bloc state with Hive |
Equatable | ^2.0.5 | Easily compare custom classes, used for Bloc states* |
Flutter Lints | ^2.0.1 | Stricter linting rules |
Path Provider | ^2.0.11 | Get the save path for Hive |
Flutter Displaymode | ^0.5.0 | Support high refresh rate displays |
Easy Localization | ^3.0.1 | Makes localization easy |
Hive | ^2.2.3 | Platform independent storage. |
Url Launcher | ^6.1.7 | Open urls in Browser |
Ionicons | ^0.2.2 | Modern icon library |
Thanks!
License
GNU AGPL v3 (see LICENSE)