status-im / open-bounty

Enable communities to distribute funds to push their cause forward.
https://openbounty.status.im/
GNU Affero General Public License v3.0
119 stars 36 forks source link

:token-data needs to be added to config-dev.edn for lein run to work #371

Closed msuess closed 6 years ago

msuess commented 6 years ago

User Story

As a developer, I want to be able to execute lein run so that I contribute to the project.

Description

Type: Bug

Summary: After cloning the repo and following the instructions in in the readme, lein run crashed on me with this error:

➜  open-bounty (develop) ✔ lein run
Finding SHA for /Users/msuess/src/status-im/open-bounty
Finding SHA for /Users/msuess/src/status-im/open-bounty
Compiling 4 source files to /Users/msuess/src/status-im/open-bounty/target/default/classes
WARNING: remove already refers to: #'clojure.core/remove in namespace: commiteth.db.pull-requests, being replaced by: #'commiteth.db.pull-requests/remove
addr 0x7d127a3e3b5e72cd8f1CompilerException java.lang.ClassNotFoundException: commiteth.eth.contracts.TokenReg, compiling:(commiteth/eth/token_registry.clj:1:1)
5e7dee650abe4fcced2b9
Exception in thread "main" java.lang.RuntimeException: could not start [#'commiteth.eth.token-data/token-data] due to, compiling:(/private/var/folders/xx/l5ydbx692vqgk7mvzkbt4xkw0000gn/T/form-init8458628234423305076.clj:1:125)
        at clojure.lang.Compiler.load(Compiler.java:7391)
        at clojure.lang.Compiler.loadFile(Compiler.java:7317)
        at clojure.main$load_script.invokeStatic(main.clj:275)
        at clojure.main$init_opt.invokeStatic(main.clj:277)
        at clojure.main$init_opt.invoke(main.clj:277)
        at clojure.main$initialize.invokeStatic(main.clj:308)
        at clojure.main$null_opt.invokeStatic(main.clj:342)
        at clojure.main$null_opt.invoke(main.clj:339)
        at clojure.main$main.invokeStatic(main.clj:421)
        at clojure.main$main.doInvoke(main.clj:384)
        at clojure.lang.RestFn.invoke(RestFn.java:421)
        at clojure.lang.Var.invoke(Var.java:383)
        at clojure.lang.AFn.applyToHelper(AFn.java:156)
        at clojure.lang.Var.applyTo(Var.java:700)
        at clojure.main.main(main.java:37)
Caused by: java.lang.RuntimeException: could not start [#'commiteth.eth.token-data/token-data] due to
        at mount.core$up$fn__100.invoke(core.cljc:92)
        at mount.core$up.invokeStatic(core.cljc:92)
        at mount.core$up.invoke(core.cljc:90)
        at mount.core$bring.invokeStatic(core.cljc:210)
        at mount.core$bring.invoke(core.cljc:202)
        at mount.core$start.invokeStatic(core.cljc:252)
        at mount.core$start.doInvoke(core.cljc:244)
        at clojure.lang.RestFn.invoke(RestFn.java:397)
        at mount.core$start_with_args.invokeStatic(core.cljc:350)
        at mount.core$start_with_args.doInvoke(core.cljc:346)
        at clojure.lang.RestFn.invoke(RestFn.java:410)
        at commiteth.core$start_app.invokeStatic(core.clj:46)
        at commiteth.core$start_app.invoke(core.clj:45)
        at commiteth.core$_main.invokeStatic(core.clj:62)
        at commiteth.core$_main.doInvoke(core.clj:53)
        at clojure.lang.RestFn.invoke(RestFn.java:397)
        at clojure.lang.Var.invoke(Var.java:375)
        at user$eval29147.invokeStatic(form-init8458628234423305076.clj:1)
        at user$eval29147.invoke(form-init8458628234423305076.clj:1)
        at clojure.lang.Compiler.eval(Compiler.java:6927)
        at clojure.lang.Compiler.eval(Compiler.java:6917)
        at clojure.lang.Compiler.load(Compiler.java:7379)
        ... 14 more
Caused by: java.util.concurrent.ExecutionException: java.lang.NullPointerException
        at java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:357)
        at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1895)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at clojure.lang.Reflector.invokeMatchingMethod(Reflector.java:93)
        at clojure.lang.Reflector.invokeNoArgInstanceMember(Reflector.java:313)
        at commiteth.eth.token_registry$load_parity_tokenreg_data.invokeStatic(token_registry.clj:41)
        at commiteth.eth.token_registry$load_parity_tokenreg_data.invoke(token_registry.clj:32)
        at commiteth.eth.token_registry$load_parity_tokenreg_data.invokeStatic(token_registry.clj:36)
        at commiteth.eth.token_registry$load_parity_tokenreg_data.invoke(token_registry.clj:32)
        at commiteth.eth.token_data$update_data.invokeStatic(token_data.clj:23)
        at commiteth.eth.token_data$update_data.invoke(token_data.clj:15)
        at commiteth.eth.token_data$eval57713$fn__57714.invoke(token_data.clj:30)
        at mount.core$record_BANG_.invokeStatic(core.cljc:86)
        at mount.core$record_BANG_.invoke(core.cljc:85)
        at mount.core$up$fn__100.invoke(core.cljc:93)
        ... 35 more
Caused by: java.lang.NullPointerException
        at org.web3j.utils.Numeric.containsHexPrefix(Numeric.java:80)
        at org.web3j.utils.Numeric.cleanHexPrefix(Numeric.java:64)
        at org.web3j.abi.FunctionReturnDecoder.decode(FunctionReturnDecoder.java:37)
        at org.web3j.tx.Contract.executeCall(Contract.java:157)
        at org.web3j.tx.Contract.executeCallSingleValueReturn(Contract.java:172)
        at org.web3j.tx.Contract.lambda$executeCallSingleValueReturnAsync$21(Contract.java:162)
        at org.web3j.utils.Async.lambda$run$29(Async.java:22)
        at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1626)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)

Expected behavior

lein run starts the app

Actual behavior

lein run crashes

Reproduction

Solution

Summary: Adding this to the config fixes the issue:

 :testnet-token-data {:D0X {:tla "D0X", :name "district0x Network Token", :base 1000000000000000000, :address "0x0abdace70d3790235af448c88547603b945604ea", :owner "0x0053602cf6cb33f41bf2324523eb2f1e958d07b4"} :SNT {:tla "SNT", :name "Status Network Token", :base 1000000000000000000, :address "0x744d70fdbe2ba4cf95131626614a1763df805b9e", :owner "0x6f680fcfc0cb98072ad066e207af814fdde4fe8f"} :ANT {:tla "ANT", :name "Aragon Network Token", :base 1000000000000000000, :address "0x960b236a07cf122663c4303350609a66a7b288c0", :owner "0x6f680fcfc0cb98072ad066e207af814fdde4fe8f"}}

The readme mentions to add :testnet-token-data in case of Geth connectivity problems, however I was using infura and the error message did not indicate a connectivity problem to me.

I'm unsure why this fixes it. @martinklepsch can probably explain better, since he provided the fix.

vitvly commented 6 years ago

This is weird. I remember getting the same error a couple of months ago, and am not getting it any more. Not sure what fixed it. Just tried fetching token registry data via (commiteth.eth.token-registry/load-parity-tokenreg-data) while connected to Ropsten via Infura, and it works fine.

Can you please post your config.edn here? Just remove your eth-account, eth-password, eth-wallet-file settings.

msuess commented 6 years ago

Forget it guys, somehow I ended up with an invalid value for :tokenreg-addr in my config-dev.edn. I just tried it again and everything seems fine. Sorry for the false alarm.