- 개발 기록을 남기기 위해 쓴 글 입니다.
- IPFS 어디다 쓰냐고여 ? 파일 업로드 할 때 쓰면 좋습니다. (feat busy.org) 동영상 스트리밍 할때도 좋고여 ( feat DTube )
- 왜 좋냐고여 ? 파일을 분산 해서 가져와 대역폭를 나눠가져와요 속도도 빠르죠+서버 부하가 줄어들죠, 그런데 왜 DTube는 느리냐고요 ? 국내에 서버가 없어요 ㅜㅜ 해외라 느려요 그리고 해당 자료를 다운받아 공유해야 빨라지는데 공유가 거의 없죠(IPFS Daemon 설치 필요)
- 기타 궁금한 점이 있음 댓글요
sudo add-apt-repository ppa:longsleep/golang-backports
sudo apt-get update
sudo apt-get install golang-go
export PATH=$PATH:/usr/local/go/bin
export PATH=$PATH:$GOPATH/bin
go env 를 통해 경로정보(GOPATH) 확인 후 PATH에 추가$ go get -u -d github.com/ipfs/go-ipfs
$ cd $GOPATH/src/github.com/ipfs/go-ipfs<br>
$ make install
GOPATH/bin 경로에 파일이 위치하게 된다.$ ipfs init
initializing IPFS node at /home/wonsama/.ipfs
generating 2048-bit RSA keypair...done
peer identity: QmZVbfF459S3213213NBxxxxxxxxxxxxxxxxxxpCorJggzm6
to get started, enter:
ipfs cat /ipfs/QmS4ustL54uo8FzR9455qaxZwuMiUhyvMcX9Ba8nUH4uVv/readme
$ ipfs cat /ipfs/QmS4ustL54uo8FzR9455qaxZwuMiUhyvMcX9Ba8nUH4uVv/readme
Hello and Welcome to IPFS!
██╗██████╗ ███████╗███████╗
██║██╔══██╗██╔════╝██╔════╝
██║██████╔╝█████╗ ███████╗
██║██╔═══╝ ██╔══╝ ╚════██║
██║██║ ██║ ███████║
╚═╝╚═╝ ╚═╝ ╚══════╝
If you're seeing this, you have successfully installed
IPFS and are now interfacing with the ipfs merkledag!
-------------------------------------------------------
| Warning: |
| This is alpha software. Use at your own discretion! |
| Much is missing or lacking polish. There are bugs. |
| Not yet secure. Read the security notes for more. |
-------------------------------------------------------
Check out some of the other files in this directory:
./about
./help
./quick-start <-- usage examples
./readme <-- this file
./security-notes
$ ipfs daemon
sudo vi /etc/systemd/system/ipfs.service
[Unit]
Description=IPFS Daemon
After=syslog.target network.target remote-fs.target nss-lookup.target
[Service]
Type=simple
ExecStart=/usr/local/bin/ipfs daemon --enable-namesys-pubsub
User=wonsama
[Install]
WantedBy=multi-user.target
ExecStart=/usr/local/bin/ipfs 부분을 GOPATH 를 참조하여 ipfs가 설치된 경로로 변경User=wonsama 이 부분을 초기 서비스 기동 시 실행할 계정명으로 바꿔준다sudo systemctl daemon-reload
sudo systemctl enable ipfs
sudo systemctl start ipfs
sudo systemctl stop ipfssudo systemctl status ipfs
● ipfs.service - IPFS Daemon
Loaded: loaded (/etc/systemd/system/ipfs.service; enabled; vendor preset: enabled)
Active: active (running) since 수 2018-08-22 13:24:24 KST; 3s ago
Main PID: 17497 (ipfs)
CGroup: /system.slice/ipfs.service
└─17497 /home/wonsama/go/bin/ipfs daemon --enable-namesys-pubsub
8월 22 13:24:26 wonsama ipfs[17497]: Swarm listening on /p2p-circuit/ipfs/QmZVbfF459S72AVxxxxxxxxxxxxxxkUZsJApCorJggzm6
8월 22 13:24:26 wonsama ipfs[17497]: Swarm announcing /ip4/127.0.0.1/tcp/4001
8월 22 13:24:26 wonsama ipfs[17497]: Swarm announcing /ip4/127.0.0.1/tcp/41364
8월 22 13:24:26 wonsama ipfs[17497]: Swarm announcing /ip4/192.168.0.202/tcp/4001
8월 22 13:24:26 wonsama ipfs[17497]: Swarm announcing /ip4/192.168.0.202/tcp/41364
8월 22 13:24:26 wonsama ipfs[17497]: Swarm announcing /ip6/::1/tcp/4001
8월 22 13:24:26 wonsama ipfs[17497]: Swarm announcing /ip6/::1/tcp/46805
8월 22 13:24:26 wonsama ipfs[17497]: API server listening on /ip4/127.0.0.1/tcp/5001
8월 22 13:24:26 wonsama ipfs[17497]: Gateway (readonly) server listening on /ip4/127.0.0.1/tcp/8080
8월 22 13:24:26 wonsama ipfs[17497]: Daemon is ready
$ vi ~/.ipfs/config
"Gateway": "/ip4/127.0.0.1/tcp/8080" 에서
"Gateway": "/ip4/0.0.0.0/tcp/8080" 으로 변경처리
sudo systemctl disable tomcat8
webui localhost:5001/webui 로 접근하는 경우 로컬에 daemon이 설치 되어 있어야 됨에 유의(API의 ip4/192.168.0.xxx 로 변경해도 실제 로컬 데몬 정보를 참조)