Created
October 20, 2017 14:47
-
-
Save mrosset/747f0cf58c4fa2221fd819035d8bfa8e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func AddR(path string) (string, error) { | |
r, err := fsrepo.Open(Path("$HOME/.ipfs").String()) | |
if err != nil { | |
return "", err | |
} | |
node, err := core.NewNode(context.TODO(), &core.BuildCfg{ | |
Repo: r, | |
}) | |
if err != nil { | |
return "", err | |
} | |
bserv := blockservice.New(node.Blockstore, node.Exchange) | |
dserv := merkledag.NewDAGService(bserv) | |
return BaseAddR(node, path, dserv) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment