IntersectMBO / cardano-node

The core component that is used to participate in a Cardano decentralised blockchain.
https://cardano.org
Apache License 2.0
3.06k stars 720 forks source link

[BUG] - Outdated instructions for configuring a test chain; unhelpful error message "conditional on negotiating v8 of the node-to-client protocol" #3047

Closed HeinrichApfelmus closed 2 years ago

HeinrichApfelmus commented 3 years ago

Internal/External Internal

Area Testing, blockchain genesis, cardano-cli

Summary To better understand and test the ecosystems, developers and stake pool operators find it helpful to be able to create and run a test blockchain locally from scratch. Unfortunately, the current instructions in doc/reference/shelley-genesis.md seem to be out of date and no longer work as described.

Specifically, while the description on how to set up two nodes still works and gives helpful insights on configuration, the section "Querying the node" is no longer accurate; instead, the cardano-cli client produces the following error message:

$ CARDANO_NODE_SOCKET_PATH=example/node1/node.sock \
     cardano-cli query tip --testnet-magic 42 \
     --shelley-mode

cardano-cli: encodeFailure: local state query: using acquire without a Point must be conditional on negotiating v8 of the node-to-client protocol
CallStack (from HasCallStack):
  error, called at src/Ouroboros/Network/Protocol/LocalStateQuery/Codec.hs:79:7 in ouroboros-network-0.1.0.0-KO0frQ8Zv9tFr7JpJUW12H:Ouroboros.Network.Protocol.LocalStateQuery.Codec

Apparently, the network is configured in a way that cardano-cli does not quite know how to talk to, and the --shelley-mode flag does not provide sufficient or even the wrong context.

Workaround

The script scripts/byron-to-alonzo/mkfiles.sh correctly configures a local test network that performs a series of hardforks. It can be queried with cardano-cli using the --cardano-mode flag.

Steps to reproduce Steps to reproduce the behavior:

  1. Follow the instructions in doc/reference/shelley-genesis.md to configure a local test network.
  2. Start two nodes as described
  3. Query the network using cardano-cli query tip as described.
  4. See error
    cardano-cli: encodeFailure: local state query: using acquire without a Point must be conditional on negotiating v8 of the node-to-client protocol
    CallStack (from HasCallStack):
    error, called at src/Ouroboros/Network/Protocol/LocalStateQuery/Codec.hs:79:7 in ouroboros-network-0.1.0.0-KO0frQ8Zv9tFr7JpJUW12H:Ouroboros.Network.Protocol.LocalStateQuery.Codec

Expected behavior

System info (please complete the following information):

Additional context This problem has also been encountered in various forms elsewhere:

marijanp commented 2 years ago

I'm also interested in an updated instruction or a script generating those files. BTW: I've followed the instructions and used cardano-node 1.31.0 and ran intor the same error as described by the issuer.

mateusap1 commented 2 years ago

Any solutions? I'm receiving the same error when following the cardano-tesnet guide

marijanp commented 2 years ago

There is a script under scripts/byron-to-alonzo/mkfiles.sh which gennerates proper genesis files. Using them I was able to start the nodes wihout any errors.

mateusap1 commented 2 years ago

My problem was similar I was using cabal run cardano-testnet shelley instead of cabal run cardano-testnet cardano, since the issue has to do with node synchronization, I think most people get it when they setup the testnet in different eras.

Jimbo4350 commented 2 years ago

Closing this. If this is still relevant please reopen.