• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

getlantern/ipfs-example

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

getlantern/ipfs-example

开源软件地址:

https://github.com/getlantern/ipfs-example

开源编程语言:

Go 100.0%

开源软件介绍:

##ipfs-example

It's a slightly modified version of Making your own ipfs service that can have server and client work on same machine.

Install IPFS from source

Initialize IPFS repo for both server and client

IPFS_PATH=.ipfs-repo-server ipfs init
IPFS_PATH=.ipfs-repo-client ipfs init

IPFS_PATH=.ipfs-repo-client ipfs config edit

Then change the addresses in Swarm section to a different port.

Run server

(cd server && go get && go run *.go)

It will add a new message every 10 seconds. Note that the IPFS link changed for each message but IPNS link didn't.

1: Hey! I have a message to you at /ipfs/QmaEtVYrLa3GGA3VkTek9ABH2mZxuTQ2TdAGhbgLC3gAqc/hello
Also available at permanent link /ipns/QmPifCgEXvisnQ8vBXF4MKvkqsJ5H8bP9NZVpLpL4VaGS9
***
2: Hey! I have a message to you at /ipfs/QmR74gHBS8yRfhv6y1JdLCzWevScaFB5hGyLiVHBw7mgM3/hello
Also available at permanent link /ipns/QmPifCgEXvisnQ8vBXF4MKvkqsJ5H8bP9NZVpLpL4VaGS9
***
...

Run client

(cd client && go get && go run *.go <link>)

The link can be IPFS link or IPNS link. If you supply IPNS link, the retrieved message will vary gradually.

Real path for /ipns/QmPifCgEXvisnQ8vBXF4MKvkqsJ5H8bP9NZVpLpL4VaGS9: /ipfs/QmZYcPJUDShoFcyef6LDfTxcQ6Y9m1rWT43u8VRMXXthnG/hello
Message 295: Welcome to the wonderland of IPFS

Real path for /ipns/QmPifCgEXvisnQ8vBXF4MKvkqsJ5H8bP9NZVpLpL4VaGS9: /ipfs/Qmb9LYjQjwCY33zgwPJ3XyGH48GbLZpvT2YAxy2RaffvwV/hello
Message 299: Welcome to the wonderland of IPFS
...



鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap