Example #1
0
func addLink(t *testing.T, ds mdag.DAGService, a, b *mdag.Node) {
	to := string(a.Data()) + "2" + string(b.Data())
	if _, err := ds.Add(b); err != nil {
		t.Error(err)
	}
	if err := a.AddNodeLink(to, b); err != nil {
		t.Error(err)
	}
}
Example #2
0
File: self.go Project: utamaro/core
func (m *Self) makeInitNodes(parent *merkledag.Node) {
	n := &merkledag.Node{}
	log.IfFatal(n.AddNodeLink(config.RecentPath, &merkledag.Node{}))
	log.IfFatal(n.AddNodeLink(config.PeersPath, &merkledag.Node{}))
	log.IfFatal(n.AddNodeLink(config.TagsPath, &merkledag.Node{}))
	log.IfFatal(n.AddNodeLink(config.SpamsPath, &merkledag.Node{}))
	log.IfFatal(parent.AddNodeLink(m.RootPath, n))
	var err error
	m.myIpns, err = m.AddDAGNode(parent, false)
	log.IfFatal(err)
	log.IfFatal(m.NamePublish())
}
Example #3
0
func addLink(t *testing.T, a, b *mdag.Node) {
	to := string(a.Data) + "2" + string(b.Data)
	if err := a.AddNodeLink(to, b); err != nil {
		t.Error(err)
	}
}