/// <summary> /// Creates PlasmaComm object. /// </summary> /// <param name="ethClient">Ethereum jsonRpc client implementation</param> /// <param name="gameCenterContract">game center contract address</param> /// <param name="watcherClient">watcher client</param> /// <param name="childChainClient">child chain client</param> /// <param name="rootChainAddress">root chain address</param> /// <param name="_rootChainVersion">root chain version</param> public PlasmaComm(Nethereum.JsonRpc.Client.IClient ethClient, string gameCenterContract, PlasmaCore.RPC.IClient watcherClient, PlasmaCore.RPC.IClient childChainClient, string rootChainAddress, RootChainVersion _rootChainVersion) { web3 = new Web3(ethClient); bcComm = new BCComm(ethClient, gameCenterContract); plasmaApiService = new PlasmaAPIService(watcherClient, childChainClient); rootChainVersion = _rootChainVersion; if (rootChainAddress == null) { var statusData = plasmaApiService.GetStatus().Result; rootChainAddress = statusData.ContractAddr; } if (rootChainAddress != null) { rootChainContract = new RootChainContract(web3, rootChainAddress, rootChainVersion); } transactionEncoder = TransactionEncoderFactory.Create(rootChainVersion, rootChainAddress); }
/// <summary> /// Creates Plasma client options object with root chain access /// </summary> /// <param name="rpcClient">JsonRpc client implementation</param> /// <param name="rootChainAddress">root chain contract address</param> /// <param name="rootChainVersion">root chain version</param> /// <param name="watcherClient">Plasma watcher client</param> /// <param name="childChainClient">Plasma child chain client (optional)</param> public PlasmaClientOptions( Nethereum.JsonRpc.Client.IClient rpcClient, string rootChainAddress, string rootChainVersion, PlasmaCore.RPC.IClient watcherClient, PlasmaCore.RPC.IClient childChainClient = null) : base(rpcClient) { RootChainAddress = rootChainAddress; RootChainVersion = RootChainABI.FromString(rootChainVersion); WatcherClient = watcherClient; ChildChainClient = childChainClient; }
/// <summary> /// Creates Plasma client options object (without root chain access) /// </summary> /// <param name="rpcClient">JsonRpc client implementation</param> /// <param name="watcherClient">Plasma watcher client</param> /// <param name="childChainClient">Plasma child chain client (optional)</param> public PlasmaClientOptions(Nethereum.JsonRpc.Client.IClient rpcClient, PlasmaCore.RPC.IClient watcherClient, PlasmaCore.RPC.IClient childChainClient = null) : base(rpcClient) { WatcherClient = watcherClient; ChildChainClient = childChainClient; }