tronprotocol/tron-rosetta-api

Broken testnet config?

Closed this issue · 1 comments

GBBx commented

Hi There,

I try to build my own image with gradlew and run it on testnet.
I cloned your repo and built it:

RUN git clone --branch=v1.6.10 https://github.com/tronprotocol/tron-rosetta-api.git /tron-rosetta-api
WORKDIR /tron-rosetta-api
RUN ./gradlew build -xtest -xcheck --refresh-dependencies

Then I make a copy of your mainnet config and testnet config and run tron-rosetta-api:

java -jar tron-rosetta-api-1.0.0.jar -d database -c mainnet.conf

This works well, but

java -jar tron-rosetta-api-1.0.0.jar -d database -c testnet.conf

fails.

Logs:

...
13:58:00,619 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.
13:58:00,620 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator@61dc03ce - Registering current configuration as safe fallback point

13:58:00.627 INFO  [main] [app](OpenAPI2SpringBoot.java:45) Rosetta Api running.
13:58:01.106 WARN  [main] [Commons](DecodeUtil.java:28) Warning: Address need prefix with -96 but 65 !!
13:58:01.106 WARN  [main] [Commons](DecodeUtil.java:17) Warning: Address is empty !!
Exception in thread "main" java.lang.reflect.InvocationTargetException
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
        at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
        at org.springframework.boot.loader.Launcher.launch(Launcher.java:50)
        at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51)
Caused by: java.lang.IllegalArgumentException: The address() must be 21 bytes.
        at org.tron.common.args.Account.setAddress(Account.java:53)
        at org.tron.core.config.args.Args.createAccount(Args.java:793)
        at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
        at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1655)
        at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
        at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
        at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913)
        at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
        at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578)
        at org.tron.core.config.args.Args.getAccountsFromConfig(Args.java:786)
        at org.tron.core.config.args.Args.setParam(Args.java:362)
        at org.tron.invoker.OpenAPI2SpringBoot.main(OpenAPI2SpringBoot.java:47)
        ... 8 more
...

I see the only difference between the two config files is the network name. Don't I need to change something else? Can you please double-check if this testnet config is up-to-date:
https://github.com/tronprotocol/tron-rosetta-api/blob/master/src/main/resources/net_conf/testnet.conf
?

GBBx commented

Sorry, my bad. I worked with old config files.