Skip to content

Tezos Technical FAQ

Fred Yankowski edited this page Nov 29, 2018 · 15 revisions

This document addresses frequently asked technical questions about Tezos. The may be particularly useful to those planning to run a baker. It is unofficial, meaning that it is created by Tezos community members and is not endorsed by the core developers.

Where is the official Tezos documentation?

Where can I ask questions?

The #tezos channel at freenode IRC is the main place for technical chat. That channel can also be accessed via Riot at the #freenode_#tezos room (a.k.a. "#tezos") that is bridged there.

How can I get started using the Tezos alphanet?

See the instructions at http://doc.tzalpha.net/introduction/alphanet.html

The log messages often report “too few connections”; is that a problem?

As long as the reported number of connections is greater than 0 (zero) you can ignore those messages. The number of expected connections can be set lower using the --connections command line option.

My node has been running for a while and still reports zero connections. What should I do?

This can happen in the alphanet when the default set of peers (the “bootstrap” peers) are not responding. One workaround is to restart the node with some other known-active peers listed. You might find those via some block explorer.

Does a baker have to stay online and in service all the time? What is the downside if they do not?

If a baker is offline when its turn comes up to bake or endorse then it will not earn the reward.

Also, at the start of a cycle a baker needs to report the nonces it used when baking blocks in the prior cycle; if it’s offline and fails to do so then it loses some of its bond. [details and verification needed for this answer]

Does a baker need to have its secret key online?

Yes, when the baker service starts the secret key for its identity/account must be online were the service can read it. The secret key is needed for creating signatures used in the baking and endorsing tasks.

When I restart an alphanet node do I need to “claim baking rights” again?

No. If you are restarting the node with the same identity that it had before (the normal case when not starting from complete scratch), you do not need to set up delegation again. The delegations are recorded as transactions in the blockchain and persist until another delegation (for the same source) changes them. How can I tell whether my node is actually baking? First, the baker service must be running; check via ./alphanet.sh status. When the baker creates a block its log output will include a message with “Injected block”. Similarly the endorser will report “injected endorsement”. However, baking and endorsing rights are granted in proportion to stake (roughly, modulo random selections). Alphanet accounts are given 100,000 ꜩ as an initial balance but that is typically only a small proportion of the total stake held by all accounts and so the chance of being granted the right to bake (and to a lesser extent, endorse) is slim. To obtain more tez, increasing ones stake and thereby ones odds of winning the right to bake, see http://doc.tzalpha.net/introduction/alphanet.html#how-to-obtain-free-tez-from-the-faucet-contract

Should I build the node from source or run it from docker?

Run from docker using the alphanet.sh script. Unless you enjoy building from source and really want to know more and have more control over where things go in the filesystem and enjoy resolving weird dependency problems in Ocaml and OS libraries; then build from source.

The node log is verbose. How can I see just important events like the head being updated?

The TEZOS_LOG environment variable controls what is logged. To get quieter output do

export TEZOS_LOG='* -> notice'
./alphanet.sh restart

(The default value is effectively "* -> info". The possible log levels are these: fatal, error, warning, notice, info, and debug.)

My compiled node is crashing with error messages about "Too many open files" or "Unix.EMFILE". What to do?

Increase the number of open files allowed by running ulimit -n 2048 from the shell before running tezos-node. For example. The default maximum of 1024 open files in Debian (and others) is not currently enough for tezos-node in some circumstances.

Why is tezos-client failing with a "Connection refused" error?

The troublesome case looks like this example:

$ ./tezos-client network stat
Ignored error:
  Failed to acquire the protocol version from the node
  Cannot contact RPC server: Connection refused
Fatal error:
  Cannot contact RPC server: Connection refused

For a compiled (i.e, non-docker) tezos-client to connect to tezos-node the node process must be started with the RPC port (8732) enabled for at least local access.

./tezos-node --rpc-addr 127.0.0.1

Note that, for some reason, localhost does not work in the above. Also, using * instead of 127.0.0.1 will allow access from anywhere (if the server firewall also allows it).

Why is "client get balance for my_account" failing with a 404 (not found) error?

That is a known glitch in the alphanet. See https://github.com/tezos/tezos/tree/alphanet#missing-account-my_account for steps to work around the problem by recreating the "my_account" account.

Here is what the typical symptom looks like in full:

./alphanet.sh client get balance for my_account
Fatal error:
RPC Request failed:
Path: http://127.0.0.1:8732/blocks/prevalidation/proto/context/contracts/TZ1bNXojBsrR14T6Ep3UEdEj2TDH3cJSqdQ1/balance
HTTP status: 404 (Not Found)

How do I start baking in the zeronet?

./tezos-client transfer 10000 from my_account to my_identity
./tezos-client register key my_identity as delegate
./tezos-client set delegate for my_account to my_identity

In the betanet, how do I silence the banner message produced by tezos-client?

export TEZOS_CLIENT_UNSAFE_DISABLE_DISCLAIMER=Y

After putting the above in the shell environment you should no longer see the message starting with "This is NOT the Tezos Mainnet" in the tezos-client output.

What is the difference between implicit and originated accounts?

In Tezos there are two kinds of contracts: implicit and originated accounts. Originated accounts can have Michelson code, in which case they are also called contracts. Implicit accounts cannot have a delegate. In order to delegate funds, they need to be transfer to an originated account beforehand, and a delegate must be set. Implicit accounts only can be registered as delegates and actually bake. Funds in implicit accounts which are not registered as delegates do not participate in baking. Once registered, an implicit account can participate in baking for its own balance plus the balance of originated accounts and contracts that are delegated to it. [credit: @bitnull0]

How can I remove the timestamps from tezos-node output?

When managing tezos-node via systemd the logger facility adds its own timestamp in addition to the timestamp that tezos-node includes with each output message. Once way to avoid the double timestamps is to remove them from tezos-node by changing its template for log messages by adding the following to ~/.tezos-node/config.json at the top level:

  "log": { "template": "$(section): $(message)" },

The default template is "$(date) - $(section): $(message)".

Disclaimer

This document is a best effort but will certainly have mistakes. Use at your own risk. The authors disavow any liability for damages resulting from relying on the information here. Corrections and additions to this document are most welcome.