...
 
Commits (224)
variables:
## Please update `scripts/version.sh` accordingly
build_deps_image_version: 5aca652afd01bf0d66a9d74aa192309dcb9554b2
build_deps_image_version: b81783bc01f71a6f66ae2f63b302bdd0f240f01b
build_deps_image_name: registry.gitlab.com/tezos/opam-repository
public_docker_image_name: docker.io/${CI_PROJECT_PATH}
GIT_STRATEGY: fetch
......@@ -24,10 +24,8 @@ stages:
stage: build
except:
- master
- alphanet
- zeronet
- mainnet
- alphanet-staging
- zeronet-staging
- mainnet-staging
- zeronet-snapshots
......@@ -92,6 +90,11 @@ build:
# this section is updated using the script scripts/update_unit_test.sh
##BEGIN_UNITEST##
unit:requester:
<<: *test_definition
script:
- dune build @src/lib_requester/runtest
unit:src/proto_005_PsBabyM1/lib_client:
<<: *test_definition
script:
......@@ -102,50 +105,45 @@ unit:src/proto_005_PsBabyM1/lib_protocol:
script:
- dune build @src/proto_005_PsBabyM1/lib_protocol/runtest
unit:src/proto_004_Pt24m4xi/lib_client:
<<: *test_definition
script:
- dune build @src/proto_004_Pt24m4xi/lib_client/runtest
unit:stdlib:
unit:storage:
<<: *test_definition
script:
- dune build @src/lib_stdlib/runtest
- dune build @src/lib_storage/runtest
unit:storage:
unit:shell:
<<: *test_definition
script:
- dune build @src/lib_storage/runtest
- dune build @src/lib_shell/runtest
unit:error_monad:
unit:signer_backends/unix:
<<: *test_definition
script:
- dune build @src/lib_error_monad/runtest
- dune build @src/lib_signer_backends/unix/runtest
unit:src/proto_003_PsddFKi3/lib_client:
unit:signer_backends:
<<: *test_definition
script:
- dune build @src/proto_003_PsddFKi3/lib_client/runtest
- dune build @src/lib_signer_backends/runtest
unit:shell:
unit:protocol_environment:
<<: *test_definition
script:
- dune build @src/lib_shell/runtest
- dune build @src/lib_protocol_environment/runtest
unit:p2p:
unit:error_monad:
<<: *test_definition
script:
- dune build @src/lib_p2p/runtest
- dune build @src/lib_error_monad/runtest
unit:src/proto_alpha/lib_client:
unit:src/bin_client:
<<: *test_definition
script:
- dune build @src/proto_alpha/lib_client/runtest
- dune build @src/bin_client/runtest
unit:src/proto_alpha/lib_protocol:
unit:micheline:
<<: *test_definition
script:
- dune build @src/proto_alpha/lib_protocol/runtest
- dune build @src/lib_micheline/runtest
unit:src/proto_006_PsCARTHA/lib_client:
<<: *test_definition
......@@ -157,85 +155,70 @@ unit:src/proto_006_PsCARTHA/lib_protocol:
script:
- dune build @src/proto_006_PsCARTHA/lib_protocol/runtest
unit:signer_backends:
<<: *test_definition
script:
- dune build @src/lib_signer_backends/runtest
unit:signer_backends/unix:
unit:src/proto_alpha/lib_client:
<<: *test_definition
script:
- dune build @src/lib_signer_backends/unix/runtest
- dune build @src/proto_alpha/lib_client/runtest
unit:micheline:
unit:src/proto_alpha/lib_protocol:
<<: *test_definition
script:
- dune build @src/lib_micheline/runtest
- dune build @src/proto_alpha/lib_protocol/runtest
unit:protocol_environment:
unit:stdlib:
<<: *test_definition
script:
- dune build @src/lib_protocol_environment/runtest
- dune build @src/lib_stdlib/runtest
unit:src/bin_client:
unit:p2p:
<<: *test_definition
script:
- dune build @src/bin_client/runtest
- dune build @src/lib_p2p/runtest
unit:crypto:
<<: *test_definition
script:
- dune build @src/lib_crypto/runtest
unit:ocplib-resto/lib_ezresto-directory:
<<: *test_definition
script:
- dune build @vendors/ocplib-resto/lib_ezresto-directory/runtest
unit:ocplib-resto/lib_resto-directory:
<<: *test_definition
script:
- dune build @vendors/ocplib-resto/lib_resto-directory/runtest
unit:ocaml-pbkdf:
<<: *test_definition
script:
- dune build @vendors/ocaml-pbkdf/runtest
unit:ocaml-lmdb:
unit:ocaml-secp256k1:
<<: *test_definition
script:
- dune build @vendors/ocaml-lmdb/runtest
- dune build @vendors/ocaml-secp256k1/runtest
unit:ocaml-uecc:
unit:ocaml-ledger-wallet:
<<: *test_definition
script:
- dune build @vendors/ocaml-uecc/runtest
- dune build @vendors/ocaml-ledger-wallet/runtest
unit:ocaml-bip39:
unit:ocaml-uecc:
<<: *test_definition
script:
- dune build @vendors/ocaml-bip39/runtest
- dune build @vendors/ocaml-uecc/runtest
unit:ocaml-hacl:
unit:ocaml-blake2:
<<: *test_definition
script:
- dune build @vendors/ocaml-hacl/runtest
- dune build @vendors/ocaml-blake2/runtest
unit:ocaml-secp256k1:
unit:ocaml-lmdb:
<<: *test_definition
script:
- dune build @vendors/ocaml-secp256k1/runtest
- dune build @vendors/ocaml-lmdb/runtest
unit:ocaml-ledger-wallet:
unit:ocaml-bip39:
<<: *test_definition
script:
- dune build @vendors/ocaml-ledger-wallet/runtest
- dune build @vendors/ocaml-bip39/runtest
unit:ocaml-blake2:
unit:ocaml-hacl:
<<: *test_definition
script:
- dune build @vendors/ocaml-blake2/runtest
- dune build @vendors/ocaml-hacl/runtest
##END_UNITEST##
......@@ -589,60 +572,15 @@ opam:ledgerwallet-tezos:
variables:
package: ledgerwallet-tezos
opam:lmdb:
<<: *opam_definition
variables:
package: lmdb
opam:ocplib-ezresto:
<<: *opam_definition
variables:
package: ocplib-ezresto
opam:ocplib-ezresto-directory:
<<: *opam_definition
variables:
package: ocplib-ezresto-directory
opam:ocplib-resto:
<<: *opam_definition
variables:
package: ocplib-resto
opam:ocplib-resto-cohttp:
<<: *opam_definition
variables:
package: ocplib-resto-cohttp
opam:ocplib-resto-cohttp-client:
<<: *opam_definition
variables:
package: ocplib-resto-cohttp-client
opam:ocplib-resto-cohttp-server:
<<: *opam_definition
variables:
package: ocplib-resto-cohttp-server
opam:ocplib-resto-directory:
<<: *opam_definition
variables:
package: ocplib-resto-directory
opam:ocplib-resto-json:
<<: *opam_definition
variables:
package: ocplib-resto-json
opam:pbkdf:
<<: *opam_definition
variables:
package: pbkdf
opam:secp256k1:
opam:secp256k1-internal:
<<: *opam_definition
variables:
package: secp256k1
package: secp256k1-internal
opam:tezos-005-PsBabyM1-test-helpers:
<<: *opam_definition
......@@ -849,11 +787,6 @@ opam:tezos-client-genesis:
variables:
package: tezos-client-genesis
opam:tezos-client-genesis-alphanet:
<<: *opam_definition
variables:
package: tezos-client-genesis-alphanet
opam:tezos-client-genesis-babylonnet:
<<: *opam_definition
variables:
......@@ -934,11 +867,6 @@ opam:tezos-embedded-protocol-genesis:
variables:
package: tezos-embedded-protocol-genesis
opam:tezos-embedded-protocol-genesis-alphanet:
<<: *opam_definition
variables:
package: tezos-embedded-protocol-genesis-alphanet
opam:tezos-embedded-protocol-genesis-babylonnet:
<<: *opam_definition
variables:
......@@ -989,6 +917,11 @@ opam:tezos-event-logging:
variables:
package: tezos-event-logging
opam:tezos-lmdb:
<<: *opam_definition
variables:
package: tezos-lmdb
opam:tezos-mempool-005-PsBabyM1:
<<: *opam_definition
variables:
......@@ -1034,6 +967,11 @@ opam:tezos-p2p:
variables:
package: tezos-p2p
opam:tezos-p2p-services:
<<: *opam_definition
variables:
package: tezos-p2p-services
opam:tezos-protocol-000-Ps9mPmXa:
<<: *opam_definition
variables:
......@@ -1139,11 +1077,6 @@ opam:tezos-protocol-genesis:
variables:
package: tezos-protocol-genesis
opam:tezos-protocol-genesis-alphanet:
<<: *opam_definition
variables:
package: tezos-protocol-genesis-alphanet
opam:tezos-protocol-genesis-babylonnet:
<<: *opam_definition
variables:
......@@ -1282,10 +1215,8 @@ publish:docker:
stage: publish
only:
- [email protected]/tezos
- [email protected]/tezos
- [email protected]/tezos
- [email protected]/tezos
- [email protected]/tezos
- [email protected]/tezos
- [email protected]/tezos
- [email protected]/tezos
......
Open Source License
Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <[email protected]>
Copyright (c) 2018-2020 Nomadic Labs <[email protected]>
Copyright (c) 2019-2020 Metastate AG <[email protected]>
Copyright (c) 2018-2020 Tarides <[email protected]>
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
......
......@@ -164,7 +164,7 @@ clarity):
| Bool : bool desc
| Int64 : Int64.t desc
| Float : float desc
| Bytes : Kind.length -> MBytes.t desc
| Bytes : Kind.length -> bytes desc
| String : Kind.length -> string desc
| String_enum : Kind.length * (string * 'a) list -> 'a desc
| Array : 'a t -> 'a array desc
......
......@@ -17,33 +17,43 @@ If you don't want to deal with the complexity of running your own
delegate, you can always take part in the protocol by delegating your
coins to one.
Implicit accounts cannot have a delegate, so the first step is to
originate an account, transfer your tez there and set a delegate.
Notice that an originated account is a special case of a contract
without code, so it is still necessary to pay for its small storage
(see :ref:`Originated Account <originated-accounts>`).
Both implicit accounts and smart contracts can have a
delegate. Setting or resetting the delegate of an implicit account is
achieved by the following command:
::
tezos-client originate account alice_del for alice \
transferring 1000 from alice \
--delegate bob
tezos-client set delegate for <implicit_account> to <delegate>
As done before, we originate a contract *alice_del* with manager
*alice* and we fund it with 1kꜩ. The interesting part here is setting the
delegate to *bob*, as the delegate is not set by default when originating a
contract. If you already own contracts that are delegatable you can change the
delegate with the command ``set delegate``.
where ``<implicit_account>`` is the address or alias of the implicit
account to delegate and ``<delegate>`` is the address or alias of the
delegate (which has to be :ref:`registered<DelegateRegistration>`).
To stop a delegation, the following command can be used:
::
tezos-client withdraw delegate from <implicit_account>
Smart contract can also delegate the tokens they hold to registered
delegates. The initial delegate of a smart contract can be set at
origination using the ``--delegate`` option:
::
tezos-client originate contract <contract_alias> transferring <initial_balance> from <originator> running <script> --delegate <delegate> --burn-cap <cap>
Once the contract is originated, the only way to stop or modify its
delegation is by using the ``SET_DELEGATE`` Michelson instruction (see
:ref:`the Michelson documentation<MichelsonSetDelegate>` for more
details).
Notice that, by default, an originated account is not *delegatable*,
which means that you can't change the delegate once the contract is
originated, even if you initially set a delegate.
To be able to change the delegate latter, add the
``--delegatable`` flag.
Notice that only implicit accounts can be delegates, so your delegate
must be a *tz1* address.
must be a *tz* address.
Funds in implicit accounts which are not registered as delegates
do not participate in baking.
......@@ -66,8 +76,8 @@ to 1 roll.
When you obtain coins from :ref:`the faucet<faucet>`, if you
are lucky to obtain more than one roll, you can register a delegate
using this identity.
Otherwise, you need to ask the faucet for more accounts, originate an
account for each one and delegate them to the first.
Otherwise, you need to ask the faucet for more accounts and
delegate them to the first.
Deposits and over-delegation
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
......@@ -183,6 +193,8 @@ rewards, they participate in the staking balance of the delegate
immediately after the block has been baked.
.. _DelegateRegistration:
Register and check your rights
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
......
......@@ -189,8 +189,8 @@ aliases (``alice`` in our case) and what you would expect from the name
of the file.
Secret keys are stored on disk encrypted with a password except when
using a hardware wallet (see :ref:`ledger`).
An additional file ``contracts`` contains the addresses of `originated
contracts`, which have the form *KT1…*.
An additional file ``contracts`` contains the addresses of smart
contracts, which have the form *KT1…*.
We can for example generate a new pair of keys, which can be used locally
with the alias *bob*::
......@@ -365,23 +365,18 @@ operation that seems lost.
.. _originated-accounts:
Originated accounts and contracts
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Implicit accounts and smart contracts
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In Tezos there are two kinds of accounts: *implicit* and *originated*.
In Tezos there are two kinds of accounts: *implicit accounts* and *smart contracts*.
- The implicit accounts are the *tz1* we have used up to now. They are created
with a transfer operation to the account public key hash.
- The implicit accounts are the *tz1*, *tz2*, and *tz3* we have used
up to now. They are created with a transfer operation to the
account public key hash.
- Originated accounts have addresses *KT1* and are created with an
origination operation.
An originated account doesn't have a corresponding secret key, but is *managed*
by an implicit account. An originated account serves two purposes.
- delegate tokens (see more :ref:`here <howtorun>`).
- run Michelson code, in which case it is called a *contract*.
- Smart contracts have addresses *KT1* and are created with an
origination operation. They don't have a corresponding secret key
and they run Michelson code each time they receive a transaction.
Let's originate our first contract and call it *id*::
......@@ -389,13 +384,12 @@ Let's originate our first contract and call it *id*::
running ./tests_python/contracts/attic/id.tz \
--init '"hello"' --burn-cap 0.4
The contract manager is the implicit account ``alice``. The initial balance
is ꜩ1, generously provided by implicit account *alice* (but it could be from
another contract managed by ``alice`` too). The contract stores a Michelson
program ``id.tz``, with Michelson value ``"hello"`` as initial storage (the
extra quotes are needed to avoid shell expansion). The parameter ``--burn-cap``
specifies the maximal fee the user is willing to pay for this operation, the
actual fee being determined by the system.
The initial balance is ꜩ1, generously provided by implicit account
*alice*. The contract stores a Michelson program ``id.tz``, with
Michelson value ``"hello"`` as initial storage (the extra quotes are
needed to avoid shell expansion). The parameter ``--burn-cap``
specifies the maximal fee the user is willing to pay for this
operation, the actual fee being determined by the system.
A Michelson contract is semantically a pure function, mapping a pair
``(parameter, storage)`` to a pair ``(list_of_operations, storage)``. It can
......@@ -412,8 +406,9 @@ For the sake of this example, here is the `id.tz` contract:
code {CAR; NIL operation; PAIR};
It specifies the types for the parameter and storage, and implements a
function which ignores the parameter and returns the storage unchanged together
with an empty list of operations.
function which updates the storage with the value passed as parameter
and returns the storage unchanged together with an empty list of
operations.
Gas and storage cost model
......
......@@ -19,7 +19,7 @@ and instructions to join in :ref:`How to get Tezos<howtoget>`.
The code can be found in the Gitlab branch
`proto-006`_ and its
full hash is ``PtXXX``.
full hash is ``PsCARTHAGazKbHtnKfLzQg3kms52kSRpgnDY982a9oYsSXRLQEb``.
**This protocol contains several breaking changes with respect to Babylon.**
Developers are particularly encouraged to carefully read this page and
......
......@@ -10,9 +10,9 @@ Tezos
_`Context`
The state of the blockchain. The context is defined by the
`Economic Protocol`_ and typically includes information such as “this
account_ is credited with this many tez” and “this is the code for that smart
contract_.”
`Economic Protocol`_ and typically includes information such as
“this account_ is credited with this many tez” and “this is the
code for that `smart contract`_.”