mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-12-27 05:49:21 +00:00
13 lines
299 B
Dart
13 lines
299 B
Dart
|
import 'package:http/http.dart';
|
||
|
import 'package:web3dart/web3dart.dart' as web3;
|
||
|
|
||
|
Future<bool> testEthNodeConnection(String host) async {
|
||
|
web3.Web3Client client = web3.Web3Client(host, Client());
|
||
|
try {
|
||
|
await client.getBlockNumber();
|
||
|
return true;
|
||
|
} catch (_) {
|
||
|
return false;
|
||
|
}
|
||
|
}
|