proto school tutorial: blog: lesson 1
https://proto.school/#/blog/01
我们现在希望:把一个post 和他的作者联系起来。
- 从之前的教程here中,你可以知道, 一个cid 就是代表一个link
比如:
{
linkToAwesomeNode: awesomeCid
//字段: cid
}
总结就是: 当我们给一个字段赋值一个cid的时候,这个字段其实按照惯例,称为:named link
如下所示:(我们新加了 tt1 and tt2 , they are so called named link)
/* globals ipfs */
const run = async () => {
const natCid = await ipfs.dag.put({ author: "Nat" })
const samCid = await ipfs.dag.put({ author: "Sam" })
const treePostCid = await ipfs.dag.put({
content: "trees",
author: samCid//tt1
})
const computerPostCid = await ipfs.dag.put({
content: "computers",
author: natCid//tt2
})
return [treePostCid, computerPostCid]
}
return run
proto school tutorial: blog: lesson 1的更多相关文章
- Protobuf 动态加载 .proto 文件并操作 Message
Google Protocol Buffer 的常规用法需要使用 protoc 将 .proto 编译成 .pb.h 和 .pb.cc,这样做效率非常高,但是耦合性也很高.在某些追求通用性而不追求性能 ...
- bazel使用汇总
最近重构代码之后,打算在本地用bazel来作项目构建.主要是因为brpc已经支持了bazel,所以在此之前料想会简单许多. 安装比较简单,centos直接用yum就行.按照这个指示: https:// ...
- protobuf高效传输对比json gizp等等
https://blog.csdn.net/u013929284/article/details/72582215 利用Protocol Buffers可以很好的解决JSON数据在传输方面的不足,它是 ...
- google protobuf学习笔记:windows下环境配置
欢迎转载,转载请注明原文地址:http://blog.csdn.net/majianfei1023/article/details/45371743 protobuf的使用和原理,请查看:http:/ ...
- GOOGLE PROTOBUF开发者指南
原文地址:http://www.cppblog.com/liquidx/archive/2009/06/23/88366.html 译者: gashero 目录 1 概览 1.1 什么是pro ...
- protoc-gen-php --php_out: protoc-gen-php: Plugin output is unparseable.
背景 业务需要用protobuffer 进行通讯. client: php server: c++ 在github 上找到 Protobuf-PHP (https://github.com/drslu ...
- Google Protocol Buffers简介
什么是 protocol buffers ? Protocol buffers 是一种灵活.高效的序列化结构数据的自动机制--想想XML,但是它更小,更快,更简单.你只需要把你需要怎样结构化你的数据定 ...
- 【MINA】用protobuf做编解码协议
SOCKET协议 支持java serial 与 AMF3的混合协议,目前没有基于xml 与 json的实现. 协议说明: * 9个字节协议头+协议体. * * 协议头1-4字节表示协议长度 =协议体 ...
- 照着例子学习protobuf-python
以下是照着python操作protobuf进行的protobuf-python的学习笔记: 首先是protobuf的下载与安装: 1 由于google被墙,所以去github上面搜索了一下protob ...
随机推荐
- ffmpeg 音频常用命令
ffmpeg的使用方式: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}... Stream ...
- HTMLElement.offsetParent(offsetLeft和offsetTop参照offsetParent的内边距边界)
IE7以上(不是火狐): 父级没有定位: 本身没有定位: ==> offsetParent:body 本身定位为:absolute/relative: ==> offsetParent:b ...
- 线段树 区间查询最大值,单体修改 hdu 1754
#include<cstdio> #include<algorithm> #include<string.h> #include<math.h> #in ...
- 关于使用阿里云MAVEN镜像仓库
由于国内的某些不可明确的原因 国内连接google的时候十分慢,使得看github上的项目十分慢,这里我们可以修改build.gradle下的文件来使用阿里云仓库同步 会更快: // Top-leve ...
- MySQL数据完整性
数据完整性 一个数据库就是一个完整的业务单元,可以包含多张表,数据被存储在表中 在表中为了更加准确的存储数据,保证数据的正确有效,可以在创建表的时候,为表添加一些强制性的验证,包括数据字段的类型.约束 ...
- 转载:Linux 时钟基础学习
1.HZ Linux核心每隔固定周期会发出timer interrupt (IRQ 0),HZ是用来定义每一秒有几次timer interrupts.举例来说,HZ为1000,代表每秒有1000次ti ...
- saas的资料
互联网时代的软件革命-SaaS架构设计.叶伟.扫描版 提取码:jd5c 让云落地 云计算服务模式(SAAS.PAAS和IAAS)设计决策--Michael J.Kavis著提取码:ut24
- 67课 for循环1-为什么需要for循环
# include <stdio.h> int main (void) { int i; ;.//sum代表和的意思 ; i<=; ++i)//第八行代码 sum = sum + i ...
- 京东秒杀抢购的小脚本和chorme的一个开发者插件
chorme开发者插件 下载源码包:https://github.com/gongjunhao/seckill/archive/master.zip 解压:seckill-master.zip 打开c ...
- Linux挂载(mount,umount及开机自动挂载
挂载概念简述: 根文件系统之外的其他文件要想能够被访问,都必须通过“关联”至根文件系统上的某个目录来实现,此关联操作即为“挂载”,此目录即为“挂载点”,解除此关联关系的过程称之为“卸载” 1.挂载:根 ...