Permalink
Browse files

First public release

  • Loading branch information...
tezos authored and murbard committed Sep 8, 2016
0 parents commit f42e9d12ac75d2876a4cf600d44976b7090d4533
Showing with 39,478 additions and 0 deletions.
  1. +45 −0 .gitignore
  2. +147 −0 .gitlab-ci.yml
  3. +1 −0 .ocp-indent
  4. +13 −0 Makefile
  5. +66 −0 README.md
  6. +65 −0 docs/TUTORIAL.md
  7. +136 −0 docs/proof of stake.md
  8. +30 −0 scripts/create_docker_builder.sh
  9. +59 −0 scripts/install_build_deps.sh
  10. +40 −0 src/.merlin
  11. +467 −0 src/Makefile
  12. +18 −0 src/Makefile.config
  13. +4 −0 src/client/.merlin
  14. +198 −0 src/client/client_aliases.ml
  15. +45 −0 src/client/client_aliases.mli
  16. +202 −0 src/client/client_config.ml
  17. +347 −0 src/client/client_generic_rpcs.ml
  18. +10 −0 src/client/client_generic_rpcs.mli
  19. +137 −0 src/client/client_keys.ml
  20. +20 −0 src/client/client_keys.mli
  21. +209 −0 src/client/client_node_rpcs.ml
  22. +105 −0 src/client/client_node_rpcs.mli
  23. +31 −0 src/client/client_version.ml
  24. +16 −0 src/client/client_version.mli
  25. +78 −0 src/client/embedded/Makefile.shared
  26. +12 −0 src/client/embedded/bootstrap/.merlin
  27. +31 −0 src/client/embedded/bootstrap/Makefile
  28. +16 −0 src/client/embedded/bootstrap/client_proto_aliases.ml
  29. +10 −0 src/client/embedded/bootstrap/client_proto_aliases.mli
  30. +122 −0 src/client/embedded/bootstrap/client_proto_args.ml
  31. +49 −0 src/client/embedded/bootstrap/client_proto_args.mli
  32. +275 −0 src/client/embedded/bootstrap/client_proto_context.ml
  33. +51 −0 src/client/embedded/bootstrap/client_proto_context.mli
  34. +182 −0 src/client/embedded/bootstrap/client_proto_contracts.ml
  35. +45 −0 src/client/embedded/bootstrap/client_proto_contracts.mli
  36. +18 −0 src/client/embedded/bootstrap/client_proto_main.ml
  37. +10 −0 src/client/embedded/bootstrap/client_proto_main.mli
  38. +82 −0 src/client/embedded/bootstrap/client_proto_nonces.ml
  39. +14 −0 src/client/embedded/bootstrap/client_proto_nonces.mli
  40. +179 −0 src/client/embedded/bootstrap/client_proto_programs.ml
  41. +18 −0 src/client/embedded/bootstrap/client_proto_programs.mli
  42. +254 −0 src/client/embedded/bootstrap/client_proto_rpcs.ml
  43. +217 −0 src/client/embedded/bootstrap/client_proto_rpcs.mli
  44. +392 −0 src/client/embedded/bootstrap/concrete_lexer.mll
  45. +71 −0 src/client/embedded/bootstrap/concrete_parser.mly
  46. +21 −0 src/client/embedded/bootstrap/local_error_monad.ml
  47. +23 −0 src/client/embedded/bootstrap/mining/Makefile
  48. +86 −0 src/client/embedded/bootstrap/mining/client_mining_blocks.ml
  49. +32 −0 src/client/embedded/bootstrap/mining/client_mining_blocks.mli
  50. +39 −0 src/client/embedded/bootstrap/mining/client_mining_daemon.ml
  51. +13 −0 src/client/embedded/bootstrap/mining/client_mining_daemon.mli
  52. +40 −0 src/client/embedded/bootstrap/mining/client_mining_denunciation.ml
  53. +12 −0 src/client/embedded/bootstrap/mining/client_mining_denunciation.mli
  54. +345 −0 src/client/embedded/bootstrap/mining/client_mining_endorsement.ml
  55. +23 −0 src/client/embedded/bootstrap/mining/client_mining_endorsement.mli
  56. +454 −0 src/client/embedded/bootstrap/mining/client_mining_forge.ml
  57. +47 −0 src/client/embedded/bootstrap/mining/client_mining_forge.mli
  58. +166 −0 src/client/embedded/bootstrap/mining/client_mining_main.ml
  59. +18 −0 src/client/embedded/bootstrap/mining/client_mining_main.mli
  60. +102 −0 src/client/embedded/bootstrap/mining/client_mining_operations.ml
  61. +30 −0 src/client/embedded/bootstrap/mining/client_mining_operations.mli
  62. +58 −0 src/client/embedded/bootstrap/mining/client_mining_revelation.ml
  63. +21 −0 src/client/embedded/bootstrap/mining/client_mining_revelation.mli
  64. +68 −0 src/client/embedded/bootstrap/script_located_ir.ml
  65. +9 −0 src/client/embedded/demo/.merlin
  66. +12 −0 src/client/embedded/demo/Makefile
  67. +92 −0 src/client/embedded/demo/client_proto_main.ml
  68. +9 −0 src/client/embedded/demo/client_proto_main.mli
  69. +17 −0 src/client/embedded/demo/client_proto_rpcs.ml
  70. +13 −0 src/client/embedded/demo/client_proto_rpcs.mli
  71. +62 −0 src/client_main.ml
  72. +2 −0 src/compiler/.merlin
  73. +15 −0 src/compiler/embedded_cmis.mli
  74. +20 −0 src/compiler/node_compiler_main.ml
  75. +442 −0 src/compiler/tezos_compiler.ml
  76. +19 −0 src/compiler/tezos_compiler.mli
  77. +16 −0 src/compiler_main.ml
  78. +2 −0 src/node/.merlin
  79. +327 −0 src/node/db/context.ml
  80. +62 −0 src/node/db/context.mli
  81. +108 −0 src/node/db/db_proxy.ml
  82. +46 −0 src/node/db/db_proxy.mli
  83. +673 −0 src/node/db/ir_funview.ml
  84. +25 −0 src/node/db/ir_funview.mli
  85. +571 −0 src/node/db/persist.ml
  86. +251 −0 src/node/db/persist.mli
  87. +648 −0 src/node/db/store.ml
  88. +201 −0 src/node/db/store.mli
  89. +179 −0 src/node/net/RPC.ml
  90. +309 −0 src/node/net/RPC.mli
  91. +208 −0 src/node/net/netbits.ml
  92. +61 −0 src/node/net/netbits.mli
  93. +1,123 −0 src/node/net/p2p.ml
  94. +102 −0 src/node/net/p2p.mli
  95. +46 −0 src/node/shell/discoverer.ml
  96. +14 −0 src/node/shell/discoverer.mli
  97. +92 −0 src/node/shell/messages.ml
  98. +32 −0 src/node/shell/messages.mli
  99. +547 −0 src/node/shell/node.ml
  100. +70 −0 src/node/shell/node.mli
  101. +376 −0 src/node/shell/node_rpc.ml
  102. +10 −0 src/node/shell/node_rpc.mli
  103. +471 −0 src/node/shell/node_rpc_services.ml
  104. +117 −0 src/node/shell/node_rpc_services.mli
  105. +365 −0 src/node/shell/prevalidator.ml
  106. +56 −0 src/node/shell/prevalidator.mli
  107. +1,157 −0 src/node/shell/state.ml
  108. +417 −0 src/node/shell/state.mli
  109. +444 −0 src/node/shell/validator.ml
  110. +27 −0 src/node/shell/validator.mli
  111. +53 −0 src/node/updater/environment.ml
  112. +56 −0 src/node/updater/environment_gen.ml
  113. +54 −0 src/node/updater/fitness.ml
  114. +18 −0 src/node/updater/fitness.mli
  115. +13 −0 src/node/updater/proto_environment.ml
  116. +138 −0 src/node/updater/protocol.mli
  117. +46 −0 src/node/updater/register.ml
  118. +15 −0 src/node/updater/register.mli
  119. +215 −0 src/node/updater/updater.ml
  120. +90 −0 src/node/updater/updater.mli
  121. +336 −0 src/node_main.ml
  122. +9 −0 src/proto/bootstrap/.merlin
  123. +57 −0 src/proto/bootstrap/TEZOS_PROTOCOL
  124. +146 −0 src/proto/bootstrap/amendment.ml
  125. +32 −0 src/proto/bootstrap/amendment.mli
  126. +331 −0 src/proto/bootstrap/apply.ml
  127. +61 −0 src/proto/bootstrap/asset_repr.ml
  128. +22 −0 src/proto/bootstrap/asset_repr.mli
  129. +79 −0 src/proto/bootstrap/block_repr.ml
  130. +40 −0 src/proto/bootstrap/block_repr.mli
  131. +100 −0 src/proto/bootstrap/bootstrap_storage.ml
  132. +20 −0 src/proto/bootstrap/bootstrap_storage.mli
  133. +158 −0 src/proto/bootstrap/constants_repr.ml
  134. +144 −0 src/proto/bootstrap/contract_repr.ml
  135. +52 −0 src/proto/bootstrap/contract_repr.mli
  136. +312 −0 src/proto/bootstrap/contract_storage.ml
  137. +78 −0 src/proto/bootstrap/contract_storage.mli
  138. +41 −0 src/proto/bootstrap/cycle_repr.ml
  139. +22 −0 src/proto/bootstrap/cycle_repr.mli
  140. +35 −0 src/proto/bootstrap/fitness_repr.ml
  141. +22 −0 src/proto/bootstrap/fitness_storage.ml
  142. +68 −0 src/proto/bootstrap/init_storage.ml
  143. +72 −0 src/proto/bootstrap/level_repr.ml
  144. +29 −0 src/proto/bootstrap/level_repr.mli
  145. +67 −0 src/proto/bootstrap/level_storage.ml
  146. +21 −0 src/proto/bootstrap/level_storage.mli
  147. +45 −0 src/proto/bootstrap/main.ml
  148. +13 −0 src/proto/bootstrap/main.mli
  149. +200 −0 src/proto/bootstrap/mining.ml
  150. +82 −0 src/proto/bootstrap/mining.mli
  151. +66 −0 src/proto/bootstrap/misc.ml
  152. +22 −0 src/proto/bootstrap/misc.mli
  153. +67 −0 src/proto/bootstrap/nonce_storage.ml
  154. +43 −0 src/proto/bootstrap/nonce_storage.mli
  155. +330 −0 src/proto/bootstrap/operation_repr.ml
  156. +100 −0 src/proto/bootstrap/operation_repr.mli
  157. +36 −0 src/proto/bootstrap/period_repr.ml
  158. +26 −0 src/proto/bootstrap/period_repr.mli
  159. +177 −0 src/proto/bootstrap/qty_repr.ml
  160. +38 −0 src/proto/bootstrap/raw_level_repr.ml
  161. +23 −0 src/proto/bootstrap/raw_level_repr.mli
  162. +77 −0 src/proto/bootstrap/reward_storage.ml
  163. +21 −0 src/proto/bootstrap/reward_storage.mli
  164. +23 −0 src/proto/bootstrap/roll_repr.ml
  165. +23 −0 src/proto/bootstrap/roll_repr.mli
  166. +206 −0 src/proto/bootstrap/roll_storage.ml
  167. +63 −0 src/proto/bootstrap/roll_storage.mli
  168. +235 −0 src/proto/bootstrap/script_int_repr.ml
  169. +84 −0 src/proto/bootstrap/script_int_repr.mli
  170. +587 −0 src/proto/bootstrap/script_interpreter.ml
  171. +23 −0 src/proto/bootstrap/script_interpreter.mli
  172. +1,450 −0 src/proto/bootstrap/script_ir_translator.ml
  173. +46 −0 src/proto/bootstrap/script_parser.mli
  174. +159 −0 src/proto/bootstrap/script_repr.ml
  175. +48 −0 src/proto/bootstrap/script_repr.mli
  176. +321 −0 src/proto/bootstrap/script_typed_ir.ml
  177. +321 −0 src/proto/bootstrap/script_typed_ir.mli
  178. +107 −0 src/proto/bootstrap/seed_repr.ml
  179. +79 −0 src/proto/bootstrap/seed_repr.mli
  180. +68 −0 src/proto/bootstrap/seed_storage.ml
  181. +23 −0 src/proto/bootstrap/seed_storage.mli
  182. +533 −0 src/proto/bootstrap/services.ml
  183. +425 −0 src/proto/bootstrap/services_registration.ml
  184. +517 −0 src/proto/bootstrap/storage.ml
  185. +274 −0 src/proto/bootstrap/storage.mli
  186. +354 −0 src/proto/bootstrap/storage_functors.ml
  187. +100 −0 src/proto/bootstrap/storage_functors.mli
  188. +229 −0 src/proto/bootstrap/storage_helpers.mli
  189. +158 −0 src/proto/bootstrap/storage_sigs.ml
  190. +14 −0 src/proto/bootstrap/tez_repr.ml
  191. +13 −0 src/proto/bootstrap/tez_repr.mli
  192. +131 −0 src/proto/bootstrap/tezos_context.ml
  193. +594 −0 src/proto/bootstrap/tezos_context.mli
  194. +49 −0 src/proto/bootstrap/tezos_hash.ml
  195. +26 −0 src/proto/bootstrap/time_repr.ml
  196. +18 −0 src/proto/bootstrap/time_repr.mli
  197. +37 −0 src/proto/bootstrap/vote_repr.ml
  198. +13 −0 src/proto/bootstrap/vote_repr.mli
  199. +86 −0 src/proto/bootstrap/vote_storage.ml
  200. +52 −0 src/proto/bootstrap/vote_storage.mli
  201. +61 −0 src/proto/bootstrap/voting_period_repr.ml
  202. +29 −0 src/proto/bootstrap/voting_period_repr.mli
  203. +8 −0 src/proto/demo/.merlin
  204. +6 −0 src/proto/demo/TEZOS_PROTOCOL
  205. +23 −0 src/proto/demo/error.ml
  206. +66 −0 src/proto/demo/main.ml
  207. +62 −0 src/proto/demo/services.ml
  208. +137 −0 src/proto/environment/RPC.mli
  209. +259 −0 src/proto/environment/array.mli
  210. +15 −0 src/proto/environment/base48.mli
  211. +123 −0 src/proto/environment/buffer.mli
  212. +433 −0 src/proto/environment/bytes.mli
  213. +23 −0 src/proto/environment/compare.mli
  214. +9 −0 src/proto/environment/context.mli
  215. +232 −0 src/proto/environment/data_encoding.mli
  216. +48 −0 src/proto/environment/ed25519.mli
  217. +99 −0 src/proto/environment/error_monad.mli
  218. +8 −0 src/proto/environment/fitness.mli
  219. +306 −0 src/proto/environment/format.mli
  220. +80 −0 src/proto/environment/hash.mli
  221. +15 −0 src/proto/environment/hex_encode.mli
  222. +176 −0 src/proto/environment/int32.mli
  223. +198 −0 src/proto/environment/int64.mli
  224. +21 −0 src/proto/environment/json.mli
  225. +299 −0 src/proto/environment/list.mli
  226. +13 −0 src/proto/environment/logging.mli
  227. +469 −0 src/proto/environment/lwt.mli
  228. +74 −0 src/proto/environment/lwt_list.mli
  229. +155 −0 src/proto/environment/lwt_sequence.mli
  230. +127 −0 src/proto/environment/mBytes.mli
  231. +232 −0 src/proto/environment/map.mli
  232. +192 −0 src/proto/environment/persist.mli
  233. +560 −0 src/proto/environment/pervasives.mli
  234. +194 −0 src/proto/environment/set.mli
  235. +240 −0 src/proto/environment/string.mli
  236. +32 −0 src/proto/environment/time.mli
  237. +146 −0 src/proto/environment/updater.mli
  238. +1 −0 src/proto/environment/uri.mli
  239. +31 −0 src/tezos-deps.opam
  240. +156 −0 src/utils/IO.ml
  241. +34 −0 src/utils/IO.mli
  242. +158 −0 src/utils/base48.ml
  243. +33 −0 src/utils/base48.mli
  244. +314 −0 src/utils/cli_entries.ml
  245. +78 −0 src/utils/cli_entries.mli
  246. +150 −0 src/utils/compare.ml
  247. +31 −0 src/utils/compare.mli
  248. +1,171 −0 src/utils/data_encoding.ml
  249. +253 −0 src/utils/data_encoding.mli
  250. +134 −0 src/utils/ed25519.ml
  251. +63 −0 src/utils/ed25519.mli
  252. +346 −0 src/utils/error_monad.ml
  253. +36 −0 src/utils/error_monad.mli
  254. +134 −0 src/utils/error_monad_sig.ml
  255. +240 −0 src/utils/hash.ml
  256. +103 −0 src/utils/hash.mli
  257. +84 −0 src/utils/hex_encode.ml
  258. +24 −0 src/utils/hex_encode.mli
  259. +113 −0 src/utils/logging.ml
  260. +57 −0 src/utils/logging.mli
  261. +225 −0 src/utils/lwt_utils.ml
  262. +25 −0 src/utils/lwt_utils.mli
  263. +104 −0 src/utils/mBytes.ml
  264. +148 −0 src/utils/mBytes.mli
  265. +115 −0 src/utils/time.ml
  266. +48 −0 src/utils/time.mli
  267. +123 −0 src/utils/utils.ml
  268. +40 −0 src/utils/utils.mli
  269. +22 −0 test/.merlin
  270. +187 −0 test/Makefile
  271. +9 −0 test/launch.sh
  272. +19 −0 test/launch_daemon.sh
  273. +9 −0 test/myocaml-parser
  274. +5 −0 test/sandbox.json
  275. +9 −0 test/scripts/fail.tez
  276. +8 −0 test/scripts/hardlimit.tez
  277. +7 −0 test/scripts/noop.tez
  278. +79 −0 test/test-basic.sh
  279. +57 −0 test/test.ml
  280. +3 −0 test/test.mli
  281. +154 −0 test/test_basic.ml
  282. +219 −0 test/test_context.ml
  283. +151 −0 test/test_p2p.ml
  284. +653 −0 test/test_state.ml
  285. +238 −0 test/test_store.ml
@@ -0,0 +1,45 @@
/tezos-node
/tezos-protocol-compiler
/tezos-client
/src/.depend
/src/node/updater/environment_gen
/src/node/updater/proto_environment.mli
/src/compiler/embedded_cmis.ml
/src/proto/**/_tzbuild
/src/proto/register_client_*.ml
/src/client/embedded/**/_tzbuild
/src/client/embedded/demo/.depend
/src/client/embedded/bootstrap/.depend
/src/client/embedded/bootstrap/concrete_lexer.ml
/src/client/embedded/bootstrap/concrete_parser.ml
/src/client/embedded/bootstrap/concrete_parser.mli
/test/.depend
/test/test-store
/test/test-state
/test/test-context
/test/test-basic
/test/LOG
*~
\#*\#
*.[oa]
*.so
*~
*.cm[iaoxt]
*.cmti
*.cmxa
*.cmxs
*.mli.deps
*.ml.deps
*.rej
*.orig
@@ -0,0 +1,147 @@
variables:
ocaml_image: alpine_ocaml-4.03.0
build_image_name: ocp_tezos_build
build_image_id: ${CI_BUILD_REF}
build_image: ${build_image_name}:${ocaml_image}
image: ${build_image}_${build_image_id}
stages:
- build_deps
- build
- build_test
- test
- publish
- cleanup
build_deps:
stage: build_deps
image: ocp:docker
tags:
- docker_builder
script:
- ./scripts/create_docker_builder.sh
${build_image_name} ${ocaml_image} "_${build_image_id}"
build:
stage: build
tags:
- tezos_builder
script:
- make -j4
artifacts:
expire_in: 1 week
untracked: true
build:test:
stage: build_test
tags:
- tezos_builder
script:
- make -C test build-test -j4
dependencies:
- build
artifacts:
expire_in: 1 week
untracked: true
test:store:
stage: test
tags:
- tezos_builder
script:
- make -C test run-test-store
dependencies:
- build
- build:test
test:context:
stage: test
tags:
- tezos_builder
script:
- make -C test run-test-context
dependencies:
- build
- build:test
test:state:
stage: test
tags:
- tezos_builder
script:
- make -C test run-test-state
dependencies:
- build
- build:test
test:basic:
stage: test
tags:
- tezos_builder
script:
- make -C test run-test-basic
dependencies:
- build
- build:test
test:basic.sh:
stage: test
tags:
- tezos_builder
script:
- make -C test run-test-basic.sh
dependencies:
- build
- build:test
publish:expurge:
stage: publish
tags:
- tezos_builder
only:
- master@tezos/tezos
script:
- echo "${CI_KH}" > ~/.ssh/known_hosts
- echo "${CI_PK}" > ~/.ssh/id_rsa
- chmod 400 ~/.ssh/id_rsa
- rm -fr .git/refs/original
- git filter-branch --prune-empty --index-filter
'git rm -r --cached --ignore-unmatch
.gitlab-ci.yml
"docs/proof of stake.md"
src/client/embedded/bootstrap/mining/'
--env-filter
'export GIT_AUTHOR_NAME="Dynamic Ledger Solutions, Inc." ;
export GIT_AUTHOR_EMAIL="contact@tezos.com"'
HEAD
- git tag ${CI_BUILD_REF}_expurged
- git push git@gitlab.ocamlpro.com:${CI_PROJECT_PATH}.git
-f --tags HEAD:master-expurged
publish:github:
image: ocaml/opam:${ocaml_image}
stage: publish
tags:
- tezos_builder
only:
- master@tezos/tezos
when: manual
script:
- echo "${CI_KH}" > ~/.ssh/known_hosts
- echo "${CI_PK}" > ~/.ssh/id_rsa
- chmod 400 ~/.ssh/id_rsa
- git reset ${CI_BUILD_REF}_expurged
- git push git@github.com:OCamlPro/tezos.git
-f HEAD:master
cleanup:
stage: cleanup
image: ocp:docker
tags:
- docker_builder
script:
- docker tag ${build_image}_${build_image_id}
${build_image}_${CI_PROJECT_NAMESPACE}_${CI_BUILD_REF_NAME}
- docker rmi ${build_image}_${build_image_id}
when: always
@@ -0,0 +1 @@
match_clause = 4
@@ -0,0 +1,13 @@
all:
${MAKE} -C src all
clean:
${MAKE} -C src clean
.PHONY:test
test:
${MAKE} -C test
build_deps:
@./scripts/install_build_deps.sh all
@@ -0,0 +1,66 @@
TEZOS
=====
To compile:
```
make build-deps
make
```
=========
To run a single instance :
```
./tezos-node
```
All useful data are stored in `${HOME}/.tezos-node`.
To run a test instance, without connecting to the gossup network :
```
./tezos-node -sandbox /path/to/a/custom/data/dir
```
Useful data will be stored in the directory `/path/to/a/custom/data/dir`
instead of `${HOME}/.tezos-node`.
=========
To create other instances on the same machine, it is possible to
duplicate and edit `${HOME}/.tezos/config` while taking care not to
share paths for accessing the database or any other data file
(cf. options `db.store` ; `db.context` ; `net.peers` and `protocol.dir`).
Another possibility is to let Tezos generate a config file by specifying
options on the command line. For instance, if `${DIR}/config` does not
exist, the following command will generate it and replace the default values
with the values from the command line arguments:
```
./tezos-node -base-dir ${DIR} -net-port 2023 -net-addr 127.0.0.1
```
The Tezos server has a built-in mechanism to discover peers on the local net
(using UDP packets broadcasted on port 7732)
If this mechanism isn't sufficient, one can provide Tezos with a list of
initial peers, either by editing the option `net.bootstrap.peers` in the
`config` file, or by specifying a command line parameter:
```
./tezos-node -base-dir ${DIR} -net-port 2023 -net-addr 127.0.0.1 \
-net-bootstrap-peers '[("127.0.0.1", 2021);("127.0.0.1", 2022)]'
```
If `${DIR}/config` exists, the command line options override those read
in the config file. Tezos never modifies the content of an existing
`${DIR}/config` file.
```
./tezos-node -config-file ${DIR}/config
```
@@ -0,0 +1,65 @@
# Tezos Code Tutorial
## Introduction
The purpose of this document is to help contributors get started with the Tezos
codebase. The code is organized in several layers in a way which largely reflects the philosophy of the project. It creates a very strict separation between the "node", which implements the network protocol described in the white paper and between the protocols themselves. Of course the seed protocol itself is a very important part of the Tezos project and it follows a similar organization. The economic protocol sits on top of a few layers of abstractions dealing primarily with storing and retrieving data from the current context.
## Overview of the source
This section presents a brief overview of the layout of the source files and their significance.
### node
The network shell
#### node/db
Persistent data structures used by the shell to store its state.
#### note/net
Connectivity for the gossip network and primitives to create RPC services
#### node/shell
The shell itself
#### node/updater
Manage on-the-fly updates to the protocol
### proto
This is where the protocols live
#### proto/environment
#### proto/current
### utils
### compiler
### client
### client/embedded
### Node, the network shell
### Storing the context
## Irmin
Tezos needs to store potentially different version of its context, corresponding to potentially different branches of the blockchain. This also implies the ability to roll back the changes made by any single block, and to make atomic changes to the structure on disk for eac block to avoid corruption.
To that extent, Tezos borrows from the MirageOS project a module called [Irmin](https://github.com/mirage/irmin "Irmin")
> Irmin is a library to persist and synchronize distributed data structures both on-disk and in-memory. It enables a style of programming very similar to the Git workflow, where distributed nodes fork, fetch, merge and push data between each other. The general idea is that you want every active node to get a local (partial) copy of a global database and always be very explicit about how and when data is shared and migrated.
Caveat: although Tezos **is** a distributed ledger, it does **not** rely on Irmin's distributed store capabilities. For our purposes we only use Irmin as a local storage. The git structure is particularly well suited to represent the versionning implicit in the state of a blockchain based ledger. In fact, the context of Tezos can be observed by running "git checkout" in the data directory.
## Netbits and Jsont
Netbits and Jsont are modules which allow for the typesafe serialization of OCaml objects in a binary format and in Json (respectively). Importantly, it does not make of the potentially brittle representation created by the compiler and access through the Obj.magic function. Serializers are created using a set of type constructors defined in a GADT.
## (MISC STUFF TO BE ORGANIZED IN THE DOCUMENT)
The "Main" module represents the fixed interface between the economic protocol and the shell.
A protocol consists of several .ml and .mli files and a file name TEZOS_PROTOCOL which lists the modules in order of inclusion for the compilation. Lower level modules sit below high level modules.
What are \\_repr modules?
These modules handle the low level representation of a type, in particular its serialization in Json and in binary format. A module based on this type will often exist on top of it and provide functionality around that type. This provides finely grained layers of encapsulation to mininize the visible interfaces.
Oops, something went wrong.

0 comments on commit f42e9d1

Please sign in to comment.