Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
kangkang333 opened this issue Apr 10, 2023 · 4 comments

Comments

@kangkang333
Copy link

kangkang333 commented Apr 10, 2023

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.

@kangkang333 kangkang333 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" Apr 10, 2023
@lovesh
Copy link
Member

lovesh commented Apr 10, 2023

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.

@kangkang333
Copy link
Author

kangkang333 commented Apr 10, 2023

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

@lovesh
Copy link
Member

lovesh commented Apr 10, 2023

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.

@GinMu
Copy link
Contributor

GinMu commented Mar 29, 2024

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants