Skip to content

Instantly share code, notes, and snippets.

View sulejirl's full-sized avatar
🏠
Working from home

Ahmet Sayarlıoğlu sulejirl

🏠
Working from home
View GitHub Profile
@sulejirl
sulejirl / ipfs-backend.js
Last active January 12, 2023 15:34
IPFS backend for sending and getting file from the ipfs system without deploying local node
//Required modules
const ipfsAPI = require('ipfs-api');
const express = require('express');
const fs = require('fs');
const app = express();
//Connceting to the ipfs network via infura gateway
const ipfs = ipfsAPI('ipfs.infura.io', '5001', {protocol: 'https'})
//Reading file from computer
@sulejirl
sulejirl / ethereum-backend.js
Last active February 14, 2023 21:13
Ethereum: Sending Transaction via NodeJS Backend Tutorial
const web3 = require('web3');
const express = require('express');
const Tx = require('ethereumjs-tx');
const app = express();
//Infura HttpProvider Endpoint
web3js = new web3(new web3.providers.HttpProvider("https://rinkeby.infura.io/YOUR_API_KEY"));
app.get('/sendtx',function(req,res){