luzid_grpc_client 0.0.5 copy "luzid_grpc_client: ^0.0.5" to clipboard
luzid_grpc_client: ^0.0.5 copied to clipboard

The GRPC client interface to the Luzid Validator service.

example/luzid_grpc_client_example.dart

import 'package:luzid_grpc/proto/requests/validator_ops.pb.dart';
import 'package:luzid_grpc_client/luzid_grpc_client.dart';

Future<void> main() async {
  final client = LuzidGrpcClient();

  // Start Validator
  {
    print('Starting Validator...');
    final ValidatorOpsResponse res = await client.validator
        .validatorOps(ValidatorOpsRequest(op: ValidatorOperation.Start));

    if (res.hasError()) {
      print("Start Validator Error: ${res.error}");
    } else {
      print('Start Validator Response: $res');
    }
  }

  await sleep(500);

  // Stop Validator
  {
    print('Stopping Validator...');
    final ValidatorOpsResponse res = await client.validator
        .validatorOps(ValidatorOpsRequest(op: ValidatorOperation.Stop));

    if (res.hasError()) {
      print("Stop Validator Error: ${res.error}");
    } else {
      print('Stop Validator Response: $res');
    }
  }

  return client.close();
}

Future<void> sleep([milliseconds = 100]) {
  return Future.delayed(Duration(milliseconds: milliseconds));
}
0
likes
135
points
39
downloads

Publisher

unverified uploader

Weekly Downloads

The GRPC client interface to the Luzid Validator service.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

grpc, luzid_grpc

More

Packages that depend on luzid_grpc_client