linera-io/linera-protocol · error · anyhow::Error

No wallet found at {}. Please initialize a wallet first, e.g

Error message

No wallet found at {}. Please initialize a wallet first, e.g. `linera wallet init --faucet <FAUCET_URL>` or `linera wallet init --genesis <PATH>`.

What it means

`linera project publish-and-create` needs an existing wallet to know which chain to publish to. It resolves options.wallet_path() and fails with this message when that file does not exist, directing you to create a wallet first from a faucet or a genesis configuration.

Source

Thrown at linera-service/src/cli/main.rs:2502

                    start_time.elapsed().as_millis()
                );
                Ok(0)
            }
            ProjectCommand::Test { path } => {
                let start_time = Instant::now();
                let path = path.clone().unwrap_or_else(|| env::current_dir().unwrap());
                let project = Project::from_existing_project(&path)?;
                project.test()?;
                info!(
                    "Test project created in {} ms",
                    start_time.elapsed().as_millis()
                );
                Ok(0)
            }
            ProjectCommand::PublishAndCreate { .. } => {
                let start_time = Instant::now();
                let wallet_path = options.wallet_path()?;
                ensure!(
                    wallet_path.exists(),
                    "No wallet found at {}. \
                     Please initialize a wallet first, e.g. \
                     `linera wallet init --faucet <FAUCET_URL>` or \
                     `linera wallet init --genesis <PATH>`.",
                    wallet_path.display()
                );
                options.run_with_storage(Job(options.clone())).await??;
                info!(
                    "Project published and created in {} ms",
                    start_time.elapsed().as_millis()
                );
                Ok(0)
            }
        },

        ClientCommand::Keygen => {
            let start_time = Instant::now();

View on GitHub (pinned to 6c226ddcb3)

Solutions

  1. Run `linera wallet init --faucet <FAUCET_URL>` or `linera wallet init --genesis <PATH>` first
  2. Check you passed the right --wallet-path / LINERA_WALLET_HOME and that the file exists at that exact path
  3. In CI, add wallet creation as a preceding step before publish-and-create

Example fix

# before
$ linera project publish-and-create .
error: No wallet found at /home/me/.config/linera/wallet.json ...

# after
$ linera wallet init --faucet https://faucet.devnet.linera.net
$ linera project publish-and-create .
Defensive patterns

Strategy: validation

Validate before calling

let wallet_path = options.wallet_path()?;
if !wallet_path.exists() {
    eprintln!("No wallet at {} -- run: linera wallet init --faucet <URL>", wallet_path.display());
    std::process::exit(1);
}

Prevention

When it happens

Trigger: Running `linera project publish-and-create` on a machine with no wallet file at the resolved path (the default wallet location or a custom --wallet-path).

Common situations: Fresh machine or container; wrong --wallet-path (typo, or a relative path resolved from a different cwd); CI job missing the wallet-init step; LINERA_WALLET_HOME pointing elsewhere.

Related errors


AI-assisted analysis of linera-io/linera-protocol@6c226ddcb3 (2026-08-22). Data as JSON: /api/errors/976af27d560cb859. Report an issue: GitHub.