Commit Graph

26 Commits

Author SHA1 Message Date
Grégoire Henry
2c8b46a835 Utils: fix Utils.take_n in presence of duplicates 2017-08-22 22:07:29 +02:00
Alex Coventry
04ce0c1f5d Utils: various doc improvements 2017-08-22 20:39:59 +02:00
Alex Coventry
59b5b2df49 Utils: fix list_rev complexity.
Using fold_left here iterates over the entire list, whereas you only
need to iterate over the first `n` elements.
2017-08-22 20:22:27 +02:00
Grégoire Henry
f39eca214a Shell: remove the on-disk index of operations
Let's get serious. The full index of operations is not sustainable in
the production code. We now only keep the index of operations not yet
in the chain (i.e. the mempool/prevalidation). Operations from the
chain are now only accesible through a block. For instance, see the
RPC:

   /blocks/<hash>/proto/operations
2017-06-12 11:04:43 +02:00
Grégoire Henry
4995864316 Shell: regroups basic data types in Tezos_data 2017-06-12 11:04:43 +02:00
OCamlPro-Iguernlala
7d214a19f7 data_encoding: read streams of Mbytes.t, tests, remove dead code (debug functions), expose a function that checks without reading the data 2017-04-13 18:05:41 +02:00
Benjamin Canou
f26dfdbe8e RPC: fix CORS preflight. 2017-04-10 18:23:24 +02:00
OCamlPro-Iguernlala
cb2aa6ea2b [Data_encoding.Binary] add a function 'to_bytes_list' to encode a given data as a list of 'small' blocks 2017-04-02 16:29:19 +02:00
OCamlPro-Iguernlala
a330f3bcc5 [data_encoding] use MBytes.{get/set}_char to read/write binary data instead of int8 2017-03-31 17:46:44 +02:00
Grégoire Henry
1879c4359f Merge remote-tracking branch 'ocp/bugfix-in-data-encoding' 2017-03-31 16:48:07 +02:00
Grégoire Henry
9097809589 Shell: Merkle tree of operations 2017-03-31 01:19:33 +02:00
OCamlPro-Iguernlala
669a0249ca add some asserts in data_encoding 2017-03-29 18:33:39 +02:00
OCamlPro-Iguernlala
dc32decd05 [bugfix in data_encoding] When writing a float (to binary format), MBytes.set_double should be used instead of MBytes.set_float (Float _ encodes doubles in the encoding, not singles) 2017-03-29 18:32:46 +02:00
OCamlPro-Iguernlala
f96fbe7d31 [bugfix in data_encoding] When reading a float (from binary format), MBytes.get_double should be used instead of MBytes.get_float (Float _ encodes doubles in the encoding, not singles) 2017-03-29 18:30:15 +02:00
Guillem Rieu
c6c81345a8 RPC: add answer functions with HTTP code argument to RPC interface. 2017-03-16 18:49:31 +01:00
Guillem Rieu
cc44053229 RPC: add HTTP methods and Content-Type headers. 2017-03-16 18:49:31 +01:00
Guillem Rieu
a2758253ea Utils: add [merge_list2] function 2017-03-16 18:49:31 +01:00
Grégoire Henry
ee870722cf Shell: fix Utils.read_file 2017-03-03 18:20:38 +01:00
Grégoire Henry
639b4c0c5c Shell: add Data_encoding.unit 2017-02-25 18:14:06 +01:00
Grégoire Henry
b674c538b2 Shell: refactor the distributed DB.
This refactors `src/node/shell/state.ml` in order to trace the source of
blocks and operations. This prepares the node for the three-pass
validator.

In the procces, it adds an in-memory overlay for blocks and operations.
2017-02-25 18:14:05 +01:00
Grégoire Henry
fc53f3b233 Switch to Base58.
Base48 was fun but... hell yeah... let's stay standard.

Public encoding of hash:

```
  Block:      "B..." (len: 51)
  Operation:  "o..." (len: 51)
  Protocol:   "P..." (len: 51)

  Ed25519:    "tz1.." (len: 36)
  Contract:   "TZ1.." (len: 36)

  NetworkdId: "id.." (len: 30)
```

Other internal prefixes (in the RPC):

```
  Hash of Michelson's expression: "expr..." (len: 54)

  Ed25519 public key: "edpk..." (len: 54)
  Ed25519 secret key: "edsk..." (len: 98)
  Ed25519 signature:  "edsig.." (len: 99)

  Hash of a random seed nonce: "nce...." (len: 53)
  Random seed:                 "rng...." (len: 53)
```
2017-02-24 15:44:21 +01:00
Vincent Bernardoff
6d41b3d38c Shell: Improve the CLI of tezos-node
* Use subcommands:
  * `tezos_node run`
  * `tezos_node config`
  * `tezos_node identity`
* Regroup all on-disk data in `--data-dir`
* Split `Node_main` in multiple files.
* Add DNS resolution for `--net-addr` and `--rpc-addr`
* Hardcode `bootstrap.tezos.com` as bootstrap peer(s)
* Add `--no-bootstrap-peers`
* Rename `--expected-connections` -> `--connections`
2017-02-15 15:26:17 +01:00
Grégoire Henry
866e7add2f Shell: improve Utils 2017-01-23 21:31:30 +01:00
Vincent Bernardoff
5eb8d0077a Shell: add Data_encoding.Binary.fixed_length 2017-01-19 10:21:21 +01:00
Vincent Bernardoff
a891e23741 Shell: improve Utils
- unopt_map
- list_{sub,rev_sub}
- take_n
- Bounded
2017-01-19 10:21:17 +01:00
Benjamin Canou
e7c39578b4 Extract the js_of_ocaml compatible part of utils. 2016-12-01 18:27:53 +01:00