Demo of Enervator project

Hi @glowkeeper,

I live in Melbourne Australia so was asleep :smile:

Neither the network or account displayed in blockchain data matches what I have set in MetaMask. I tried clearing out the browser cache.
Does the dapp request access to injected web3? I don’t get a MetaMask popup.

I tried a different dapp (https://opensea.io) and it can display my network and account (after authorizing MetaMask access).

I live in Melbourne Australia so was asleep :smile:

That's a poor excuse :wink:

Yes, the app' injects web3 from MetaMask, so if you just reload the dat, it should pick up your the correct account on Rinkeby.

1 Like

Neither the network or account displayed in blockchain data matches what I have set in MetaMask

I'm confused by that - the app' just reads what's available from web3 - that Ropsten address is one of your MetaMask accounts, right?

1 Like

…it’s my turn to sleep :wink: I don’t understand why my app’ thinks it’s on Ropsten if the scenario I described a couple of posts ago was incorrect, and why a simple server reload doesn’t find your Rinkeby account…

I used a seed phrase and only generated one account on MetaMask which is not the account shown. (See the screenshot above).

Sleep is important :zzz::grinning:

I used a seed phrase and only generated one account on MetaMask

Really? Wow - how strange - I just inject web3.js (via ethers.js) - I can't imagine why it's not working for you! Unfortunately, I can't install that Clickz latest setup on my Linux machine, so I can't test whether I get similar behaviour this end. If you can find the time to try the other way I mentioned for working with dat + Firefox + MetaMask, I'd appreciate it....

1 Like

ps. thanks for trying @abcoathup :smiley:

1 Like

Hi @glowkeeper,

I tried running dat-fox-helper, and appeared to experience the following issue (I also didn’t have the registry key), which doesn’t have a solution.

I also tried running https://github.com/glowkeeper/Enervator/blob/master/demo/exchanger locally, but failed on the compile. Assume I am missing some config?

$ npm run compile

> Enerchanger@0.0.1 compile /mnt/c/Users/andre/Documents/projects/forum/Enervator/demo/exchanger
> webpack --config ./webpack.dev.js --mode development

10% building 1/3 modules 2 active ...s/projects/forum/Enervator/demo/exchanger/node_modules/babel-polyfill/lib/index.jsℹ 「atl」: Using typescript@3.6.3 from typescript
ℹ 「atl」: Using tsconfig.json from /mnt/c/Users/andre/Documents/projects/forum/Enervator/demo/exchanger/tsconfig.json
94% after sealℹ 「atl」: Checking started in a separate process...
✖ 「atl」: Checking finished with 1 errors
Hash: f649a650cf86f9a18ad7
Version: webpack 4.41.0
Time: 20554ms
Built at: 10/14/2019 6:16:45 PM
        Asset       Size  Chunks                   Chunk Names
    bundle.js   8.75 MiB     app  [emitted]        app
bundle.js.map   8.78 MiB     app  [emitted] [dev]  app
  favicon.png   1.27 KiB          [emitted]
   index.html  625 bytes          [emitted]
Entrypoint app = bundle.js bundle.js.map
[0] multi babel-polyfill ./src/index.tsx 40 bytes {app} [built]
[./node_modules/webpack/buildin/global.js] (webpack)/buildin/global.js 472 bytes {app} [built]
[./src/containers/appBar.tsx] 4.23 KiB {app} [built]
[./src/containers/content.tsx] 4.72 KiB {app} [built]
[./src/containers/main.tsx] 4.45 KiB {app} [built]
[./src/containers/pages/blockchain/blockchainInfo.tsx] 3.5 KiB {app} [built]
[./src/containers/pages/exchanger/writer/buy.tsx] 12.2 KiB {app} [built]
[./src/containers/siderOrganisationMenu.tsx] 3.44 KiB {app} [built]
[./src/images/logo.png] 8.4 KiB {app} [built]
[./src/index.tsx] 1.66 KiB {app} [built]
[./src/store/index.ts] 346 bytes {app} [built]
[./src/store/store.ts] 1.64 KiB {app} [built]
[./src/styles/theme.tsx] 4.96 KiB {app} [built]
[./src/utils/config.ts] 32.4 KiB {app} [built]
[./src/utils/strings.ts] 4.71 KiB {app} [built]
    + 1752 hidden modules

WARNING in ./node_modules/web3-eth-accounts/src/scrypt.js 17:50-60
Critical dependency: the request of a dependency is an expression
 @ ./node_modules/web3-eth-accounts/src/index.js
 @ ./node_modules/web3-eth/src/index.js
 @ ./node_modules/web3/src/index.js
 @ ./src/components/blockchain/blockchainProvider.tsx
 @ ./src/components/blockchain/blockchain.tsx
 @ ./src/index.tsx
 @ multi babel-polyfill ./src/index.tsx

ERROR in [at-loader] ./node_modules/jss/src/index.d.ts:8:78
    TS2344: Type 'Name' does not satisfy the constraint 'string'.
  Type 'string | number | symbol' is not assignable to type 'string'.
    Type 'number' is not assignable to type 'string'.
Child html-webpack-plugin for "index.html":
     1 asset
    Entrypoint undefined = index.html
    [./node_modules/html-webpack-plugin/lib/loader.js!./src/index.html] 734 bytes {0} [built]
    [./node_modules/webpack/buildin/global.js] (webpack)/buildin/global.js 472 bytes {0} [built]
    [./node_modules/webpack/buildin/module.js] (webpack)/buildin/module.js 497 bytes {0} [built]
        + 1 hidden module
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! Enerchanger@0.0.1 compile: `webpack --config ./webpack.dev.js --mode development`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the Enerchanger@0.0.1 compile script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/abcoathup/.npm/_logs/2019-10-14T07_16_45_812Z-debug.log

I’ve now run my dApp on four different machines, and all of them have behaved. What I’ve not managed to do is run that Clickz latest build you tried. However, tomorrow, I will get access to a MAC, when I will be able to download and try Clickz. I’m hoping I get the same Rinkeby/Ropsten mismatch, so I can debug WTF!

1 Like

Hi @abcoathup

Ah - no - that's a typescript error - you need to hack that ./node_modules/jss/src/index.d.ts file so line 8 looks like this:

export type Classes<Name extends string = string> = Record<Name, string>

...instead of including string | number | symbol. I meant to raise an issue somewhere about that...

Thanks for persevering!

1 Like

You’ll also need to install the node package http-server:

npm install --global http-server  

…or whatever the equivalent of that is on Windows. Then you should be able to run:

npm run start

And then point your browser at http://localhost:8085

I really should post some proper instructions up on GitHub about all this :smiley:

1 Like

Hi @glowkeeper,

I can run the dapp locally now and was able to submit a transaction:

Transaction Details
Transaction Summary: Submitted Successfully!

hash: 0xb40eb0737793266e4e39174ed2a05acb845f4588b1d0356d6114349158cc8bcc
blockHash: 0xa731c02714d6b6f2e544a6216d64b6a2284b55a48a32b883790c20f8f673e9c6
blockNumber: 5260435
transactionIndex: 4
confirmations: 1
from: 0x77737a65C296012C67F8c7f656d1Df81827c9541
gasPrice: 1000000000
gasLimit: 521000
to: 0x2484336c3a7812a3011ead2064ee0a7190B6F1a3
value: 0
nonce: 375
r: 0xbc54fb11d0fd302073f109dc408655ae569660820209975aec0311a0bc511b48
s: 0x54a19cf03eac39fb92b7f21a681147f17d4ee1d11e1a6f4f78b5c4abc96439a0
v: 43
creates: null
networkId: 4
1 Like

I can run the dapp locally now and was able to submit a transaction:

Awesome - so I take it that's a deposit? You should be able to use that to 'buy' some Enervator...

1 Like

Hi @glowkeeper,

I now have 27 EOR
https://rinkeby.etherscan.io/token/0x5483b2996bba07330e188fe10bb101d4c1ac8530?a=0x77737a65c296012c67f8c7f656d1df81827c9541

I now have 27 EOR

Awesome! Congratulations! Treasure them :smiley:

Thanks so much for persevering....

1 Like

Hi @glowkeeper,
Still doesn’t show what the issue was with Cliqz and MetaMask unfortunately.

...Clicks

Yeah - that's a really strange one - I just inject web3 from whatever provider is available from the browser, so your local build and the one I have running on dat should behave exactly the same!

I'm gonna be on a MAC in an hour or so, so I'll be able to install the Clicks latest build on that. Hopefully that'll provide some clues...

1 Like

Right - good - I get the same error with Clickz latest on the MAC - Enerchanger seems to think it’s on Ropsten, no matter what MetaMask thinks. I notice this error in the web developer console:

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://127.0.0.1:8545/. (Reason: CORS request did not succeed).

Do you get the same?

I’m guessing that’s an error in dat-webext, but I might be wrong - I’m going to have a bit of a dig around…

1 Like

I’m guessing that’s an error in dat-webext,

Yup - seems there are CORS issues with that - I'm going to update that issue, and see what they say...

1 Like

I've also logged that issue with the good people of jss - thanks for reminding me...

1 Like