Skip to content

run yarn dock-did-example, error "TypeError: this.module.newOnchain is not a function" #346

Open

Description

@kangkang333

step1. docker run -p 9944:9944 -p 30333:30333 docknetwork/dock-substrate:mainnet --chain ./cspec/knox_raw.json --ws-external --enable-offchain-indexing=true

step2. run yarn dock-did-example

Creating DID resolvers...
Building DIDs list...
Error occurred somewhere, it was caught! TypeError: this.module.newOnchain is not a function
at DIDModule.createNewOnchainTx (/Users/xxxxx/Downloads/sdk-master/src/modules/did/did.js:143:24)
at DIDModule.new (/Users/xxxxx/Downloads/sdk-master/src/modules/did/did.js:167:12)
at registerNewDIDUsingPair (/Users/xxxxx/Downloads/sdk-master/tests/integration/helpers.js:25:25)
at createDockDID (/Users/xxxxx/Downloads/sdk-master/example/resolver.js:55:32)
at main (/Users/xxxxx/Downloads/sdk-master/example/resolver.js:78:25)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
error Command failed with exit code 1.

Activity

  1. changed the title [-]TypeError: this.module.newOnchain is not a function[/-] [+]run yarn dock-did-example, error "TypeError: this.module.newOnchain is not a function"[/+] on Apr 10, 2023
  2. lovesh commented on Apr 10, 2023

    @lovesh
    Collaborator

    Can you share your docker image id and SDK version because this.module.newOnchain is not a function suggests an old docker image?

    Creating DID resolvers...
    Building DIDs list

    The output logs suggest you're running yarn did-resolver-example and not yarn dock-did-example. Secondly using the mainnet tagged docker images to run examples and tests isn't a good idea as it will cost you real tokens.

  3. kangkang333 commented on Apr 10, 2023

    @kangkang333
    Author

    SDK version: master
    dock-substrate: version 0.22.0

    And I run the following command :

    docker run -p 9944:9944 -p 30333:30333 docknetwork/dock-substrate:mainnet --chain ./cspec/knox_raw.json --ws-external --enable-offchain-indexing=true

    2023-04-10 08:07:06 Dock Node
    2023-04-10 08:07:06 ✌️ version 0.22.0
    2023-04-10 08:07:06 ❤️ by Dock.io, 2017-2023
    2023-04-10 08:07:06 📋 Chain specification: Dock PoS Mainnet
    2023-04-10 08:07:06 🏷 Node name: imported-learning-5413
    2023-04-10 08:07:06 👤 Role: FULL

  4. lovesh commented on Apr 10, 2023

    @lovesh
    Collaborator

    Can you share the most recent block on your node? The TypeError might be because your local node doesn't have the recent blocks (last few months) and as per your local state, newOnchain is not an extrinsic as it was only introduced a few months ago.

  5. GinMu commented on Mar 29, 2024

    @GinMu
    Contributor

    i also have this problem on mainnet, docker image log is:
    Screenshot 2024-03-29 at 13 41 37

    then i run connect command:

    docker run -p 9944:9944 -p 30333:30333 docknetwork/dock-substrate:mainnet --chain ./cspec/knox_raw.json --ws-external --enable-offchain-indexing=true
    

    then run yarn dock-did-example that throws this.module.newOnchain is not a function error. But not throw this error on testnet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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