Skip to content

Commit

Permalink
feat: more ipfs replace
Browse files Browse the repository at this point in the history
  • Loading branch information
Shengwen Yu authored and zyyw committed Apr 23, 2019
1 parent 8f4463b commit 5bacd4c
Show file tree
Hide file tree
Showing 42 changed files with 210 additions and 210 deletions.
2 changes: 1 addition & 1 deletion core/commands/active.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const (

var ActiveReqsCmd = &cmds.Command{
Helptext: cmdkit.HelpText{
Tagline: "List commands run on this IPFS node.",
Tagline: "List commands run on this BTFS node.",
ShortDescription: `
Lists running and recently run commands.
`,
Expand Down
26 changes: 13 additions & 13 deletions core/commands/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,29 +52,29 @@ const adderOutChanSize = 8

var AddCmd = &cmds.Command{
Helptext: cmdkit.HelpText{
Tagline: "Add a file or directory to ipfs.",
Tagline: "Add a file or directory to btfs.",
ShortDescription: `
Adds contents of <path> to ipfs. Use -r to add directories (recursively).
Adds contents of <path> to btfs. Use -r to add directories (recursively).
`,
LongDescription: `
Adds contents of <path> to ipfs. Use -r to add directories.
Note that directories are added recursively, to form the ipfs
Adds contents of <path> to btfs. Use -r to add directories.
Note that directories are added recursively, to form the btfs
MerkleDAG.
The wrap option, '-w', wraps the file (or files, if using the
recursive option) in a directory. This directory contains only
the files which have been added, and means that the file retains
its filename. For example:
> ipfs add example.jpg
> btfs add example.jpg
added QmbFMke1KXqnYyBBWxB74N4c5SBnJMVAiMNRcGu6x1AwQH example.jpg
> ipfs add example.jpg -w
> btfs add example.jpg -w
added QmbFMke1KXqnYyBBWxB74N4c5SBnJMVAiMNRcGu6x1AwQH example.jpg
added QmaG4FuMqEBnQNn3C8XJ5bpW8kLs7zq2ZXgHptJHbKDDVx
You can now refer to the added file in a gateway, like so:
/ipfs/QmaG4FuMqEBnQNn3C8XJ5bpW8kLs7zq2ZXgHptJHbKDDVx/example.jpg
/btfs/QmaG4FuMqEBnQNn3C8XJ5bpW8kLs7zq2ZXgHptJHbKDDVx/example.jpg
The chunker option, '-s', specifies the chunking strategy that dictates
how to break files into blocks. Blocks with same content can
Expand All @@ -89,25 +89,25 @@ The following examples use very small byte sizes to demonstrate the
properties of the different chunkers on a small file. You'll likely
want to use a 1024 times larger chunk sizes for most files.
> ipfs add --chunker=size-2048 ipfs-logo.svg
> btfs add --chunker=size-2048 ipfs-logo.svg
added QmafrLBfzRLV4XSH1XcaMMeaXEUhDJjmtDfsYU95TrWG87 ipfs-logo.svg
> ipfs add --chunker=rabin-512-1024-2048 ipfs-logo.svg
> btfs add --chunker=rabin-512-1024-2048 ipfs-logo.svg
added Qmf1hDN65tR55Ubh2RN1FPxr69xq3giVBz1KApsresY8Gn ipfs-logo.svg
You can now check what blocks have been created by:
> ipfs object links QmafrLBfzRLV4XSH1XcaMMeaXEUhDJjmtDfsYU95TrWG87
> btfs object links QmafrLBfzRLV4XSH1XcaMMeaXEUhDJjmtDfsYU95TrWG87
QmY6yj1GsermExDXoosVE3aSPxdMNYr6aKuw3nA8LoWPRS 2059
Qmf7ZQeSxq2fJVJbCmgTrLLVN9tDR9Wy5k75DxQKuz5Gyt 1195
> ipfs object links Qmf1hDN65tR55Ubh2RN1FPxr69xq3giVBz1KApsresY8Gn
> btfs object links Qmf1hDN65tR55Ubh2RN1FPxr69xq3giVBz1KApsresY8Gn
QmY6yj1GsermExDXoosVE3aSPxdMNYr6aKuw3nA8LoWPRS 2059
QmerURi9k4XzKCaaPbsK6BL5pMEjF7PGphjDvkkjDtsVf3 868
QmQB28iwSriSUSMqG2nXDTLtdPHgWb4rebBrU7Q1j4vxPv 338
`,
},

Arguments: []cmdkit.Argument{
cmdkit.FileArg("path", true, true, "The path to a file to be added to ipfs.").EnableRecursive().EnableStdin(),
cmdkit.FileArg("path", true, true, "The path to a file to be added to btfs.").EnableRecursive().EnableStdin(),
},
Options: []cmdkit.Option{
cmds.OptionRecursivePath, // a builtin option that allows recursive paths (-r, --recursive)
Expand Down Expand Up @@ -142,7 +142,7 @@ You can now check what blocks have been created by:
return nil
}

// ipfs cli progress bar defaults to true unless quiet or silent is used
// btfs cli progress bar defaults to true unless quiet or silent is used
_, found := req.Options[progressOptionName].(bool)
if !found {
req.Options[progressOptionName] = true
Expand Down
24 changes: 12 additions & 12 deletions core/commands/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ func (bs BlockStat) String() string {

var BlockCmd = &cmds.Command{
Helptext: cmdkit.HelpText{
Tagline: "Interact with raw IPFS blocks.",
Tagline: "Interact with raw BTFS blocks.",
ShortDescription: `
'ipfs block' is a plumbing command used to manipulate raw IPFS blocks.
'btfs block' is a plumbing command used to manipulate raw BTFS blocks.
Reads from stdin or writes to stdout, and <key> is a base58 encoded
multihash.
`,
Expand All @@ -45,10 +45,10 @@ multihash.

var blockStatCmd = &cmds.Command{
Helptext: cmdkit.HelpText{
Tagline: "Print information of a raw IPFS block.",
Tagline: "Print information of a raw BTFS block.",
ShortDescription: `
'ipfs block stat' is a plumbing command for retrieving information
on raw IPFS blocks. It outputs the following to stdout:
'btfs block stat' is a plumbing command for retrieving information
on raw BTFS blocks. It outputs the following to stdout:
Key - the base58 encoded multihash
Size - the size of the block in bytes
Expand Down Expand Up @@ -91,9 +91,9 @@ on raw IPFS blocks. It outputs the following to stdout:

var blockGetCmd = &cmds.Command{
Helptext: cmdkit.HelpText{
Tagline: "Get a raw IPFS block.",
Tagline: "Get a raw BTFS block.",
ShortDescription: `
'ipfs block get' is a plumbing command for retrieving raw IPFS blocks.
'btfs block get' is a plumbing command for retrieving raw BTFS blocks.
It outputs to stdout, and <key> is a base58 encoded multihash.
`,
},
Expand Down Expand Up @@ -129,9 +129,9 @@ const (

var blockPutCmd = &cmds.Command{
Helptext: cmdkit.HelpText{
Tagline: "Store input as an IPFS block.",
Tagline: "Store input as an BTFS block.",
ShortDescription: `
'ipfs block put' is a plumbing command for storing raw IPFS blocks.
'btfs block put' is a plumbing command for storing raw BTFS blocks.
It reads from stdin, and <key> is a base58 encoded multihash.
By default CIDv0 is going to be generated. Setting 'mhtype' to anything other
Expand All @@ -140,7 +140,7 @@ than 'sha2-256' or format to anything other than 'v0' will result in CIDv1.
},

Arguments: []cmdkit.Argument{
cmdkit.FileArg("data", true, false, "The data to be stored as an IPFS block.").EnableStdin(),
cmdkit.FileArg("data", true, false, "The data to be stored as an BTFS block.").EnableStdin(),
},
Options: []cmdkit.Option{
cmdkit.StringOption(blockFormatOptionName, "f", "cid format for blocks to be created with."),
Expand Down Expand Up @@ -210,9 +210,9 @@ const (

var blockRmCmd = &cmds.Command{
Helptext: cmdkit.HelpText{
Tagline: "Remove IPFS block(s).",
Tagline: "Remove BTFS block(s).",
ShortDescription: `
'ipfs block rm' is a plumbing command for removing raw ipfs blocks.
'btfs block rm' is a plumbing command for removing raw btfs blocks.
It takes a list of base58 encoded multihashes to remove.
`,
},
Expand Down
2 changes: 1 addition & 1 deletion core/commands/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ var BootstrapCmd = &cmds.Command{
Helptext: cmdkit.HelpText{
Tagline: "Show or edit the list of bootstrap peers.",
ShortDescription: `
Running 'ipfs bootstrap' with no arguments will run 'ipfs bootstrap list'.
Running 'btfs bootstrap' with no arguments will run 'btfs bootstrap list'.
` + bootstrapSecurityWarning,
},

Expand Down
6 changes: 3 additions & 3 deletions core/commands/cat.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ const (

var CatCmd = &cmds.Command{
Helptext: cmdkit.HelpText{
Tagline: "Show IPFS object data.",
ShortDescription: "Displays the data contained by an IPFS or IPNS object(s) at the given path.",
Tagline: "Show BTFS object data.",
ShortDescription: "Displays the data contained by an BTFS or BTNS object(s) at the given path.",
},

Arguments: []cmdkit.Argument{
cmdkit.StringArg("ipfs-path", true, true, "The path to the IPFS object(s) to be outputted.").EnableStdin(),
cmdkit.StringArg("ipfs-path", true, true, "The path to the BTFS object(s) to be outputted.").EnableStdin(),
},
Options: []cmdkit.Option{
cmdkit.Int64Option(offsetOptionName, "o", "Byte offset to begin reading from."),
Expand Down
2 changes: 1 addition & 1 deletion core/commands/commands.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Package commands implements the ipfs command interface
//
// Using github.com/ipfs/go-ipfs/commands to define the command line and HTTP
// APIs. This is the interface available to folks using IPFS from outside of
// APIs. This is the interface available to folks using BTFS from outside of
// the Go language.
package commands

Expand Down
16 changes: 8 additions & 8 deletions core/commands/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,25 +39,25 @@ const (

var ConfigCmd = &cmds.Command{
Helptext: cmdkit.HelpText{
Tagline: "Get and set ipfs config values.",
Tagline: "Get and set btfs config values.",
ShortDescription: `
'ipfs config' controls configuration variables. It works like 'git config'.
The configuration values are stored in a config file inside your ipfs
'btfs config' controls configuration variables. It works like 'git config'.
The configuration values are stored in a config file inside your btfs
repository.`,
LongDescription: `
'ipfs config' controls configuration variables. It works
'btfs config' controls configuration variables. It works
much like 'git config'. The configuration values are stored in a config
file inside your IPFS repository.
file inside your BTFS repository.
Examples:
Get the value of the 'Datastore.Path' key:
$ ipfs config Datastore.Path
$ btfs config Datastore.Path
Set the value of the 'Datastore.Path' key:
$ ipfs config Datastore.Path ~/.ipfs/datastore
$ btfs config Datastore.Path ~/.btfs/datastore
`,
},
Subcommands: map[string]*cmds.Command{
Expand Down Expand Up @@ -236,7 +236,7 @@ var configEditCmd = &cmds.Command{
Helptext: cmdkit.HelpText{
Tagline: "Open the config file for editing in $EDITOR.",
ShortDescription: `
To use 'ipfs config edit', you must have the $EDITOR environment
To use 'btfs config edit', you must have the $EDITOR environment
variable set to your preferred text editor.
`,
},
Expand Down
8 changes: 4 additions & 4 deletions core/commands/dht.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import (

var ErrNotDHT = errors.New("routing service is not a DHT")

// TODO: Factor into `ipfs dht` and `ipfs routing`.
// Everything *except `query` goes into `ipfs routing`.
// TODO: Factor into `btfs dht` and `btfs routing`.
// Everything *except `query` goes into `btfs routing`.

var DhtCmd = &cmds.Command{
Helptext: cmdkit.HelpText{
Expand Down Expand Up @@ -515,9 +515,9 @@ Keys have two parts: a keytype (foo) and the key name (bar). IPNS uses the
/ipns keytype, and expects the key name to be a Peer ID. IPNS entries are
specifically formatted (protocol buffer).
You may only use keytypes that are supported in your ipfs binary: currently
You may only use keytypes that are supported in your btfs binary: currently
this is only /ipns. Unless you have a relatively deep understanding of the
go-ipfs routing internals, you likely want to be using 'ipfs name publish' instead
go-ipfs routing internals, you likely want to be using 'btfs name publish' instead
of this.
Value is arbitrary text. Standard input can be used to provide value.
Expand Down
16 changes: 8 additions & 8 deletions core/commands/dns.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,35 +22,35 @@ var DNSCmd = &cmds.Command{
ShortDescription: `
Multihashes are hard to remember, but domain names are usually easy to
remember. To create memorable aliases for multihashes, DNS TXT
records can point to other DNS links, IPFS objects, IPNS keys, etc.
records can point to other DNS links, BTFS objects, IPNS keys, etc.
This command resolves those links to the referenced object.
`,
LongDescription: `
Multihashes are hard to remember, but domain names are usually easy to
remember. To create memorable aliases for multihashes, DNS TXT
records can point to other DNS links, IPFS objects, IPNS keys, etc.
records can point to other DNS links, BTFS objects, IPNS keys, etc.
This command resolves those links to the referenced object.
Note: This command can only recursively resolve DNS links,
it will fail to recursively resolve through IPNS keys etc.
For general-purpose recursive resolution, use ipfs name resolve -r.
For general-purpose recursive resolution, use btfs name resolve -r.
For example, with this DNS TXT record:
> dig +short TXT _dnslink.ipfs.io
dnslink=/ipfs/QmRzTuh2Lpuz7Gr39stNr6mTFdqAghsZec1JoUnfySUzcy
dnslink=/btfs/QmRzTuh2Lpuz7Gr39stNr6mTFdqAghsZec1JoUnfySUzcy
The resolver will give:
> ipfs dns ipfs.io
/ipfs/QmRzTuh2Lpuz7Gr39stNr6mTFdqAghsZec1JoUnfySUzcy
> btfs dns ipfs.io
/btfs/QmRzTuh2Lpuz7Gr39stNr6mTFdqAghsZec1JoUnfySUzcy
The resolver can recursively resolve:
> dig +short TXT recursive.ipfs.io
dnslink=/ipns/ipfs.io
> ipfs dns -r recursive.ipfs.io
/ipfs/QmRzTuh2Lpuz7Gr39stNr6mTFdqAghsZec1JoUnfySUzcy
> btfs dns -r recursive.ipfs.io
/btfs/QmRzTuh2Lpuz7Gr39stNr6mTFdqAghsZec1JoUnfySUzcy
`,
},

Expand Down
2 changes: 1 addition & 1 deletion core/commands/external.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func ExternalBinary() *cmds.Command {
buf := new(bytes.Buffer)
fmt.Fprintf(buf, "%s is an 'external' command.\n", binname)
fmt.Fprintf(buf, "It does not currently appear to be installed.\n")
fmt.Fprintf(buf, "Please refer to the ipfs documentation for instructions.\n")
fmt.Fprintf(buf, "Please refer to the btfs documentation for instructions.\n")
return res.Emit(buf)
}
}
Expand Down
Loading

0 comments on commit 5bacd4c

Please sign in to comment.