getswap

command
v0.0.0-...-3979291 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 10, 2022 License: Apache-2.0, MIT Imports: 10 Imported by: 0

README

Example: getswap

Example demonstrating the use of go-selfish-bitswap-client.

First, we start an IPFS instance.

# init and start an IPFS node
> ipfs init
> ipfs daemon

We get a Multiaddress of the running IPFS instance.

# get ipfs instance multiaddress
> ipfs id
# select one entry from the "Address" field
# e.g /ip6/::1/udp/4001/quic/p2p/12D3KooWJm3q58KR3GuXWpnxUbYNbazHKMb9a2vtYrEhZzm19f66

Then, we create a new file, and add it to IPFS.

# create a file and pin it to ipfs
> echo Hello world! > hello.txt
> ipfs add hello.txt
added QmXgBq2xJKMqVo8jZdziyudNmnbiwjbpAycy5RbfDBoJRM hello.txt
 13 B / 13 B [================================================] 100.00%

Run the selfish bitswap client to retrieve the file you just added to IPFS.

# from within cmd/getswap
> go run main.go -p <multaddress> <cid>

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL