@@ -196,12 +196,12 @@ func main() {
196
196
defer cancel ()
197
197
198
198
// Spawn a local peer using a temporary path, for testing purposes
199
- peerAPI , peerNode , err := spawnEphemeral (ctx )
199
+ ipfsA , nodeA , err := spawnEphemeral (ctx )
200
200
if err != nil {
201
201
panic (fmt .Errorf ("failed to spawn peer node: %s" , err ))
202
202
}
203
203
204
- peerCidFile , err := peerAPI .Unixfs ().Add (ctx ,
204
+ peerCidFile , err := ipfsA .Unixfs ().Add (ctx ,
205
205
files .NewBytesFile ([]byte ("hello from ipfs 101 in go-ipfs" )))
206
206
if err != nil {
207
207
panic (fmt .Errorf ("could not add File: %s" , err ))
@@ -211,7 +211,7 @@ func main() {
211
211
212
212
// Spawn a node using a temporary path, creating a temporary repo for the run
213
213
fmt .Println ("Spawning node on a temporary repo" )
214
- ipfs , _ , err := spawnEphemeral (ctx )
214
+ ipfsB , _ , err := spawnEphemeral (ctx )
215
215
if err != nil {
216
216
panic (fmt .Errorf ("failed to spawn ephemeral node: %s" , err ))
217
217
}
@@ -231,7 +231,7 @@ func main() {
231
231
panic (fmt .Errorf ("could not get File: %s" , err ))
232
232
}
233
233
234
- cidFile , err := ipfs .Unixfs ().Add (ctx , someFile )
234
+ cidFile , err := ipfsB .Unixfs ().Add (ctx , someFile )
235
235
if err != nil {
236
236
panic (fmt .Errorf ("could not add File: %s" , err ))
237
237
}
@@ -243,7 +243,7 @@ func main() {
243
243
panic (fmt .Errorf ("could not get File: %s" , err ))
244
244
}
245
245
246
- cidDirectory , err := ipfs .Unixfs ().Add (ctx , someDirectory )
246
+ cidDirectory , err := ipfsB .Unixfs ().Add (ctx , someDirectory )
247
247
if err != nil {
248
248
panic (fmt .Errorf ("could not add Directory: %s" , err ))
249
249
}
@@ -260,7 +260,7 @@ func main() {
260
260
outputPathFile := outputBasePath + strings .Split (cidFile .String (), "/" )[2 ]
261
261
outputPathDirectory := outputBasePath + strings .Split (cidDirectory .String (), "/" )[2 ]
262
262
263
- rootNodeFile , err := ipfs .Unixfs ().Get (ctx , cidFile )
263
+ rootNodeFile , err := ipfsB .Unixfs ().Get (ctx , cidFile )
264
264
if err != nil {
265
265
panic (fmt .Errorf ("could not get file with CID: %s" , err ))
266
266
}
@@ -272,7 +272,7 @@ func main() {
272
272
273
273
fmt .Printf ("got file back from IPFS (IPFS path: %s) and wrote it to %s\n " , cidFile .String (), outputPathFile )
274
274
275
- rootNodeDirectory , err := ipfs .Unixfs ().Get (ctx , cidDirectory )
275
+ rootNodeDirectory , err := ipfsB .Unixfs ().Get (ctx , cidDirectory )
276
276
if err != nil {
277
277
panic (fmt .Errorf ("could not get file with CID: %s" , err ))
278
278
}
@@ -288,7 +288,7 @@ func main() {
288
288
289
289
fmt .Println ("\n -- Going to connect to a few nodes in the Network as bootstrappers --" )
290
290
291
- peerMa := fmt .Sprintf ("/ip4/127.0.0.1/udp/4010/p2p/%s" , peerNode .Identity .String ())
291
+ peerMa := fmt .Sprintf ("/ip4/127.0.0.1/udp/4010/p2p/%s" , nodeA .Identity .String ())
292
292
293
293
bootstrapNodes := []string {
294
294
// IPFS Bootstrapper nodes.
@@ -314,7 +314,7 @@ func main() {
314
314
}
315
315
316
316
go func () {
317
- err := connectToPeers (ctx , ipfs , bootstrapNodes )
317
+ err := connectToPeers (ctx , ipfsB , bootstrapNodes )
318
318
if err != nil {
319
319
log .Printf ("failed connect to peers: %s" , err )
320
320
}
@@ -326,7 +326,7 @@ func main() {
326
326
outputPath := outputBasePath + exampleCIDStr
327
327
testCID := icorepath .New (exampleCIDStr )
328
328
329
- rootNode , err := ipfs .Unixfs ().Get (ctx , testCID )
329
+ rootNode , err := ipfsB .Unixfs ().Get (ctx , testCID )
330
330
if err != nil {
331
331
panic (fmt .Errorf ("could not get file with CID: %s" , err ))
332
332
}
0 commit comments