mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-11-17 17:57:40 +00:00
21 lines
488 B
Dart
21 lines
488 B
Dart
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||
|
import 'package:stackwallet/utilities/stack_file_system.dart';
|
||
|
import 'package:tor/tor.dart';
|
||
|
|
||
|
final pTorService = Provider((_) => TorService());
|
||
|
|
||
|
class TorService {
|
||
|
final _tor = Tor();
|
||
|
|
||
|
int get port => _tor.port;
|
||
|
|
||
|
Future<void> start() async {
|
||
|
final dir = await StackFileSystem.applicationTorDirectory();
|
||
|
return await _tor.start(torDir: dir);
|
||
|
}
|
||
|
|
||
|
Future<void> stop() async {
|
||
|
return await _tor.disable();
|
||
|
}
|
||
|
}
|