Giter Club home page Giter Club logo

Comments (13)

xeniacx avatar xeniacx commented on May 27, 2024

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.

barratt avatar barratt commented on May 27, 2024

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.

barratt avatar barratt commented on May 27, 2024

So I fixed my problem #16

from bitcoinlib.

xeniacx avatar xeniacx commented on May 27, 2024

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.

barratt avatar barratt commented on May 27, 2024

Alrighty, thanks for the update!

from bitcoinlib.

Affinity121 avatar Affinity121 commented on May 27, 2024

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.

Affinity121 avatar Affinity121 commented on May 27, 2024

I forced to edit IgnoreConfigValues property directly in your code.

from bitcoinlib.

xeniacx avatar xeniacx commented on May 27, 2024

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.

Affinity121 avatar Affinity121 commented on May 27, 2024

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.

xeniacx avatar xeniacx commented on May 27, 2024

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.

r00tn avatar r00tn commented on May 27, 2024

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.

HellsChicken avatar HellsChicken commented on May 27, 2024

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.

surchello avatar surchello commented on May 27, 2024

it's funny that it will work if you build the solution using debug configuration instead of release.

from bitcoinlib.

Related Issues (20)

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.