Skip to content

Fix and document mint command #485

Closed

Description

@pshenmic

Expected Behavior

Command should be documented and dashmate wallet:mint 10 should add 10 DASH to the account

Current Behavior

On the fresh setup, after dashmate setup with local configuration, mint command does not see default local configuration, so the command dashmate wallet:mint 10 results in error:

Error: Only local network supports generation of dash

If you pass --config=local manually, then the core service fails to read spork address and crashes immediately

 % yarn dashmate wallet:mint 10 --config=local --verbose 
[STARTED] Generate 10 dash to address
[STARTED] Start Core
[FAILED] Could not connect to Core RPC
[FAILED] Could not connect to Core RPC

The log of core is:

2022-08-16T16:07:36Z Dash Core version v18.0.0-5d32741d4 (release build)
2022-08-16T16:07:36Z InitParameterInteraction: parameter interaction: -externalip set -> setting -discover=0
2022-08-16T16:07:36Z InitParameterInteraction: parameter interaction: additional indexes -> setting -checklevel=4
2022-08-16T16:07:36Z Validating signatures for all blocks.
2022-08-16T16:07:36Z Setting nMinimumChainWork=0000000000000000000000000000000000000000000000000000000000000000
2022-08-16T16:07:36Z fDisableGovernance 0
2022-08-16T16:07:36Z Using the 'arm_shani(1way,2way)' SHA256 implementation
2022-08-16T16:07:36Z Default data directory /dash/.dashcore
2022-08-16T16:07:36Z Using data directory /dash/.dashcore/regtest
2022-08-16T16:07:36Z Config file: /dash/.dashcore/dash.conf
2022-08-16T16:07:36Z Using at most 256 automatic connections (1048576 file descriptors available)
2022-08-16T16:07:36Z Using 16 MiB out of 32/2 requested for signature cache, able to store 524288 elements
2022-08-16T16:07:36Z Using 16 MiB out of 32/2 requested for script execution cache, able to store 524288 elements
2022-08-16T16:07:36Z Script verification uses 4 additional threads
Error: Invalid spork address specified with -sporkaddr
2022-08-16T16:07:36Z CSporkManager::SetSporkAddress -- Failed to parse spork address
2022-08-16T16:07:36Z Error: Invalid spork address specified with -sporkaddr
2022-08-16T16:07:36Z PrepareShutdown: In progress...
2022-08-16T16:07:36Z Shutdown: done

Possible Solution

If we look into created dashmate configuration file, we can see that spork parameters are null:

"spork": {
          "address": null,
          "privateKey": null
        }

Need to find out why they are nulled and fix command to pass proper command line parameters to the Core

Steps to Reproduce (for bugs)

  1. dashmate setup local
  2. dashmate wallet:mint 10
  3. dashmate wallet:mint 10 --config=local

Context

Your Environment

  • Version used: dashmate 0.22.13
  • Environment name and version (e.g. Chrome 39, node.js 5.4): Node v16.14.2
  • Operating System and version (desktop, server, or mobile): Apple M1 arm64

Activity

  1. added
    bug
    on Aug 16, 2022
  2. added this to the v0.24.0 milestone on Mar 15, 2023
  3. pshenmic commented on Mar 15, 2023

    @pshenmic
    ContributorAuthor

    The original error with Could not connect to core RPC is gone, but invoking it without --config=local will result an error. Maybe we should consider just moving wallet mint comand inside the group folder?

  4. shumkov commented on Apr 19, 2023

    @shumkov
    Collaborator

    Actually, the right option here is --config=local_seed if you use it for the local network. This command doesn't support config groups so It behaves as expected.

  5. modified the milestones: v0.24.0, v0.25.0 on May 10, 2023
  6. pshenmic commented on Jun 25, 2023

    @pshenmic
    ContributorAuthor

    I agree, but it does not support regular nodes either, because this command does not make sense for mainnet, testnet, and devnet nodes. It is only supported for regtest nodes I believe

  7. shumkov commented on Sep 26, 2024

    @shumkov
    Collaborator

    @pshenmic What do you recommend? Add a check that the specified config has network == local? I wouldn't say I like the idea to hardcode config name there because a user can manually create any configuration for local network and name configs differently.

  8. shumkov commented on Sep 26, 2024

    @shumkov
    Collaborator

    Let's update documentation at least :)

  9. added a commit that references this issue on Sep 26, 2024
    df67dcf
  10. removed this from the v0.25.0 milestone on Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions