Giter VIP home page Giter VIP logo

ipfs-example's Introduction

##ipfs-example

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

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
...

ipfs-example's People

Contributors

fffw avatar uaalto avatar

Watchers

 avatar

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.