Exemple #1
0
        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);
        }
Exemple #2
0
        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;
        }