2023-08-09 02:33:31 -04:00
|
|
|
import 'package:charcode/charcode.dart';
|
2023-01-09 22:50:34 -05:00
|
|
|
import 'package:veilid/veilid.dart';
|
|
|
|
|
|
|
|
Future<VeilidConfig> getVeilidChatConfig() async {
|
2023-07-26 14:20:29 -04:00
|
|
|
var config = await getDefaultVeilidConfig('VeilidChat');
|
2023-07-26 17:42:11 -04:00
|
|
|
// ignore: do_not_use_environment
|
2023-07-26 14:20:29 -04:00
|
|
|
if (const String.fromEnvironment('DELETE_TABLE_STORE') == '1') {
|
2023-07-26 10:06:54 -04:00
|
|
|
config =
|
|
|
|
config.copyWith(tableStore: config.tableStore.copyWith(delete: true));
|
|
|
|
}
|
2023-07-26 17:42:11 -04:00
|
|
|
// ignore: do_not_use_environment
|
2023-07-26 14:20:29 -04:00
|
|
|
if (const String.fromEnvironment('DELETE_PROTECTED_STORE') == '1') {
|
2023-07-26 10:06:54 -04:00
|
|
|
config = config.copyWith(
|
|
|
|
protectedStore: config.protectedStore.copyWith(delete: true));
|
|
|
|
}
|
2023-07-26 17:42:11 -04:00
|
|
|
// ignore: do_not_use_environment
|
2023-07-26 14:20:29 -04:00
|
|
|
if (const String.fromEnvironment('DELETE_BLOCK_STORE') == '1') {
|
2023-07-26 10:06:54 -04:00
|
|
|
config =
|
|
|
|
config.copyWith(blockStore: config.blockStore.copyWith(delete: true));
|
|
|
|
}
|
|
|
|
|
2023-08-09 02:33:31 -04:00
|
|
|
// xxx hack
|
|
|
|
config = config.copyWith(
|
|
|
|
network: config.network.copyWith(
|
|
|
|
dht: config.network.dht.copyWith(
|
|
|
|
getValueCount: 2,
|
|
|
|
getValueTimeoutMs: 5000,
|
|
|
|
setValueCount: 2,
|
|
|
|
setValueTimeoutMs: 5000)));
|
|
|
|
|
2023-01-09 22:50:34 -05:00
|
|
|
return config;
|
|
|
|
}
|