veilidchat/lib/veilid_support/config.dart

34 lines
1.1 KiB
Dart
Raw Normal View History

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-09-21 21:00:58 -04:00
// // xxx hack
// config = config.copyWith(
// network: config.network.copyWith(
// dht: config.network.dht.copyWith(
// getValueCount: 3,
// getValueFanout: 8,
// getValueTimeoutMs: 5000,
// setValueCount: 4,
// setValueFanout: 10,
// setValueTimeoutMs: 5000)));
2023-08-09 02:33:31 -04:00
2023-01-09 22:50:34 -05:00
return config;
}