Compare commits

...

82 Commits

Author SHA1 Message Date
fuwa 628b713f24 release: 0.9.5.1
3 years ago
fuwa 9a6665bca8 update ndk
3 years ago
fuwa c3d418e326 release: v0.9.4.4
3 years ago
fuwa d96991a4fe use ninja build
3 years ago
fuwa 2fcf59fa38 release v0.9.3.5
3 years ago
fuwa 41fcb692fd update to v0.9.3.5
3 years ago
fuwa eb08fe1dcc update to v0.9.3.2
3 years ago
fuwa c023a25a1e release v0.9.3.1
3 years ago
fuwa 6dd63978ba release: v0.9.2.7
3 years ago
fuwa ac4342c430 update to lolnero v0.9.2.7
3 years ago
fuwa b36a82607e boost: do not build datetime
3 years ago
fuwa 671fd96bbb update lolnero to v0.9.2.2
3 years ago
fuwa 4df69a8f25 update lolnero to v0.9.2.0
3 years ago
fuwa ee0bc769a7 update lolnero to v0.9.1.7
3 years ago
fuwa 35df36221e update lolnero to v0.9.1.6
3 years ago
fuwa 481ed5c4ea release: v0.9.1.2:44
3 years ago
fuwa e5549769b1 update deps
3 years ago
fuwa cdc97eee50 update to ndk-r23-beta2
3 years ago
fuwa cd24088714 release: v0.9.0.1-43
3 years ago
fuwa 7c6d19c7e3 null safety 3
3 years ago
fuwa a6e1659db5 null safety 2
3 years ago
fuwa c2830ced7b null safety 1
3 years ago
fuwa c63408a957 add more tick to slow down rpc requests
3 years ago
fuwa 7c3f361135 release: v0.9.0.1
3 years ago
fuwa 9bef2280f2 use lolnero v0.9.0.1
3 years ago
fuwa e12e5d5e4f use lolnero v0.9.0.0
3 years ago
fuwa 7303c7374c release v0.8.3.8-41
3 years ago
fuwa ed1ab4efd1 add peerMinimumConnectedTime
3 years ago
fuwa c0fb0a6dc4 release v0.8.3.8-1
3 years ago
fuwa 314934be11 use jdk8 for sdk-manager
3 years ago
fuwa dba7f3f858 update pub lock
3 years ago
fuwa d37563baa8 release v0.8.3.8
3 years ago
fuwa ab3389beac migrate flutter 2
3 years ago
fuwa 0ee59a1f30 use lolnero-node
3 years ago
fuwa 4986583ae4 boost: less modules
3 years ago
fuwa c2553850eb release v0.8.3.5
3 years ago
fuwa 517c9fb3d5 use v0.8.3.5
3 years ago
fuwa 2de8ea1836 clean up some echo
3 years ago
fuwa 4266334d32 update to v0.8.3.4
3 years ago
fuwa 0619ad667a smaller terminal fonts
3 years ago
fuwa a1718f2bd5 release: v0.8.3.1
3 years ago
fuwa 93e8065c24 use latest cmake, ndk and lolnero
3 years ago
fuwa 5e34574b74 update to v0.6.2.8
3 years ago
fuwa 12f2aee882 remove custom logging args, since these are default now
3 years ago
fuwa 882ae9a5b6 update boost dep
3 years ago
fuwa a9976035f7 do not build unused boost
3 years ago
fuwa 2e79c61531 do not display pruning_seed
3 years ago
fuwa 282f769ee7 update version
3 years ago
fuwa 9f8b86a6be up version
3 years ago
fuwa ba406e286e explicitly disable readline
3 years ago
fuwa 362d3aceb9 update ndk
3 years ago
fuwa e871b91ddf update version
3 years ago
fuwa 9ff33aa4a1 up version
3 years ago
fuwa dec7da1d59 fix use release build
3 years ago
fuwa a547561a66 update lol ver
3 years ago
fuwa d8cf0f0872 update version
3 years ago
fuwa 77f713b51d use version tag
3 years ago
fuwa b7dc13539f update cmake args
3 years ago
fuwa e5864309a2 update version
3 years ago
fuwa db5acac856 do not mess with keyboard
3 years ago
fuwa 965bd60d91 refactor state
3 years ago
fuwa 2aa380a143 update android sdk version
3 years ago
fuwa 55ece76998 update lolnero version
4 years ago
fuwa 0a9ba1fb06 more lint
4 years ago
fuwa 77bc2369f2 use L node in theme
4 years ago
fuwa 96b20933c2 use modern theme
4 years ago
fuwa 72fb69a512 lint
4 years ago
fuwa 7f37f554ef remove test
4 years ago
fuwa 2f8f98c59d update sdk version
4 years ago
fuwa 79adc83caf pub: update dependencies
4 years ago
fuwa 79af95aac7 flutter: update package
4 years ago
fuwa 1219ad6f90 update lolnerod
4 years ago
fuwa f5a072c655 update version
4 years ago
fuwa c558e17885 add collect raw task
4 years ago
fuwa b01b0fe5c5 fix readme
4 years ago
fuwa 91e26d4e11 update readme
4 years ago
fuwa 9e5b350b27 fix version
4 years ago
fuwa fcd72d1fa9 lol: rebrand: gui
4 years ago
fuwa 5a6173d7f3 lol: build: build lolnero
4 years ago
fuwa a27a76ca0a update nix source
4 years ago
fuwa 3499b96a1c remove gui libs for jdk
4 years ago
fuwa f56382ad73 fix jdk
4 years ago

@ -1,4 +1,4 @@
# Copyright (c) 2019, The Wownero Project
# Copyright (c) 2019, The Lolnero Project
#
# All rights reserved.
#
@ -30,47 +30,47 @@
.PHONY: toolchain clean
clean:
-rm -f ./cyberwow/android/app/src/main/jniLibs/arm64-v8a/*.so
cd cyberwow && \
-rm -f ./lolnode/android/app/src/main/jniLibs/arm64-v8a/*.so
cd lolnode && \
flutter clean
watch:
find cyberwow/lib/ -name '*.dart' | \
find lolnode/lib/ -name '*.dart' | \
entr kill -USR1 `cat /tmp/flutter.pid`
watch-build:
find cyberwow/lib/ -name '*.dart' | \
find lolnode/lib/ -name '*.dart' | \
entr $(MAKE) build-debug
run:
cd cyberwow && \
cd lolnode && \
flutter run --debug --pid-file /tmp/flutter.pid
run-release:
cd cyberwow && \
cd lolnode && \
flutter run --release --pid-file /tmp/flutter.pid
build:
cd cyberwow && \
cd lolnode && \
flutter build apk --target-platform android-arm64
build-bundle:
cd cyberwow && \
cd lolnode && \
flutter build appbundle --target-platform android-arm64
build-debug:
cd cyberwow && \
cd lolnode && \
flutter build appbundle --debug --target-platform android-arm64
install: build
cd cyberwow && \
cd lolnode && \
flutter install
# build wownero android binary
# build lolnero android binary
script := etc/scripts/build-external-libs
wow: clean-external-libs collect-wownero build
lol: clean-external-libs collect-lolnero build
clean-external-libs:
$(script)/clean.sh
@ -78,11 +78,7 @@ clean-external-libs:
toolchain:
$(script)/toolchain/import.sh
iconv: toolchain
$(script)/iconv/fetch.sh
$(script)/iconv/build.sh
boost: iconv
boost:
$(script)/boost/fetch.sh
$(script)/boost/build.sh
@ -94,15 +90,21 @@ sodium: toolchain
$(script)/sodium/fetch.sh
$(script)/sodium/build.sh
toolchain-wow:
$(script)/toolchain-wow/import.sh
$(script)/toolchain-wow/patch.sh
toolchain-lol:
$(script)/toolchain-lol/import.sh
lolnero: openssl boost sodium toolchain-lol
$(script)/lolnero/fetch.sh
$(script)/lolnero/build.sh
wownero: openssl boost sodium toolchain-wow
$(script)/wownero/fetch.sh
$(script)/wownero/build.sh
lolnero-raw:
$(script)/lolnero/fetch.sh
$(script)/lolnero/build.sh
collect-lolnero: lolnero
$(script)/collect.sh
collect-wownero: wownero
collect-lolnero-raw: lolnero-raw
$(script)/collect.sh
# etc

@ -1,25 +1,12 @@
# CyberWOW
# Lolnero node
A dumb android pruned full node for Wownero.
A mobile node for Loloero.
[<img src="https://f-droid.org/badge/get-it-on.png"
alt="Get it on F-Droid"
height="80">](https://f-droid.org/en/packages/org.wownero.cyberwow/)
<a href='https://play.google.com/store/apps/details?id=org.wownero.cyberwow'><img alt='Get it on Google Play' src='https://play.google.com/intl/en_us/badges/images/generic/en_badge_web_generic.png' height='80'/></a>
<a href='https://play.google.com/store/apps/details?id=org.lolnero.node'><img alt='Get it on Google Play' src='https://play.google.com/intl/en_us/badges/images/generic/en_badge_web_generic.png' height='80'/></a>
## How to build
An example build script that works on an F-droid build server, which is based on debian stable, is here:
<https://gitlab.com/fdroid/fdroiddata/-/raw/master/metadata/org.wownero.cyberwow.yml>
## How to use custom start up arguments
Sending the arguments to an unopened CyberWOW app will cause `wownerod` to use them on start up, for example:
Sending the arguments to an unopened lolnero node app will cause `lolnerod` to use them on start up, for example:
`--add-exclusive-node 192.168.1.3`
## F-droid build status
<https://f-droid.org/wiki/page/org.wownero.cyberwow/lastbuild>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 MiB

@ -1,66 +0,0 @@
/*
Copyright 2019 fuwa
This file is part of CyberWOW.
CyberWOW is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
CyberWOW is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with CyberWOW. If not, see <https://www.gnu.org/licenses/>.
*/
import 'package:shared_preferences/shared_preferences.dart';
import '../config.dart' as config;
import '../logging.dart';
import '../helper.dart';
import 'prototype.dart';
import 'syncing.dart';
class LoadingState extends AppState {
final String banner;
String status = '';
LoadingState(appHook, this.banner) : super (appHook);
void append(final String msg) {
this.status += msg;
syncState();
}
Future<SyncingState> next() async {
Future<void> showBanner() async {
final Iterable<String> chars = banner.runes.map((x) => String.fromCharCode(x));
for (final String char in chars) {
append(char);
await Future.delayed(Duration(milliseconds: config.c.splashDelay));
}
await tick();
await tick();
}
SharedPreferences _prefs = await SharedPreferences.getInstance();
final _bannerShown = await _prefs.getBool(config.bannerShownKey);
if (_bannerShown == null) {
await showBanner();
await _prefs.setBool(config.bannerShownKey, true);
}
SyncingState _next = SyncingState(appHook);
return moveState(_next);
}
}

@ -1,47 +0,0 @@
/*
Copyright 2019 fuwa
This file is part of CyberWOW.
CyberWOW is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
CyberWOW is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with CyberWOW. If not, see <https://www.gnu.org/licenses/>.
*/
import 'package:flutter/material.dart';
typedef SetStateFunc = void Function(AppState);
typedef GetNotificationFunc = AppLifecycleState Function();
typedef IsExitingFunc = bool Function();
class AppHook {
final SetStateFunc setState;
final GetNotificationFunc getNotification;
final IsExitingFunc isExiting;
AppHook(this.setState, this.getNotification, this.isExiting);
}
class AppState {
final AppHook appHook;
AppState(this.appHook);
syncState() {
appHook.setState(this);
}
AppState moveState(AppState _next) {
appHook.setState(_next);
return _next;
}
}

@ -1,101 +0,0 @@
/*
Copyright 2019 fuwa
This file is part of CyberWOW.
CyberWOW is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
CyberWOW is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with CyberWOW. If not, see <https://www.gnu.org/licenses/>.
*/
import 'dart:async';
import 'dart:collection';
import '../logic/controller/refresh.dart' as refresh;
import '../logic/sensor/rpc/rpc.dart' as rpc;
import '../logic/sensor/daemon.dart' as daemon;
import '../config.dart' as config;
import '../logging.dart';
import 'prototype.dart';
import 'synced.dart';
import 'exiting.dart';
class ReSyncingState extends AppState {
final Queue<String> stdout;
final StreamSink<String> processInput;
final Stream<String> processOutput;
final int pageIndex;
bool synced = false;
ReSyncingState(appHook, this.stdout, this.processInput, this.processOutput, this.pageIndex)
: super (appHook);
void append(final String msg) {
stdout.addLast(msg);
while (stdout.length > config.stdoutLineBufferSize) {
stdout.removeFirst();
}
syncState();
}
Future<AppState> next() async {
log.fine("ReSyncing next");
Future<void> printStdout() async {
await for (final line in processOutput) {
if (synced) break;
// print('re-syncing: print stdout loop');
append(line);
log.info(line);
}
}
Future<void> checkSync() async {
await for (final _null in refresh.pull(appHook.getNotification, 'ReSyncingState')) {
if (appHook.isExiting()) {
log.fine('ReSyncing state detected exiting');
break;
}
if (await daemon.isSynced()) {
synced = true;
break;
}
// print('re-syncing: checkSync loop');
}
}
printStdout();
await checkSync();
if (appHook.isExiting()) {
ExitingState _next = ExitingState
(
appHook, stdout, processOutput
);
return moveState(_next);
}
log.fine('resync: await exit');
SyncedState _next = SyncedState
(
appHook, stdout, processInput, processOutput, pageIndex
);
_next.height = await rpc.height();
return moveState(_next);
}
}

@ -1,161 +0,0 @@
/*
Copyright 2019 fuwa
This file is part of CyberWOW.
CyberWOW is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
CyberWOW is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with CyberWOW. If not, see <https://www.gnu.org/licenses/>.
*/
import 'dart:async';
import 'dart:collection';
import 'package:flutter/material.dart';
import '../config.dart' as config;
import '../logic/sensor/daemon.dart' as daemon;
import '../logic/controller/refresh.dart' as refresh;
import '../logic/sensor/rpc/rpc.dart' as rpc;
import '../logic/sensor/rpc/rpc2.dart' as rpc;
import '../logic/view/rpc/rpc2.dart' as rpc2View;
import '../logic/view/rpc/rpc.dart' as rpcView;
import '../helper.dart';
import '../logging.dart';
import 'prototype.dart';
import 'resyncing.dart';
import 'exiting.dart';
class SyncedState extends AppState {
final Queue<String> stdout;
final StreamSink<String> processInput;
final Stream<String> processOutput;
final TextEditingController textController = TextEditingController();
int height;
bool synced = true;
bool userExit = false;
bool connected = true;
Map<String, dynamic> getInfo = {};
List<Map<String, dynamic>> getConnections = [];
List<Map<String, dynamic>> getTransactionPool = [];
int pageIndex;
String syncInfo = 'syncInfo';
PageController pageController;
String getInfoCache = '';
String getConnectionsCache = '';
String getTransactionPoolCache = '';
SyncedState(appHook, this.stdout, this.processInput, this.processOutput, this.pageIndex)
: super (appHook) {
pageController = PageController( initialPage: pageIndex );
}
void appendInput(final String line) {
stdout.addLast(config.c.promptString + line);
syncState();
processInput.add(line);
if (line == 'exit') {
userExit = true;
}
}
void append(final String msg) {
stdout.addLast(msg);
while (stdout.length > config.stdoutLineBufferSize) {
stdout.removeFirst();
}
syncState();
}
void onPageChanged(int value) {
this.pageIndex = value;
}
Future<AppState> next() async {
log.fine("Synced next");
Future<void> logStdout() async {
await for (final line in processOutput) {
if (!synced) break;
// print('synced: print stdout loop');
append(line);
log.info(line);
}
}
logStdout();
Future<void> checkSync() async {
await for (final _null in refresh.pull(appHook.getNotification, 'syncedState')) {
if (appHook.isExiting() || userExit) {
log.fine('Synced state detected exiting');
break;
}
if (await daemon.isNotSynced()) {
synced = false;
break;
}
// log.finer('SyncedState: checkSync loop');
height = await rpc.height();
connected = await daemon.isConnected();
getInfo = await rpc.getInfoSimple();
final _getInfoView = cleanKey(rpcView.getInfoView(getInfo));
getInfoCache = pretty(_getInfoView);
getConnections = await rpc.getConnectionsSimple();
final List<Map<String, dynamic>> _getConnectionsView =
getConnections
.map(rpcView.getConnectionView)
.map((x) => rpcView.simpleHeight(height, x))
.map(cleanKey)
.toList();
getConnectionsCache = pretty(_getConnectionsView);
getTransactionPool = await rpc.getTransactionPoolSimple();
final List<Map<String, dynamic>> _getTransactionPoolView =
getTransactionPool.map(rpc2View.txView).map(cleanKey).toList();
getTransactionPoolCache = pretty(_getTransactionPoolView);
syncState();
}
}
await checkSync();
if (appHook.isExiting() || userExit) {
ExitingState _next = ExitingState
(
appHook, stdout, processOutput
);
return moveState(_next);
}
log.fine('synced: loop exit');
ReSyncingState _next = ReSyncingState
(
appHook, stdout, processInput, processOutput, pageIndex
);
return moveState(_next);
}
}

@ -1,111 +0,0 @@
/*
Copyright 2019 fuwa
This file is part of CyberWOW.
CyberWOW is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
CyberWOW is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with CyberWOW. If not, see <https://www.gnu.org/licenses/>.
*/
import 'dart:async';
import 'dart:collection';
import '../logic/sensor/rpc/rpc.dart' as rpc;
import '../logic/sensor/daemon.dart' as daemon;
import '../logic/controller/refresh.dart' as refresh;
import '../config.dart' as config;
import '../logging.dart';
import 'prototype.dart';
import 'synced.dart';
import 'exiting.dart';
class SyncingState extends AppState {
final Queue<String> stdout = Queue();
bool synced = false;
SyncingState(appHook) : super (appHook);
void append(final String msg) {
stdout.addLast(msg);
while (stdout.length > config.stdoutLineBufferSize) {
stdout.removeFirst();
}
syncState();
}
Future<AppState> next
(
StreamSink<String> processInput, Stream<String> processOutput
) async {
log.fine("Syncing next");
Future<void> printStdout() async {
await for (final line in processOutput) {
if (synced) break;
log.finest('syncing: print stdout loop');
append(line);
log.info(line);
}
}
Future<void> checkSync() async {
await for (final _null in refresh.pull(appHook.getNotification, 'syncingState')) {
log.finer('SyncingState: checkSync loop');
if (appHook.isExiting()) {
log.fine('Syncing state detected exiting');
break;
}
// here doc is wrong, targetHeight could match height when synced
// potential bug, targetHeight could be smaller then height
final _isConnected = await daemon.isConnected();
final _isSynced = await daemon.isSynced();
if (_isConnected && _isSynced) {
synced = true;
break;
}
}
}
printStdout();
await checkSync();
if (appHook.isExiting()) {
ExitingState _next = ExitingState
(
appHook, stdout, processOutput
);
return moveState(_next);
}
log.fine('syncing: loop exit');
// processInput.add('exit');
final _height = await rpc.height();
SyncedState _next = SyncedState
(
appHook, stdout, processInput, processOutput, 1,
);
_next.height = _height;
return moveState(_next);
}
}

@ -1,30 +0,0 @@
// This is a basic Flutter widget test.
//
// To perform an interaction with a widget in your test, use the WidgetTester
// utility that Flutter provides. For example, you can send tap and scroll
// gestures. You can also use WidgetTester to find child widgets in the widget
// tree, read text, and verify that the values of widget properties are correct.
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:cyberwow/main.dart';
void main() {
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
// Build our app and trigger a frame.
await tester.pumpWidget(MyApp());
// Verify that our counter starts at 0.
expect(find.text('0'), findsOneWidget);
expect(find.text('1'), findsNothing);
// Tap the '+' icon and trigger a frame.
await tester.tap(find.byIcon(Icons.add));
await tester.pump();
// Verify that our counter has incremented.
expect(find.text('0'), findsNothing);
expect(find.text('1'), findsOneWidget);
});
}

@ -0,0 +1,87 @@
{ lib, stdenv, fetchurl, fetchpatch, curl, expat, zlib, bzip2
, useNcurses ? false, ncurses, useQt4 ? false, qt4, ps
}:
with lib;
assert stdenv ? cc;
assert stdenv.cc ? libc;
let
os = lib.optionalString;
majorVersion = "2.8";
minorVersion = "12.2";
version = "${majorVersion}.${minorVersion}";
in
stdenv.mkDerivation rec {
name = "cmake-${os useNcurses "cursesUI-"}${os useQt4 "qt4UI-"}${version}";
inherit majorVersion;
src = fetchurl {
url = "${meta.homepage}files/v${majorVersion}/cmake-${version}.tar.gz";
sha256 = "0phf295a9cby0v7zqdswr238v5aiy3rb2fs6dz39zjxbmzlp8rcc";
};
enableParallelBuilding = true;
patches =
[(fetchpatch { # see https://www.cmake.org/Bug/view.php?id=13959
name = "FindFreetype-2.5.patch";
url = "https://public.kitware.com/Bug/file/4660/0001-Support-finding-freetype2-using-pkg-config.patch";
sha256 = "136z63ff83hnwd247cq4m8m8164pklzyl5i2csf5h6wd8p01pdkj";
})] ++
# Don't search in non-Nix locations such as /usr, but do search in our libc.
[ ./search-path-2.8.patch ] ++
optional (stdenv.hostPlatform != stdenv.buildPlatform) (fetchurl {
name = "fix-darwin-cross-compile.patch";
url = "https://public.kitware.com/Bug/file_download.php?"
+ "file_id=4981&type=bug";
sha256 = "16acmdr27adma7gs9rs0dxdiqppm15vl3vv3agy7y8s94wyh4ybv";
});
postPatch = ''
substituteInPlace Utilities/cmlibarchive/CMakeLists.txt \
--replace '"-framework CoreServices"' '""'
'';
buildInputs = [ setupHook curl expat zlib bzip2 ]
++ optional useNcurses ncurses
++ optional useQt4 qt4;
propagatedBuildInputs = [ ps ];
CMAKE_PREFIX_PATH = concatStringsSep ":"
(concatMap (p: [ (p.dev or p) (p.out or p) ]) buildInputs);
configureFlags = [
"--docdir=/share/doc/${name}"
"--mandir=/share/man"
"--system-libs"
"--no-system-libarchive"
] ++ lib.optional useQt4 "--qt-gui";
setupHook = ./setup-hook.sh;
dontUseCmakeConfigure = true;
preConfigure = with stdenv; ''
fixCmakeFiles .
substituteInPlace Modules/Platform/UnixPaths.cmake \
--subst-var-by libc_bin ${getBin cc.libc} \
--subst-var-by libc_dev ${getDev cc.libc} \
--subst-var-by libc_lib ${getLib cc.libc}
configureFlags="--parallel=''${NIX_BUILD_CORES:-1} $configureFlags"
'';
hardeningDisable = [ "format" ];
meta = {
homepage = "https://cmake.org";
description = "Cross-Platform Makefile Generator";
platforms = if useQt4 then qt4.meta.platforms else lib.platforms.unix;
maintainers = with lib.maintainers; [ xfix ];
license = lib.licenses.bsd3;
};
}

@ -0,0 +1,274 @@
--- cmake-3.2.2/Source/cmFileCommand.cxx 2015-04-13 19:09:00.000000000 +0200
+++ cmake-3.2.2/Source/ccmFileCommand.cxx 2015-06-10 11:02:27.345598700 +0200
@@ -1179,7 +1179,7 @@
MatchProperties CollectMatchProperties(const char* file)
{
// Match rules are case-insensitive on some platforms.
-#if defined(_WIN32) || defined(__APPLE__) || defined(__CYGWIN__)
+#if defined(_WIN32) || defined(__APPLE__)
std::string lower = cmSystemTools::LowerCase(file);
const char* file_to_match = lower.c_str();
#else
--- cmake-3.2.2/Source/cmInstallCommand.cxx 2015-04-13 19:09:00.000000000 +0200
+++ cmake-3.2.2/Source/cmInstallCommand.cxx 2015-06-10 11:04:19.257935200 +0200
@@ -1138,7 +1138,7 @@
{
literal_args += " REGEX \"";
// Match rules are case-insensitive on some platforms.
-#if defined(_WIN32) || defined(__APPLE__) || defined(__CYGWIN__)
+#if defined(_WIN32) || defined(__APPLE__)
std::string regex = cmSystemTools::LowerCase(args[i]);
#else
std::string regex = args[i];
--- cmake-3.2.2/Source/kwsys/Glob.cxx 2015-04-13 19:09:00.000000000 +0200
+++ cmake-3.2.2/Source/kwsys/Glob.cxx 2015-06-10 11:05:51.602674000 +0200
@@ -37,7 +37,7 @@
#include <string.h>
namespace KWSYS_NAMESPACE
{
-#if defined(_WIN32) || defined(__APPLE__) || defined(__CYGWIN__)
+#if defined(_WIN32) || defined(__APPLE__)
// On Windows and apple, no difference between lower and upper case
# define KWSYS_GLOB_CASE_INDEPENDENT
#endif
--- cmake-3.2.2/Source/kwsys/SystemInformation.cxx 2015-04-13 19:09:00.000000000 +0200
+++ cmake-3.2.2/Source/kwsys/SystemInformation.cxx 2015-06-10 11:13:00.308303500 +0200
@@ -911,7 +911,7 @@
// Hide implementation details in an anonymous namespace.
namespace {
// *****************************************************************************
-#if defined(__linux) || defined(__APPLE__)
+#if defined(__linux) || defined(__APPLE__) || defined(__CYGWIN__)
int LoadLines(
FILE *file,
kwsys_stl::vector<kwsys_stl::string> &lines)
@@ -947,7 +947,7 @@
return nRead;
}
-# if defined(__linux)
+# if defined(__linux) || defined(__CYGWIN__)
// *****************************************************************************
int LoadLines(
const char *fileName,
@@ -986,7 +986,7 @@
}
#endif
-#if defined(__linux)
+#if defined(__linux) || defined(__CYGWIN__)
// ****************************************************************************
template<typename T>
int GetFieldsFromFile(
@@ -3132,7 +3132,6 @@
pos = buffer.find("processor\t",pos+1);
}
-#ifdef __linux
// Find the largest physical id.
int maxId = -1;
kwsys_stl::string idc =
@@ -3165,14 +3164,6 @@
atoi(this->ExtractValueFromCpuInfoFile(buffer,"ncpus active").c_str());
}
-#else // __CYGWIN__
- // does not have "physical id" entries, neither "cpu cores"
- // this has to be fixed for hyper-threading.
- kwsys_stl::string cpucount =
- this->ExtractValueFromCpuInfoFile(buffer,"cpu count");
- this->NumberOfPhysicalCPU=
- this->NumberOfLogicalCPU = atoi(cpucount.c_str());
-#endif
// gotta have one, and if this is 0 then we get a / by 0n
// better to have a bad answer than a crash
if(this->NumberOfPhysicalCPU <= 0)
@@ -3370,7 +3361,7 @@
GlobalMemoryStatusEx(&statex);
return statex.ullTotalPhys/1024;
# endif
-#elif defined(__linux)
+#elif defined(__linux) || defined(__CYGWIN__)
SystemInformation::LongLong memTotal=0;
int ierr=GetFieldFromFile("/proc/meminfo","MemTotal:",memTotal);
if (ierr)
@@ -3501,7 +3492,7 @@
GlobalMemoryStatusEx(&statex);
return (statex.ullTotalPhys - statex.ullAvailPhys)/1024;
# endif
-#elif defined(__linux)
+#elif defined(__linux) || defined(__CYGWIN__)
const char *names[3]={"MemTotal:","MemFree:",NULL};
SystemInformation::LongLong values[2]={SystemInformation::LongLong(0)};
int ierr=GetFieldsFromFile("/proc/meminfo",names,values);
@@ -3560,7 +3551,7 @@
return -2;
}
return pmc.WorkingSetSize/1024;
-#elif defined(__linux)
+#elif defined(__linux) || defined(__CYGWIN__)
SystemInformation::LongLong memUsed=0;
int ierr=GetFieldFromFile("/proc/self/status","VmRSS:",memUsed);
if (ierr)
@@ -3612,7 +3603,7 @@
{
#if defined(_WIN32)
return GetCurrentProcessId();
-#elif defined(__linux) || defined(__APPLE__)
+#elif defined(__linux) || defined(__APPLE__) || defined(__CYGWIN__)
return getpid();
#else
return -1;
--- cmake-3.2.2/Source/kwsys/SystemTools.cxx 2015-04-13 19:09:00.000000000 +0200
+++ cmake-3.2.2/Source/kwsys/SystemTools.cxx 2015-06-10 11:21:58.980443200 +0200
@@ -93,19 +93,12 @@
# if defined(_MSC_VER) && _MSC_VER >= 1800
# define KWSYS_WINDOWS_DEPRECATED_GetVersionEx
# endif
-#elif defined (__CYGWIN__)
-# include <windows.h>
-# undef _WIN32
#endif
#if !KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H
extern char **environ;
#endif
-#ifdef __CYGWIN__
-# include <sys/cygwin.h>
-#endif
-
// getpwnam doesn't exist on Windows and Cray Xt3/Catamount
// same for TIOCGWINSZ
#if defined(_WIN32) || defined (__LIBCATAMOUNT__)
@@ -1148,15 +1141,7 @@
{
return false;
}
-#if defined(__CYGWIN__)
- // Convert filename to native windows path if possible.
- char winpath[MAX_PATH];
- if(SystemTools::PathCygwinToWin32(filename.c_str(), winpath))
- {
- return (GetFileAttributesA(winpath) != INVALID_FILE_ATTRIBUTES);
- }
- return access(filename.c_str(), R_OK) == 0;
-#elif defined(_WIN32)
+#if defined(_WIN32)
return (GetFileAttributesW(
SystemTools::ConvertToWindowsExtendedPath(filename).c_str())
!= INVALID_FILE_ATTRIBUTES);
@@ -1190,28 +1175,6 @@
}
//----------------------------------------------------------------------------
-#ifdef __CYGWIN__
-bool SystemTools::PathCygwinToWin32(const char *path, char *win32_path)
-{
- SystemToolsTranslationMap::iterator i =
- SystemTools::Cyg2Win32Map->find(path);
-
- if (i != SystemTools::Cyg2Win32Map->end())
- {
- strncpy(win32_path, i->second.c_str(), MAX_PATH);
- }
- else
- {
- if(cygwin_conv_path(CCP_POSIX_TO_WIN_A, path, win32_path, MAX_PATH) != 0)
- {
- win32_path[0] = 0;
- }
- SystemToolsTranslationMap::value_type entry(path, win32_path);
- SystemTools::Cyg2Win32Map->insert(entry);
- }
- return win32_path[0] != 0;
-}
-#endif
bool SystemTools::Touch(const kwsys_stl::string& filename, bool create)
{
@@ -4307,7 +4270,7 @@
bool SystemTools::FileIsFullPath(const char* in_name, size_t len)
{
-#if defined(_WIN32) || defined(__CYGWIN__)
+#if defined(_WIN32)
// On Windows, the name must be at least two characters long.
if(len < 2)
{
@@ -5078,9 +5041,6 @@
static unsigned int SystemToolsManagerCount;
SystemToolsTranslationMap *SystemTools::TranslationMap;
SystemToolsTranslationMap *SystemTools::LongPathMap;
-#ifdef __CYGWIN__
-SystemToolsTranslationMap *SystemTools::Cyg2Win32Map;
-#endif
// SystemToolsManager manages the SystemTools singleton.
// SystemToolsManager should be included in any translation unit
@@ -5126,9 +5086,6 @@
// Allocate the translation map first.
SystemTools::TranslationMap = new SystemToolsTranslationMap;
SystemTools::LongPathMap = new SystemToolsTranslationMap;
-#ifdef __CYGWIN__
- SystemTools::Cyg2Win32Map = new SystemToolsTranslationMap;
-#endif
// Add some special translation paths for unix. These are not added
// for windows because drive letters need to be maintained. Also,
@@ -5183,9 +5140,6 @@
{
delete SystemTools::TranslationMap;
delete SystemTools::LongPathMap;
-#ifdef __CYGWIN__
- delete SystemTools::Cyg2Win32Map;
-#endif
}
--- cmake-3.2.2/Source/kwsys/SystemTools.hxx.in 2015-04-13 19:09:00.000000000 +0200
+++ cmake-3.2.2/Source/kwsys/SystemTools.hxx.in 2015-06-10 11:24:24.271286600 +0200
@@ -298,15 +298,6 @@
static bool FileExists(const kwsys_stl::string& filename);
/**
- * Converts Cygwin path to Win32 path. Uses dictionary container for
- * caching and calls to cygwin_conv_to_win32_path from Cygwin dll
- * for actual translation. Returns true on success, else false.
- */
-#ifdef __CYGWIN__
- static bool PathCygwinToWin32(const char *path, char *win32_path);
-#endif
-
- /**
* Return file length
*/
static unsigned long FileLength(const kwsys_stl::string& filename);
@@ -942,9 +933,6 @@
*/
static SystemToolsTranslationMap *TranslationMap;
static SystemToolsTranslationMap *LongPathMap;
-#ifdef __CYGWIN__
- static SystemToolsTranslationMap *Cyg2Win32Map;
-#endif
friend class SystemToolsManager;
};
--- cmake-3.2.2/Modules/FindCurses.cmake 2015-04-13 19:09:00.000000000 +0200
+++ cmake-3.2.2/Modules/FindCurses.cmake 2015-06-10 12:10:19.682030300 +0200
@@ -60,15 +60,6 @@
if(CURSES_NCURSES_LIBRARY AND ((NOT CURSES_CURSES_LIBRARY) OR CURSES_NEED_NCURSES))
set(CURSES_USE_NCURSES TRUE)
endif()
-# http://cygwin.com/ml/cygwin-announce/2010-01/msg00002.html
-# cygwin ncurses stopped providing curses.h symlinks see above
-# message. Cygwin is an ncurses package, so force ncurses on
-# cygwin if the curses.h is missing
-if(CYGWIN)
- if(NOT EXISTS /usr/include/curses.h)
- set(CURSES_USE_NCURSES TRUE)
- endif()
-endif()
# Not sure the logic is correct here.

@ -0,0 +1,45 @@
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index 1b6bb00d4c..487114daa8 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -893,7 +893,6 @@ endif()
# On Apple we need CoreFoundation and CoreServices
if(APPLE)
target_link_libraries(CMakeLib "-framework CoreFoundation")
- target_link_libraries(CMakeLib "-framework CoreServices")
endif()
if(WIN32 AND NOT UNIX)
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index a5ce5d18f4..3d6838ce82 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -43,11 +43,10 @@
struct cmLinkImplementation;
#if !defined(CMAKE_BOOTSTRAP) && defined(__APPLE__)
-# define HAVE_APPLICATION_SERVICES
-# include <ApplicationServices/ApplicationServices.h>
+# include <CoreFoundation/CoreFoundation.h>
#endif
#if !defined(CMAKE_BOOTSTRAP)
# include "cmXMLParser.h"
diff --git a/Utilities/cmlibarchive/CMakeLists.txt b/Utilities/cmlibarchive/CMakeLists.txt
index bfcaf30bb7..1da540aee5 100644
--- a/Utilities/cmlibarchive/CMakeLists.txt
+++ b/Utilities/cmlibarchive/CMakeLists.txt
@@ -2007,11 +2007,6 @@ IF(ENABLE_TEST)
ENDIF(ENABLE_TEST)
ENDIF()
-# We need CoreServices on Mac OS.
-IF(APPLE)
- LIST(APPEND ADDITIONAL_LIBS "-framework CoreServices")
-ENDIF(APPLE)
-
add_subdirectory(libarchive)
IF(0) # CMake does not build libarchive's command-line tools.
add_subdirectory(cat)

@ -0,0 +1,132 @@
{ stdenv, lib, fetchurl, pkg-config
, bzip2, curl, expat, libarchive, xz, zlib, libuv, rhash
, buildPackages
# darwin attributes
, ps
, isBootstrap ? false
, useSharedLibraries ? (!isBootstrap && !stdenv.isCygwin)
, useOpenSSL ? !isBootstrap, openssl
, useNcurses ? false, ncurses
, useQt4 ? false, qt4
, withQt5 ? false, qtbase
, fetchFromGitHub
}:
assert withQt5 -> useQt4 == false;
assert useQt4 -> withQt5 == false;
stdenv.mkDerivation rec {
pname = "cmake"
+ lib.optionalString isBootstrap "-boot"
+ lib.optionalString useNcurses "-cursesUI"
+ lib.optionalString withQt5 "-qt5UI"
+ lib.optionalString useQt4 "-qt4UI";
version = "3.20.0-rc3";
src = fetchFromGitHub {
# https://github.com/Kitware/CMake/releases/download/v3.20.0-rc3/cmake-3.20.0-rc3.tar.gz
owner = "Kitware";
repo = "CMake";
rev = "v${version}";
sha256 = {
"3.20.0-rc3" = "1za6kpi0bn5cfzs2s41snmms12mw3963mndwph17j3ka1cybhwd4";
}.${version};
};
patches = [
# Don't search in non-Nix locations such as /usr, but do search in our libc.
./search-path.patch
];
outputs = [ "out" ];
setOutputFlags = false;
setupHook = ./setup-hook.sh;
depsBuildBuild = [ buildPackages.stdenv.cc ];
nativeBuildInputs = [ setupHook pkg-config ];
buildInputs = []
++ lib.optionals useSharedLibraries [ bzip2 curl expat libarchive xz zlib libuv rhash ]
++ lib.optional useOpenSSL openssl
++ lib.optional useNcurses ncurses
++ lib.optional useQt4 qt4
++ lib.optional withQt5 qtbase;
propagatedBuildInputs = lib.optional stdenv.isDarwin ps;
preConfigure = ''
fixCmakeFiles .
substituteInPlace Modules/Platform/UnixPaths.cmake \
--subst-var-by libc_bin ${lib.getBin stdenv.cc.libc} \
--subst-var-by libc_dev ${lib.getDev stdenv.cc.libc} \
--subst-var-by libc_lib ${lib.getLib stdenv.cc.libc}
substituteInPlace Modules/FindCxxTest.cmake \
--replace "$""{PYTHON_EXECUTABLE}" ${stdenv.shell}
''
# CC_FOR_BUILD and CXX_FOR_BUILD are used to bootstrap cmake
+ ''
configureFlags="--parallel=''${NIX_BUILD_CORES:-1} CC=$CC_FOR_BUILD CXX=$CXX_FOR_BUILD $configureFlags"
'';
configureFlags = [
"--docdir=share/doc/${pname}${version}"
] ++ (if useSharedLibraries then [ "--no-system-jsoncpp" "--system-libs" ] else [ "--no-system-libs" ]) # FIXME: cleanup
++ lib.optional (useQt4 || withQt5) "--qt-gui"
# Workaround https://gitlab.kitware.com/cmake/cmake/-/issues/20568
++ lib.optionals stdenv.hostPlatform.is32bit [
"CFLAGS=-D_FILE_OFFSET_BITS=64"
"CXXFLAGS=-D_FILE_OFFSET_BITS=64"
]
++ [
"--"
# We should set the proper `CMAKE_SYSTEM_NAME`.
# http://www.cmake.org/Wiki/CMake_Cross_Compiling
#
# Unfortunately cmake seems to expect absolute paths for ar, ranlib, and
# strip. Otherwise they are taken to be relative to the source root of the
# package being built.
"-DCMAKE_CXX_COMPILER=${stdenv.cc.targetPrefix}c++"
"-DCMAKE_C_COMPILER=${stdenv.cc.targetPrefix}cc"
"-DCMAKE_AR=${lib.getBin stdenv.cc.bintools.bintools}/bin/${stdenv.cc.targetPrefix}ar"
"-DCMAKE_RANLIB=${lib.getBin stdenv.cc.bintools.bintools}/bin/${stdenv.cc.targetPrefix}ranlib"
"-DCMAKE_STRIP=${lib.getBin stdenv.cc.bintools.bintools}/bin/${stdenv.cc.targetPrefix}strip"
"-DCMAKE_USE_OPENSSL=${if useOpenSSL then "ON" else "OFF"}"
# Avoid depending on frameworks.
"-DBUILD_CursesDialog=${if useNcurses then "ON" else "OFF"}"
];
# make install attempts to use the just-built cmake
preInstall = lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) ''
sed -i 's|bin/cmake|${buildPackages.cmakeMinimal}/bin/cmake|g' Makefile
'';
dontUseCmakeConfigure = true;
enableParallelBuilding = true;
# This isn't an autoconf configure script; triples are passed via
# CMAKE_SYSTEM_NAME, etc.
configurePlatforms = [ ];
doCheck = false; # fails
meta = with lib; {
homepage = "https://cmake.org/";
changelog = "https://cmake.org/cmake/help/v${lib.versions.majorMinor version}/"
+ "release/${lib.versions.majorMinor version}.html";
description = "Cross-Platform Makefile Generator";
longDescription = ''
CMake is an open-source, cross-platform family of tools designed to
build, test and package software. CMake is used to control the software
compilation process using simple platform and compiler independent
configuration files, and generate native makefiles and workspaces that
can be used in the compiler environment of your choice.
'';
platforms = if useQt4 then qt4.meta.platforms else platforms.all;
maintainers = with maintainers; [ ttuegel lnl7 ];
license = licenses.bsd3;
};
}

@ -0,0 +1,55 @@
diff --git a/Utilities/cmlibuv/CMakeLists.txt b/Utilities/cmlibuv/CMakeLists.txt
index 7625cf65d9..167903e309 100644
--- a/Utilities/cmlibuv/CMakeLists.txt
+++ b/Utilities/cmlibuv/CMakeLists.txt
@@ -193,6 +193,22 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
src/unix/kqueue.c
src/unix/proctitle.c
)
+
+ include(CheckIncludeFile)
+
+ check_include_file("ApplicationServices/ApplicationServices.h" HAVE_ApplicationServices)
+ if (HAVE_ApplicationServices)
+ list(APPEND uv_defines
+ HAVE_APPLICATIONSERVICES_APPLICATIONSERVICES_H=1
+ )
+ endif()
+
+ check_include_file("CoreServices/CoreServices.h" HAVE_CoreServices)
+ if (HAVE_CoreServices)
+ list(APPEND uv_defines
+ HAVE_CORESERVICES_CORESERVICES_H=1
+ )
+ endif()
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
diff --git a/Utilities/cmlibuv/src/unix/fsevents.c b/Utilities/cmlibuv/src/unix/fsevents.c
index a51f29b3f6..3f6bf01968 100644
--- a/Utilities/cmlibuv/src/unix/fsevents.c
+++ b/Utilities/cmlibuv/src/unix/fsevents.c
@@ -21,7 +21,7 @@
#include "uv.h"
#include "internal.h"
-#if TARGET_OS_IPHONE || MAC_OS_X_VERSION_MAX_ALLOWED < 1070
+#if !HAVE_CORESERVICES_CORESERVICES_H || MAC_OS_X_VERSION_MAX_ALLOWED < 1070
/* iOS (currently) doesn't provide the FSEvents-API (nor CoreServices) */
/* macOS prior to 10.7 doesn't provide the full FSEvents API so use kqueue */
@@ -39,7 +39,7 @@ int uv__fsevents_close(uv_fs_event_t* handle) {
void uv__fsevents_loop_delete(uv_loop_t* loop) {
}
-#else /* TARGET_OS_IPHONE */
+#else /* !HAVE_CORESERVICES_CORESERVICES_H */
#include "darwin-stub.h"
@@ -920,4 +920,4 @@ int uv__fsevents_close(uv_fs_event_t* handle) {
return 0;
}
-#endif /* TARGET_OS_IPHONE */
+#endif /* !HAVE_CORESERVICES_CORESERVICES_H */

@ -0,0 +1,92 @@
diff -ru3 cmake-2.8.12.2/Modules/Platform/Linux.cmake cmake-2.8.12.2-new/Modules/Platform/Linux.cmake
--- cmake-2.8.12.2/Modules/Platform/Linux.cmake 2014-01-16 21:15:08.000000000 +0400
+++ cmake-2.8.12.2-new/Modules/Platform/Linux.cmake 2016-04-13 22:00:32.928575740 +0300
@@ -36,22 +36,11 @@
# checking the platform every time. This option is advanced enough
# that only package maintainers should need to adjust it. They are
# capable of providing a setting on the command line.
- if(EXISTS "/etc/debian_version")
- set(CMAKE_INSTALL_SO_NO_EXE 1 CACHE INTERNAL
- "Install .so files without execute permission.")
- else()
- set(CMAKE_INSTALL_SO_NO_EXE 0 CACHE INTERNAL
- "Install .so files without execute permission.")
- endif()
+ set(CMAKE_INSTALL_SO_NO_EXE 0 CACHE INTERNAL
+ "Install .so files without execute permission.")
endif()
# Match multiarch library directory names.
set(CMAKE_LIBRARY_ARCHITECTURE_REGEX "[a-z0-9_]+(-[a-z0-9_]+)?-linux-gnu[a-z0-9_]*")
include(Platform/UnixPaths)
-
-# Debian has lib64 paths only for compatibility so they should not be
-# searched.
-if(EXISTS "/etc/debian_version")
- set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS FALSE)
-endif()
diff -ru3 cmake-2.8.12.2/Modules/Platform/UnixPaths.cmake cmake-2.8.12.2-new/Modules/Platform/UnixPaths.cmake
--- cmake-2.8.12.2/Modules/Platform/UnixPaths.cmake 2014-01-16 21:15:08.000000000 +0400
+++ cmake-2.8.12.2-new/Modules/Platform/UnixPaths.cmake 2016-04-14 00:09:10.106362636 +0300
@@ -32,9 +32,6 @@
# List common installation prefixes. These will be used for all
# search types.
list(APPEND CMAKE_SYSTEM_PREFIX_PATH
- # Standard
- /usr/local /usr /
-
# CMake install location
"${_CMAKE_INSTALL_DIR}"
@@ -44,44 +41,26 @@
# List common include file locations not under the common prefixes.
list(APPEND CMAKE_SYSTEM_INCLUDE_PATH
- # Windows API on Cygwin
- /usr/include/w32api
-
- # X11
- /usr/X11R6/include /usr/include/X11
-
- # Other
- /usr/pkg/include
- /opt/csw/include /opt/include
- /usr/openwin/include
+ @libc_dev@/include
)
list(APPEND CMAKE_SYSTEM_LIBRARY_PATH
- # Windows API on Cygwin
- /usr/lib/w32api
-
- # X11
- /usr/X11R6/lib /usr/lib/X11
-
- # Other
- /usr/pkg/lib
- /opt/csw/lib /opt/lib
- /usr/openwin/lib
+ @libc_lib@/lib
)
list(APPEND CMAKE_SYSTEM_PROGRAM_PATH
- /usr/pkg/bin
+ @libc_bin@/bin
)
list(APPEND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES
- /lib /usr/lib /usr/lib32 /usr/lib64
+ @libc_lib@/lib
)
list(APPEND CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES
- /usr/include
+ @libc_dev@/include
)
list(APPEND CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES
- /usr/include
+ @libc_dev@/include
)
# Enable use of lib64 search path variants by default.

@ -0,0 +1,74 @@
diff --git a/Modules/Platform/UnixPaths.cmake b/Modules/Platform/UnixPaths.cmake
index b9381c3d7d..cecc40a89e 100644
--- a/Modules/Platform/UnixPaths.cmake
+++ b/Modules/Platform/UnixPaths.cmake
@@ -26,9 +26,6 @@ get_filename_component(_CMAKE_INSTALL_DIR "${_CMAKE_INSTALL_DIR}" PATH)
# please make sure to keep Help/variable/CMAKE_SYSTEM_PREFIX_PATH.rst
# synchronized
list(APPEND CMAKE_SYSTEM_PREFIX_PATH
- # Standard
- /usr/local /usr /
-
# CMake install location
"${_CMAKE_INSTALL_DIR}"
)
@@ -47,24 +44,19 @@ endif()
# Non "standard" but common install prefixes
list(APPEND CMAKE_SYSTEM_PREFIX_PATH
- /usr/X11R6
- /usr/pkg
- /opt
)
# List common include file locations not under the common prefixes.
list(APPEND CMAKE_SYSTEM_INCLUDE_PATH
- # X11
- /usr/include/X11
+ @libc_dev@/include
)
list(APPEND CMAKE_SYSTEM_LIBRARY_PATH
- # X11
- /usr/lib/X11
+ @libc_lib@/lib
)
list(APPEND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES
- /lib /lib32 /lib64 /usr/lib /usr/lib32 /usr/lib64
+ @libc_lib@/lib
)
if(CMAKE_SYSROOT_COMPILE)
@@ -77,15 +69,15 @@ endif()
# parsing the implicit directory information from compiler output.
set(_CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES_INIT
${CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES}
- "${_cmake_sysroot_compile}/usr/include"
+ @libc_dev@/include
)
set(_CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES_INIT
${CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES}
- "${_cmake_sysroot_compile}/usr/include"
+ @libc_dev@/include
)
set(_CMAKE_CUDA_IMPLICIT_INCLUDE_DIRECTORIES_INIT
${CMAKE_CUDA_IMPLICIT_INCLUDE_DIRECTORIES}
- "${_cmake_sysroot_compile}/usr/include"
+ @libc_dev@/include
)
unset(_cmake_sysroot_compile)
diff --git a/Modules/Platform/WindowsPaths.cmake b/Modules/Platform/WindowsPaths.cmake
index b9e2f17979..ab517cd4a7 100644
--- a/Modules/Platform/WindowsPaths.cmake
+++ b/Modules/Platform/WindowsPaths.cmake
@@ -70,7 +70,7 @@ endif()
if(CMAKE_CROSSCOMPILING AND NOT CMAKE_HOST_SYSTEM_NAME MATCHES "Windows")
# MinGW (useful when cross compiling from linux with CMAKE_FIND_ROOT_PATH set)
- list(APPEND CMAKE_SYSTEM_PREFIX_PATH /)
+ # list(APPEND CMAKE_SYSTEM_PREFIX_PATH /)
endif()
list(APPEND CMAKE_SYSTEM_INCLUDE_PATH

@ -0,0 +1,178 @@
addCMakeParams() {
addToSearchPath CMAKE_PREFIX_PATH $1
}
fixCmakeFiles() {
# Replace occurences of /usr and /opt by /var/empty.
echo "fixing cmake files..."
find "$1" \( -type f -name "*.cmake" -o -name "*.cmake.in" -o -name CMakeLists.txt \) -print |
while read fn; do
sed -e 's^/usr\([ /]\|$\)^/var/empty\1^g' -e 's^/opt\([ /]\|$\)^/var/empty\1^g' < "$fn" > "$fn.tmp"
mv "$fn.tmp" "$fn"
done
}
cmakeConfigurePhase() {
runHook preConfigure
export CTEST_OUTPUT_ON_FAILURE=1
if [ -n "${enableParallelChecking-1}" ]; then
export CTEST_PARALLEL_LEVEL=$NIX_BUILD_CORES
fi
if [ -z "${dontFixCmake-}" ]; then
fixCmakeFiles .
fi
if [ -z "${dontUseCmakeBuildDir-}" ]; then
mkdir -p build
cd build
cmakeDir=${cmakeDir:-..}
fi
if [ -z "${dontAddPrefix-}" ]; then
cmakeFlags="-DCMAKE_INSTALL_PREFIX=$prefix $cmakeFlags"
fi
# We should set the proper `CMAKE_SYSTEM_NAME`.
# http://www.cmake.org/Wiki/CMake_Cross_Compiling
#
# Unfortunately cmake seems to expect absolute paths for ar, ranlib, and
# strip. Otherwise they are taken to be relative to the source root of the
# package being built.
cmakeFlags="-DCMAKE_CXX_COMPILER=$CXX $cmakeFlags"
cmakeFlags="-DCMAKE_C_COMPILER=$CC $cmakeFlags"
cmakeFlags="-DCMAKE_AR=$(command -v $AR) $cmakeFlags"
cmakeFlags="-DCMAKE_RANLIB=$(command -v $RANLIB) $cmakeFlags"
cmakeFlags="-DCMAKE_STRIP=$(command -v $STRIP) $cmakeFlags"
# on macOS we want to prefer Unix-style headers to Frameworks
# because we usually do not package the framework
cmakeFlags="-DCMAKE_FIND_FRAMEWORK=LAST $cmakeFlags"
# on macOS i686 was only relevant for 10.5 or earlier.
cmakeFlags="-DCMAKE_OSX_ARCHITECTURES=x86_64 $cmakeFlags"
# we never want to use the global macOS SDK
cmakeFlags="-DCMAKE_OSX_SYSROOT= $cmakeFlags"
# correctly detect our clang compiler
cmakeFlags="-DCMAKE_POLICY_DEFAULT_CMP0025=NEW $cmakeFlags"
# This installs shared libraries with a fully-specified install
# name. By default, cmake installs shared libraries with just the
# basename as the install name, which means that, on Darwin, they
# can only be found by an executable at runtime if the shared
# libraries are in a system path or in the same directory as the
# executable. This flag makes the shared library accessible from its
# nix/store directory.
cmakeFlags="-DCMAKE_INSTALL_NAME_DIR=${!outputLib}/lib $cmakeFlags"
# The docdir flag needs to include PROJECT_NAME as per GNU guidelines,
# try to extract it from CMakeLists.txt.
if [[ -z "$shareDocName" ]]; then
local cmakeLists="${cmakeDir}/CMakeLists.txt"
if [[ -f "$cmakeLists" ]]; then
local shareDocName="$(grep --only-matching --perl-regexp --ignore-case '\bproject\s*\(\s*"?\K([^[:space:]")]+)' < "$cmakeLists" | head -n1)"
fi
# The argument sometimes contains garbage or variable interpolation.
# When that is the case, lets fall back to the derivation name.
if [[ -z "$shareDocName" ]] || echo "$shareDocName" | grep -q '[^a-zA-Z0-9_+-]'; then
if [[ -n "${pname-}" ]]; then
shareDocName="$pname"
else
shareDocName="$(echo "$name" | sed 's/-[^a-zA-Z].*//')"
fi
fi
fi
# This ensures correct paths with multiple output derivations
# It requires the project to use variables from GNUInstallDirs module
# https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html
cmakeFlags="-DCMAKE_INSTALL_BINDIR=${!outputBin}/bin $cmakeFlags"
cmakeFlags="-DCMAKE_INSTALL_SBINDIR=${!outputBin}/sbin $cmakeFlags"
cmakeFlags="-DCMAKE_INSTALL_INCLUDEDIR=${!outputInclude}/include $cmakeFlags"
cmakeFlags="-DCMAKE_INSTALL_OLDINCLUDEDIR=${!outputInclude}/include $cmakeFlags"
cmakeFlags="-DCMAKE_INSTALL_MANDIR=${!outputMan}/share/man $cmakeFlags"
cmakeFlags="-DCMAKE_INSTALL_INFODIR=${!outputInfo}/share/info $cmakeFlags"
cmakeFlags="-DCMAKE_INSTALL_DOCDIR=${!outputDoc}/share/doc/${shareDocName} $cmakeFlags"
cmakeFlags="-DCMAKE_INSTALL_LIBDIR=${!outputLib}/lib $cmakeFlags"
cmakeFlags="-DCMAKE_INSTALL_LIBEXECDIR=${!outputLib}/libexec $cmakeFlags"
cmakeFlags="-DCMAKE_INSTALL_LOCALEDIR=${!outputLib}/share/locale $cmakeFlags"
# Dont build tests when doCheck = false
if [ -z "${doCheck-}" ]; then
cmakeFlags="-DBUILD_TESTING=OFF $cmakeFlags"
fi
# Avoid cmake resetting the rpath of binaries, on make install
# And build always Release, to ensure optimisation flags
cmakeFlags="-DCMAKE_BUILD_TYPE=${cmakeBuildType:-Release} -DCMAKE_SKIP_BUILD_RPATH=ON $cmakeFlags"
# Disable user package registry to avoid potential side effects
# and unecessary attempts to access non-existent home folder
# https://cmake.org/cmake/help/latest/manual/cmake-packages.7.html#disabling-the-package-registry
cmakeFlags="-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON $cmakeFlags"
cmakeFlags="-DCMAKE_FIND_USE_PACKAGE_REGISTRY=OFF $cmakeFlags"
cmakeFlags="-DCMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY=OFF $cmakeFlags"
if [ "${buildPhase-}" = ninjaBuildPhase ]; then
cmakeFlags="-GNinja $cmakeFlags"
fi
echo "cmake flags: $cmakeFlags ${cmakeFlagsArray[@]}"
cmake ${cmakeDir:-.} $cmakeFlags "${cmakeFlagsArray[@]}"
if ! [[ -v enableParallelBuilding ]]; then
enableParallelBuilding=1
echo "cmake: enabled parallel building"
fi
runHook postConfigure
}
if [ -z "${dontUseCmakeConfigure-}" -a -z "${configurePhase-}" ]; then
setOutputFlags=
configurePhase=cmakeConfigurePhase
fi
addEnvHooks "$targetOffset" addCMakeParams
makeCmakeFindLibs(){
isystem_seen=
iframework_seen=
for flag in ${NIX_CFLAGS_COMPILE-} ${NIX_LDFLAGS-}; do
if test -n "$isystem_seen" && test -d "$flag"; then
isystem_seen=
export CMAKE_INCLUDE_PATH="${CMAKE_INCLUDE_PATH-}${CMAKE_INCLUDE_PATH:+:}${flag}"
elif test -n "$iframework_seen" && test -d "$flag"; then
iframework_seen=
export CMAKE_FRAMEWORK_PATH="${CMAKE_FRAMEWORK_PATH-}${CMAKE_FRAMEWORK_PATH:+:}${flag}"
else
isystem_seen=
iframework_seen=
case $flag in
-I*)
export CMAKE_INCLUDE_PATH="${CMAKE_INCLUDE_PATH-}${CMAKE_INCLUDE_PATH:+:}${flag:2}"
;;
-L*)
export CMAKE_LIBRARY_PATH="${CMAKE_LIBRARY_PATH-}${CMAKE_LIBRARY_PATH:+:}${flag:2}"
;;
-F*)
export CMAKE_FRAMEWORK_PATH="${CMAKE_FRAMEWORK_PATH-}${CMAKE_FRAMEWORK_PATH:+:}${flag:2}"
;;
-isystem)
isystem_seen=1
;;
-iframework)
iframework_seen=1
;;
esac
fi
done
}
# not using setupHook, because it could be a setupHook adding additional
# include flags to NIX_CFLAGS_COMPILE
postHooks+=(makeCmakeFindLibs)

@ -35,81 +35,63 @@ let
findutils
file
git
glxinfo
gn
gnused
gnutar
gtk3
gnome3.gvfs
glib
# gnome3.gconf
gzip
fontconfig
freetype
libpulseaudio
libGL
xorg.libX11
xorg.libXext
xorg.libXi
xorg.libXrandr
xorg.libXrender
xorg.libXtst
xorg.setxkbmap
pciutils
unzip
which
xkeyboard_config
]
; ndk-r17c = (nixpkgs.androidenv.composeAndroidPackages
{
ndkVersion = "17.2.4988734"
; }).ndk-bundle
; vendorCmake = nixpkgs.libsForQt5.callPackage ./deps/cmake {}
; ndk-r21b =
; ndk-r21 =
let
version = "r21b"
version = "r21e"
; in
nixpkgs.fetchzip
{
url = "https://dl.google.com/android/repository/android-ndk-${version}-linux-x86_64.zip"
; sha256 = "0shz45b6f2k4lnca8fgghh4cdh53vghfn26cj4mkirkk4cpv1qry"
; sha256 = "10gv70bblifypx1r4qy771p92amxaq3yrbd7j5fzmipdyar5hs9h"
; }
; openssl-source =
; ndk-r23 =
let
name = "openssl"
; version = "1.1.1g"
version = "r23-beta3"
; in
nixpkgs.fetchurl
nixpkgs.fetchzip
{
url = "https://www.openssl.org/source/${name}-${version}.tar.gz"
; sha256 = "0ikdcc038i7jk8h7asq5xcn8b1xc2rrbc88yfm4hqbz3y5s4gc6x"
url = "https://dl.google.com/android/repository/android-ndk-${version}-linux-x86_64.zip"
; sha256 = "12gcg8w7ybxlqa034jawc364d084wq2bl9rsz210l1hayp1y7xg8"
; }
; iconv-source =
; openssl-source =
let
name = "libiconv"
; version = "1.16"
name = "openssl"
; version = "1.1.1k"
; in
nixpkgs.fetchurl
{
url = "http://ftp.gnu.org/pub/gnu/${name}/${name}-${version}.tar.gz"
; sha256 = "016c57srqr0bza5fxjxfrx6aqxkqy0s3gkhcg7p7fhk5i6sv38g6"
url = "https://www.openssl.org/source/${name}-${version}.tar.gz"
; sha256 = "1rdfzcrxy9y38wqdw5942vmdax9hjhgrprzxm42csal7p5shhal9"
; }
; boost-source =
let
name = "boost"
; version = "1_71_0"
; dot_version = "1.71.0"
; version = "1_75_0"
; dot_version = "1.75.0"
; in
nixpkgs.fetchurl
{
url =
"https://dl.bintray.com/boostorg/release/{dot_version}/source/${name}_${version}.tar.bz2"
; sha256 = "1vi40mcair6xgm9k8rsavyhcia3ia28q8k0blknwgy4b3sh8sfnp"
; }
{
url =
"https://dl.bintray.com/boostorg/release/${dot_version}/source/${name}_${version}.tar.bz2"
# ; sha256 = "1js9zpij58l60kx46s3lxdp5207igppjnhqigwhbpdvd04gb6gcm"
; sha256 = "1js9zpij58l60kx46s3lxdp5207igppjnhqigwhbpdvd04gb6gcm"
; }
; sodium-source =
let
@ -122,42 +104,17 @@ let
; sha256 = "1x6lll81z4ah732zwpw481qfbzg7yml0nwdgbnd5388jnz3274ym"
; }
; randomwow-source =
let
name = "RandomWOW"
; version = "1.1.6"
; in
nixpkgs.fetchurl
{
url = "https://github.com/wownero/${name}/archive/${version}.tar.gz"
; sha256 = "1c55y2dwrayh6k1avpchs89gq1mvy5c305h92jm2k48kzhw6a792"
; }
; wownero-source =
nixpkgs.fetchFromGitHub
{
owner = "wownero"
; repo = "wownero"
; rev = "dev-v0.8"
; sha256 = "13032pa9wx3h6x860f9iy28vdpkc94wzby153ig7hw4dixjqhs6w"
; }
; miniupnp-source =
nixpkgs.fetchFromGitHub
{
owner = "miniupnp"
; repo = "miniupnp"
; rev = "7800de9"
; sha256 = "1f7jgll8lxz2l5lifgqafgx8694x0svgwyz8w8w4cwavm9lmah63"
; }
; lolnero-rev = "v0.9.5.1"
; lolnero-sha256 = "12qabkilidpkdx61dv09fiyrxd12pkdcf5fbk63fcw8s26xyijks"
; unbound-source =
nixpkgs.fetchFromGitHub
; lolnero-source =
nixpkgs.fetchgit
{
owner = "monero-project"
; repo = "unbound"
; rev = "9a77c29"
; sha256 = "0dmm5pz2yf1lfand9k1c8x0mbrwynkpphh877b8jbavjrwiwsw35"
url = "https://gitlab.com/fuwa/lolnero.git"
; rev = lolnero-rev
; sha256 = lolnero-sha256
; fetchSubmodules = false
; }
; in
@ -165,7 +122,7 @@ let
with nixpkgs;
(buildFHSUserEnv {
name = "cyberwow-env"
name = "lolnode-env"
; targetPkgs = pkgs: (with pkgs;
[
bash
@ -176,11 +133,12 @@ with nixpkgs;
which
zsh
# openjdk10
# openjdk
# jetbrains.jdk
# zulu
jdk13
# jdk8 for sdkmanager
jdk8
# jdk for android dev
# jdk
# dart_dev
gnumake
gcc
@ -196,8 +154,11 @@ with nixpkgs;
automake
gnum4
pkgconfig
cmake
vendorCmake
ccache
python2
ninja
]
++ android-studio-deps
)
@ -208,26 +169,22 @@ with nixpkgs;
; profile = ''
export ANDROID_HOME=~/SDK/Android/Sdk
export ANDROID_HOME=~/local/sdk/android
PATH=~/local/sdk/flutter/stable/bin:$PATH
PATH=~/SDK/Android/android-studio/bin:$PATH
PATH=~/SDK/Android/Sdk/tools/bin:$PATH
PATH=$ANDROID_HOME/cmdline-tools/latest/bin:$PATH
export ANDROID_NDK_VERSION=r21b
export ANDROID_NDK_ROOT=${ndk-r21b}
export ANDROID_NDK_VERSION=r21
export ANDROID_NDK_ROOT=${ndk-r21}
export NDK=$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64
PATH=$NDK/bin:$PATH
export SRC_OPENSSL=${openssl-source}
export SRC_ICONV=${iconv-source}
export SRC_BOOST=${boost-source}
export SRC_SODIUM=${sodium-source}
export SRC_RANDOMWOW=${randomwow-source}
export SRC_MINIUPNP_DIR=${miniupnp-source}
export SRC_UNBOUND_DIR=${unbound-source}
export SRC_RAPIDJSON_DIR=${nixpkgs.rapidjson.src}
export SRC_WOWNERO_DIR=${wownero-source}
export SRC_LOLNERO_DIR=${lolnero-source}
export VERSIONTAG_LOLNERO=${lolnero-rev}
export PATH_NCURSES=${nixpkgs.ncurses5}
export PATH
@ -235,8 +192,8 @@ with nixpkgs;
export _JAVA_AWT_WM_NONREPARENTING=1
export DART_VM_OPTIONS=--root-certs-file=/etc/ssl/certs/ca-certificates.crt
export ANDROID_NDK_VERSION_WOW=r17c
export ANDROID_NDK_ROOT_WOW=${ndk-r17c}/libexec/android-sdk/ndk-bundle
export ANDROID_NDK_VERSION_LOL=r23
export ANDROID_NDK_ROOT_LOL=${ndk-r23}
export ZSH_INIT=${nixpkgs.oh-my-zsh}/share/oh-my-zsh/oh-my-zsh.sh
exec zsh

@ -37,7 +37,7 @@ build_root=$BUILD_ROOT
src_root=$BUILD_ROOT_SRC
name=boost
version=1_71_0
version=1_75_0
cd $src_root/${name}_${version}
@ -91,15 +91,9 @@ for arch in ${archs[@]}; do
--build-dir=android \
-sICONV_PATH=${ICONV_PATH} \
--build-type=minimal \
--with-chrono \
--with-date_time \
--with-filesystem \
--with-program_options \
--with-regex \
--with-serialization \
--with-system \
--with-thread \
--with-locale \
install \
-j${NPROC} \
)

@ -38,7 +38,7 @@ cd $BUILD_ROOT_SRC
name=boost
version=1_71_0
dot_version=1.71.0
hash=d73a8da01e8bf8c7eda40b4c84915071a8c8a0df4a6734537ddde4a8580524ee
hash=953db31e016db7bb207f11432bef7df100516eeb746843fa0486a222e3fd49cb
url=https://dl.bintray.com/boostorg/release/${dot_version}/source/${name}_${version}.tar.bz2
out=${name}_${version}.tar.bz2
@ -49,8 +49,8 @@ if [ ! -z $SRC_BOOST ]; then
cp $SRC_BOOST $out
else
curl -# -L -o $out -O $url
echo "$hash $out" | sha256sum -c
fi
echo "$hash $out" | sha256sum -c
tar xfv $out

@ -37,7 +37,7 @@ src_root=$BUILD_ROOT_SRC
build_root=$BUILD_ROOT
target_root=`pwd`
name=wownero
name=lolnero
cd $src_root/${name}
@ -61,9 +61,9 @@ for arch in ${archs[@]}; do
esac
echo "collecting for ${arch}"
mkdir -p $target_root/cyberwow/android/app/src/main/jniLibs/$target_abi
cp build/release/bin/wownerod \
$target_root/cyberwow/android/app/src/main/jniLibs/$target_abi/libwownerod.so
mkdir -p $target_root/lolnode/android/app/src/main/jniLibs/$target_abi
cp build/release/bin/lolnerod \
$target_root/lolnode/android/app/src/main/jniLibs/$target_abi/liblolnerod.so
done

@ -29,14 +29,14 @@
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
DEFAULT_ANDROID_NDK_ROOT=~/SDK/Android/ndk-archive/android-ndk-r20
DEFAULT_ANDROID_NDK_VERSION=r21d
ANDROID_NDK_VERSION="${ANDROID_NDK_VERSION:-${DEFAULT_ANDROID_NDK_VERSION}}"
DEFAULT_ANDROID_NDK_ROOT=~/SDK/Android/ndk-archive/android-ndk-${ANDROID_NDK_VERSION}
ANDROID_NDK_ROOT="${ANDROID_NDK_ROOT:-${DEFAULT_ANDROID_NDK_ROOT}}"
export ANDROID_NDK_ROOT=`realpath $ANDROID_NDK_ROOT`
DEFAULT_ANDROID_NDK_VERSION=r20
ANDROID_NDK_VERSION="${ANDROID_NDK_VERSION:-${DEFAULT_ANDROID_NDK_VERSION}}"
BUILD_PATH=../cyberwow-build
BUILD_PATH=../build/lolnero-node
DEFAULT_BUILD_ROOT=${BUILD_PATH}/$ANDROID_NDK_VERSION
BUILD_ROOT="${BUILD_ROOT:-${DEFAULT_BUILD_ROOT}}"
@ -50,18 +50,18 @@ NPROC="${NPROC:-${DEFAULT_NPROC}}"
export NPROC
# wownero can only be built with ndk-r17c
# can only be built with ndk-r17c
DEFAULT_ANDROID_NDK_VERSION_WOW=r17c
ANDROID_NDK_VERSION_WOW="${ANDROID_NDK_VERSION_WOW:-${DEFAULT_ANDROID_NDK_VERSION_WOW}}"
DEFAULT_ANDROID_NDK_VERSION_LOL=r23
ANDROID_NDK_VERSION_LOL="${ANDROID_NDK_VERSION_LOL:-${DEFAULT_ANDROID_NDK_VERSION_LOL}}"
DEFAULT_ANDROID_NDK_ROOT_WOW=$ANDROID_NDK_ROOT/../$ANDROID_NDK_VERSION_WOW
ANDROID_NDK_ROOT_WOW="${ANDROID_NDK_ROOT_WOW:-${DEFAULT_ANDROID_NDK_ROOT_WOW}}"
export ANDROID_NDK_ROOT_WOW=`realpath $ANDROID_NDK_ROOT_WOW`
DEFAULT_ANDROID_NDK_ROOT_LOL=$ANDROID_NDK_ROOT/../$ANDROID_NDK_VERSION_LOL
ANDROID_NDK_ROOT_LOL="${ANDROID_NDK_ROOT_LOL:-${DEFAULT_ANDROID_NDK_ROOT_LOL}}"
export ANDROID_NDK_ROOT_LOL=`realpath $ANDROID_NDK_ROOT_LOL`
DEFAULT_BUILD_ROOT_WOW=${BUILD_PATH}/$ANDROID_NDK_VERSION_WOW
BUILD_ROOT_WOW="${BUILD_ROOT_WOW:-${DEFAULT_BUILD_ROOT_WOW}}"
export BUILD_ROOT_WOW=`realpath $BUILD_ROOT_WOW`
DEFAULT_BUILD_ROOT_LOL=${BUILD_PATH}/$ANDROID_NDK_VERSION_LOL
BUILD_ROOT_LOL="${BUILD_ROOT_LOL:-${DEFAULT_BUILD_ROOT_LOL}}"
export BUILD_ROOT_LOL=`realpath $BUILD_ROOT_LOL`

@ -1,86 +0,0 @@
#!/usr/bin/env bash
# Copyright (c) 2019, The Wownero Project
# Copyright (c) 2014-2019, The Monero Project
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification, are
# permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this list of
# conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice, this list
# of conditions and the following disclaimer in the documentation and/or other
# materials provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names of its contributors may be
# used to endorse or promote products derived from this software without specific
# prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
# THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
set -e
source etc/scripts/build-external-libs/env.sh
build_root=$BUILD_ROOT
src_root=$BUILD_ROOT_SRC
version=1.16
name=libiconv
cd $src_root/${name}-${version}
archs=(arm64)
for arch in ${archs[@]}; do
extra_cmake_flags=""
case ${arch} in
"arm64")
target_host=aarch64-linux-android
;;
"x86_64")
target_host=x86_64-linux-android
;;
*)
exit 16
;;
esac
# PREFIX=$build_root/build/${name}/$arch
PREFIX=$build_root/build/$arch
echo "building for ${arch}"
(
PATH=$build_root/tool/$arch/$target_host/bin:$build_root/tool/$arch/bin:$PATH
if [ -x "$(command -v ccache)" ]; then
echo "////////////////////////////////////////////"
echo "// CCACHE 1 //"
echo "////////////////////////////////////////////"
CC="ccache clang"
CXX="ccache clang++"
else
CC=clang
CXX=clang++
fi
./configure \
--prefix=${PREFIX} \
--build=x86_64-linux-gnu \
--host=${target_host} \
--disable-rpath \
&& make -j${NPROC} && make install && make clean \
)
done
exit 0

@ -36,9 +36,9 @@ source etc/scripts/build-external-libs/env.sh
build_root=$BUILD_ROOT
src_root=$BUILD_ROOT_SRC
build_root_wow=$BUILD_ROOT_WOW
build_root_lol=$BUILD_ROOT_LOL
name=wownero
name=lolnero
cd $src_root/${name}
@ -60,40 +60,40 @@ for arch in ${archs[@]}; do
;;
esac
# PREFIX=$build_root/build/${name}/$arch
ndk_root=${BUILD_ROOT_LOL}/mirror
echo "ndk_root: $ndk_root"
PREFIX=$build_root/build/$arch
echo "building for ${arch}"
mkdir -p $PREFIX/dlib/
rm -f $PREFIX/dlib/libtinfo.so.5
ln -s $PATH_NCURSES/lib/libncursesw.so.5 $PREFIX/dlib/libtinfo.so.5
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PREFIX/dlib
export TOOLCHAIN_DIR=`realpath $build_root_wow/tool/${arch}`
export PATH=$PATH:$build_root/host/bin
ccdir=$ndk_root/toolchains/llvm/prebuilt/linux-x86_64/bin/host/bin
mkdir -p build/release
pushd .
cd build/release
(
CMAKE_INCLUDE_PATH="${PREFIX}/include" \
CMAKE_LIBRARY_PATH="${PREFIX}/lib" \
CC=aarch64-linux-android-clang \
CXX=aarch64-linux-android-clang++ \
cmake \
-D BUILD_TESTS=OFF \
-D ARCH="armv8-a" \
-D STATIC=ON \
-D BUILD_64=ON \
CC="$ccdir/aarch64-linux-android-clang" \
CXX="$ccdir/aarch64-linux-android-clang++" \
cmake \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-G Ninja \
-DOPENSSL_INCLUDE_DIR=$PREFIX/include/openssl \
-DOPENSSL_CRYPTO_LIBRARY=$PREFIX/lib/libcrypto.a \
-DOPENSSL_SSL_LIBRARY=$PREFIX/lib/libssl.a \
-DBoost_INCLUDE_DIR=$PREFIX/include \
-DBoost_LIBRARY_DIR=$PREFIX/lib \
-DSODIUM_LIBRARY=$PREFIX/lib/libsodium.a \
-D CMAKE_BUILD_TYPE=release \
-D ANDROID=true \
-D INSTALL_VENDORED_LIBUNBOUND=ON \
-D BUILD_TAG="android-armv8" \
-D CMAKE_SYSTEM_NAME="Android" \
-D CMAKE_ANDROID_STANDALONE_TOOLCHAIN="${TOOLCHAIN_DIR}" \
-D CMAKE_ANDROID_ARCH_ABI="arm64-v8a" \
-D MANUAL_SUBMODULES=ON \
../.. && make -j${NPROC} daemon
-D ANDROID_ABI="arm64-v8a" \
-D USE_READLINE=OFF \
-DCMAKE_TOOLCHAIN_FILE=${ndk_root}/build/cmake/android.toolchain.cmake \
-DANDROID_TOOLCHAIN=clang \
-DANDROID_NATIVE_API_LEVEL=28 \
../.. && ninja -j${NPROC} lolnerod
)
popd

@ -1,6 +1,6 @@
#!/usr/bin/env bash
# Copyright (c) 2019, The Wownero Project
# Copyright (c) 2019-2020, The Wownero Project
# Copyright (c) 2014-2019, The Monero Project
#
# All rights reserved.
@ -35,21 +35,31 @@ source etc/scripts/build-external-libs/env.sh
cd $BUILD_ROOT_SRC
name=libiconv
version=1.16
hash=e6a1b1b589654277ee790cce3734f07876ac4ccfaecbee8afa0b649cf529cc04
url=http://ftp.gnu.org/pub/gnu/${name}/${name}-${version}.tar.gz
out=${name}-${version}.tar.gz
name=lolnero
version=v0.5.0.0
# version=dev-v0.8
githash=1271a7e3a97c0d81816b401627aefb6c6697d0b3
out=lolnero
rm -rf ${name}-${version}
chmod u+w -f -R $out || true
if [ ! -z $SRC_ICONV ]; then
rm -rf $out
if [ ! -z $SRC_LOLNERO_DIR ]; then
echo "using pre-fetched $name"
cp $SRC_ICONV $out
rsync -av --no-perms --no-owner --no-group --delete $SRC_LOLNERO_DIR/* $out
chmod u+w -R $out/vendor
cd $name
else
curl -# -L -o $out -O $url
git clone --depth 1 https://gitlab.com/fuwa/lolnero.git -b $version
cd $name
test `git rev-parse HEAD` = $githash || exit 1
fi
echo "$hash $out" | sha256sum -c
tar -xzf $out
if [ ! -z $SRC_RAPIDJSON_DIR ]; then
echo "using pre-fetched rapidjson"
rsync -av --no-perms --no-owner --no-group --delete $SRC_RAPIDJSON_DIR/* vendor/rapidjson
else
git submodule update --init vendor/rapidjson
fi

@ -37,7 +37,7 @@ build_root=$BUILD_ROOT
src_root=$BUILD_ROOT_SRC
name=openssl
version=1.1.1g
version=1.1.1k
cd $src_root/${name}-${version}

@ -48,8 +48,8 @@ if [ ! -z $SRC_OPENSSL ]; then
cp $SRC_OPENSSL $out
else
curl -# -L -o $out -O $url
echo "${hash} $out" | sha256sum -c
fi
echo "${hash} $out" | sha256sum -c
tar xzf $out

@ -48,8 +48,8 @@ if [ ! -z $SRC_SODIUM ]; then
cp $SRC_SODIUM $out
else
curl -# -L -o $out -O $url
echo "${hash} $out" | sha256sum -c
fi
echo "${hash} $out" | sha256sum -c
tar xzf $out

@ -30,16 +30,14 @@
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
set -e
source etc/scripts/build-external-libs/env.sh
build_root=$BUILD_ROOT_WOW
PATH=$ANDROID_NDK_ROOT_WOW/build/tools/:$PATH
archs=(arm64)
build_root=$BUILD_ROOT_LOL
# PATH=$ANDROID_NDK_ROOT_LOL/build/tools/:$PATH
mkdir -p $build_root
ndk_mirror=$build_root/mirror
cp -vr $ANDROID_NDK_ROOT_LOL/ $ndk_mirror
chmod u+w -R $ndk_mirror
for arch in ${archs[@]}; do
cd $build_root/tool/$arch/sysroot && \
mkdir -p var/empty/include/android && \
cp usr/include/android/api-level.h var/empty/include/android/
done

@ -1,49 +0,0 @@
#!/usr/bin/env bash
# Copyright (c) 2019, The Wownero Project
# Copyright (c) 2014-2019, The Monero Project
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification, are
# permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this list of
# conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice, this list
# of conditions and the following disclaimer in the documentation and/or other
# materials provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names of its contributors may be
# used to endorse or promote products derived from this software without specific
# prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
# THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
set -e
source etc/scripts/build-external-libs/env.sh
build_root=$BUILD_ROOT_WOW
PATH=$ANDROID_NDK_ROOT_WOW/build/tools/:$PATH
args="--api 23 --stl=libc++"
archs=(arm64)
for arch in ${archs[@]}; do
if [ ! -d "$build_root/tool/$arch" ]; then
echo "installing $arch"
make_standalone_toolchain.py $args --arch $arch --install-dir $build_root/tool/$arch
fi
done

@ -40,10 +40,14 @@ args="--api 29 --stl=libc++"
archs=(arm64)
for arch in ${archs[@]}; do
bin=$ANDROID_NDK_ROOT/build/tools/make_standalone_toolchain.py
if [ ! -d "$build_root/tool/$arch" ]; then
out=$build_root/tool/$arch
echo "installing toolchain for ${arch} into $out"
if [ ! -d "$out" ]; then
echo "installing $arch"
make_standalone_toolchain.py $args --arch $arch --install-dir $build_root/tool/$arch
$bin $args --arch $arch --install-dir $out
fi
done

@ -1,86 +0,0 @@
#!/usr/bin/env bash
# Copyright (c) 2019-2020, The Wownero Project
# Copyright (c) 2014-2019, The Monero Project
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification, are
# permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this list of
# conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice, this list
# of conditions and the following disclaimer in the documentation and/or other
# materials provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names of its contributors may be
# used to endorse or promote products derived from this software without specific
# prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
# THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
set -e
source etc/scripts/build-external-libs/env.sh
cd $BUILD_ROOT_SRC
name=wownero
version=v0.8.0.0
# version=dev-v0.8
githash=1271a7e3a97c0d81816b401627aefb6c6697d0b3
out=wownero
chmod u+w -f -R $out || true
rm -rf $out
if [ ! -z $SRC_WOWNERO_DIR ]; then
echo "using pre-fetched $name"
rsync -av --no-perms --no-owner --no-group --delete $SRC_WOWNERO_DIR/* $out
chmod u+w -R $out/external
cd $name
else
git clone --depth 1 https://github.com/wownero/wownero.git -b $version
cd $name
test `git rev-parse HEAD` = $githash || exit 1
fi
if [ ! -z $SRC_MINIUPNP_DIR ]; then
echo "using pre-fetched miniupnpc"
rsync -av --no-perms --no-owner --no-group --delete $SRC_MINIUPNP_DIR/* external/miniupnp
else
git submodule update --init external/miniupnp
fi
if [ ! -z $SRC_RAPIDJSON_DIR ]; then
echo "using pre-fetched rapidjson"
rsync -av --no-perms --no-owner --no-group --delete $SRC_RAPIDJSON_DIR/* external/rapidjson
else
git submodule update --init external/rapidjson
fi
if [ ! -z $SRC_RANDOMWOW ]; then
echo "using pre-fetched RandomWOW"
tar xzf $SRC_RANDOMWOW -C external/RandomWOW --strip-components=1
else
git submodule update --init external/RandomWOW
fi
if [ ! -z $SRC_UNBOUND_DIR ]; then
echo "using pre-fetched unbound"
rsync -av --no-perms --no-owner --no-group --delete $SRC_UNBOUND_DIR/* external/unbound
else
git submodule update --init external/unbound
fi

@ -26,7 +26,7 @@ apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
compileSdkVersion 29
compileSdkVersion 30
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
@ -38,11 +38,11 @@ android {
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "org.wownero.cyberwow"
minSdkVersion 26
targetSdkVersion 29
versionCode 27
versionName "0.8.0.0-a"
applicationId "org.lolnero.node"
minSdkVersion 28
targetSdkVersion 30
versionCode 49
versionName "0.9.5.1"
}
if(project.hasProperty("RELEASE_STORE_FILE")) {

@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.wownero.cyberwow">
package="org.lolnero.node">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->

@ -1,9 +1,9 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.wownero.cyberwow">
package="org.lolnero.node">
<application
android:name="io.flutter.app.FlutterApplication"
android:label="CyberWOW"
android:label="L node"
android:icon="@drawable/icon">
<activity
android:name=".MainActivity"

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.wownero.cyberwow">
package="org.lolnero.node">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

@ -19,8 +19,7 @@ along with CyberWOW. If not, see <https://www.gnu.org/licenses/>.
*/
import 'config/prototype.dart';
import 'config/cyberwow.dart' as cryptoConfig;
import 'config/lolnode.dart' as cryptoConfig;
final c = cryptoConfig.config;
@ -28,7 +27,7 @@ enum Arch { arm64, x86_64 }
const arch = Arch.arm64;
// const arch = 'x86_64';
const minimumHeight = 118361;
const minimumHeight = 60;
const isEmu = identical(arch, Arch.x86_64);
const emuHost = '192.168.10.100';
@ -40,3 +39,8 @@ const bannerShownKey = 'banner-shown';
const int maxPoolTxSize = 5000;
const int forcedUpdateInSeconds = 3;
const int processTimeoutInSeconds = 4;
const int processKillWaitingInSeconds = 2;
const int logLines = 200;
const int defaultPageIndex = 1;

@ -2,20 +2,20 @@
Copyright 2019 fuwa
This file is part of CyberWOW.
This file is part of LOLnode.
CyberWOW is free software: you can redistribute it and/or modify
LOLnode is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
CyberWOW is distributed in the hope that it will be useful,
LOLnode is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with CyberWOW. If not, see <https://www.gnu.org/licenses/>.
along with LOLnode. If not, see <https://www.gnu.org/licenses/>.
*/
@ -23,83 +23,69 @@ import 'package:flutter/material.dart';
import 'prototype.dart';
const crtGreen = Color.fromRGBO(0, 255, 102, 1);
// const crtGreen = Color.fromRGBO(0, 255, 102, 1);
const crtGreen = Color.fromRGBO(51, 255, 51, 1);
final _theme = ThemeData
(
final _theme = ThemeData(
brightness: Brightness.dark,
primaryColor: crtGreen,
hintColor: Colors.yellow,
accentColor: crtGreen,
cursorColor: crtGreen,
backgroundColor: Colors.black,
scaffoldBackgroundColor: Colors.black,
textTheme: TextTheme
(
display1: TextStyle
(
textButtonTheme: TextButtonThemeData(
style: TextButton.styleFrom(primary: crtGreen),
),
textSelectionTheme: TextSelectionThemeData(
cursorColor: crtGreen,
selectionColor: crtGreen,
selectionHandleColor: crtGreen,
),
textTheme: TextTheme(
headline4: TextStyle(
fontFamily: 'RobotoMono',
fontSize: 35,
fontWeight: FontWeight.bold,
),
display2: TextStyle
(
headline3: TextStyle(
fontFamily: 'RobotoMono',
fontSize: 22,
),
title: TextStyle
(
headline6: TextStyle(
fontFamily: 'VT323',
fontSize: 22,
),
subhead: TextStyle
(
subtitle1: TextStyle(
fontFamily: 'RobotoMono',
fontSize: 17,
fontWeight: FontWeight.bold,
),
body1: TextStyle
(
bodyText2: TextStyle(
fontFamily: 'VT323',
fontSize: 17,
fontSize: 16,
height: 1,
),
body2: TextStyle
(
bodyText1: TextStyle(
fontFamily: 'RobotoMono',
fontSize: 12.5,
fontSize: 12,
),
).apply
(
).apply(
bodyColor: crtGreen,
displayColor: crtGreen,
),
);
final config = CryptoConfig
(
'libwownerod.so',
'wownerod',
'Follow the white rabbit.',
final config = CryptoConfig(
'liblolnerod.so',
'lolnerod',
'Is this a test, sir?',
70,
_theme,
34568,
45679,
[
'--prune-blockchain',
'--max-concurrency=1',
'--fast-block-sync=1',
'--block-sync-size=5',
'--no-igd',
'--check-updates=disabled',
'--disable-dns-checkpoints',
'--log-file=/dev/null',
'--max-log-file-size=0',
'--p2p-use-ipv6',
],
'[1337@cyberwow]: ',
'[1337@lol]: ',
6,
2,
);

@ -31,8 +31,8 @@ class CryptoConfig {
final List<String> extraArgs;
final String promptString;
final int hashViewBlockLength;
const CryptoConfig
(
final int peerMinimumConnectedTimeInSeconds;
const CryptoConfig(
this.outputBin,
this.appPath,
this.splash,
@ -42,5 +42,6 @@ class CryptoConfig {
this.extraArgs,
this.promptString,
this.hashViewBlockLength,
this.peerMinimumConnectedTimeInSeconds,
);
}

@ -32,70 +32,32 @@ import '../../sensor/helper.dart' as helper;
typedef ShouldExit = bool Function();
Stream<String> runBinary
(
final String name,
{ final Stream<String> input,
final ShouldExit shouldExit,
final List<String> userArgs = const [],
}
) async* {
Future<Process> runBinary(
final String name, {
final List<String> userArgs = const [],
}) async {
final binPath = await helper.getBinaryPath(name);
final appDocDir = await getApplicationDocumentsDirectory();
final appDocPath = appDocDir.path;
final binDir = Directory(appDocDir.path + "/" + config.c.appPath);
await binDir.create();
// print('binDir: ' + binDir.path);
const List<String> debugArgs =
[
];
const List<String> releaseArgs =
[
];
const List<String> debugArgs = [];
const List<String> releaseArgs = [];
const extraArgs = kReleaseMode ? releaseArgs : debugArgs;
final args =
[
"--data-dir",
binDir.path,
] + extraArgs + config.c.extraArgs + userArgs;
final args = [
"--data-dir",
binDir.path,
] +
extraArgs +
config.c.extraArgs +
userArgs;
log.info('args: ' + args.toString());
final outputProcess = await Process.start(binPath, args);
Future<void> printInput() async {
await for (final line in input) {
log.finest('process input: ' + line);
outputProcess.stdin.writeln(line);
outputProcess.stdin.flush();
}
}
if (input != null) {
printInput();
}
final _stdout = outputProcess.stdout
.transform(utf8.decoder).transform(const LineSplitter());
await for (final line in _stdout) {
log.finest('process output: ' + line);
yield line;
}
if (config.isEmu) return;
if (shouldExit != null) {
if (!shouldExit()) {
log.warning('process is ded');
exit(1);
}
}
log.info('Daemon exited gracefully.');
return Process.start(binPath, args);
}

@ -29,25 +29,18 @@ import '../../../config.dart' as config;
import '../../../helper.dart';
import '../../../logging.dart';
Future<http.Response> rpcHTTP(final String method) async {
final url = 'http://${config.host}:${config.c.port}/json_rpc';
Future<http.Response?> rpcHTTP(final String method) async {
final url = Uri.parse('http://${config.host}:${config.c.port}/json_rpc');
final body = json.encode
(
{
'jsonrpc': '2.0',
'method': method,
}
);
final body = json.encode({
'jsonrpc': '2.0',
'method': method,
});
try {
final response = await http.post
( url,
body: body
);
final response = await http.post(url, body: body);
return response;
}
catch (e) {
} catch (e) {
log.warning(e);
return null;
}
@ -55,7 +48,7 @@ Future<http.Response> rpcHTTP(final String method) async {
dynamic jsonDecode(final String responseBody) => json.decode(responseBody);
Future<dynamic> rpc(final String method, {final String field}) async {
Future<dynamic> rpc(final String method, {final String? field}) async {
final response = await rpcHTTP(method);
if (response == null) return null;
@ -73,7 +66,7 @@ Future<dynamic> rpc(final String method, {final String field}) async {
}
}
Future<String> rpcString(final String method, {final String field}) async {
Future<String> rpcString(final String method, {final String? field}) async {
final _field = await rpc(method, field: field);
return pretty(_field);
}

@ -25,22 +25,20 @@ import 'dart:math';
import 'package:http/http.dart' as http;
import 'package:flutter/foundation.dart';
import 'package:intl/intl.dart';
import '../../../config.dart' as config;
import '../../../helper.dart';
import '../../../logging.dart';
Future<http.Response> rpc2(final String method) async {
final url = 'http://${config.host}:${config.c.port}/${method}';
Future<http.Response?> rpc2(final String method) async {
final url = Uri.parse('http://${config.host}:${config.c.port}/$method');
try {
final response = await http.post
( url,
final response = await http.post(
url,
);
return response;
}
catch (e) {
} catch (e) {
log.warning(e);
return null;
}
@ -48,7 +46,7 @@ Future<http.Response> rpc2(final String method) async {
dynamic jsonDecode(final String responseBody) => json.decode(responseBody);
Future<String> rpc2String(final String method, {final String field}) async {
Future<String> rpc2String(final String method, {final String? field}) async {
final response = await rpc2(method);
if (response == null) return '';
@ -57,7 +55,7 @@ Future<String> rpc2String(final String method, {final String field}) async {
return '';
} else {
final _body = await compute(jsonDecode, response.body);
final _field = field == null ? _body: _body[field];
final _field = field == null ? _body : _body[field];
return pretty(_field);
}

@ -20,7 +20,6 @@ along with CyberWOW. If not, see <https://www.gnu.org/licenses/>.
*/
import 'dart:async';
import 'dart:convert';
import 'rpc/rpc.dart' as rpc;
import '../../config.dart' as config;
@ -28,14 +27,16 @@ import '../../logging.dart';
Future<bool> isConnected() async {
final _connections = await rpc.getConnectionsSimple();
log.finer('cyberwow: _connections: ${_connections}');
return !_connections.isEmpty;
log.finer('cyberwow: _connections: $_connections');
return _connections.isNotEmpty;
}
Future<bool> isSynced() async {
final _targetHeight = await rpc.targetHeight();
final _height = await rpc.height();
return _targetHeight >= 0 && _targetHeight <= _height && _height > config.minimumHeight;
return _targetHeight >= 0 &&
_targetHeight <= _height &&
_height > config.minimumHeight;
}
Future<bool> isNotSynced() async {

@ -20,22 +20,13 @@ along with Wowllet. If not, see <https://www.gnu.org/licenses/>.
*/
import 'dart:async';
import 'dart:io';
import 'package:path_provider/path_provider.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/services.dart';
import '../../logging.dart';
const _methodChannel = const MethodChannel('send-intent');
Future<String> getBinaryDir() async {
final _dir = await _methodChannel.invokeMethod('getBinaryDir');
final _binDir = Directory(_dir);
final _bins = _binDir.listSync(recursive: true);
return _dir;
}

@ -20,21 +20,19 @@ along with CyberWOW. If not, see <https://www.gnu.org/licenses/>.
*/
import 'dart:async';
import 'dart:convert';
import 'package:http/http.dart' as http;
import '../../../helper.dart';
import '../../../logging.dart';
import '../../interface/rpc/rpc.dart';
import '../../../config.dart' as config;
Future<http.Response> syncInfo() => rpc('sync_info');
Future<dynamic> syncInfo() => rpc('sync_info');
Future<String> syncInfoString() => rpcString('sync_info');
Future<int> targetHeight() => rpc('sync_info', field: 'target_height').then(asInt);
Future<int> targetHeight() =>
rpc('sync_info', field: 'target_height').then(asInt);
Future<int> height() => rpc('sync_info', field: 'height').then(asInt);
Future<http.Response> getInfo() => rpc('get_info');
Future<dynamic> getInfo() => rpc('get_info');
Future<Map<String, dynamic>> getInfoSimple() async {
final _getInfo = await rpc('get_info').then(asMap);
@ -47,26 +45,23 @@ Future<String> getInfoString() => rpcString('get_info');
Future<bool> offline() => rpc('get_info', field: 'offline').then(asBool);
Future<int> outgoingConnectionsCount() =>
rpc('get_info', field: 'outgoing_connections_count').then(asInt);
rpc('get_info', field: 'outgoing_connections_count').then(asInt);
Future<int> incomingConnectionsCount() =>
rpc('get_info', field: 'incoming_connections_count').then(asInt);
rpc('get_info', field: 'incoming_connections_count').then(asInt);
Future<List<Map<String, dynamic>>> getConnectionsSimple() async {
final _connections = await rpc('get_connections', field: 'connections').then(asJsonArray);
final _connections =
await rpc('get_connections', field: 'connections').then(asJsonArray);
const minActiveTime = 8;
final _activeConnections = _connections.where((x) => x['live_time'] > minActiveTime);
final _activeConnections = _connections.where(
(x) => x['live_time'] > config.c.peerMinimumConnectedTimeInSeconds);
final _sortedConn = _activeConnections.toList()..sort
(
(x, y) {
final _sortedConn = _activeConnections.toList()
..sort((x, y) {
final int a = x['live_time'];
final int b = y['live_time'];
return a.compareTo(b);
}
);
});
return _sortedConn.toList();
}

@ -31,7 +31,8 @@ import '../../../config.dart' as config;
import '../../../logging.dart';
import '../../interface/rpc/rpc2.dart' as rpc2;
Future<http.Response> getTransactionPool() async => rpc2.rpc2('get_transaction_pool');
Future<http.Response?> getTransactionPool() async =>
rpc2.rpc2('get_transaction_pool');
Map<String, String> txInOutCache = {};
@ -48,46 +49,41 @@ Future<List<Map<String, dynamic>>> getTransactionPoolSimple() async {
} else {
final responseBody = json.decode(response.body);
final result = asJsonArray(responseBody['transactions']);
final _sortedPool = result..sort
(
(x, y) {
final _sortedPool = result
..sort((x, y) {
final int a = x['receive_time'];
final int b = y['receive_time'];
return b.compareTo(a);
}
);
final _decodedPool = await Stream.fromIterable(_sortedPool).asyncMap
(
(x) async {
if (txInOutCache.length > config.maxPoolTxSize) {
txInOutCache = {};
}
});
final _txid = x['id_hash'];
final _decodedPool = Stream.fromIterable(_sortedPool).asyncMap((x) async {
if (txInOutCache.length > config.maxPoolTxSize) {
txInOutCache = {};
}
if (txInOutCache[_txid] == null) {
final String _tx_json = x['tx_json'];
final _tx_json_decoded = await compute(jsonDecode, _tx_json);
final _txid = x['id_hash'];
final _inOut =
{
'vin': _tx_json_decoded['vin'].length,
'vout': _tx_json_decoded['vout'].length,
};
if (txInOutCache[_txid] == null) {
final String _txJson = x['tx_json'];
final _txJsonDecoded = await compute(jsonDecode, _txJson);
final _inOutString = _inOut['vin'].toString() + '/' + _inOut['vout'].toString();
final _inOut = {
'vin': _txJsonDecoded['vin'].length,
'vout': _txJsonDecoded['vout'].length,
};
txInOutCache[_txid] = _inOutString;
log.fine('cached tx_json in pool for: ${_txid}');
}
final _inOutString =
_inOut['vin'].toString() + '/' + _inOut['vout'].toString();
return {
...x,
...{'i/o': txInOutCache[_txid]},
};
txInOutCache[_txid] = _inOutString;
log.fine('cached tx_json in pool for: $_txid');
}
);
return {
...x,
...{'i/o': txInOutCache[_txid]},
};
});
return _decodedPool.toList();
}

@ -21,12 +21,10 @@ along with CyberWOW. If not, see <https://www.gnu.org/licenses/>.
import 'package:intl/intl.dart';
import '../../../config.dart' as config;
import '../../../helper.dart';
Map<String, dynamic> getConnectionView(Map<String, dynamic> x) {
const _remove =
[
const _remove = [
'address_type',
'connection_id',
'ip',
@ -50,44 +48,38 @@ Map<String, dynamic> getConnectionView(Map<String, dynamic> x) {
'incoming',
];
final _filteredConn = x..removeWhere
(
(k,v) => _remove.contains(k)
);
final _filteredConn = x..removeWhere((k, v) => _remove.contains(k));
final _formattedConn = _filteredConn.map
(
(k, v) {
switch (k) {
case 'connection_id': {
final _formattedConn = _filteredConn.map((k, v) {
switch (k) {
case 'connection_id':
{
return MapEntry(k, trimHash(v));
}
case 'live_time': {
case 'live_time':
{
final _duration = Duration(seconds: v);
format(Duration d) => d.toString().split('.').first.padLeft(8, "0");
return MapEntry(k, format(_duration));
}
default: {
const speedField =
[
default:
{
const speedField = [
'avg_download',
'avg_upload',
'current_download',
'current_upload',
];
if (speedField.contains(k)) {
return MapEntry(k, '${v} kB/s');
}
else {
return MapEntry(k, '$v kB/s');
} else {
return MapEntry(k, v);
}
}
}
}
);
});
final List<String> keys =
[
final List<String> keys = [
'host',
'height',
'live_time',
@ -95,54 +87,35 @@ Map<String, dynamic> getConnectionView(Map<String, dynamic> x) {
'current_upload',
'avg_download',
'avg_upload',
'pruning_seed',
]
.where((k) => _formattedConn.keys.contains(k))
.toList();
].where((k) => _formattedConn.keys.contains(k)).toList();
final _sortedConn = {
for (final k in keys) k: _formattedConn[k]
};
final _sortedConn = {for (final k in keys) k: _formattedConn[k]};
final _cleanedUpConn = _sortedConn..removeWhere
(
(k,v) => k == 'pruning_seed' && x[k] == 0
);
final _cleanedUpConn = _sortedConn;
return _cleanedUpConn;
}
Map<String, dynamic> simpleHeight(int height, Map<String, dynamic> x) {
return x.map
(
(k, v) {
if (k == 'height') {
if (v == 0) {
return MapEntry(k, '');
}
else if (v < height) {
return MapEntry(k, '-${height - v}');
}
else if (v == height) {
return MapEntry(k, '');
}
else {
return MapEntry(k, '+${v - height}');
}
}
else {
return MapEntry(k, v);
return x.map((k, v) {
if (k == 'height') {
if (v == 0) {
return MapEntry(k, '');
} else if (v < height) {
return MapEntry(k, '-${height - v}');
} else if (v == height) {
return MapEntry(k, '');
} else {
return MapEntry(k, '+${v - height}');
}
} else {
return MapEntry(k, v);
}
);
});
}
Map<String, dynamic> getInfoView(Map<String, dynamic> x) {
const _remove =
[
const _remove = [
'difficulty_top64',
'stagenet',
'testnet',
@ -157,10 +130,7 @@ Map<String, dynamic> getInfoView(Map<String, dynamic> x) {
'credits',
];
final _filteredInfo = x..removeWhere
(
(k,v) => _remove.contains(k)
);
final _filteredInfo = x..removeWhere((k, v) => _remove.contains(k));
final int _difficulty = _filteredInfo['difficulty'] ?? 0;
final Map<String, double> _hashRate = {'hash_rate': _difficulty / 300};
@ -169,23 +139,23 @@ Map<String, dynamic> getInfoView(Map<String, dynamic> x) {
..._hashRate,
};
final _formattedInfo = _ammendedInfo.map
(
(k, v) {
switch (k) {
case 'top_block_hash': {
final _formattedInfo = _ammendedInfo.map((k, v) {
switch (k) {
case 'top_block_hash':
{
return MapEntry(k, trimHash(v));
}
case 'start_time': {
final _receive_time = DateTime.fromMillisecondsSinceEpoch(v * 1000);
final _diff = DateTime.now().difference(_receive_time);
case 'start_time':
{
final _receiveTime = DateTime.fromMillisecondsSinceEpoch(v * 1000);
final _diff = DateTime.now().difference(_receiveTime);
format(Duration d) => d.toString().split('.').first.padLeft(8, "0");
return MapEntry('uptime', format(_diff));
}
default: {
const sizeField =
[
default:
{
const sizeField = [
'block_size_limit',
'block_size_median',
'block_weight_limit',
@ -200,27 +170,20 @@ Map<String, dynamic> getInfoView(Map<String, dynamic> x) {
if (sizeField.contains(k)) {
final formatter = NumberFormat.compact();
return MapEntry(k, formatter.format(v));
}
else {
} else {
return MapEntry(k, v);
}
}
}
}
);
final _cleanedUpInfo = _formattedInfo.map
(
(k, v) {
if (k.contains('_count') && k != 'tx_count') {
return MapEntry(k.replaceAll('_count', ''), v);
}
});
else {
return MapEntry(k, v);
}
final _cleanedUpInfo = _formattedInfo.map((k, v) {
if (k.contains('_count') && k != 'tx_count') {
return MapEntry(k.replaceAll('_count', ''), v);
} else {
return MapEntry(k, v);
}
);
});
final _sortedInfo = {
for (final k in _cleanedUpInfo.keys.toList()..sort()) k: _cleanedUpInfo[k]

@ -23,12 +23,10 @@ import 'dart:math';
import 'package:intl/intl.dart';
import '../../../config.dart' as config;
import '../../../helper.dart';
Map<String, dynamic> txView(Map<String, dynamic> x) {
const _remove =
[
const _remove = [
'tx_blob',
// 'tx_json',
'last_failed_id_hash',
@ -45,57 +43,44 @@ Map<String, dynamic> txView(Map<String, dynamic> x) {
// 'blob_size',
];
final _filteredTx = x..removeWhere
(
(k,v) => _remove.contains(k)
);
final _formattedTx = _filteredTx.map
(
(k, v) {
switch (k) {
case 'id_hash':
return MapEntry('id', trimHash(v));
case 'blob_size':
return MapEntry('size', (v / 1024).toStringAsFixed(2) + ' kB');
case 'fee': {
final formatter = NumberFormat.currency
(
final _filteredTx = x..removeWhere((k, v) => _remove.contains(k));
final _formattedTx = _filteredTx.map((k, v) {
switch (k) {
case 'id_hash':
return MapEntry('id', trimHash(v));
case 'blob_size':
return MapEntry('size', (v / 1024).toStringAsFixed(2) + ' kB');
case 'fee':
{
final formatter = NumberFormat.currency(
symbol: '',
decimalDigits: 2,
);
return MapEntry(k, formatter.format(v / pow(10, 11)) + '');
}
case 'receive_time': {
final _receive_time = DateTime.fromMillisecondsSinceEpoch(v * 1000);
final _diff = DateTime.now().difference(_receive_time);
case 'receive_time':
{
final _receiveTime = DateTime.fromMillisecondsSinceEpoch(v * 1000);
final _diff = DateTime.now().difference(_receiveTime);
format(Duration d) => d.toString().split('.').first.padLeft(8, "0");
return MapEntry('age', format(_diff));
}
default:
return MapEntry(k, v);
}
default:
return MapEntry(k, v);
}
});
);
final List<String> keys =
[
final List<String> keys = [
'id',
'age',
'fee',
'i/o',
'size',
]
.where((k) => _formattedTx.keys.contains(k))
.toList();
].where((k) => _formattedTx.keys.contains(k)).toList();
final _sortedTx = {
for (final k in keys) k: _formattedTx[k]
};
final _sortedTx = {for (final k in keys) k: _formattedTx[k]};
return _sortedTx;
}

@ -26,9 +26,9 @@ import 'package:logging/logging.dart';
import 'dart:io';
import 'dart:async';
import 'dart:collection';
import 'config.dart' as config;
import 'logic/controller/process/run.dart' as process;
import 'logging.dart';
import 'state.dart' as state;
import 'widget.dart' as widget;
@ -36,70 +36,66 @@ import 'widget.dart' as widget;
void main() {
Logger.root.level = kReleaseMode ? Level.INFO : Level.FINE;
Logger.root.onRecord.listen((LogRecord rec) {
print('${rec.level.name}: ${rec.time}: ${rec.message}');
print('${rec.level.name}: ${rec.time}: ${rec.message}');
});
runApp(CyberWOW_App());
runApp(LNodeApp());
}
class CyberWOW_App extends StatelessWidget {
class LNodeApp extends StatelessWidget {
@override
Widget build(final BuildContext context) {
SystemChrome.setEnabledSystemUIOverlays([SystemUiOverlay.bottom]);
SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle.dark);
return MaterialApp
(
title: 'CyberWOW',
return MaterialApp(
title: 'L node',
theme: config.c.theme,
darkTheme: config.c.theme,
home: CyberWOW_Page(title: 'CyberWOW'),
home: LNodePage(),
);
}
}
class CyberWOW_Page extends StatefulWidget {
CyberWOW_Page({Key key, this.title}) : super(key: key);
final String title;
class LNodePage extends StatefulWidget {
LNodePage({Key? key}) : super(key: key);
@override
_CyberWOW_PageState createState() => _CyberWOW_PageState();
_LNodePageState createState() => _LNodePageState();
}
class _CyberWOW_PageState extends State<CyberWOW_Page> with WidgetsBindingObserver
{
class _LNodePageState extends State<LNodePage> with WidgetsBindingObserver {
// AppState _state = LoadingState("init...");
static const _channel = const MethodChannel('send-intent');
state.AppState _state;
state.AppState? _state;
AppLifecycleState _notification = AppLifecycleState.resumed;
bool _exiting = false;
final StreamController<String> inputStreamController = StreamController();
final StreamController<String> _inputStreamController = StreamController();
Future<String> getInitialIntent() async {
final text = await _channel.invokeMethod('getInitialIntent');
log.fine('getInitialIntent: ${text}');
log.fine('getInitialIntent: $text');
return text;
}
@override
void didChangeAppLifecycleState(final AppLifecycleState state) {
log.fine('app cycle: ${state}');
setState(() { _notification = state; });
log.fine('app cycle: $state');
setState(() {
_notification = state;
});
}
@override
void dispose() {
WidgetsBinding.instance.removeObserver(this);
WidgetsBinding.instance?.removeObserver(this);
_inputStreamController.close();
super.dispose();
}
void _setState(final state.AppState newState) {
setState
(
() => _state = newState
);
setState(() => _state = newState);
}
AppLifecycleState _getNotification() {
@ -110,59 +106,31 @@ class _CyberWOW_PageState extends State<CyberWOW_Page> with WidgetsBindingObserv
return _exiting;
}
state.AppState _getState() {
return _state;
}
Future<void> buildStateMachine(final state.BlankState _blankState) async {
final loadingText = config.c.splash;
state.LoadingState _loadingState = await _blankState.next(loadingText);
state.SyncingState _syncingState = await _loadingState.next();
final _initialIntent = await getInitialIntent();
final _userArgs = _initialIntent
.trim()
.split(RegExp(r"\s+"))
.where((x) => !x.isEmpty)
.toList();
if (!_userArgs.isEmpty) {
log.info('user args: ${_userArgs}');
}
final syncing = process
.runBinary
(
config.c.outputBin,
input: inputStreamController.stream,
shouldExit: _isExiting,
userArgs: _userArgs,
)
.asBroadcastStream();
await _syncingState.next(inputStreamController.sink, syncing);
_setState(_blankState);
bool exited = false;
bool validState = true;
while (validState && !exited) {
switch (_state.runtimeType) {
case state.ExitingState: {
await (_state as state.ExitingState).wait();
log.finer('exit state wait done');
exited = true;
}
break;
case state.SyncedState:
await (_state as state.SyncedState).next();
case state.ExitingState:
{
await (_state as state.ExitingState).wait();
log.finer('exit state wait done');
exited = true;
}
break;
case state.BlankState:
case state.LoadingState:
case state.SyncingState:
case state.SyncedState:
case state.ReSyncingState:
await (_state as state.ReSyncingState).next();
_setState(await (_state as state.AppStateAutomata).next());
break;
default: validState = false;
default:
validState = false;
}
}
@ -170,7 +138,6 @@ class _CyberWOW_PageState extends State<CyberWOW_Page> with WidgetsBindingObserv
if (exited) {
log.finer('popping navigator');
// SystemNavigator.pop();
exit(0);
} else {
log.severe('Reached invalid state!');
@ -181,11 +148,18 @@ class _CyberWOW_PageState extends State<CyberWOW_Page> with WidgetsBindingObserv
@override
void initState() {
super.initState();
log.fine("CyberWOW_PageState initState");
log.fine("LNodePageState initState");
WidgetsBinding.instance.addObserver(this);
WidgetsBinding.instance?.addObserver(this);
final state.AppHook _appHook = state.AppHook(_setState, _getNotification, _isExiting);
final state.AppHook _appHook = state.AppHook(
_setState,
_getNotification,
_isExiting,
getInitialIntent,
null,
Queue(),
);
final state.BlankState _blankState = state.BlankState(_appHook);
_state = _blankState;
@ -193,11 +167,11 @@ class _CyberWOW_PageState extends State<CyberWOW_Page> with WidgetsBindingObserv
}
Future<bool> _exitApp(final BuildContext context) async {
log.info("CyberWOW_PageState _exitApp");
WidgetsBinding.instance.removeObserver(this);
log.info("LNodePageState _exitApp");
WidgetsBinding.instance?.removeObserver(this);
_exiting = true;
inputStreamController.sink.add('exit');
_inputStreamController.sink.add('exit');
await Future.delayed(const Duration(seconds: 5));
@ -208,10 +182,9 @@ class _CyberWOW_PageState extends State<CyberWOW_Page> with WidgetsBindingObserv
@override
Widget build(final BuildContext context) {
return WillPopScope
(
return WillPopScope(
onWillPop: () => _exitApp(context),
child: widget.build(context, _state),
child: widget.build(context, _state!),
);
}
}

@ -21,14 +21,18 @@ along with CyberWOW. If not, see <https://www.gnu.org/licenses/>.
import 'dart:async';
import '../logging.dart';
import 'prototype.dart';
import 'loading.dart';
class BlankState extends AppState {
BlankState(appHook) : super (appHook);
class BlankState extends AppStateAutomata {
BlankState(appHook) : super(appHook);
Future<LoadingState> next(String status) async {
LoadingState _next = LoadingState(appHook, status);
return moveState(_next);
Future<AppStateAutomata> next() async {
if (await shouldExit()) return exitState();
log.fine('blank state next');
return LoadingState(appHook);
}
}

@ -19,41 +19,34 @@ along with CyberWOW. If not, see <https://www.gnu.org/licenses/>.
*/
import 'dart:collection';
import 'dart:io';
import '../config.dart' as config;
import '../logging.dart';
import 'prototype.dart';
import 'blank.dart';
class ExitingState extends AppState {
final Queue<String> stdout;
final Stream<String> processOutput;
ExitingState(appHook, this.stdout, this.processOutput) : super (appHook);
void append(final String msg) {
stdout.addLast(msg);
while (stdout.length > config.stdoutLineBufferSize) {
stdout.removeFirst();
}
syncState();
}
class ExitingState extends AppStateAutomata {
ExitingState(appHook) : super(appHook);
Future<void> wait() async {
log.finer("Exiting wait");
Future<void> printStdout() async {
await for (final line in processOutput) {
log.finer('exiting: print stdout loop');
append(line);
log.info(line);
}
if (appHook.process != null) {
log.fine('exiting state: killing process');
appHook.process?.kill();
await appHook.process?.exitCode.timeout(
Duration(seconds: config.processKillWaitingInSeconds),
onTimeout: () {
log.warning('process exitCode timeout');
appHook.process?.kill(ProcessSignal.sigkill);
return -1;
},
);
}
await printStdout();
log.finer('exiting state done');
}
Future<AppStateAutomata> next() async {
return BlankState(appHook);
}
}

@ -0,0 +1,117 @@
/*
Copyright 2019 fuwa
This file is part of CyberWOW.
CyberWOW is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
CyberWOW is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with CyberWOW. If not, see <https://www.gnu.org/licenses/>.
*/
import 'package:shared_preferences/shared_preferences.dart';
import 'package:async/async.dart';
import 'dart:async';
import 'dart:core';
import 'dart:convert';
import 'dart:collection';
import '../config.dart' as config;
import '../helper.dart';
import '../logic/controller/process/run.dart' as process;
import '../logging.dart';
import 'prototype.dart';
import 'syncing.dart';
class LoadingState extends AppStateAutomata {
String status = '';
LoadingState(appHook) : super(appHook);
void append(final String msg) {
this.status += msg;
syncState();
}
Future<SyncingState> next() async {
Future<void> showBanner() async {
final Iterable<String> chars =
config.c.splash.runes.map((x) => String.fromCharCode(x));
for (final String char in chars) {
append(char);
final int _delay = config.c.splashDelay;
await Future.delayed(Duration(milliseconds: _delay));
}
await tick();
await tick();
}
SharedPreferences _prefs = await SharedPreferences.getInstance();
final _bannerShown = _prefs.getBool(config.bannerShownKey);
if (_bannerShown == null) {
await showBanner();
await _prefs.setBool(config.bannerShownKey, true);
}
final _initialIntent = await appHook.getInitialIntent();
final _userArgs = _initialIntent
.trim()
.split(RegExp(r"\s+"))
.where((x) => x.isNotEmpty)
.toList();
if (_userArgs.isNotEmpty) {
log.info('user args: $_userArgs');
}
final _process = await process.runBinary(
config.c.outputBin,
userArgs: _userArgs,
);
log.fine('process created');
final _stdout = StreamGroup.merge([_process.stdout, _process.stderr]
.map((x) => x.transform(utf8.decoder).transform(LineSplitter())))
.asBroadcastStream();
final _stdoutQueue = Queue();
AppHook _appHook = AppHook(
appHook.setState,
appHook.getNotification,
appHook.isExiting,
appHook.getInitialIntent,
_process,
_stdoutQueue,
);
_stdout.listen((x) {
log.fine(x);
_stdoutQueue.addLast(x);
while (_stdoutQueue.length > config.logLines) {
_stdoutQueue.removeFirst();
}
_appHook.stdoutCache = _stdoutQueue.join('\n');
});
_process.exitCode.whenComplete(() => _appHook.processCompleted = true);
return SyncingState(_appHook);
}
}

@ -0,0 +1,108 @@
/*
Copyright 2019 fuwa
This file is part of CyberWOW.
CyberWOW is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
CyberWOW is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with CyberWOW. If not, see <https://www.gnu.org/licenses/>.
*/
import 'package:flutter/material.dart';
import 'dart:collection';
import 'dart:io';
import '../config.dart' as config;
import 'exiting.dart';
typedef SetStateFunc = void Function(AppState);
typedef GetNotificationFunc = AppLifecycleState Function();
typedef IsExitingFunc = bool Function();
typedef GetInitialIntentFunc = Future<String> Function();
class AppHook {
final SetStateFunc setState;
final GetNotificationFunc getNotification;
final IsExitingFunc isExiting;
final GetInitialIntentFunc getInitialIntent;
final Process? process;
final Queue stdout;
String stdoutCache;
bool processCompleted;
AppHook(
this.setState,
this.getNotification,
this.isExiting,
this.getInitialIntent,
this.process,
this.stdout, {
this.stdoutCache = '',
this.processCompleted = false,
});
}
class AppState {
final AppHook appHook;
int skipped = 0;
AppState(this.appHook);
Future<bool> shouldExit() async {
final _isExiting = appHook.isExiting();
if (_isExiting) return true;
if (appHook.process != null && appHook.processCompleted) {
final _exitCode = await appHook.process?.exitCode;
return _exitCode != 0;
}
return false;
}
ExitingState exitState() => ExitingState(appHook);
bool isActive() {
final _appState = appHook.getNotification();
return _appState == AppLifecycleState.resumed;
}
bool shouldPop() => true;
bool shouldSkip() {
if (!isActive()) {
if (skipped < config.forcedUpdateInSeconds) {
skipped++;
return true;
} else {
skipped = 0;
return false;
}
} else {
skipped = 0;
return false;
}
}
void syncState() {
appHook.setState(this);
}
}
abstract class AppStateAutomata extends AppState {
AppStateAutomata(appHook) : super(appHook);
Future<AppStateAutomata> next();
}

@ -0,0 +1,56 @@
/*
Copyright 2019 fuwa
This file is part of CyberWOW.
CyberWOW is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
CyberWOW is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with CyberWOW. If not, see <https://www.gnu.org/licenses/>.
*/
import 'dart:async';
import '../logic/sensor/rpc/rpc.dart' as rpc;
import '../logic/sensor/daemon.dart' as daemon;
import '../logging.dart';
import '../helper.dart';
import 'prototype.dart';
import 'synced.dart';
class ReSyncingState extends AppStateAutomata {
final int pageIndex;
bool synced = false;
ReSyncingState(appHook, this.pageIndex) : super(appHook);
Future<AppStateAutomata> next() async {
log.fine("ReSyncing next");
if (await shouldExit()) return exitState();
if (shouldSkip()) {
log.finest('skipping state update');
await tick();
return this;
}
if (await daemon.isSynced()) {
final int _height = await rpc.height();
return SyncedState(appHook, _height, pageIndex);
} else {
await tick();
return this;
}
}
}

@ -0,0 +1,134 @@
/*
Copyright 2019 fuwa
This file is part of CyberWOW.
CyberWOW is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
CyberWOW is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with CyberWOW. If not, see <https://www.gnu.org/licenses/>.
*/
import 'dart:async';
import 'dart:io';
import 'package:flutter/material.dart';
import '../config.dart' as config;
import '../logic/sensor/daemon.dart' as daemon;
import '../logic/sensor/rpc/rpc.dart' as rpc;
import '../logic/sensor/rpc/rpc2.dart' as rpc;
import '../logic/view/rpc/rpc2.dart' as rpc2View;
import '../logic/view/rpc/rpc.dart' as rpcView;
import '../helper.dart';
import '../logging.dart';
import 'prototype.dart';
import 'resyncing.dart';
class SyncedState extends AppStateAutomata {
final TextEditingController textController = TextEditingController();
bool synced = true;
bool userExit = false;
bool connected = true;
Map<String, dynamic> getInfo = {};
List<Map<String, dynamic>> getConnections = [];
List<Map<String, dynamic>> getTransactionPool = [];
int height;
int pageIndex;
PageController? pageController;
String getInfoCache = '';
String getConnectionsCache = '';
String getTransactionPoolCache = '';
SyncedState(appHook, this.height, this.pageIndex) : super(appHook) {
pageController = PageController(initialPage: pageIndex);
// textController.addListener(this.appendInput);
}
void appendInput(final String x) {
final _input = config.c.promptString + x;
log.fine(_input);
final _stdoutQueue = appHook.stdout;
_stdoutQueue.addLast('\n' + _input);
while (_stdoutQueue.length > config.logLines) {
_stdoutQueue.removeFirst();
}
appHook.stdoutCache = _stdoutQueue.join();
// ignore: close_sinks
final IOSink? _stdin = appHook.process?.stdin;
_stdin?.writeln(x);
_stdin?.flush();
syncState();
if (x == 'exit') {
userExit = true;
}
}
void onPageChanged(int value) {
this.pageIndex = value;
}
Future<AppStateAutomata> next() async {
log.fine("Synced next");
if (userExit) {
return exitState();
}
if (await shouldExit()) {
return exitState();
}
if (shouldSkip()) {
log.finest('skipping state update');
await tick();
return this;
}
if (await daemon.isNotSynced()) {
return ReSyncingState(appHook, pageIndex);
}
await tick();
// log.finer('SyncedState: checkSync loop');
height = await rpc.height();
connected = await daemon.isConnected();
getInfo = await rpc.getInfoSimple();
final _getInfoView = cleanKey(rpcView.getInfoView(getInfo));
getInfoCache = pretty(_getInfoView);
getConnections = await rpc.getConnectionsSimple();
final List<Map<String, dynamic>> _getConnectionsView = getConnections
.map(rpcView.getConnectionView)
.map((x) => rpcView.simpleHeight(height, x))
.map(cleanKey)
.toList();
getConnectionsCache = pretty(_getConnectionsView);
getTransactionPool = await rpc.getTransactionPoolSimple();
final List<Map<String, dynamic>> _getTransactionPoolView =
getTransactionPool.map(rpc2View.txView).map(cleanKey).toList();
getTransactionPoolCache = pretty(_getTransactionPoolView);
log.fine('synced: loop exit');
return this;
}
}

@ -19,28 +19,36 @@ along with CyberWOW. If not, see <https://www.gnu.org/licenses/>.
*/
import 'package:logging/logging.dart';
import 'dart:ui';
import 'dart:async';
import '../../config.dart';
import '../../logging.dart';
import '../../helper.dart';
import '../logic/sensor/rpc/rpc.dart' as rpc;
import '../logic/sensor/daemon.dart' as daemon;
import '../logging.dart';
import '../helper.dart';
import '../config.dart' as config;
import 'prototype.dart';
import 'synced.dart';
typedef GetNotificationFunc = AppLifecycleState Function();
class SyncingState extends AppStateAutomata {
SyncingState(appHook) : super(appHook);
Stream<Null> pull(GetNotificationFunc getNotification, final String puller) async* {
while (true) {
final _appState = getNotification();
log.finer('refresh pull by ${puller}: app state: ${_appState}');
Future<AppStateAutomata> next() async {
log.fine("Syncing next");
if (await shouldExit()) return exitState();
if (_appState == AppLifecycleState.resumed) {
yield null;
if (shouldSkip()) {
log.fine('skipping state update');
await tick();
return this;
}
if (await daemon.isSynced()) {
final int _height = await rpc.height();
return SyncedState(appHook, _height, config.defaultPageIndex);
} else {
await tick();
await tick();
return this;
}
}
}

@ -31,12 +31,19 @@ import 'widget/exiting.dart' as exiting;
Widget build(final BuildContext context, final AppState state) {
switch (state.runtimeType) {
case BlankState: return blank.build(context, state);
case LoadingState: return loading.build(context, state);
case SyncingState: return syncing.build(context, state);
case SyncedState: return synced.build(context, state);
case ReSyncingState: return resyncing.build(context, state);
case ExitingState: return exiting.build(context, state);
default: return Placeholder();
case BlankState:
return blank.build(context, state as BlankState);
case LoadingState:
return loading.build(context, state as LoadingState);
case SyncingState:
return syncing.build(context, state as SyncingState);
case SyncedState:
return synced.build(context, state as SyncedState);
case ReSyncingState:
return resyncing.build(context, state as ReSyncingState);
case ExitingState:
return exiting.build(context, state as ExitingState);
default:
return Placeholder();
}
}

@ -22,12 +22,9 @@ along with CyberWOW. If not, see <https://www.gnu.org/licenses/>.
import 'package:flutter/material.dart';
import '../state.dart';
import '../config.dart' as config;
Widget build(BuildContext context, BlankState state) {
return Scaffold(
body: Container
(
),
body: Container(),
);
}

@ -22,41 +22,26 @@ along with CyberWOW. If not, see <https://www.gnu.org/licenses/>.
import 'package:flutter/material.dart';
import '../state.dart';
import '../config.dart' as config;
Widget build(BuildContext context, ExitingState state) {
return Scaffold
(
// appBar: AppBar
// (
// // title: Text(widget.title),
// title: Text('CyberWOW'),
// ),
body: Container
(
// padding: const EdgeInsets.all(10.0),
child: Align
(
return Scaffold(
body: Container(
padding: const EdgeInsets.all(40.0),
child: Align(
alignment: Alignment.topLeft,
child: Column
(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>
[
Expanded
(
children: <Widget>[
Spacer(
flex: 1,
child: SingleChildScrollView
(
scrollDirection: Axis.vertical,
reverse: true,
child: Text
(
state.stdout.join(),
style: Theme.of(context).textTheme.body1,
)
)
)
),
Text(
'',
style: Theme.of(context).textTheme.headline4,
),
Spacer(
flex: 1,
),
],
),
),

@ -22,36 +22,28 @@ along with CyberWOW. If not, see <https://www.gnu.org/licenses/>.
import 'package:flutter/material.dart';
import '../state.dart';
import '../config.dart' as config;
Widget build(BuildContext context, LoadingState state) {
return Scaffold(
// appBar: AppBar(
// // title: Text(widget.title),
// title: Text('WOW'),
// // headline6: Text(widget.headline6),
// headline6: Text('WOW'),
// ),
body: Container
(
body: Container(
padding: const EdgeInsets.all(40.0),
child: Align
(
child: Align(
alignment: Alignment.topLeft,
child: Column
(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>
[
Spacer
(
children: <Widget>[
Spacer(
flex: 1,
),
Text
(
Text(
state.status,
style: Theme.of(context).textTheme.title,
style: Theme.of(context).textTheme.headline6,
),
Spacer
(
Spacer(
flex: 1,
),
],

@ -22,56 +22,40 @@ along with CyberWOW. If not, see <https://www.gnu.org/licenses/>.
import 'package:flutter/material.dart';
import '../state.dart';
import '../config.dart' as config;
Widget build(BuildContext context, ReSyncingState state) {
final progressWidget =
[
Spacer
(
final progressWidget = [
Spacer(
flex: 3,
),
LinearProgressIndicator(),
Spacer
(
Spacer(
flex: 2,
),
Expanded
(
flex: 5,
child: Text
(
state.stdout.last,
style: Theme.of(context).textTheme.body1,
)
),
Expanded(
flex: 5,
child: Text(
state.appHook.stdout.last,
style: Theme.of(context).textTheme.bodyText2,
)),
];
return Scaffold
(
body: Container
(
padding: const EdgeInsets.all(10.0),
child: Column
(
return Scaffold(
body: Container(
padding: const EdgeInsets.all(10.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>
[
Spacer
(
flex: 10,
),
] +
progressWidget +
[
Spacer
(
flex: 10,
),
]
),
)
);
children: <Widget>[
Spacer(
flex: 10,
),
] +
progressWidget +
[
Spacer(
flex: 10,
),
]),
));
}

@ -22,11 +22,7 @@ along with CyberWOW. If not, see <https://www.gnu.org/licenses/>.
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'dart:collection';
import '../state.dart';
import '../config.dart' as config;
import '../helper.dart';
import '../logging.dart';
Widget summary(BuildContext context, SyncedState state) {
@ -34,92 +30,73 @@ Widget summary(BuildContext context, SyncedState state) {
final onFire = state.getTransactionPool.length >= 10;
final onFireNotice = onFire ? ' 🔥' : '';
final poolLength = state.getTransactionPool.length;
final poolLengthNotice = poolLength > 1 ? '[${poolLength}] ' : '';
final txNotice = state.getTransactionPool.isEmpty ?
'' : poolLengthNotice + state.getTransactionPool.first['id_hash'].substring(0, 6) + ' ...';
final poolLengthNotice = poolLength > 1 ? '[$poolLength] ' : '';
final txNotice = state.getTransactionPool.isEmpty
? ''
: poolLengthNotice +
state.getTransactionPool.first['id_hash'].substring(0, 6) +
' ...';
return Container
(
return Container(
padding: EdgeInsets.only(bottom: 10.0),
child: Align
(
child: Align(
alignment: Alignment.center,
child: Column
(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>
[
Spacer
(
children: <Widget>[
Spacer(
flex: 17,
),
Image.asset
('assets/wownero_symbol.png',
Image.asset(
'assets/lolnode_icon.png',
height: 220,
),
Spacer
(
Spacer(
flex: 7,
),
Expanded
(
flex: 15,
child: Row
(
children: <Widget>
[
Expanded(
flex: 15,
child: Row(children: <Widget>[
Spacer(),
AnimatedSwitcher
(
AnimatedSwitcher(
duration: Duration(milliseconds: 500),
child: Text
(
child: Text(
height,
style: Theme.of(context).textTheme.display1,
style: Theme.of(context).textTheme.headline4,
key: ValueKey<int>(state.height),
),
),
AnimatedSwitcher
(
AnimatedSwitcher(
duration: Duration(milliseconds: 500),
child: Text
(
child: Text(
onFireNotice,
style: TextStyle
(
style: TextStyle(
fontSize: 25,
),
key: ValueKey<int>(onFire ? 0 : 1),
),
),
Spacer(),
]
)
),
AnimatedSwitcher
(
])),
AnimatedSwitcher(
duration: Duration(milliseconds: 500),
child: Text
(
child: Text(
txNotice,
style: Theme.of(context).textTheme.body2,
style: Theme.of(context).textTheme.bodyText1,
key: ValueKey<int>(poolLength),
),
),
Spacer
(
Spacer(
flex: 1,
),
SizedBox
(
SizedBox(
height: 20.0,
width: 20.0,
child: (state.connected) ?
Container() :
CircularProgressIndicator
(
strokeWidth: 2,
),
child: (state.connected)
? Container()
: CircularProgressIndicator(
strokeWidth: 2,
),
),
],
),
@ -127,60 +104,47 @@ Widget summary(BuildContext context, SyncedState state) {
);
}
Widget rpcView(BuildContext context, String title, String body) {
return Container
(
Widget rpcView(BuildContext context, String headline6, String body) {
return Container(
padding: const EdgeInsets.all(10.0),
child: Align
(
child: Align(
alignment: Alignment.topLeft,
child: Column
(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>
[
Expanded
(
flex: 1,
child: SingleChildScrollView
(
scrollDirection: Axis.vertical,
child: Column
(
children: <Widget>
[
Container(
height: 0,
margin: const EdgeInsets.only(bottom: 15),
),
Text
(
title,
style: Theme.of(context).textTheme.display1,
),
Container(
height: 1,
color: Theme.of(context).primaryColor,
margin: const EdgeInsets.only(bottom: 20, top: 20),
),
Text
(
body,
style: Theme.of(context).textTheme.body2,
)
],
)
)
)
children: <Widget>[
Expanded(
flex: 1,
child: SingleChildScrollView(
scrollDirection: Axis.vertical,
child: Column(
children: <Widget>[
Container(
height: 0,
margin: const EdgeInsets.only(bottom: 15),
),
Text(
headline6,
style: Theme.of(context).textTheme.headline4,
),
Container(
height: 1,
color: Theme.of(context).primaryColor,
margin: const EdgeInsets.only(bottom: 20, top: 20),
),
Text(
body,
style: Theme.of(context).textTheme.bodyText1,
)
],
)))
],
),
),
);
}
Widget getInfo(BuildContext context, SyncedState state) => rpcView(context, 'info', state.getInfoCache);
Widget syncInfo(BuildContext context, SyncedState state) => rpcView(context, 'sync info', pretty(state.syncInfo));
Widget getInfo(BuildContext context, SyncedState state) =>
rpcView(context, 'info', state.getInfoCache);
Widget getTransactionPool(BuildContext context, SyncedState state) {
final pool = state.getTransactionPool;
@ -196,28 +160,21 @@ Widget getConnections(BuildContext context, SyncedState state) {
return rpcView(context, 'peers' + subTitle, state.getConnectionsCache);
}
Widget terminalView(BuildContext context, String title, SyncedState state) {
final input = TextFormField
(
Widget terminalView(BuildContext context, String headline6, SyncedState state) {
final input = TextFormField(
controller: state.textController,
textInputAction: TextInputAction.next,
autofocus: true,
// textInputAction: TextInputAction.next,
// autofocus: true,
autocorrect: false,
enableSuggestions: false,
keyboardType: TextInputType.visiblePassword,
decoration:
InputDecoration
(
decoration: InputDecoration(
// border: UnderlineInputBorder // OutlineInputBorder
// (
// ),
// hintText: 'WOW',
enabledBorder: UnderlineInputBorder
(
borderSide: BorderSide
(
enabledBorder: UnderlineInputBorder(
borderSide: BorderSide(
color: Theme.of(context).primaryColor,
),
),
@ -235,58 +192,44 @@ Widget terminalView(BuildContext context, String title, SyncedState state) {
final tail = words.sublist(1);
final guessHead = head.replaceAll('-', '_');
return [ guessHead, ...tail ].join(' ');
return [guessHead, ...tail].join(' ');
}
final _text = state.textController.text.trim();
final line = autoReplace(_text);
log.info('textController: $state.controller');
if (line.isNotEmpty) {
log.finer('terminal input: ${line}');
log.finer('terminal input: $line');
state.appendInput(line);
state.textController.clear();
}
else {
state.textController.clear();
SystemChannels.textInput.invokeMethod('TextInput.hide');
}
state.textController.clear();
},
);
return Container
(
return Container(
// padding: const EdgeInsets.all(10.0),
child: Align
(
child: Align(
alignment: Alignment.topLeft,
child: Column
(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>
[
Expanded
(
flex: 1,
child: SingleChildScrollView
(
scrollDirection: Axis.vertical,
reverse: true,
child: Column
(
children: <Widget>
[
Text
(
state.stdout.join('\n'),
style: Theme.of(context).textTheme.body2,
)
],
)
)
),
Container
(
children: <Widget>[
Expanded(
flex: 1,
child: SingleChildScrollView(
scrollDirection: Axis.vertical,
reverse: true,
child: Column(
children: <Widget>[
Text(
state.appHook.stdoutCache,
style: Theme.of(context).textTheme.bodyText1,
)
],
))),
Container(
margin: const EdgeInsets.all(10.0),
child: input,
),
@ -296,10 +239,10 @@ Widget terminalView(BuildContext context, String title, SyncedState state) {
);
}
Widget terminal(BuildContext context, SyncedState state) =>
terminalView(context, 'terminal', state);
Widget terminal(BuildContext context, SyncedState state) => terminalView(context, 'terminal', state);
Widget pageView (BuildContext context, SyncedState state) {
Widget pageView(BuildContext context, SyncedState state) {
void _onPageChanged(int pageIndex) {
if (pageIndex != 0) {
SystemChannels.textInput.invokeMethod('TextInput.hide');
@ -307,24 +250,19 @@ Widget pageView (BuildContext context, SyncedState state) {
state.onPageChanged(pageIndex);
}
return PageView (
return PageView(
controller: state.pageController,
onPageChanged: _onPageChanged,
children:
[
children: [
terminal(context, state),
summary(context, state),
getTransactionPool(context, state),
getConnections(context, state),
getInfo(context, state),
// syncInfo(state),
],
);
}
Widget build(BuildContext context, SyncedState state) {
return Scaffold
(
body: pageView(context, state)
);
return Scaffold(body: pageView(context, state));
}

@ -22,41 +22,30 @@ along with CyberWOW. If not, see <https://www.gnu.org/licenses/>.
import 'package:flutter/material.dart';
import '../state.dart';
import '../config.dart' as config;
Widget build(BuildContext context, SyncingState state) {
return Scaffold
(
return Scaffold(
// appBar: AppBar
// (
// // title: Text(widget.title),
// title: Text('CyberWOW'),
// // headline6: Text(widget.headline6),
// headline6: Text('CyberWOW'),
// ),
body: Container
(
body: Container(
// padding: const EdgeInsets.all(10.0),
child: Align
(
child: Align(
alignment: Alignment.topLeft,
child: Column
(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>
[
Expanded
(
flex: 1,
child: SingleChildScrollView
(
scrollDirection: Axis.vertical,
reverse: true,
child: Text
(
state.stdout.join('\n'),
style: Theme.of(context).textTheme.body1,
)
)
),
children: <Widget>[
Expanded(
flex: 1,
child: SingleChildScrollView(
scrollDirection: Axis.vertical,
reverse: true,
child: Text(
state.appHook.stdoutCache,
style: Theme.of(context).textTheme.bodyText2,
))),
],
),
),

@ -1,62 +1,69 @@
# Generated by pub
# See https://dart.dev/tools/pub/glossary#lockfile
packages:
archive:
dependency: transitive
async:
dependency: "direct main"
description:
name: archive
name: async
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.13"
args:
version: "2.5.0"
boolean_selector:
dependency: transitive
description:
name: args
name: boolean_selector
url: "https://pub.dartlang.org"
source: hosted
version: "1.6.0"
async:
version: "2.1.0"
characters:
dependency: transitive
description:
name: async
name: characters
url: "https://pub.dartlang.org"
source: hosted
version: "2.4.1"
boolean_selector:
version: "1.1.0"
charcode:
dependency: transitive
description:
name: boolean_selector
name: charcode
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
charcode:
version: "1.2.0"
clock:
dependency: transitive
description:
name: charcode
name: clock
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.3"
version: "1.1.0"
collection:
dependency: transitive
description:
name: collection
url: "https://pub.dartlang.org"
source: hosted
version: "1.14.12"
convert:
version: "1.15.0"
fake_async:
dependency: transitive
description:
name: convert
name: fake_async
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.1"
crypto:
version: "1.2.0"
ffi:
dependency: transitive
description:
name: crypto
name: ffi
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.4"
version: "1.0.0"
file:
dependency: transitive
description:
name: file
url: "https://pub.dartlang.org"
source: hosted
version: "6.1.0"
flutter:
dependency: "direct main"
description: flutter
@ -78,140 +85,175 @@ packages:
name: http
url: "https://pub.dartlang.org"
source: hosted
version: "0.12.1"
version: "0.13.1"
http_parser:
dependency: transitive
description:
name: http_parser
url: "https://pub.dartlang.org"
source: hosted
version: "3.1.4"
image:
dependency: transitive
description:
name: image
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.12"
version: "4.0.0"
intl:
dependency: "direct main"
description:
name: intl
url: "https://pub.dartlang.org"
source: hosted
version: "0.16.1"
version: "0.17.0"
js:
dependency: transitive
description:
name: js
url: "https://pub.dartlang.org"
source: hosted
version: "0.6.3"
logging:
dependency: "direct main"
description:
name: logging
url: "https://pub.dartlang.org"
source: hosted
version: "0.11.4"
version: "1.0.0"
matcher:
dependency: transitive
description:
name: matcher
url: "https://pub.dartlang.org"
source: hosted
version: "0.12.6"
version: "0.12.10"
meta:
dependency: transitive
description:
name: meta
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.8"
version: "1.3.0"
mime:
dependency: transitive
description:
name: mime
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.0"
path:
dependency: transitive
description:
name: path
url: "https://pub.dartlang.org"
source: hosted
version: "1.6.4"
version: "1.8.0"
path_provider:
dependency: "direct main"
description:
name: path_provider
url: "https://pub.dartlang.org"
source: hosted
version: "1.6.8"
version: "2.0.1"
path_provider_linux:
dependency: transitive
description:
name: path_provider_linux
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
path_provider_macos:
dependency: transitive
description:
name: path_provider_macos
url: "https://pub.dartlang.org"
source: hosted
version: "0.0.4+2"
version: "2.0.0"
path_provider_platform_interface:
dependency: transitive
description:
name: path_provider_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.2"
pedantic:
version: "2.0.1"
path_provider_windows:
dependency: transitive
description:
name: pedantic
name: path_provider_windows
url: "https://pub.dartlang.org"
source: hosted
version: "1.9.0"
petitparser:
version: "2.0.0"
pedantic:
dependency: transitive
description:
name: petitparser
name: pedantic
url: "https://pub.dartlang.org"
source: hosted
version: "2.4.0"
version: "1.11.0"
platform:
dependency: transitive
description:
name: platform
url: "https://pub.dartlang.org"
source: hosted
version: "2.2.1"
version: "3.0.0"
plugin_platform_interface:
dependency: transitive
description:
name: plugin_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.2"
quiver:
version: "2.0.0"
process:
dependency: transitive
description:
name: quiver
name: process
url: "https://pub.dartlang.org"
source: hosted
version: "4.1.1"
share:
dependency: "direct main"
description:
name: share
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.3"
version: "2.0.1"
shared_preferences:
dependency: "direct main"
description:
name: shared_preferences
url: "https://pub.dartlang.org"
source: hosted
version: "0.5.7+2"
version: "2.0.5"
shared_preferences_linux:
dependency: transitive
description:
name: shared_preferences_linux
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
shared_preferences_macos:
dependency: transitive
description:
name: shared_preferences_macos
url: "https://pub.dartlang.org"
source: hosted
version: "0.0.1+8"
version: "2.0.0"
shared_preferences_platform_interface:
dependency: transitive
description:
name: shared_preferences_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.4"
version: "2.0.0"
shared_preferences_web:
dependency: transitive
description:
name: shared_preferences_web
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.2+5"
version: "2.0.0"
shared_preferences_windows:
dependency: transitive
description:
name: shared_preferences_windows
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
sky_engine:
dependency: transitive
description: flutter
@ -223,63 +265,70 @@ packages:
name: source_span
url: "https://pub.dartlang.org"
source: hosted
version: "1.7.0"
version: "1.8.0"
stack_trace:
dependency: transitive
description:
name: stack_trace
url: "https://pub.dartlang.org"
source: hosted
version: "1.9.3"
version: "1.10.0"
stream_channel:
dependency: transitive
description:
name: stream_channel
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
version: "2.1.0"
string_scanner:
dependency: transitive
description:
name: string_scanner
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.5"
version: "1.1.0"
term_glyph:
dependency: transitive
description:
name: term_glyph
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
version: "1.2.0"
test_api:
dependency: transitive
description:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.15"
version: "0.2.19"
typed_data:
dependency: transitive
description:
name: typed_data
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.6"
version: "1.3.0"
vector_math:
dependency: transitive
description:
name: vector_math
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.8"
xml:
version: "2.1.0"
win32:
dependency: transitive
description:
name: win32
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.4"
xdg_directories:
dependency: transitive
description:
name: xml
name: xdg_directories
url: "https://pub.dartlang.org"
source: hosted
version: "3.6.1"
version: "0.2.0"
sdks:
dart: ">=2.6.0 <3.0.0"
flutter: ">=1.12.13+hotfix.5 <2.0.0"
dart: ">=2.12.0 <3.0.0"
flutter: ">=1.20.0"

@ -1,20 +1,22 @@
name: cyberwow
description: A new Flutter project.
name: lolnero_node
description: A lolnode mobile node
version: 0.8.0+1
version: 0.9.5+0
environment:
sdk: ">=2.1.0 <3.0.0"
sdk: ">=2.12.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
path_provider: ^1.1.0
http: ^0.12.0
logging: ^0.11.3
intl: ^0.16.0
shared_preferences: ^0.5.6
intl: ^0.17.0
logging: ^1.0.0
path_provider: ^2.0.1
share: ^2.0.1
shared_preferences: ^2.0.5
async: ^2.5.0
http: ^0.13.1
dev_dependencies:
flutter_test:
@ -25,7 +27,7 @@ flutter:
uses-material-design: true
assets:
- assets/wownero_symbol.png
- assets/lolnode_icon.png
fonts:
- family: RobotoMono

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB