public async Task <ChainInitializationContext> RequestChainInitializationContext(string uri, int chainId, int timeout) { var clientForParentChain = new GrpcClientForParentChain(uri, chainId, timeout); var response = await TryRequest(clientForParentChain, c => c.RequestChainInitializationContext(chainId)); return(response?.SideChainInitializationContext); }
public async Task ParentChainClient_TryHandShakeAsync() { var result = await parentClient.TryHandShakeAsync(0, ListenPort); result.Result.ShouldBeTrue(); parentClient = new GrpcClientForParentChain("localhost:3000", 0, 1); await Assert.ThrowsAsync <RpcException>(() => parentClient.TryHandShakeAsync(0, 3000)); }
private void InitServerAndClient() { var keyStore = _certificateStore.LoadKeyStore("test"); var cert = _certificateStore.LoadCertificate("test"); var keyCert = new KeyCertificatePair(cert, keyStore); _server.StartAsync(Host, ListenPort).Wait(); string uri = $"{Host}:{ListenPort}"; parentClient = new GrpcClientForParentChain(uri, 0, 1); sideClient = new GrpcClientForSideChain(uri, 1); }