-
Notifications
You must be signed in to change notification settings - Fork 0
/
all.go
279 lines (242 loc) · 6.59 KB
/
all.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
package tour
import "sort"
func init() {
for _, t := range allTopics {
Topics[t.ID] = t
IDs = append(IDs, t.ID)
}
sort.Sort(IDSlice(IDs))
}
// TODO move content into individual files if desired
// TODO(brian): If sub-topics are needed, write recursively (as tree comprised
// of Section nodes:
//
// type Section interface {
// Sections() []Section
// Topic() Topic
// }
var (
// TODO bootstrapping
// TODO pinning: ensuring a block is kept in local storage (i.e. not
// evicted from cache).
Introduction = Chapter(0)
FileBasics = Chapter(1)
NodeBasics = Chapter(2)
MerkleDag = Chapter(3)
Network = Chapter(4)
Daemon = Chapter(5)
Routing = Chapter(6)
Exchange = Chapter(7)
Ipns = Chapter(8)
Mounting = Chapter(9)
Plumbing = Chapter(10)
Formats = Chapter(11)
)
// Topics contains a mapping of Tour Topic ID to Topic
var allTopics = []Topic{
{ID: Introduction(0), Content: IntroHelloMars},
{ID: Introduction(1), Content: IntroTour},
{ID: Introduction(2), Content: IntroAboutIpfs},
{ID: FileBasics(1), Content: FileBasicsFilesystem},
{ID: FileBasics(2), Content: FileBasicsGetting},
{ID: FileBasics(3), Content: FileBasicsAdding},
{ID: FileBasics(4), Content: FileBasicsDirectories},
{ID: FileBasics(5), Content: FileBasicsDistributed},
{ID: FileBasics(6), Content: FileBasicsMounting},
{NodeBasics(0), NodeBasicsInit},
{NodeBasics(1), NodeBasicsHelp},
{NodeBasics(2), NodeBasicsUpdate},
{NodeBasics(3), NodeBasicsConfig},
{MerkleDag(0), MerkleDagIntro},
{MerkleDag(1), MerkleDagContentAddressing},
{MerkleDag(2), MerkleDagContentAddressingLinks},
{MerkleDag(3), MerkleDagRedux},
{MerkleDag(4), MerkleDagIpfsObjects},
{MerkleDag(5), MerkleDagIpfsPaths},
{MerkleDag(6), MerkleDagImmutability},
{MerkleDag(7), MerkleDagUseCaseUnixFS},
{MerkleDag(8), MerkleDagUseCaseGitObjects},
{MerkleDag(9), MerkleDagUseCaseOperationalTransforms},
{Network(0), Network_Intro},
{Network(1), Network_Ipfs_Peers},
{Network(2), Network_Daemon},
{Network(3), Network_Routing},
{Network(4), Network_Exchange},
{Network(5), Network_Intro},
// TODO daemon - {API, API Clients, Example} how old-school http + ftp
// clients show it
{Daemon(0), Daemon_Intro},
{Daemon(1), Daemon_Running_Commands},
{Daemon(2), Daemon_Web_UI},
{Routing(0), Routing_Intro},
{Routing(1), Rouing_Interface},
{Routing(2), Routing_Resolving},
{Routing(3), Routing_DHT},
{Routing(4), Routing_Other},
// TODO Exchange_Providing
// TODO Exchange_Providers
{Exchange(0), Exchange_Intro},
{Exchange(1), Exchange_Getting_Blocks},
{Exchange(2), Exchange_Strategies},
{Exchange(3), Exchange_Bitswap},
{Ipns(0), Ipns_Name_System},
{Ipns(1), Ipns_Mutability},
{Ipns(2), Ipns_PKI_Review},
{Ipns(3), Ipns_Publishing},
{Ipns(4), Ipns_Resolving},
{Ipns(5), Ipns_Consistency},
{Ipns(6), Ipns_Records_Etc},
{Mounting(0), Mounting_General},
{Mounting(1), Mounting_Ipfs},
{Mounting(2), Mounting_Ipns},
{Plumbing(0), Plumbing_Intro},
{Plumbing(1), Plumbing_Ipfs_Block},
{Plumbing(2), Plumbing_Ipfs_Object},
{Plumbing(3), Plumbing_Ipfs_Refs},
{Plumbing(4), Plumbing_Ipfs_Ping},
{Plumbing(5), Plumbing_Ipfs_Id},
{Formats(0), Formats_MerkleDag},
{Formats(1), Formats_Multihash},
{Formats(2), Formats_Multiaddr},
{Formats(3), Formats_Multicodec},
{Formats(4), Formats_Multicodec},
{Formats(5), Formats_Multikey},
{Formats(6), Formats_Protocol_Specific},
}
// Introduction
var IntroHelloMars = Content{
Title: "Hello Mars",
Text: `
check things work
`,
}
var IntroTour = Content{
Title: "Hello Mars",
Text: `
how this works
`,
}
var IntroAboutIpfs = Content{
Title: "About IPFS",
}
// File Basics
var FileBasicsFilesystem = Content{
Title: "Filesystem",
Text: `
`,
}
var FileBasicsGetting = Content{
Title: "Getting Files",
Text: `ipfs cat
`,
}
var FileBasicsAdding = Content{
Title: "Adding Files",
Text: `ipfs add
`,
}
var FileBasicsDirectories = Content{
Title: "Directories",
Text: `ipfs ls
`,
}
var FileBasicsDistributed = Content{
Title: "Distributed",
Text: `ipfs cat from mars
`,
}
var FileBasicsMounting = Content{
Title: "Getting Files",
Text: `ipfs mount (simple)
`,
}
// Node Basics
var NodeBasicsInit = Content{
Title: "Basics - init",
// TODO touch on PKI
//
// This is somewhat relevant at ipfs init since the generated key pair is the
// basis for the node's identity in the network. A cursory nod may be
// sufficient at that stage, and goes a long way in explaining init's raison
// d'être.
// NB: user is introduced to ipfs init before ipfs add.
Text: `
`,
}
var NodeBasicsHelp = Content{
Title: "Basics - help",
Text: `
`,
}
var NodeBasicsUpdate = Content{
Title: "Basics - update",
Text: `
`,
}
var NodeBasicsConfig = Content{
Title: "Basics - config",
Text: `
`,
}
// Merkle DAG
var MerkleDagIntro = Content{}
var MerkleDagContentAddressing = Content{}
var MerkleDagContentAddressingLinks = Content{}
var MerkleDagRedux = Content{}
var MerkleDagIpfsObjects = Content{}
var MerkleDagIpfsPaths = Content{}
var MerkleDagImmutability = Content{
Title: "Immutability",
Text: `
TODO plan9
TODO git
`,
}
var MerkleDagUseCaseUnixFS = Content{}
var MerkleDagUseCaseGitObjects = Content{}
var MerkleDagUseCaseOperationalTransforms = Content{}
var Network_Intro = Content{}
var Network_Ipfs_Peers = Content{}
var Network_Daemon = Content{}
var Network_Routing = Content{}
var Network_Exchange = Content{}
var Network_Naming = Content{}
var Daemon_Intro = Content{}
var Daemon_Running_Commands = Content{}
var Daemon_Web_UI = Content{}
var Routing_Intro = Content{}
var Rouing_Interface = Content{}
var Routing_Resolving = Content{}
var Routing_DHT = Content{}
var Routing_Other = Content{}
var Exchange_Intro = Content{}
var Exchange_Bitswap = Content{}
var Exchange_Strategies = Content{}
var Exchange_Getting_Blocks = Content{}
var Ipns_Consistency = Content{}
var Ipns_Mutability = Content{}
var Ipns_Name_System = Content{}
var Ipns_PKI_Review = Content{
Title: "PKI Review",
Text: `
TODO sign verify
`,
}
var Ipns_Publishing = Content{}
var Ipns_Records_Etc = Content{}
var Ipns_Resolving = Content{}
var Mounting_General = Content{} // TODO note fuse
var Mounting_Ipfs = Content{} // TODO cd, ls, cat
var Mounting_Ipns = Content{} // TODO editing
var Plumbing_Intro = Content{}
var Plumbing_Ipfs_Block = Content{}
var Plumbing_Ipfs_Object = Content{}
var Plumbing_Ipfs_Refs = Content{}
var Plumbing_Ipfs_Ping = Content{}
var Plumbing_Ipfs_Id = Content{}
var Formats_MerkleDag = Content{}
var Formats_Multihash = Content{}
var Formats_Multiaddr = Content{}
var Formats_Multicodec = Content{}
var Formats_Multikey = Content{}
var Formats_Protocol_Specific = Content{}