ipfs

https://www.fil.club/view/77.html 端口8080是HTTP网关,它允许您使用浏览器查询ipfs数据(请参阅此示例) 端口4001是IPFS用于与其他节点通信的群集端口,端口5001用于本地API。 我们5001只会绑定127.0.0.1因为它不应该暴露给外界。 我们已经安装了数据和分段卷。 该data卷用于存储IPFS本地存储(配置和数据库),并且 staging是一个可用于暂存文件以供命令行使用的目录(例如ipfs add)。 如果您只使用API,则可以省略暂存目录卷。当然,随意将这些目录放在除了之外的其他地方/tmp。

2019-07-30 · 1 min · 9 words · Me

[轉]用Go来做以太坊开发

https://github.com/miguelmota/ethereum-development-with-go-book https://goethereumbook.org/zh/

2019-07-29 · 1 min · 2 words · Me

ethereum explorer

https://github.com/gobitfly/etherchain-light https://github.com/gobitfly/erc20-explorer https://github.com/carsenk/explorer https://github.com/Capgemini-AIE/ethereum-docker/tree/master/monitored-geth-client https://github.com/cubedro/eth-net-intelligence-api https://github.com/cubedro/eth-netstats Browse blocks and transactions It’s nice to have some simple analogue of Etherscan for your local chain browsing. It will be useful to examine transactions, balances, blocks and etc. It appeared that it is quite difficult to find an open-source good solution for geth. After several tries I found an acceptable solution called ETHExplorer V2. Clone it into explorer-v2 folder. To Dockerize it I had to make 2 changes. First create a Dockerfile ...

2019-07-28 · 1 min · 150 words · Me

prisma like dreamfactory

https://github.com/prisma/prisma

2019-07-27 · 1 min · word · Me

nestjs csrf

https://gitissue.com/repos/jiayisheji/blog pass csrf https://github.com/expressjs/csurf/issues/21 main.ts import { NestFactory } from '@nestjs/core'; import { NestExpressApplication } from '@nestjs/platform-express'; import { join } from 'path' import { AppModule } from './app.module'; import * as cookieSession from 'cookie-session'; import * as helmet from 'helmet'; import * as cookieParser from 'cookie-parser'; import * as csurf from 'csurf'; import * as rateLimit from 'express-rate-limit'; async function bootstrap() { const app = await NestFactory.create( AppModule, ); app.init() app.useStaticAssets(join(__dirname, '..', 'public')); app.setBaseViewsDir(join(__dirname, '..', 'views')); app.setViewEngine('pug'); app.set('trust proxy', 1); app.use(cookieSession({ name: 'session', keys: ['key1', 'key2'] })); //app.enableCors(); app.use(helmet()); app.use(cookieParser()); //app.use(csurf({ cookie: true })); //正常是這行,但有些API POST時需要略過csrf app.use(function (req, res, next) { var mw = csurf({ cookie: true }); // console.log(req.url) // check real get url if (req.url === '/testpostcsrf') return next(); //pass csrf check mw(req, res, next); }); app.use( rateLimit({ windowMs: 15 * 60 * 1000, // 15 minutes max: 100, // limit each IP to 100 requests per windowMs }), ); await app.listen(3000); } bootstrap(); layout.pug doctype html html head title= title meta(content= csrfToken, name='csrf-token') body block content login.pug extends layout block content h1 Please log in if error p. #{error} form(action="/login",method="POST") input(type="hidden",name="_csrf",value=csrfToken) input(type="hidden",name="challenge",value=challenge) table(style="") tr td input(type="email",id="email",name="email",placeholder="email@foobar.com") td. (Example: "foo@bar.com") tr td input(type="password",id="password",name="password") td. (Example: "foobar") input(type="checkbox",id="remember",name="remember",value="1") label(for="remember") Remember me br input(type="submit",id="accept",value="Log in")

2019-07-25 · 1 min · 206 words · Me