Ejemplo n.º 1
0
        /// <summary>
        ///   Creates a new instance of the <see cref="IpfsClient"/> class and sets the
        ///   default values.
        /// </summary>
        /// <remarks>
        ///   All methods of IpfsClient are thread safe.  Typically, only one instance is required for
        ///   an application.
        /// </remarks>
        public IpfsClient()
        {
            ApiUri = DefaultApiUri;
            var version = Assembly.GetExecutingAssembly().GetName().Version;

            UserAgent     = string.Format("net-ipfs/{0}.{1}", version.Major, version.Minor);
            TrustedPeers  = new TrustedPeerCollection(this);
            PinnedObjects = new PinnedCollection(this);
            Block         = new BlockApi(this);
            Config        = new ConfigApi(this);
            Pin           = new PinApi(this);
            Dht           = new DhtApi(this);
            Swarm         = new SwarmApi(this);
            Dag           = new DagApi(this);
            Object        = new ObjectApi(this);
            FileSystem    = new FileSystemApi(this);
        }
Ejemplo n.º 2
0
        /// <summary>
        ///   Creates a new instance of the <see cref="IpfsClient"/> class and sets the
        ///   default values.
        /// </summary>
        /// <remarks>
        ///   All methods of IpfsClient are thread safe.  Typically, only one instance is required for
        ///   an application.
        /// </remarks>
        public IpfsClient()
        {
            ApiUri = DefaultApiUri;
            var version = typeof(IpfsClient).GetTypeInfo().Assembly.GetName().Version;

            UserAgent    = string.Format("net-ipfs/{0}.{1}", version.Major, version.Minor);
            TrustedPeers = new TrustedPeerCollection(this);

            Bitswap    = new BitswapApi(this);
            Block      = new BlockApi(this);
            Config     = new ConfigApi(this);
            Pin        = new PinApi(this);
            Dht        = new DhtApi(this);
            Swarm      = new SwarmApi(this);
            Dag        = new DagApi(this);
            Object     = new ObjectApi(this);
            FileSystem = new FileSystemApi(this);
            PubSub     = new PubSubApi(this);
            Key        = new KeyApi(this);
            Generic    = this;
            Name       = new NameApi(this);
        }