dashpay / platform

L2 solution for seriously fast decentralized applications for the Dash network
https://dashplatform.readme.io/docs/introduction-what-is-dash-platform
MIT License
67 stars 39 forks source link

Wallet is disabled in seed node in local preset setup #87

Closed Arne96R closed 1 year ago

Arne96R commented 2 years ago

When setting up a network of masternodes with the local preset, the wallet is not accessible on the seed node. Trying to access wallet RPCs gives a 'Method not found' error (code -32601).

Expected Behavior

Wallet should be accessible on the seed node.

Current Behavior

Calling wallet RPC's returns error.

Possible Solution

As discussed in dc, this is caused by the way the nodes are started with docker-compose: https://github.com/dashevo/dashmate/blob/v0.22-dev/docker-compose.yml#L15

A fix that would work is to change the command in the docker-compose file. Instead of starting dashd directly, change the command to a bash script with a conditional clause, if the current node is a masternode (CORE_MASTERNODE_ENABLE=true) then start it with the -masternodeblsprivkey flag, and otherwise start it without any flags.

Something like: command: bash -c "if [[ $CORE_MASTERNODE_ENABLE = true ]]; then dashd -masternodeblsprivkey=$CORE_MASTERNODE_OPERATOR_PRIVATE_KEY; else dashd; fi

Steps to Reproduce (for bugs)

  1. Setup local dash network with dashmate setup local
  2. Try to create a wallet (or use any other wallet rpc) on the seed node in the created network

Context

It is impossible to make transactions in the local Dash network without access to wallets. Making transactions is desirable functionality for local testing.

Your Environment

pshenmic commented 2 years ago

https://github.com/dashevo/platform/pull/86