Giter Club home page Giter Club logo

dashj's Introduction

dashj

A Java library for working with Dash

License dashevo/dashj

Branch Tests Coverage Linting
master Tests codecov N/A

Welcome to dashj

The dashj library is a Java implementation of the Dash protocol, which allows it to maintain a wallet and send/receive transactions without needing a local copy of Dash Core. It comes with full documentation and some example apps showing how to use it.

This branch is up to date with bitcoinj (https://github.com/bitcoinj/bitcoinj) 0.15.10.

Technologies

  • Java 8+ (needs Java 8 API or Android 6.0 API, compiles to Java 8 bytecode) and Gradle 4.4+ for the core module
  • Java 8+ and Gradle 5.6 for tools and examples
  • Java 11+ and Gradle 5.6 for the JavaFX-based wallettemplate
  • Gradle - for building the project
  • Google Protocol Buffers - for use with serialization and hardware communications

Getting started

To get started, it is best to have the latest JDK and Maven installed. The HEAD of the master branch contains the latest development code and various production releases are provided on feature branches.

Building from the command line

Official builds are currently using JDK 8. Our GitHub Actions build and test with JDK 8 and JDK 11.

To initialize the repo after cloning it (this will build the bls shared library):

git submodule update  --init --recursive
cd contrib/dashj-bls
mvn package -DskipTests
cd ../..

To use the optional x11 native library:

cd contrib/x11
mkdir build
cd build
cmake ..
cmake --build .
cd ../../..

To perform a full build use (this includes the dashjbls shared library):

To perform a full build (including JavaDocs and unit/integration tests) use JDK 11+.

./gradlew clean build

If you are using Gradle 4.10 or later, the build will automatically include the JavaFX-based wallettemplate module. The outputs are under the build directory.

To perform a full build without unit/integration tests use:

./gradlew clean build -x test

To perform a full build and install it in the local maven repository:

./gradlew assemble

to generate a website with useful information like JavaDocs.

The outputs are under the target directory.

Deployment

To deploy to the maven repository:

./gradlew publish

Building from an IDE

Alternatively, just import the project using your IDE. IntelliJ has Gradle integration built-in and has a free Community Edition. Simply use File | New | Project from Existing Sources and locate the build.gradle in the root of the cloned project source tree.

The dashjbls library must still using the instructions above.

Example applications

These are found in the examples module.

Where next?

Now you are ready to follow the tutorial. Though this is for bitcoinj, there is no equivalent site for dashj.

Building and Using the Wallet Tool

The dashj tools subproject includes a command-line Wallet Tool (wallet-tool) that can be used to create and manage dashj-based wallets (both the HD keychain and SPV blockchain state.) Using wallet-tool on Dash's test net is a great way to learn about Dash and dashj.

To build an executable shell script that runs the command-line Wallet Tool, use:

gradle dashj-tools:installDist

You can now run the wallet-tool without parameters to get help on its operation:

./tools/build/install/wallet-tool/bin/wallet-tool

To create a test net wallet file in ~/dashj/dashj-test.wallet, you would use:

mkdir ~/dashj
./tools/build/install/wallet-tool/bin/wallet-tool --net=TEST --wallet=$HOME/dashj/dashj-test.wallet create

To sync the newly created wallet in ~/dashj/dashj-test.wallet with the test net, you would use:

./tools/build/install/wallet-tool/bin/wallet-tool --net=TEST --wallet=$HOME/dashj/dashj-test.wallet sync

To dump the state of the wallet in ~/dashj/dashj-test.wallet with the test net, you would use:

./tools/build/install/wallet-tool/bin/wallet-tool --net=TEST --wallet=$HOME/dashj/dashj-test.wallet dump

Note: These instructions are for macOS/Linux, for Windows use the tools/build/install/wallet-tool/bin/wallet-tool.bat batch file with the equivalent Windows command-line commands and options.

Example applications

These are found in the examples module.

Where next?

Now you are ready to follow the tutorial.

Testing a SNAPSHOT build

Building apps with official releases of dashj is covered in the tutorial.

dashj's People

Contributors

amichair avatar c-otto avatar cyberzac avatar devrandom avatar devrandom1 avatar eleetas avatar erasmospunk avatar haraldh avatar hashengineering avatar jarlfr avatar jim618 avatar kirill-vlasov avatar kmels avatar kparmar1 avatar ksedgwic avatar matthewleon avatar mikehearn avatar mjjbell avatar mruddy avatar msgilligan avatar natzei avatar oscarguindzberg avatar peterdettman avatar schildbach avatar syn-mcj avatar thebluematt avatar tomasz-ludek avatar troggy avatar w-shackleton avatar wlk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dashj's Issues

! Chaotic behavior

Expected Behavior

Current Behavior

Possible Solution

Alternatives Considered

Additional Context

balance

Expected Behavior

Current Behavior

Possible Solution

Alternatives Considered

Additional Context

possible memory leaks when not initialized properly

When dashj is initialized with just Context.get().initDash(false, true); it leaks memory as MasternodeManager#mapSeenMasternodePing is populated but never cleaned.

Context.get().setLiteMode(false); has to be called to start ThreadCheckDarkSendPool which cleans the map.

Also mapTxLockVotes seems to be getting filled with entries that will never be removed because TransactionLockVote#isExpired is never true on them

This seems to be a problem only when lite mode = false. I tried using the lite mode but it had some problems discovering peers. What exactly is is the non-lite mode used for?

Thanks

DefaultRiskAnalysis - Dust Rules don't use DIP0001 values

02:30:27 [main] DefaultRiskAnalysis - TX considered non-standard due to output 0 violating rule DUST
02:30:27 [main] Wallet - Pending transaction was considered risky: Risky due to non-standard tx a2d79ae524994c6a0c46284e241348bb90c65600c5ae2035409bad801a46b53e
  a2d79ae524994c6a0c46284e241348bb90c65600c5ae2035409bad801a46b53e
  updated: 2018-02-25T02:30:27Z
     in   PUSHDATA(72)[3045022100a94974af46c2fe991b1bb5375ae3a1effea5bad373040f14d5d16322aefffe1a022036b90e51d85b1b0bc9360ec357ccde790c9799a945b34679673186f5bfa0363101] PUSHDATA(33)[02ed8cd1e6c6f8c73e6e15ceeca0eb9603f139cfb3a1d02715e6a91453fe478168] 0.00001709 DASH
          outpoint:89351a77cefad3758544053e7d7bd615e3da098856a3fc9dec74464e7827fcc0:0 hash160:620fb1a6d3cd7fd265b5044f695d0e3e9597d0ef
     out  DUP HASH160 PUSHDATA(20)[dc4c7ebac1390eb6396043cb5cff18d5aec9597a] EQUALVERIFY CHECKSIG 0.00000709 DASH
     fee  0.00005208 DASH/kB, 0.00001 DASH for 192 bytes
     prps USER_PAYMENT

InstantSend Coin Selector Not used

dashj has an InstantSend coin Selector, but it is not used by default.

Dash Wallet uses it for the dummy transaction checker, but not when actually sending the transaction. Could this result in rejected or stuck transactions.

Stuck at block 1037027

In our testing of full block verification mode, we found that BIP30 fails with this block:
https://explorer.dash.org/block/0000000000000005609b6426cc199fc3cec30dbdd19d1c483edcefa5c7e1b080 on this transaction: https://explorer.dash.org/tx/c51691cd143bbb824f2b1046adff9db35373b67ff0100b9541a8bc5ab999790e

Block: 1037027

@pvyhnal-generalbytes - have you encountered something like this?

The transaction in question: https://explorer.dash.org/tx/c51691cd143bbb824f2b1046adff9db35373b67ff0100b9541a8bc5ab999790e appeared in two blocks according to the block explorer with block times 3 seconds apart. It could be that this has failed due to the same transaction being found in an orphan?

mandatory-script-verify-flag-failed (Script failed an OP_EQUALVERIFY operation)

Building a Dash testnet transaction, but the transaction gets rejected if I broadcast it via this page.

This is the code I'm using to create the transaction:

val sendingAddress = "yWT4E7FKGmDXuGnYQ4BLX8Nvd2KTMEQ6aU"
val receivingAddress = "ybM6VBWqMgYHUDv7PBeN31Kb7NioX9RpHD"
val sendingAddressPrivkey = "[[ REMOVED ]]" // testnet, but still, would be nice to continue using this address ๐Ÿ˜œ

val tx = Transaction(params)

val inputScript = ScriptBuilder.createOutputScript(Address.fromBase58(params, sendingAddress))
assertEquals("DUP HASH160 PUSHDATA(20)[6f21b38d07b1e7c1f1cb02e52d90486d015ce522] EQUALVERIFY CHECKSIG", inputScript.toString())

tx.addInput(Sha256Hash.wrap("c4e841e257ad42e173eeae309df403f0eff6b51dc87a861e5639041ea362b501"), 0, inputScript)
tx.addOutput(Coin.valueOf(1_0000_0000), Address.fromBase58(params, receivingAddress))
tx.addOutput(Coin.valueOf(13_9878_9000), Address.fromBase58(params, sendingAddress))

println(String(Hex.encode(tx.bitcoinSerialize())))

println("From: ${inputScript.getToAddress(params)}")

val privKey = ECKey.fromPrivate(Hex.decode(sendingAddressPrivkey))

tx.clearInputs()
tx.addSignedInput(TransactionOutPoint(
        params, 0, Sha256Hash.wrap("c4e841e257ad42e173eeae309df403f0eff6b51dc87a861e5639041ea362b501")
), inputScript, privKey, Transaction.SigHash.ALL, true)

println(String(Hex.encode(tx.bitcoinSerialize())))

Output:

010000000101b562a31e0439561e867ac81db5f6eff003f49d30aeee73e142ad57e241e8c4000000001976a9146f21b38d07b1e7c1f1cb02e52d90486d015ce52288acffffffff0200e1f505000000001976a914a4d9b8921b90f9febd8a4ccaa62162a809a05f1588ac88d35f53000000001976a9146f21b38d07b1e7c1f1cb02e52d90486d015ce52288ac00000000
From: yWT4E7FKGmDXuGnYQ4BLX8Nvd2KTMEQ6aU
010000000101b562a31e0439561e867ac81db5f6eff003f49d30aeee73e142ad57e241e8c4000000006a473044022018f362b2a6997177dd95bdc5f5e5415183b4629e90481b76b0eef5e5ae80d595022040fb1f370ad2a4db439c321668bbccbc03088040e5ea0c1740ee40d18b5175d1812102a1580b67fdc6337b8575a3f0f7c1fb55bd365454010d728e6156e813aca1d7ecffffffff0200e1f505000000001976a914a4d9b8921b90f9febd8a4ccaa62162a809a05f1588ac88d35f53000000001976a9146f21b38d07b1e7c1f1cb02e52d90486d015ce52288ac00000000

Could this be the same issue as the one in bitcoinj-cash?

#actual behavior

Expected Behavior

Current Behavior

Possible Solution

Alternatives Considered

Additional Context

Problems when try to execute mvn clean install -DskipTests on MAC

Software:

    System Software Overview:

      System Version: macOS 10.13.4 (17E199)
      Kernel Version: Darwin 17.5.0

Steps to reproduce

$ git clone https://github.com/HashEngineering/dashj.git

$ cd dashj

$ git checkout release-0.14

$ mvn clean install -DskipTests

at this point I got an error with this file core/src/main/java/org/bitcoinj/core/MasterNode.java the name of the file is capitalized and should be Masternode.java

after rename it works fine ๐Ÿ‘

Memory leak in Peer

There is a possible memory leak in Peer class (originally form bitcoinj) when a peer does not respond to Ping or when a peer does not send announced transactions. See PR: bitcoinj/bitcoinj#1726 or maybe wait for a review in bitcoinj before using it

multi input cant send raw transaction success

demo code :

        //child=~~~~
        ECKey ecKey = child.getEcKey();
        org.dashj.core.ECKey dashECKey = org.dashj.core.ECKey.fromPrivate(ecKey.getPrivKeyBytes());
        Transaction transaction1 = new Transaction(getDashParameters());
        TransactionOutPoint outPoint = new TransactionOutPoint(getDashParameters(), 1, Sha256Hash.wrap("123456"));
        TransactionOutPoint outPoint2 = new TransactionOutPoint(getDashParameters(), 1, Sha256Hash.wrap("12345678"));
        org.dashj.script.ScriptBuilder scriptBuilder = new org.dashj.script.ScriptBuilder();
        scriptBuilder.op(OP_DUP).op(OP_HASH160).data(dashECKey.getPubKeyHash()).op(OP_EQUALVERIFY).op(OP_CHECKSIG);
        Script script = scriptBuilder.build();
        long coin = 10000000;
        transaction1.addOutput(Coin.valueOf(coin), org.dashj.core.Address.fromBase58(getDashParameters(), "XpPQxF147HvauDGPHaU323wRKVE7gQrocZ"));
        transaction1.addSignedInput(outPoint, script, dashECKey);
        transaction1.addSignedInput(outPoint2, script, dashECKey);
        String tx = Utils.HEX.encode(transaction1.bitcoinSerialize());
        System.out.println(tx);

running dashj examples

Hi, I see the native-x11 code in dash-wallet, but I'm wondering if it is possible to run the examples in dashj. Currently it fails because it is looking for the x11 native code. Any tips are much appreciated.

Deserialization failure

Hi did not check deep into it what is wrong, but on livenet some of the dashj (0.15) instances are unable to sync due to the similar errors. Any info regarding this case?

2019-02-27 22:10:38.730 WARN  [NioClientManager] PeerSocketHandler:234 - [111.111.111.111]:9999 - : org.bitcoinj.core.ProtocolException: Error deserializing message 03000600000000000000fd49010100aab00f000100019cfc7ec999e13a421207b26e0d3e0561db4fed681c99773c3100000000000000320000000000000032000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

        at org.bitcoinj.core.BitcoinSerializer.deserializePayload(BitcoinSerializer.java:210) [dashj-core-0.15.jar:]
        at org.bitcoinj.core.BitcoinSerializer.deserialize(BitcoinSerializer.java:171) [dashj-core-0.15.jar:]
        at org.bitcoinj.core.PeerSocketHandler.receiveBytes(PeerSocketHandler.java:155) [dashj-core-0.15.jar:]
        at org.bitcoinj.net.ConnectionHandler.handleKey(ConnectionHandler.java:223) [dashj-core-0.15.jar:]
        at org.bitcoinj.net.NioClientManager.handleKey(NioClientManager.java:86) [dashj-core-0.15.jar:]
        at org.bitcoinj.net.NioClientManager.run(NioClientManager.java:122) [dashj-core-0.15.jar:]
        at com.google.common.util.concurrent.AbstractExecutionThreadService$1$2.run(AbstractExecutionThreadService.java:60) [guava-18.0.jar:]
        at com.google.common.util.concurrent.Callables$3.run(Callables.java:95) [guava-18.0.jar:]
        at org.bitcoinj.utils.ContextPropagatingThreadFactory$1.run(ContextPropagatingThreadFactory.java:49) [dashj-core-0.15.jar:]
        at java.base/java.lang.Thread.run(Thread.java:834) [java.base:]
Caused by: java.lang.NullPointerException
        at org.bitcoinj.core.Transaction.setExtraPayloadObject(Transaction.java:1546) [dashj-core-0.15.jar:]
        at org.bitcoinj.core.Transaction.parse(Transaction.java:644) [dashj-core-0.15.jar:]
        at org.bitcoinj.core.Message.<init>(Message.java:96) [dashj-core-0.15.jar:]
        at org.bitcoinj.core.Message.<init>(Message.java:128) [dashj-core-0.15.jar:]
        at org.bitcoinj.core.ChildMessage.<init>(ChildMessage.java:57) [dashj-core-0.15.jar:]
        at org.bitcoinj.core.Transaction.<init>(Transaction.java:291) [dashj-core-0.15.jar:]
        at org.bitcoinj.core.BitcoinSerializer.makeTransaction(BitcoinSerializer.java:366) [dashj-core-0.15.jar:]
        at org.bitcoinj.core.BitcoinSerializer.makeMessage(BitcoinSerializer.java:232) [dashj-core-0.15.jar:]
        at org.bitcoinj.core.BitcoinSerializer.deserializePayload(BitcoinSerializer.java:208) [dashj-core-0.15.jar:]
        ... 9 more

mvn build error

Error occurred while building mvn.

My CLI command went as follows

git clone https://github.com/dashevo/dashj.git
cd dashj
git submodule update  --init --recursive
mvn clean package

[ERROR] Failed to execute goal com.googlecode.cmake-maven-project:cmake-maven-plugin:3.7.2-b1:generate (cmake-generate) on project dashj-bls: Return code: 1 -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <args> -rf :dashj-bls
mvn clean package -Pno-build-bls -DskipTests

[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for dashj Parent 0.18-SNAPSHOT:
[INFO]
[INFO] dashj Parent ....................................... SUCCESS [  0.423 s]
[INFO] dashj-bls .......................................... FAILURE [ 19.165 s]
[INFO] dashj .............................................. SKIPPED
[INFO] dashj Examples ..................................... SKIPPED
[INFO] dashj Tools ........................................ SKIPPED
[INFO] dashj Wallet-Template .............................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  19.765 s
[INFO] Finished at: 2020-12-07T14:44:10+09:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:3.0.0:jar (attach-javadocs) on project dashj-bls: MavenReportException: Error while generating Javadoc:
[ERROR] Exit code: 1 - javadoc: error - Error fetching URL: http://docs.guava-libraries.googlecode.com/git-history/release/javadoc/
[ERROR] javadoc: error - The code being documented uses modules but the packages defined in https://docs.oracle.com/javase/8/docs/api/ are in the unnamed module.
[ERROR]
[ERROR] Command line was: "C:\Program Files\Java\jdk-11.0.6\bin\javadoc.exe" @options @packages
[ERROR]
[ERROR] Refer to the generated Javadoc files in 'C:\Users\B-USER\Desktop\dash2\dashj\bls\target\apidocs' dir.
[ERROR]
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <args> -rf :dashj-bls

Is there any solution?

Android: couldn't find "libdashjbls.so"

Hi.
I try to generate BLS key on android device, but I always get the error when I trying to create bytes for BLSSecretKey:
val bytes = ByteArray(BLSSecretKey.BLS_CURVE_SECKEY_SIZE)
I used next step to init dashj:
git submodule update --init --recursive
mvn clean package -DskipTests
mvn clean install

and I got :

java.lang.RuntimeException: dalvik.system.PathClassLoader[DexPathList[[ zip file "/data/app/some_package-1/base.apk", zip file "/data/app/some_package-1/split_lib_dependencies_apk.apk", zip file "/data/app/some_package-1/split_lib_slice_0_apk.apk", zip file "/data/app/some_package-1/split_lib_slice_1_apk.apk", zip file "/data/app/some_package-1/split_lib_slice_2_apk.apk", zip file "/data/app/some_package-1/split_lib_slice_3_apk.apk", zip file "/data/app/some_package-1/split_lib_slice_4_apk.apk", zip file "/data/app/some_package-1/split_lib_slice_5_apk.apk", zip file "/data/app/some_package-1/split_lib_slice_6_apk.apk", zip file "/data/app/some_package-1/split_lib_slice_7_apk.apk", zip file "/data/app/some_package-1/split_lib_slice_8_apk.apk", zip file "/data/app/some_package-1/split_lib_slice_9_apk.apk"], nativeLibraryDirectories=[/data/app/some_package-1/lib/arm64, /system/lib64, /vendor/lib64]]] couldn't find "libdashjbls.so" at org.bitcoinj.crypto.BLSAbstractObject.<clinit>(BLSAbstractObject.java:21)

mvn compile error

I run mvn compile and find this error
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.googlecode.cmake-maven-project:cmake-maven-plugin:3.7.2-b1:generate (cmake-generate) on project dashj-bls: Return code: 1
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
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 org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException: Return code: 1
at com.googlecode.cmakemavenproject.GenerateMojo.execute (GenerateMojo.java:214)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
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 org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
who can help me ,greate thanks

dashj-core

<dependency>
<groupId>org.dashj</groupId>
<artifactId>dashj-core</artifactId>
<version>${project.parent.version}</version>
</dependency>

Saw this piece of code in pom.xml, but seems like there is no such artifact in maven repo ??

Version code of address did not match acceptable versions for network

        NetworkParameters params = MainNetParams.get();

        WalletAppKit kit = new WalletAppKit(params, new File("."), "test");

        kit.startAsync();
        kit.awaitRunning();
        System.out.println(kit.wallet().toString());
        
        Coin value = Coin.parseCoin("1");

        Address to = Address.fromBase58(params, "to_address");
        System.out.println("Wallet information : " + kit.wallet().toString());

I was trying this code to load wallet from file and sending some coin on MainNet, but somehow it throws this error :

Exception in thread "main" org.bitcoinj.core.WrongNetworkException: Version code of address did not match acceptable versions for network: 140 not in [76, 16]
	at org.bitcoinj.core.Address.<init>(Address.java:113)
	at org.bitcoinj.core.Address.fromBase58(Address.java:93)
	at org.bitcoinj.examples.Main.main(Main.java:39)

Seems like the initiation of Address for variable to is having error inside, any advice for this one ? (I tried same piece of code on TestNet3params and its working)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.