C# Class Ipfs.IpfsClient

Inheritance: IDisposable
显示文件 Open project: TrekDev/net-ipfs-api

Private Properties

Property Type Description

Public Methods

Method Description
Add ( IpfsStream file, bool recursive = false, bool quiet = false, bool wrapWithDirectory = false, bool trickle = false ) : Task

Add an object to ipfs. Adds contents of to ipfs. Use -r to add directories. Note that directories are added recursively, to form the ipfs MerkleDAG.A smarter partial add with a staging area(like git) remains to be implemented

Cat ( string ipfsPath ) : Task

Show IPFS object data Retrieves the object named by and outputs the data it contains.

Commands ( ) : Task

List all available commands. Lists all available commands (and subcommands) and exits.

ConfigCommand ( string key, string value = null, bool @bool = false ) : Task

get and set IPFS config values ipfs config controls configuration variables. It works much like 'git config'. The configuration values are stored in a config file inside your IPFS repository.

Dispose ( ) : void
Get ( string ipfsPath, string output = null, bool archive = false, bool compress = false, int compressionLevel = null ) : Task

Download IPFS objects Retrieves the object named by and stores the data to disk. By default, the output will be stored at./, but an alternate path can be specified with '--output=' or '-o='. To output a TAR archive instead of unpacked files, use '--archive' or '-a'. To compress the output with GZIP compression, use '--compress' or '-C'. You may also specify the level of compression by specifying '-l=<1-9>'.

Id ( string peerId = null, string format = null ) : Task

Show IPFS Node ID info Prints out information about the specified peer, if no peer is specified, prints out local peers info. ipfs id supports the format option for output with the following keys: : the peers id : agent version : protocol version : public key

IpfsClient ( ) : Ipfs.Commands
IpfsClient ( Uri address ) : Ipfs.Commands
IpfsClient ( Uri address, HttpClient httpClient ) : Ipfs.Commands
IpfsClient ( Uri address, HttpClient httpClient, IJsonSerializer jsonSerializer ) : Ipfs.Commands
IpfsClient ( string address ) : Ipfs.Commands
Ls ( string path ) : Task>

List links from an object. Retrieves the object named by and displays the links it contains, with the following format:

Mount ( string f = null, string n = null ) : Task

Mounts IPFS to the filesystem (read-only) Mount ipfs at a read-only mountpoint on the OS (default: /ipfs and /ipns). All ipfs objects will be accessible under that directory.Note that the root will not be listable, as it is virtual. Access known paths directly. You may have to create /ipfs and /ipfs before using 'ipfs mount'

Ping ( string peerId, int count = null ) : Task

send echo request packets to IPFS hosts ipfs ping is a tool to test sending data to other nodes. It finds nodes via the routing system, send pings, wait for pongs, and print out round- trip latency information.

RefsCommand ( string ipfsPath, string format = null, bool edges = false, bool unique = false, bool recursive = false ) : Task

Lists links (references) from an object Retrieves the object named by and displays the link hashes it contains, with the following format:

TourCommand ( string id ) : Task

An introduction to IPFS This is a tour that takes you through various IPFS concepts, features, and tools to make sure you get up to speed with IPFS very quickly

Version ( bool number = false ) : Task

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Method Details

Add() public method

Add an object to ipfs. Adds contents of to ipfs. Use -r to add directories. Note that directories are added recursively, to form the ipfs MerkleDAG.A smarter partial add with a staging area(like git) remains to be implemented
public Add ( IpfsStream file, bool recursive = false, bool quiet = false, bool wrapWithDirectory = false, bool trickle = false ) : Task
file IpfsStream
recursive bool Add directory paths recursively
quiet bool Write minimal output
wrapWithDirectory bool Wrap files with a directory object
trickle bool Use trickle-dag format for dag generation
return Task

Cat() public method

Show IPFS object data Retrieves the object named by and outputs the data it contains.
public Cat ( string ipfsPath ) : Task
ipfsPath string The path to the IPFS object(s) to be outputted
return Task

Commands() public method

List all available commands. Lists all available commands (and subcommands) and exits.
public Commands ( ) : Task
return Task

ConfigCommand() public method

get and set IPFS config values ipfs config controls configuration variables. It works much like 'git config'. The configuration values are stored in a config file inside your IPFS repository.
public ConfigCommand ( string key, string value = null, bool @bool = false ) : Task
key string The key of the config entry (e.g. "Addresses.API")
value string The value to set the config entry to
@bool bool
return Task

Dispose() public method

public Dispose ( ) : void
return void

Dispose() protected method

protected Dispose ( bool disposing ) : void
disposing bool
return void

Get() public method

Download IPFS objects Retrieves the object named by and stores the data to disk. By default, the output will be stored at./, but an alternate path can be specified with '--output=' or '-o='. To output a TAR archive instead of unpacked files, use '--archive' or '-a'. To compress the output with GZIP compression, use '--compress' or '-C'. You may also specify the level of compression by specifying '-l=<1-9>'.
public Get ( string ipfsPath, string output = null, bool archive = false, bool compress = false, int compressionLevel = null ) : Task
ipfsPath string The path to the IPFS object(s) to be outputted
output string The path where output should be stored
archive bool Output a TAR archive
compress bool Compress the output with GZIP compression
compressionLevel int The level of compression (1-9)
return Task

Id() public method

Show IPFS Node ID info Prints out information about the specified peer, if no peer is specified, prints out local peers info. ipfs id supports the format option for output with the following keys: : the peers id : agent version : protocol version : public key
public Id ( string peerId = null, string format = null ) : Task
peerId string peer.ID of node to look up
format string optional output format
return Task

IpfsClient() public method

public IpfsClient ( ) : Ipfs.Commands
return Ipfs.Commands

IpfsClient() public method

public IpfsClient ( Uri address ) : Ipfs.Commands
address System.Uri
return Ipfs.Commands

IpfsClient() public method

public IpfsClient ( Uri address, HttpClient httpClient ) : Ipfs.Commands
address System.Uri
httpClient System.Net.Http.HttpClient
return Ipfs.Commands

IpfsClient() public method

public IpfsClient ( Uri address, HttpClient httpClient, IJsonSerializer jsonSerializer ) : Ipfs.Commands
address System.Uri
httpClient System.Net.Http.HttpClient
jsonSerializer IJsonSerializer
return Ipfs.Commands

IpfsClient() public method

public IpfsClient ( string address ) : Ipfs.Commands
address string
return Ipfs.Commands

Ls() public method

List links from an object. Retrieves the object named by and displays the links it contains, with the following format:
public Ls ( string path ) : Task>
path string The path to the IPFS object(s) to list links from
return Task>

Mount() public method

Mounts IPFS to the filesystem (read-only) Mount ipfs at a read-only mountpoint on the OS (default: /ipfs and /ipns). All ipfs objects will be accessible under that directory.Note that the root will not be listable, as it is virtual. Access known paths directly. You may have to create /ipfs and /ipfs before using 'ipfs mount'
public Mount ( string f = null, string n = null ) : Task
f string The path where IPFS should be mounted
n string The path where IPNS should be mounted
return Task

Ping() public method

send echo request packets to IPFS hosts ipfs ping is a tool to test sending data to other nodes. It finds nodes via the routing system, send pings, wait for pongs, and print out round- trip latency information.
public Ping ( string peerId, int count = null ) : Task
peerId string ID of peer to be pinged
count int number of ping messages to send
return Task

RefsCommand() public method

Lists links (references) from an object Retrieves the object named by and displays the link hashes it contains, with the following format:
public RefsCommand ( string ipfsPath, string format = null, bool edges = false, bool unique = false, bool recursive = false ) : Task
ipfsPath string Path to the object(s) to list refs from
format string Emit edges with given format. tokens:
edges bool Emit edge format: ` -> `
unique bool Omit duplicate refs from output
recursive bool Recursively list links of child nodes
return Task

TourCommand() public method

An introduction to IPFS This is a tour that takes you through various IPFS concepts, features, and tools to make sure you get up to speed with IPFS very quickly
public TourCommand ( string id ) : Task
id string The id of the topic you would like to tour
return Task

Version() public method

public Version ( bool number = false ) : Task
number bool
return Task