Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Resolve ipns on browser side #1644

Closed
mullerivan opened this issue Oct 18, 2018 · 3 comments
Closed

Resolve ipns on browser side #1644

mullerivan opened this issue Oct 18, 2018 · 3 comments

Comments

@mullerivan
Copy link

HI there, That is a grate app im working on some test that intent to resolve in client/browser side a static IPNS with something like

<script src="https://unpkg.com/ipfs/dist/index.js"></script>


const node = new Ipfs({
        EXPERIMENTAL: {
            pubsub: true // required, enables pubsub
        },
        repo: 'ipfs-' + Math.random(),
        config: {
            Addresses: {
                Swarm: [
                    '/dns4/ws-star.discovery.libp2p.io/tcp/443/wss/p2p-websocket-star'
                ]
            }
        }
    });
node.once('ready', () => {})

result = node.resolve('/ipns/IPNS-HASH',
node._peerInfo.id,{local:false,recursive=true},
function (err) {console.log(err)})

Any idea how is the proper way to call ipns to resolve an static hash and give me back the last updated hash of the curren file?

@alanshaw
Copy link
Member

Soon™️. IPNS doesn't have a complete implementation in js-ipfs just yet. It is being worked on right now (IPNS over pubsub). Also, one of ways of resolving IPNS names is via the DHT which is also being worked on so that it is interoperable with go-ipfs.

You can also use ipfs.name.resolve to resolve an IPNS name to a hash but currently this only works for keys you've published locally (so not much good for application use atm).

ipfs.resolve has not been updated yet to work with IPNS, and can currently only be used to lookup hashes for IPFS paths. See the 0.32 release docs for more info.

@kuabhish
Copy link

Hey @alanshaw , I am unable to work with ipns,

I am publishing a static file(i.e. ipfs/) to ipns
and I am getting some name , value pair .

then, when i try to fetch it.:

ipfs resolve -r /ipns/QmW5VYrjip26PC3ni6ML8TnbQULU7RJqSr6KiEH6TDQ5ca: context deadline exceeded

I see this..

How can i resolve this. ?

@lukecage0
Copy link

lukecage0 commented Jul 19, 2020

@kuabhish
Please try
$ipfs name resolve QmW5VYrjip26PC3ni6ML8TnbQULU7RJqSr6KiEH6TDQ5ca

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants