public IpfsConnection(string apiHost = "localhost", int apiPort = 5001, HttpProtocol apiProtocol = HttpProtocol.Http) { CheckParameter(apiHost != null, "apiHost is required"); CheckParameter(apiPort > 0, "apiPort must be non-negative int"); ApiHost = apiHost; ApiPort = apiPort; HttpProtocol = apiProtocol; RestApiUrl = new UriBuilder(HttpProtocol.GetProtocol(), apiHost, apiPort).Uri.AbsoluteUri; Ipfs = new IpfsClient(RestApiUrl); }
public StorageConnection(string apiHost, int apiPort, HttpProtocol apiProtocol, string bearerToken, string nemAddress) { CheckParameter(apiHost != null, "apiHost is required"); CheckParameter(apiPort > 0, "apiPort must be non-negative int"); ApiHost = apiHost; ApiPort = apiPort; HttpProtocol = apiProtocol; BearerToken = bearerToken; NemAddress = nemAddress; RestApiUrl = new UriBuilder(HttpProtocol.GetProtocol(), apiHost, apiPort).Uri.AbsoluteUri; }
public BlockchainNetworkConnection(BlockchainNetworkType networkType, string apiHost = "localhost", int apiPort = 3000, HttpProtocol apiProtocol = HttpProtocol.Http) { CheckParameter(apiHost != null, "apiHost is required"); CheckParameter(apiPort > 0, "apiPort must be non-negative int"); NetworkType = networkType.GetNetworkType(); ApiHost = apiHost; ApiPort = apiPort; HttpProtocol = apiProtocol; RestApiUrl = new UriBuilder(HttpProtocol.GetProtocol(), apiHost, apiPort).Uri.AbsoluteUri; }