Step 2: 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.
-
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 this example:docker exec -it dal-baker /bin/sh
To get the name of the Docker container, run the
docker ps
command. -
Connect the Octez client to 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 theconfig update
command are correct. -
Make sure that the installation of the Octez client is using your node by running this command:
octez-client bootstrapped
If the client is connected and the node is running properly, the response is
Node is bootstrapped
. It may take a short time for the node to start. -
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.
-
Create or import an account in the Octez client. The simplest way to get an account 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
-
Get at least 6,000 tez from the Ghostnet faucet.
The account must stake tez to get consensus and DAL rights. To get tez, use the Ghostnet faucet linked from https://teztnets.com/ghostnet-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.
-
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.
-
Register your account as a delegate by running the following command:
octez-client register key my_baker as delegate
-
Stake at least 6,000 tez, saving a small amount for transaction fees,by running this command:
octez-client stake 6000 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 3: Run an Octez DAL node.