Code Monkey home page Code Monkey logo

go-fetcher's Introduction

go-fetcher

โ— This repo is no longer maintained.

๐Ÿ‘‰ We highly recommend switching to the maintained version at https://github.com/ipfs/boxo/tree/main/fetcher. ๐ŸŽ๏ธ Good news! There is tooling and documentation to expedite a switch in your repo.

โš ๏ธ If you continue using this repo, please note that security fixes will not be provided (unless someone steps in to maintain it).

๐Ÿ“š Learn more, including how to take the maintainership mantle or ask questions, here.

Go-fetcher is a library to retrieve IPLD prime nodes from IPFS using data exchange protocols

License

The go-fetcher project is dual-licensed under Apache 2.0 and MIT terms:

go-fetcher's People

Contributors

acruikshank avatar aschmahmann avatar guseggert avatar hacdias avatar hannahhoward avatar ipfs-mgmt-read-write[bot] avatar warpfork avatar web-flow avatar web3-bot avatar whyrusleeping avatar willscott avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

go-fetcher's Issues

Why do we have dagpb specific logic here?

go-fetcher/fetcher.go

Lines 195 to 200 in 3290471

var DefaultPrototypeChooser = dagpb.AddSupportToChooser(func(lnk ipld.Link, lnkCtx ipld.LinkContext) (ipld.NodePrototype, error) {
if tlnkNd, ok := lnkCtx.LinkNode.(schema.TypedLinkNode); ok {
return tlnkNd.LinkTargetNodePrototype(), nil
}
return basicnode.Prototype.Any, nil
})

This isn't extensible or maintainable.

failing TestFetchGraphToBlocks test

=== RUN   TestFetchGraphToBlocks
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x8049f6c]

goroutine 930 [running]:
runtime/internal/atomic.Xadd64(0xa54e59c, 0x1, 0x0, 0xa5501b0, 0x7)
	/opt/hostedtoolcache/go/1.15.12/x64/src/runtime/internal/atomic/asm_386.s:105 +0xc
github.com/ipfs/go-bitswap/testnet.(*networkClient).SendMessage(0xa54e580, 0x872a2e0, 0xa76f920, 0xa550150, 0x7, 0x872e940, 0xa76fac0, 0x0, 0xffffffff)
	/home/runner/go/pkg/mod/github.com/ipfs/[email protected]/testnet/virtual.go:216 +0x9c
github.com/ipfs/go-bitswap/testnet.(*messagePasser).SendMsg(0xa416920, 0x872a2e0, 0xa76f920, 0x872e940, 0xa76fac0, 0x2, 0x0)
	/home/runner/go/pkg/mod/github.com/ipfs/[email protected]/testnet/virtual.go:260 +0x51
github.com/ipfs/go-bitswap/internal/messagequeue.(*MessageQueue).sendMessage(0xa4f83c0)
	/home/runner/go/pkg/mod/github.com/ipfs/[email protected]/internal/messagequeue/messagequeue.go:518 +0x247
github.com/ipfs/go-bitswap/internal/messagequeue.(*MessageQueue).sendIfReady(0xa4f83c0)
	/home/runner/go/pkg/mod/github.com/ipfs/[email protected]/internal/messagequeue/messagequeue.go:487 +0x39
github.com/ipfs/go-bitswap/internal/messagequeue.(*MessageQueue).runQueue(0xa4f83c0)
	/home/runner/go/pkg/mod/github.com/ipfs/[email protected]/internal/messagequeue/messagequeue.go:436 +0x3eb
created by github.com/ipfs/go-bitswap/internal/messagequeue.(*MessageQueue).Startup
	/home/runner/go/pkg/mod/github.com/ipfs/[email protected]/internal/messagequeue/messagequeue.go:374 +0x8c
FAIL	github.com/ipfs/go-fetcher/helpers	0.020s
=== RUN   TestFetchIPLDPrimeNode
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x8049f6c]

goroutine 930 [running]:
runtime/internal/atomic.Xadd64(0x8d4c41c, 0x1, 0x0, 0x8d4e130, 0x7)
	/opt/hostedtoolcache/go/1.15.12/x64/src/runtime/internal/atomic/asm_386.s:105 +0xc
github.com/ipfs/go-bitswap/testnet.(*networkClient).SendMessage(0x8d4c400, 0x8730240, 0x8f497c0, 0x8d4e0d0, 0x7, 0x8734900, 0x8f49960, 0x0, 0xffffffff)
	/home/runner/go/pkg/mod/github.com/ipfs/[email protected]/testnet/virtual.go:216 +0x9c
github.com/ipfs/go-bitswap/testnet.(*messagePasser).SendMsg(0x8c16860, 0x8730240, 0x8f497c0, 0x8734900, 0x8f49960, 0x2, 0x0)
	/home/runner/go/pkg/mod/github.com/ipfs/[email protected]/testnet/virtual.go:260 +0x51
github.com/ipfs/go-bitswap/internal/messagequeue.(*MessageQueue).sendMessage(0x8cf83c0)
	/home/runner/go/pkg/mod/github.com/ipfs/[email protected]/internal/messagequeue/messagequeue.go:518 +0x247
github.com/ipfs/go-bitswap/internal/messagequeue.(*MessageQueue).sendIfReady(0x8cf83c0)
	/home/runner/go/pkg/mod/github.com/ipfs/[email protected]/internal/messagequeue/messagequeue.go:487 +0x39
github.com/ipfs/go-bitswap/internal/messagequeue.(*MessageQueue).runQueue(0x8cf83c0)
	/home/runner/go/pkg/mod/github.com/ipfs/[email protected]/internal/messagequeue/messagequeue.go:436 +0x3eb
created by github.com/ipfs/go-bitswap/internal/messagequeue.(*MessageQueue).Startup
	/home/runner/go/pkg/mod/github.com/ipfs/[email protected]/internal/messagequeue/messagequeue.go:374 +0x8c
FAIL	github.com/ipfs/go-fetcher/impl/blockservice	0.011s
?   	github.com/ipfs/go-fetcher/testutil	[no test files]
FAIL

Consider removing `PrototypeFromLink`

PrototypeFromLink(link ipld.Link) (ipld.NodePrototype, error) is a weird thing to have as part of the fetcher interface.
This seems to be a function of the active ipld linksystem, and it seems unclear why this is something that belongs on the fetcher public interface. We should document or consider where the right place for this to live would be.

Consider separation between 'core interface' and helper methods

It would be useful to specify a clear "core interface" to this library in case other implementations are desired, and separate that from the utility methods that can be used to to simplify for downstream clients.

In particular, it seems that the core interface we're presenting are
BlockMatchingOfType and NodeMatchingOfType, with the other methods being simplified helper cases derived from these. Is that right?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.