728x90 반응형 SMALL IPFS2 [IPFS] Node.js를 이용한 파일 업로드 방식들 파헤치기 기본 세팅 및 파일 버퍼 준비. const fs = require('fs'); const Client = require('ipfs-http-client'); const ipfs = Client.create({ host: 'localhost', port: '80', protocol: 'http', }); const testFile = fs.readFileSync('hello_world.txt', 'utf8'); const testBuffer = Buffer.from(testFile); async function go() { // 여기에 입력합니다. } go() 1. 파일 버퍼 그대로 업로드. async function go() { const result = await ipfs.add(testBuffer);.. 2022. 9. 1. Ubuntu 18.04에 IPFS 설치하기 우분투에 IPFS를 설치하고 GUI와 Node.js 서버에서 업로드 할게요. 서버에 설치해요. $ sudo apt-get update $ sudo apt-get -y upgrade $ sudo apt install golang-go -y $ wget https://dist.ipfs.io/go-ipfs/v0.14.0/go-ipfs_v0.14.0_linux-amd64.tar.gz $ tar zxvf go-ipfs_v0.14.0_linux-amd64.tar.gz $ cd go-ipfs $ sudo ./install.sh IPFS를 실행할 때는 단독으로 실행할 수도 있지만 PM2를 이용하는게 좋아요. (자동 관리) PM2: https://pm2.io PM2 - Home Build Battle-Hardened N.. 2022. 8. 26. 이전 1 다음 728x90 반응형 LIST