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

[tutorial-1 bug] how can I call contract in private development chain? #140

Closed
maxisacoder opened this issue Jul 3, 2018 · 1 comment
Closed

Comments

@maxisacoder
Copy link

After running by command in tutorial-1, I get this error in Chrome. I have deployed the Dharma contract in my private chain to address list in /artifacts/.

dharma.umd.js:170037 Uncaught (in promise) Error: Unable to find address for contract TokenRegistry on network with id 70
    at Function.<anonymous> (dharma.umd.js:170037)
    at step (dharma.umd.js:169709)
    at Object.next (dharma.umd.js:169690)
    at fulfilled (dharma.umd.js:169681)
(anonymous) @ dharma.umd.js:170037
step @ dharma.umd.js:169709
(anonymous) @ dharma.umd.js:169690
fulfilled @ dharma.umd.js:169681
Promise.then (async)
step @ App.css?d973:26
(anonymous) @ App.css?d973:26
Promise.then (async)
step @ App.css?d973:26
(anonymous) @ App.css?d973:26
(anonymous) @ App.css?d973:26
createDebtOrder @ App.jsx:72
handleSubmit @ RequestLoanForm.jsx:37
callCallback @ react-dom.development.js:100
invokeGuardedCallbackDev @ react-dom.development.js:138
invokeGuardedCallback @ react-dom.development.js:187
invokeGuardedCallbackAndCatchFirstError @ react-dom.development.js:201
executeDispatch @ react-dom.development.js:461
executeDispatchesInOrder @ react-dom.development.js:483
executeDispatchesAndRelease @ react-dom.development.js:581
executeDispatchesAndReleaseTopLevel @ react-dom.development.js:592
forEachAccumulated @ react-dom.development.js:562
runEventsInBatch @ react-dom.development.js:723
runExtractedEventsInBatch @ react-dom.development.js:732
handleTopLevel @ react-dom.development.js:4476
batchedUpdates$1 @ react-dom.development.js:16659
batchedUpdates @ react-dom.development.js:2131
dispatchEvent @ react-dom.development.js:4555
interactiveUpdates$1 @ react-dom.development.js:16714
interactiveUpdates @ react-dom.development.js:2150
dispatchInteractiveEvent @ react-dom.development.js:4532

I found the address in @dharmaprotocol/dharma.js/dist/dharma.umd.js

"70": {
            "events": {
                "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0": {
                    "anonymous": false,
                    "inputs": [
                        {
                            "indexed": true,
                            "name": "previousOwner",
                            "type": "address"
                        },
                        {
                            "indexed": true,
                            "name": "newOwner",
                            "type": "address"
                        }
                    ],
                    "name": "OwnershipTransferred",
                    "type": "event"
                }
            },
            "links": {},
            "address": "0xf21ef0271ebcbd144616c43b90dc578665264a2c"
        }

and in truffle console

truffle(development)> TokenRegistry.address
'0xf21ef0271ebcbd144616c43b90dc578665264a2c'

Plz give me some insight for this question, thx a lot.

@graemecode
Copy link
Contributor

graemecode commented Jul 3, 2018

Hi @CNaiko,

A few of us on the team have tried to reproduce this bug, but have not been able to. Would you mind trying to re-clone the repo, and attempting the tutorial again? It's possible that some of the code you have is out of date.

To be clear, all you need to do once you have cloned the repo is run:

npm install
npm run blockchain

and then in a new terminal window:

npm start

You do not need to manually deploy/migrate any contracts.

Apologies for the inconvenience.

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

2 participants