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

Custom compile #7

Closed
viraladmin opened this issue Feb 9, 2021 · 1 comment
Closed

Custom compile #7

viraladmin opened this issue Feb 9, 2021 · 1 comment

Comments

@viraladmin
Copy link

I don't expect much but maybe some pointers as to what might be going wrong.

Here is my setup:

I have custom compiled every single library needed to compile the main waves blockchain. I have changed my address version to 15. I am using a node id of % - this generates addresses that begin with Tu (nodes.tactoken.io).

I clone the wavesj library from your repo as the other versions of wavesj don't work build with wavesfx. I enter the directory.

I issue the command
grep -rli 'WAVES' * | xargs -i@ sed -i 's/WAVES/TAC/g' @

This should rewrite every instance of the word WAVES with TAC in all files.

I then remove the test direct from the source seeing as I don't have a testnet setup none of the tests are going to pass.

I compile. All goes ok so far.

Next I clone the wavesfx folder. First I modify the AddressValidator.java file to set the address version to 15. Next I modify the build.gradle to add.

flatDir { dirs 'libs' }

I copy the wavesj-with-dependancies file to to libs folder. I change the chain ID from W to % in the ApplicationSettings.java file.

I compile. All goes well.

I run app - create a new wallet... all is working great.

Next I go back into the wavesj and then the wavesfx folders and issue

grep -rli 'Waves' * | xargs -i@ sed -i 's/Waves/Tac/g' @
grep -rli 'waves' * | xargs -i@ sed -i 's/waves/tac/g' @
grep -rli 'Wavel' * | xargs -i@ sed -i 's/wavel/racl/g' @
grep -rli 'WAVEL' * | xargs -i@ sed -i 's/WAVEL/TACL/g' @
grep -rli 'wavel' * | xargs -i@ sed -i 's/wavel/tacl/g' @

Then I rename all files with the words Waves or waves in them to replace the word waves with tac or Tac.

Basically I just changed every instance of the word waves to the word tac and the words wavelets to the word taclet.

I then rebuild, copy the net TacJ.jar file to the wavefx libs folder and rebuild wavesfx.

Again all goes well. I start the wallet. Create a new address......... and it creates the wrong address (they begin with 3 as if ignoring the ADDRESS_VERSION settings) and starts tossing all sorts of errors.

[ERROR] 2021-02-08 18:23:32.843 [RxCachedThreadScheduler-172] NodeService - Error fetching balance details java.io.IOException: {"error":102,"message":"invalid address"} at com.tacplatform.tacj.Node.exec(Node.java:706) ~[TacJ.jar:?] at com.tacplatform.tacj.Node.send(Node.java:362) ~[TacJ.jar:?]
Any possible insite as to what would cause this? I mean practically it works just fine until I do those last series of renames then suddenly everything fails.

Is their some check that is taking place and failing that I am not seeing? Suggestions or ideas?

@viraladmin
Copy link
Author

I found it but it was not easy to find.

Inside PublicKeyAccount.java of wavesj is a random

buf.put((byte) 1).put((byte) chainId).put(hash, 0, 20);

I had to change it to

buf.put((byte) 15).put((byte) chainId).put(hash, 0, 20);

Might I recommend this as a variable?

@suadzh suadzh closed this as completed Mar 19, 2021
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