Skip to main content

Step 3: Set up a baker account

The baker needs a user account that stakes tez. In this section, you use the Octez client to create an account, register it as a delegate, and stake tez with it.

  1. Open a new terminal window in the same environment. If you are using a Docker container, you can enter the container with the docker exec command, as in docker exec -it my-image /bin/sh. To get the name of the Docker container, run the docker ps command.

  2. Make sure that the installation of the Octez client is using your node by running this command:

    octez-client -E http://localhost:8732 config update

    By default, the Octez client in the container is set to use a node running at localhost:8732, which is the default port of the node, but this command sets it explicitly. If you see an error that says "Failed to acquire the protocol version from the node," ensure that your node is running and verify that the host name and port in the config update command are correct.

  3. Optional: Hide the Octez client's network warning message by running this command:

    export TEZOS_CLIENT_UNSAFE_DISABLE_DISCLAIMER=y

    This command suppresses the message that your instance of the Octez client is not using Mainnet.

  4. Create or import an account in the Octez client. The simplest way to get an account that works with Weeklynet is to use the Octez client to randomly generate an account. This command creates an account and associates it with the my_baker alias:

    octez-client gen keys my_baker

    The address of the generated account can be obtained with the following command:

    octez-client show address my_baker

    At this point, the balance of the my_baker account is still zero, as you can see by running this command:

    octez-client get balance for my_baker

    If you get an error on this command, your local node isn't ready yet. Until the node has finished bootstrapping, pass the public RPC endpoint for Weeklynet in the --endpoint argument, as in this example:

    octez-client --endpoint https://rpc.weeklynet-2024-01-17.teztnets.com get balance for my_baker

    Don't set the client endpoint to the public node permanently because it should use your local node whenever possible. For bakers, it's important to set the Octez client to use their node rather than a public node because the baker daemon uses the client configuration and the baker daemon should use the local node.

  5. Get 40,000 tez from the Weeklynet faucet.

    The account must stake tez to get consensus and DAL rights. To get tez, use the Weeklynet faucet linked from https://teztnets.com/weeklynet-about to send tez to the baker account.

    Running a baker requires staking at least 6,000 tez, but the more tez it stakes, the more rights it gets and the lass time it has to wait to produce blocks and make attestations. However, baking with too large of a stake can cause problems when the baker stops because it holds a significant portion of baking rights. If the baker is using a large portion of the total tez on the network and stops, the system gets slower because the baker isn't making blocks. This delay continues until the system marks the baker as inactive.

    Therefore, to avoid slowing Weeklynet for other users, don't request too much tez. 40,000 tez is enough to get enough rights to verify that the baker is behaving as expected while not disturbing the network too much when it stops operating.

  6. Verify that the faucet sent the tez to the account with the same get balance command:

    octez-client get balance for my_baker

    If the balance still shows 0, the local node may not be ready yet. In this case you can temporarily use the public RPC endpoint.

    When the account receives its tez, it owns enough stake to bake but has still no consensus or DAL rights because it has not declared its intention to become a baker.

  7. Register your account as a delegate by running the following command:

    octez-client register key my_baker as delegate

    Again, pass the --endpoint argument if your node has not finished bootstrapping.

  8. Stake the tez, saving a small amount for transaction fees. For example, if your account has 40,000 tez, stake 39,990 tez by running this command:

    octez-client stake 39990 for my_baker

Now the account has staked enough tez to earn the right to make attestations, including attestations that data is available on the DAL. However, it does not receive these rights until the baking daemon is running and a certain amount of time has passed.

To run a baking daemon with this account, continue to Step 5: Run an Octez baking daemon.