Skip to content

Documentation Guide Error #2069

@deruelle

Description

@deruelle

Bug Report

Setup

CometBFT version (use cometbft version or git rev-parse --verify HEAD if installed from source): 0.38.0

Have you tried the latest version: yes

ABCI app (name for built-in, URL for self-written if it's publicly available):

Environment:

  • OS (e.g. from /etc/os-release): Ubuntu 22.04.3 LTS
  • Install tools:
  • Others: go version go1.21.6 linux/amd64

node command runtime flags:

Config

What happened?

When trying to run any of the guides at https://docs.cometbft.com/v0.38/guides/go#13-writing-a-cometbft-application or https://docs.cometbft.com/v0.38/guides/go-built-in#13-writing-a-cometbft-application, the compilation triggers errors, see Logs section below

What did you expect to happen?

Build without any issues. Fixing the import by adding context is fixing the build issue

How to reproduce it

Follow the steps in the guide.

Logs

$ go build

# kvstore
./app.go:15:39: undefined: context
./app.go:19:40: undefined: context
./app.go:23:42: undefined: context
./app.go:27:44: undefined: context
./app.go:31:50: undefined: context
./app.go:35:50: undefined: context
./app.go:39:48: undefined: context
./app.go:43:40: undefined: context
./app.go:47:48: undefined: context
./app.go:59:53: undefined: context
./app.go:47:48: too many errors

For the non built-in app, once the import is fixed the following error can be seen

go build
# kvstore
./app.go:25:45: undefined: code

dump_consensus_state output

Anything else we need to know

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingneeds-triageThis issue/PR has not yet been triaged by the team.

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions