Comments (13)
@jjos2372 is your fork still up to date?
When I want to use a wallet for the dogecoin blockchain, what parts of bitcoinj I need to use and want are the parts of libdohj?
Is it enought to useNetworkParameters params = DogecoinMainNetParams.get();and use this params for the wallet and the webkitapi of bitcoinj ?
@Tockra I've been using https://github.com/jjos2372/altcoinj since I published it with no problem, as you said:
NetworkParameters params = DogecoinMainNetParams.get();
Is enough as long as you have the dependencies:
repositories {
maven { url 'https://jitpack.io' }
}
dependencies {
compile 'com.github.jjos2372:altcoinj:f26e20bb13'
compile 'org.bitcoinj:bitcoinj-core:0.15.6'
}
In addition I also have support for LTC on it.
from libdohj.
Attn: @JeremyRand
from libdohj.
I just made this fork compatible with bitcoinj 0.15 https://github.com/jjos2372/altcoinj
from libdohj.
@jjos2372 is your fork still up to date?
When I want to use a wallet for the dogecoin blockchain, what parts of bitcoinj I need to use and want are the parts of libdohj?
Is it enought to use
NetworkParameters params = DogecoinMainNetParams.get();
and use this params for the wallet and the webkitapi of bitcoinj ?
from libdohj.
Okay, I hope I did it right.
So I can fully ignore everything else from altcoinj instead of DogecoinMainNetParams.get();
.
That sounds easy.
Maybe you can help me further.
I read in a bitcoinj tutorial, that I need to save the wallet multiple times in a file. I don't understand why.
I just want to have a wallet, where I can get the balance and I want to create fresh addresses to which multiple transactions can be sent. Sometimes I want to send balance from that wallet to a other.
When and why I need to write a new version of the wallet to a file?
And what happens if I make wallet transactions (getBalance, sendCoin, ...) before the blockchain is fully synced?
from libdohj.
You would be actually using all bitcoinj infrastructure, so check their docs. I particularly create a kit:
kit = new WalletAppKit(params, ...)
And them sync the chain before using it:
kit.startAsync();
kit.awaitRunning();
You probably should start with DogecoinTestNet3Params.get()
first.
from libdohj.
Okay thank you. I will look ^^.
I hope my questions will be answered here : bitcoinj/bitcoinj#2020
from libdohj.
Following code causes into this exception:
[00:25:51 WARN]: [org.bitcoinj.net.ConnectionHandler] Error handling SelectionKey: java.nio.channels.CancelledKeyException
app | java.nio.channels.CancelledKeyException: null
app | at sun.nio.ch.SelectionKeyImpl.ensureValid(SelectionKeyImpl.java:74) ~[?:?]
app | at sun.nio.ch.SelectionKeyImpl.readyOps(SelectionKeyImpl.java:133) ~[?:?]
app | at java.nio.channels.SelectionKey.isWritable(SelectionKey.java:378) ~[?:?]
app | at org.bitcoinj.net.ConnectionHandler.handleKey(ConnectionHandler.java:244) ~[?:?]
app | at org.bitcoinj.net.NioClientManager.handleKey(NioClientManager.java:86) ~[?:?]
app | at org.bitcoinj.net.NioClientManager.run(NioClientManager.java:122) ~[?:?]
app | at com.google.common.util.concurrent.AbstractExecutionThreadService$1$2.run(AbstractExecutionThreadService.java:66) ~[patched_1.16.1.jar:git-Paper-"0b33230f2"]
app | at com.google.common.util.concurrent.Callables$4.run(Callables.java:122) ~[patched_1.16.1.jar:git-Paper-"0b33230f2"]
app | at org.bitcoinj.utils.ContextPropagatingThreadFactory$1.run(ContextPropagatingThreadFactory.java:51) ~[?:?]
app | at java.lang.Thread.run(Thread.java:832) [?:?]
NetworkParameters params = DogecoinMainNetParams.get();
this.walletKit = new WalletAppKit(params,new File(config.getWalletPath()),"wallet.dat");
this.walletKit.setBlockingStartup(true);
this.walletKit.startAsync();
this.walletKit.awaitRunning();
from libdohj.
I use something like this for an existing wallet folder (previously created with bitcoinj randomly, using a seed, etc.):
kit = new WalletAppKit(params, folderFile, filePrefix) {
@Override
protected void onSetupCompleted() {
log.info("kit setup complete");
}
};
// Download the block chain and wait until it's done.
kit.startAsync();
kit.awaitRunning();
Recall that filePrefix
is the wallet file name without the .wallet
, not sure where are you getting this .dat
file.
from libdohj.
I copied it somewhere.
But I still get the java.nio.channels.CancelledKeyException at application start. That isn't cool. Because they spam my console...
from libdohj.
So I did a unsafe workaround. I just filter all Exceptions out of my log, which happens without valid reason:
log4j2.xml:
...
<Loggers>
<Root level="info">
<filters>
<MarkerFilter marker="NETWORK_PACKETS" onMatch="DENY" onMismatch="NEUTRAL" />
<RegexFilter regex=".*java.nio.channels.CancelledKeyException.*" onMatch="DENY" onMismatch="NEUTRAL"/>
<RegexFilter regex=".*Error\swriting\smessage\sto\sconnection,\sclosing\sconnection.*" onMatch="DENY" onMismatch="NEUTRAL"/>
<RegexFilter regex=".*java.net.SocketException.*" onMatch="DENY" onMismatch="NEUTRAL"/>
<RegexFilter regex=".*java.net.ConnectException.*" onMatch="DENY" onMismatch="NEUTRAL"/>
<RegexFilter regex=".*SelectionKey.*java.lang.IllegalStateException.*" onMatch="DENY" onMismatch="NEUTRAL"/>
<RegexFilter regex=".*Received\sRejectMessage\sbefore\sversion\shandshake\sis\scomplete.*" onMatch="DENY" onMismatch="NEUTRAL"/>
<RegexFilter regex=".*java.net.NoRouteToHostException.*Host\sis\sunreachable.*" onMatch="DENY" onMismatch="NEUTRAL"/>
</filters>
</Root>
</Loggers>
from libdohj.
I've finally had some free time, reviews of #44 would be appreciated
from libdohj.
Oops this was merged a while ago, closing now.
from libdohj.
Related Issues (20)
- Libdohj cuts off the high version bits, this is needed for latest LTC due to BIP91 usage
- Maven artifact? HOT 2
- Examples use dogecoinj
- StoredBlock.serializeCompact() trims AuxPoW HOT 4
- How did you get the hash of Nintondo as 04ffff001d0104084e696e746f6e646f? HOT 1
- Send not working HOT 3
- loadFromFile not working HOT 1
- Example without using parents
- Receiving Coins fails HOT 1
- Problems while sending coins HOT 1
- How to use this lib to create an address like "9rbtVJXpPFGkf9gas71aZoZoTpZT625DGX" HOT 1
- Can not download blockchain
- How to create a mainnet address
- We need Java Library for our coin
- Unable to run node HOT 1
- Could not resolve the dependency HOT 3
- add support for P2SH and bech32 for Litecoin
- K
- doge-core plus dohj
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libdohj.