Skip to content
This repository was archived by the owner on Oct 9, 2023. It is now read-only.
This repository was archived by the owner on Oct 9, 2023. It is now read-only.

First argument to new HDWalletProvider() must be a mnemonic phrase, a single private key, or a list of private keys #11

@ltfschoen

Description

@ltfschoen

Using the latest "@truffle/hdwallet-provider": "^2.1.12",, when I tried to run truffle migrate --reset --compile-all --network moonbase it gave me an error First argument to new HDWalletProvider() must be a mnemonic phrase, a single private key, or a list of private keys., it now expects the private key is a Uint8Array with length 32 to be provided as an array.
so provide a parameter privateKeys and type string[] as mentioned here https://github.com/trufflesuite/truffle/tree/develop/packages/hdwallet-provider

so i change it to

let args = {
   privateKeys: [privateKeyDev],
   providerOrUrl: 'http://localhost:9944/',
};
return new HDWalletProvider(args);

...

let args = {
   privateKeys: [privateKeyMoonbase],
   providerOrUrl: 'https://rpc.api.moonbase.moonbeam.network',
};
return new HDWalletProvider(args);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions