Comments (13)
The required parameters are already defined in the sample .config file but since you don't use one they are not available at runtime. This library is configured to look for these parameters in the .config file (as you can see here: https://github.com/GeorgeKimionis/BitcoinLib/blob/master/CoinWrapper/CoinParameters/Base/CoinParameters.cs#L24) so they can be configured at runtime only after the library has found them in the .config file. Please not that these are general-purpose parameters and not coin-specific.
The recommended way to resolve this is to use a .config file.
The quick 'n' dirty way (not recommended) is to replace the value assignments with your own values inside the private CoinParameters parameterless constructor: https://github.com/GeorgeKimionis/BitcoinLib/blob/master/CoinWrapper/CoinParameters/Base/CoinParameters.cs#L24
I would also suggest you go for a complete configuration for Dogecoin, taking the Bitcoin configuration as an example: https://github.com/GeorgeKimionis/BitcoinLib/blob/master/CoinWrapper/CoinParameters/Base/CoinParameters.cs#L39. Once you have Dogecoin's values in hand we can also add built-in support for Dogecoin in the same way we currently do for Bitcoin and Litecoin.
from bitcoinlib.
I see! Thank you, I'd be happy to help once I wrap my head around some of your code. I don't suppose you know where I could find the config values for Dogecoin? Is there some sort of command I can plug into dogecoind or something? (Its essentially just a Litecoin clone so Litecoin commands should work and I presume the configs will be near enough the same.) I know I don't -need- them but I'd like to include them if possible
from bitcoinlib.
So I fixed my problem #16
from bitcoinlib.
This is now resolved with the use of the IgnoreConfigValues
parameter which must be set true
upon initialization and then the 6 shared RPC config values as well as the config values for each coin (Bitcoin, Litecoin, etc) have to be defined at run-time.
from bitcoinlib.
Alrighty, thanks for the update!
from bitcoinlib.
Do not quite understand how IgnoreConfigValues
works. I am unable to set it before new BitcoinService
, because it is part of BitcoinService
object, but new BitcoinService
throws the exception if IgnoreConfigValues
is not set. Vicious circle.
from bitcoinlib.
I forced to edit IgnoreConfigValues
property directly in your code.
from bitcoinlib.
Here is some sample code for IgnoreConfigValues
. To test it go to the demo app's app.config
and remove all config values under the Bitcoin settings
section, then add this to Main()
and run it:
ICoinService CoinService = new BitcoinService(useTestnet:true);
CoinService.Parameters.IgnoreConfigValues = true;
CoinService.Parameters.DaemonUrl = "http://localhost:8332";
CoinService.Parameters.DaemonUrlTestnet = "http://localhost:18332";
CoinService.Parameters.WalletPassword = "MyWalletPassword";
CoinService.Parameters.RpcUsername = "MyRpcUsername";
CoinService.Parameters.RpcPassword = "MyRpcPassword";
from bitcoinlib.
Let's assume I do not have app.config
file. First I do IBitcoinService bitcoinService = new BitcoinService(.........)
. As I see internally it calls CoinService(.....)
. Then CoinService(.....)
calls parameterless CoinService()
. Then parameterless CoinService()
calls new CoinParameters(this)
and finally CoinParameters(....)
tries to read from AppSettings
and crashes. Am I correct?
from bitcoinlib.
Nice catch. With the latest commit you can choose to ignore the .config
files by invoking the coin service like this:
ICoinService CoinService = new BitcoinService("http://localhost:18332", "MyRpcUsername", "MyRpcPassword", "MyWalletPassword", 60);
.
This: ICoinService CoinService = new BitcoinService(useTestnet:true);
will still use the .config
facility.
from bitcoinlib.
Hey, still got the issue.
It tells, that i am missing parameters, but i am using the example appSettings section.
Also when i try to create a new BitcoinService instance with entering the parameters on the concstructor it fails with same message.
Got the package from NuGet.
from bitcoinlib.
Same issue as r00tn. I can't construct using the example from the 27th because it tells me that no constructor takes 5 parameters. Even if I use the example .config file, I still get this error.
from bitcoinlib.
it's funny that it will work if you build the solution using debug configuration instead of release.
from bitcoinlib.
Related Issues (20)
- Add createwallet HOT 1
- It produces errors with bitcoin core 0.17.1 HOT 4
- Add documentation comments to methods showing which units are returned HOT 1
- GetBlockResponse does not contain weight
- bitcoinlib support .net core? HOT 1
- NetworkHashPS exceeds Int64.Max resulting in overflow HOT 1
- GetRawMemPool(true) throws exception HOT 4
- Is this repo still maintained? HOT 6
- GetBlockTemplate no longer works HOT 4
- Add support for secure (.cookie) auth
- IsWalletEncrypted returns false positive
- Getting - Dummy value must be set to "" - after some of the method calls HOT 6
- Various 'Wallet' RPC Calls Require URL with '/wallet/<wallet-name>' appended HOT 1
- DecodeRawTransaction does not populate addresses
- GetAccount method returns empty string HOT 2
- ListSinceBlock passing wrong parameter by default HOT 4
- How to create transactions that carry messages in OP_RETURN HOT 2
- Getblocktemplate does not provide txid, only hash HOT 3
- No support for new label system HOT 4
- Exception while DumpWallet method HOT 2
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 bitcoinlib.