Code Monkey home page Code Monkey logo

dashpay / platform Goto Github PK

View Code? Open in Web Editor NEW
39.0 17.0 30.0 568.35 MB

L2 solution for seriously fast decentralized applications for the Dash network

Home Page: https://dashplatform.readme.io/docs/introduction-what-is-dash-platform

License: MIT License

Shell 0.21% JavaScript 45.65% Java 0.80% Objective-C 0.37% Python 0.26% Dockerfile 0.10% Batchfile 0.01% HTML 0.03% TypeScript 0.94% Prolog 0.01% Rust 51.21% C 0.42%
blockchain dapp dapps decentralization dash cryptocurrency crypto p2p

platform's Introduction

:

babel

Seriously fast decentralized applications for the Dash network

GitHub CI Status Devs Chat General Chat Follow on Twitter

Dash Platform is a technology stack for building decentralized applications on the Dash network. The two main architectural components, Drive and DAPI, turn the Dash P2P network into a cloud that developers can integrate with their applications.

If you are looking for how to contribute to the project or need any help with building an app on the Dash Platform - message us on the Devs Discord!

Note: Dash Platform is currently available on the Dash Testnet only

Intro

This is a multi-package repository - sometimes also known as monorepository - that contains all packages that comprise the Dash platform - for example, Drive, which is the storage component of Dash Platform, the JavaScript SDK, wallet-lib, DAPI, and others. Every individual package contains its own readme. Packages are located in the packages directory.

Supported networks

Dash Platform is currently undergoing testing and final development necessary to support its release on the Dash production network (mainnet). The packages in this repository may be used on the following networks:

FAQ

How to build and set up a node from the code in this repo?

  • Clone the repo
  • Install prerequisites:
    • node.js v20
    • docker v20.10+
    • rust v1.73+, with wasm32 target (rustup target add wasm32-unknown-unknown)
    • protoc - protobuf compiler v25.2+
      • if needed, set PROTOC environment variable to location of protoc binary
    • wasm-bingen toolchain:
      • IMPORTANT (OSX only): built-in llvm on OSX does not work, needs to be installed from brew:
        • brew install llvm
        • LLVM installed from brew is keg only, and path to it must be provided in the profile file, in terminal run echo 'export PATH="/opt/homebrew/opt/llvm/bin:$PATH"' >> ~/.zshrc or echo 'export PATH="/opt/homebrew/opt/llvm/bin:$PATH"' >> ~/.bash_profile depending on your default shell. You can find your default shell with echo $SHELL
        • Reload your shell with source ~/.zshrc or source ~/.bash_profile
      • cargo install [email protected]
        • double-check that wasm-bindgen-cli version above matches wasm-bindgen version in Cargo.lock file
        • Depending on system, additional packages may need to be installed as a prerequisite for wasm-bindgen-cli. If anything is missing, installation will error and prompt what packages are missing (i.e. clang, llvm, libssl-dev)
    • essential build tools - example for Debian/Ubuntu: apt install -y build-essential libssl-dev pkg-config clang
  • Run corepack enable to enable corepack and install yarn
  • Run yarn setup to install dependencies and configure and build all packages
  • Run yarn start to start the local dev environment built from the sources
  • Run yarn test to run the whole test suite (note that running tests requires a running node, so be sure to call yarn start first). Alternatively, you can run tests for a specific package by running yarn workspace <package_name> test, for example running yarn workspace @dashevo/dapi-client test will run tests for the JS DAPI client. To see all available packages, please see the packages readme
  • yarn stop will stop the local dev environment. Running a dev environment requires a non-trivial amount of system resources, so it is best to stop the local node when not in use
  • Run yarn build to rebuild the project after changes. If you have a local node running, you may need to restart it by running yarn restart
  • To completely reset all local data and builds, run yarn reset

Looking for support?

For questions and support, please join our Devs Discord

Where are the docs?

Our docs are hosted on readme.io. You can create issues and feature requests in the issues for this repository.

Want to report a bug or request a feature?

Please read through our CONTRIBUTING.md and fill out the issue template at platform/issues!

Want to contribute to Dash Platform?

Check out:

License

MIT

platform's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

platform's Issues

Fedora support

mn-bootstrap needs to be tested on non-Ubuntu platforms. Let's test CentOS/Fedora/Redhat first.

Expected Behavior

Current Behavior

Possible Solution

Alternatives Considered

Additional Context

Travis builds fail for PRs from forks of the repository

Since dashevo/js-dash-sdk#74 (I think), Travis is unable to run successfully for PRs from external repos.

Expected Behavior

PRs should build successfully regardless of source repository.

Current Behavior

If a PR is opened from a fork of this repository, Travis builds fail.

Possible Solution

๐Ÿคท ๐Ÿ™‚

Steps to Reproduce (for bugs)

  1. Open PR from a forked version of this repository

Context

Can't merge PR because I opened it from my fork of the repo

Your Environment

N/A

Add remove command

Add feature 'dashmate remove' to completely remove/uninstall the node. On top of my head that would be the .dashmate directory, docker containers and docker volumes. Perhaps more?

query operator 'in' throws "Identifier expects Buffer"

Using an array of buffer identity Ids:

ownerIds :>>  (5)ย [Uint8Array(32), Uint8Array(32), Uint8Array(32), Uint8Array(32), Uint8Array(32)]

And a query using the in operator according to https://dashplatform.readme.io/docs/reference-query-syntax#operator-examples

        {
          where: [["$ownerId", "in", ownerIds]],
        }

throws:

Uncaught (in promise) IdentifierError: Identifier expects Buffer
    at new Identifier (webpack-internal:///./node_modules/@dashevo/dpp/lib/identifier/Identifier.js:18:11)
    at Function.from (webpack-internal:///./node_modules/@dashevo/dpp/lib/identifier/Identifier.js:106:10)
    at convertIdentifierProperties (webpack-internal:///./node_modules/dash/build/src/SDK/Client/Platform/methods/documents/get.js:93:55)
    at eval (webpack-internal:///./node_modules/dash/build/src/SDK/Client/Platform/methods/documents/get.js:130:88)
    at Array.map (<anonymous>)
    at Platform.eval (webpack-internal:///./node_modules/dash/build/src/SDK/Client/Platform/methods/documents/get.js:130:49)
    at step (webpack-internal:///./node_modules/dash/build/src/SDK/Client/Platform/methods/documents/get.js:33:23)
    at Object.eval [as next] (webpack-internal:///./node_modules/dash/build/src/SDK/Client/Platform/methods/documents/get.js:14:53)
    at fulfilled (webpack-internal:///./node_modules/dash/build/src/SDK/Client/Platform/methods/documents/get.js:5:58)
IdentifierError @ IdentifierError.js?93a2:12
Identifier @ Identifier.js?3e2b:18
from @ Identifier.js?3e2b:106
convertIdentifierProperties @ get.js?ae15:93

Same happens for an Array of String identityIds.

Need 'unsafe-eval' content_security_policy in WebExtension API

Expected Behavior

DashJS loading with the default content_security_policy configured in WebExtension Manifest (Chrome,Firefox Extension)

Current Behavior

Need to set 'unsafe-eval' content_security_policy (which is not allowed if u want to submit the app to the official Chrome/Firefox-Extension-Store)

Context

Here is the description what might be the cause if u need to set 'unsafe-eval': https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Content_Security_Policy#eval%28%29_and_friends

Steps to Reproduce & logs

In Chrome-Wallet i need to set it, else dash.min.js wont load: https://github.com/readme55/Dash-Chrome-Wallet/blob/master/app/manifest.json

Standard Codespaces dev container config

Expected Behavior

It seems like Codespaces could be quite helpful at times. We may want to consider adding a config so people new to the project could easily get running/contribute.

From: https://docs.github.com/en/codespaces/customizing-your-codespace/configuring-codespaces-for-your-project

If you want all users of your project to have a consistent environment that is tailored to your project, you can add a dev container to your repository. You can use a predefined configuration to select a common configuration for various project types with the option to further customize your project or you can create your own custom configuration. For more information, see "Using a predefined container configuration" and "Creating a custom codespace configuration." The option you choose is dependent on the tools, runtimes, dependencies, and workflows that a user might need to be successful with your project.

Current Behavior

N/A

Possible Solution

N/A

Alternatives Considered

N/A

Additional Context

Error: Merkle root from the diff doesn't match calculated merkle root after diff is applied

During registering contracts encountered error:

Error: Merkle root from the diff doesn't match calculated merkle root after diff is applied
    at SimplifiedMNList.applyDiff (dashpay-wallet/node_modules/@dashevo/dashcore-lib/lib/deterministicmnlist/SimplifiedMNList.js:85:11)
    at SimplifiedMasternodeListProvider.updateMasternodeList (dashpay-wallet/node_modules/@dashevo/dapi-client/lib/SimplifiedMasternodeListProvider/SimplifiedMasternodeListProvider.js:59:29)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async SimplifiedMasternodeListProvider.getSimplifiedMNList (dashpay-wallet/node_modules/@dashevo/dapi-client/lib/SimplifiedMasternodeListProvider/SimplifiedMasternodeListProvider.js:34:7)
    at async SimplifiedMasternodeListDAPIAddressProvider.getLiveAddress (dashpay-wallet/node_modules/@dashevo/dapi-client/lib/dapiAddressProvider/SimplifiedMasternodeListDAPIAddressProvider.js:21:17)
    at async GrpcTransport.request (dashpay-wallet/node_modules/@dashevo/dapi-client/lib/transport/GrpcTransport/GrpcTransport.js:46:21)
    at async PlatformMethodsFacade.broadcastStateTransition (dashpay-wallet/node_modules/@dashevo/dapi-client/lib/methods/platform/broadcastStateTransition/broadcastStateTransitionFactory.js:33:50)

create Document with $id provided

If a documentDefinition includes an $id field, use it as the document.$id instead of creating new one.

Ideally provide a function to generate a valid $id simply, so the entire document doesn't have to created in a dry-run just to be re-created a second time.

the use case is this

DAPP SIDE:

jam = extension.create(jam)
tag.jamId = jam.id.toString()
mention.jamId = jam.id.toString()

    const documentBatch = {
      create: [jam, tag, mention],
      replace: [],
      delete: [],
    }

extension.broadcastDocumentBatch(documentBatch)

EXTENSION SIDE:

function broadcastDocumentBatch(documentBatch){
// documentBatch is JSON
// recreating the objects with documents.create changes:
// jam.id
// then tag.jamId and mention.jamId point at the wrong jam.id
platform.documents.broadcast(documentBatch)
}

Discussion: https://discord.com/channels/670271785974890526/670540408593448980/848875188366999605

rm drive_json.log: Permission denied

running the temp reset script a second time throws this error:


Remove dashmate configuration...
rm: cannot remove '/home/user/.dashmate/local_1/logs/drive_json.log': Permission denied
rm: cannot remove '/home/user/.dashmate/local_1/logs/drive_pretty.log': Permission denied
/home/user/Development/dashplatform/dashpay-wallet/dashpay-wallet
    ConfigIsNotPresentError: Config with name 'local_seed' is not present
    ConfigIsNotPresentError: Config with name 'local_seed' is not present
    ConfigIsNotPresentError: Config with name 'local_seed' is not present
    ConfigIsNotPresentError: Config with name 'local_seed' is not present
    Error: Default group is not set. Please use `--group` option or set default group
    ConfigIsNotPresentError: Config with name 'local_1' is not present
    ConfigIsNotPresentError: Config with name 'local_1' is not present
    ConfigIsNotPresentError: Config with name 'local_1' is not present
    ConfigIsNotPresentError: Config with name 'local_1' is not present

those .log files are directories and must be deleted with sudo

This can be reproduced by restarting the system while dashmate is still running and then re-running the temp reset script.

feat(dashmate): add version details to update command

Expected Behavior

The dashmate update command should show versions before and after update, so that the action it carried out is clear.

Current Behavior

Dashmate only shows whether the update was successful or not, but not what actual images were updated.

Possible Solution

Some output similar to what we get from npm outdated

Alternatives Considered

Additional Context

Testnet network not working

The testnet network is down. Is there any other network that i could use for development??

Expected Behavior
Testent network connected without error

Current Behavior
(node:9023) UnhandledPromiseRejectionWarning: PluginInjectionError: Failed to perform standard injections with reason: Plugin ChainPlugin of type Standard onStart failed: getaddrinfo ENOTFOUND testnet-seed.darkcoin.qa
at /home/builduser/app/dashjs/node_modules/@dashevo/wallet-lib/src/types/Account/_initializeAccount.js:57:16
at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:9023) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 3)
(node:9023) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Network config file

@dashevo/dapi-client/lib/networkConfigs.js
module.exports = {
evonet: {
seeds: [
'seed-1.evonet.networks.dash.org',
'seed-2.evonet.networks.dash.org',
'seed-3.evonet.networks.dash.org',
'seed-4.evonet.networks.dash.org',
'seed-5.evonet.networks.dash.org',
],
network: 'evonet',
},
local: {
dapiAddresses: ['127.0.0.1'],
network: 'regtest',
},
testnet: {
seeds: [
'test.dnsseed.masternode.io',
'testnet-seed.darkcoin.qa',
'testnet-seed.dashpay.io'
],
network: 'testnet',
},
};

Possible Solution
Steps to Reproduce (for bugs)
client.getWalletAccount()

Context

Your Environment
Nodejs version: v12.20.0
@dashevo/dapi-client: 0.16.0
@dashevo/dashcore-lib: 0.18.16

Using DashJS (which requires grpc) in AWS Lambda function

Expected Behavior

Expected to be able to use DashJS without issue, regardless of platform.

Current Behavior

I got a {"message": "Internal server error"} when my DashJS-using lambda function fired (which was set up to fire upon an http API request, but that's probably irrelevant). The original error on AWS showed:

{
    "errorType": "Error",
    "errorMessage": "Failed to load gRPC binary module because it was not installed for the current system\nExpected directory: node-v64-linux-x64-glibc\nFound: [node-v64-darwin-x64-unknown]\nThis problem can often be fixed by running \"npm rebuild\" on the current system\nOriginal error: Cannot find module '/var/task/node_modules/grpc/src/node/extension_binary/node-v64-linux-x64-glibc/grpc_node.node'",
    "code": "MODULE_NOT_FOUND",
    "stack": [
        "Error: Failed to load gRPC binary module because it was not installed for the current system",
        "Expected directory: node-v64-linux-x64-glibc",
        "Found: [node-v64-darwin-x64-unknown]",
        "This problem can often be fixed by running \"npm rebuild\" on the current system",
        "Original error: Cannot find module '/var/task/node_modules/grpc/src/node/extension_binary/node-v64-linux-x64-glibc/grpc_node.node'",
        "    at Object.<anonymous> (/var/task/node_modules/grpc/src/grpc_extension.js:53:17)",
        "    at Module._compile (internal/modules/cjs/loader.js:778:30)",
        "    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)",
        "    at Module.load (internal/modules/cjs/loader.js:653:32)",
        "    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)",
        "    at Function.Module._load (internal/modules/cjs/loader.js:585:3)",
        "    at Module.require (internal/modules/cjs/loader.js:692:17)",
        "    at require (internal/modules/cjs/helpers.js:25:18)",
        "    at Object.<anonymous> (/var/task/node_modules/grpc/src/client_interceptors.js:144:12)",
        "    at Module._compile (internal/modules/cjs/loader.js:778:30)"
    ]
}

Problem & Solution

DashJS uses grpc under the hood. The problem seems to be that the grpc package you download depends on the platform you run npm install on. If you are developing on MacOS (darwin), the downloaded package will include a directory named node-v64-darwin-x64-unknown. If your function ultimately executes on a different platform than the one you packaged your lambda on there's going to be a problem, because the runtime will look for a folder (e.g. node-v64-linux-x64-glibc for the executing platform (typically Linux).

After debugging this for longer than I'd like to admit I figured out the (or at least one possible) solution:

  1. Add the following to your package.json:
"scripts": {
  "postinstall": "npm rebuild grpc --target_arch=x64 --target_platform=linux --target_libc=glibc"
}

I'm pretty sure this adds a folder to the package (rather than replacing it), so it should work in both your local and remote environments. I found this out by first naively trying other solutions like this and this, where they include a specific --target=x.y.z in that postinstall script above. This would add a path to the "Found: [node-v64-darwin-x64-unknown]" directory array, but still resulted in an error. Simply removing the --target=x.y.z part did the trick because it seems to default to process.version, which should always work.

  1. Run rm -rf ./node_modules/ package-lock.json && npm install on your development machine.

This removes your cached packages and reinstalls them fresh, now including the target environment's grpc version due to the postinstall script.

Recommendation

I'm not sure if there's anything to do to fix this issue other than to know about how to address it (as explained above), but it might be helpful if there's something that can be changed in the packages DashJS requires for grpc so that the issue doesn't arise.

Error logging & unhandled promise rejection

Expected Behavior

Rightly or not, I didn't expect console logs from the production release of DashJS. Instead, I expected all errors to just be thrown, allowing the consumer of the library to choose how to handle them.

Current Behavior

There are 4 instances where DashJS logs console.errors to the consumer. There are also others in DashJS dependancies, such as the 18 instances in wallet-lib.

Issue dashevo/js-dash-sdk#54 occasionally results in a long error like this:

Failed to get dataContract { Error: 14 UNAVAILABLE: failed to connect to all addresses
    at Object.exports.createStatusError (/Users/Rion/code/dash/playground/basic-ts/node_modules/grpc/src/common.js:91:15)
    at Object.onReceiveStatus (/Users/Rion/code/dash/playground/basic-ts/node_modules/grpc/src/client_interceptors.js:1209:28)
    at InterceptingListener._callNext (/Users/Rion/code/dash/playground/basic-ts/node_modules/grpc/src/client_interceptors.js:568:42)
    at InterceptingListener.onReceiveStatus (/Users/Rion/code/dash/playground/basic-ts/node_modules/grpc/src/client_interceptors.js:618:8)
    at InterceptingListener._callNext (/Users/Rion/code/dash/playground/basic-ts/node_modules/grpc/src/client_interceptors.js:574:12)
    at InterceptingListener.onReceiveStatus (/Users/Rion/code/dash/playground/basic-ts/node_modules/grpc/src/client_interceptors.js:618:8)
    at callback (/Users/Rion/code/dash/playground/basic-ts/node_modules/grpc/src/client_interceptors.js:847:24)
  code: 14,
  metadata: Metadata { _internal_repr: {}, flags: 0 },
  details: 'failed to connect to all addresses' }
SDK apps fetching : failed to init { Error: 14 UNAVAILABLE: failed to connect to all addresses
    at Object.exports.createStatusError (/Users/Rion/code/dash/playground/basic-ts/node_modules/grpc/src/common.js:91:15)
    at Object.onReceiveStatus (/Users/Rion/code/dash/playground/basic-ts/node_modules/grpc/src/client_interceptors.js:1209:28)
    at InterceptingListener._callNext (/Users/Rion/code/dash/playground/basic-ts/node_modules/grpc/src/client_interceptors.js:568:42)
    at InterceptingListener.onReceiveStatus (/Users/Rion/code/dash/playground/basic-ts/node_modules/grpc/src/client_interceptors.js:618:8)
    at InterceptingListener._callNext (/Users/Rion/code/dash/playground/basic-ts/node_modules/grpc/src/client_interceptors.js:574:12)
    at InterceptingListener.onReceiveStatus (/Users/Rion/code/dash/playground/basic-ts/node_modules/grpc/src/client_interceptors.js:618:8)
    at callback (/Users/Rion/code/dash/playground/basic-ts/node_modules/grpc/src/client_interceptors.js:847:24)
  code: 14,
  metadata: Metadata { _internal_repr: {}, flags: 0 },
  details: 'failed to connect to all addresses' }
(node:25756) UnhandledPromiseRejectionWarning: Error: 14 UNAVAILABLE: failed to connect to all addresses
    at Object.exports.createStatusError (/Users/Rion/code/dash/playground/basic-ts/node_modules/grpc/src/common.js:91:15)
    at Object.onReceiveStatus (/Users/Rion/code/dash/playground/basic-ts/node_modules/grpc/src/client_interceptors.js:1209:28)
    at InterceptingListener._callNext (/Users/Rion/code/dash/playground/basic-ts/node_modules/grpc/src/client_interceptors.js:568:42)
    at InterceptingListener.onReceiveStatus (/Users/Rion/code/dash/playground/basic-ts/node_modules/grpc/src/client_interceptors.js:618:8)
    at InterceptingListener._callNext (/Users/Rion/code/dash/playground/basic-ts/node_modules/grpc/src/client_interceptors.js:574:12)
    at InterceptingListener.onReceiveStatus (/Users/Rion/code/dash/playground/basic-ts/node_modules/grpc/src/client_interceptors.js:618:8)
    at callback (/Users/Rion/code/dash/playground/basic-ts/node_modules/grpc/src/client_interceptors.js:847:24)
(node:25756) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:25756) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
error: Error fetching UTXO yXZHE87HnZzM9RdE29A9k4ChtNXnxsBH1b,yPywTqhYdTShcVGjdUvZ7oEVrDtLMuvmHd,yZy99o1pA5rLeJUAW8KTn9L7orb4ENUgoD,yhbgMHneshPk9AGkFKNuRXL9LEWzzoyAn7,yZqgZBEQx7LWW86hbrpHRjTsWKGJQMmXmt,yPDnxrjVXZXPXYp93huz8gj54wBvVnj16W,yaacFqcTTjzqfmzhE8TCTjpDfxB1VvrpqZ,ySfb5jSAyJgLaNL59dHmYhYGDcFa22ZMYw,ycHJ3cwn9UqdsqEBmJjU1PvGjX5WfPkVgV,yb97wbMADJ6xNu47dXpn5z9MQsmxxTEcf2,yULX46SvfWs9oVBBiRU8poCya1X55EoUqT,yYRMM4jpwrygyLC53B9XH4EuUPPUoTpy6f,ybVYawJ4XCvA6EDgiSyGkXBq6qN5VSVXvb,yR1qxxgtZFPnsvyjJkdzkZZkNf1BuJKYHu,yiiPLJbLppSf6EixjrcCMd4ZefZcvEfJcb,yahrxZx5aYsyDbypMiAbmPFV43XfoVBfBJ,yXVuuMPbw6snFrTgKbRZipg9UGNYnpKXrK,ybsX3WTYpbTgqbUavsiAd7WLCDSMNxzJib,yZa6ejoJWvr2oUqj4QQfJBKctZxf7aR98t,yfVR4Pwxbp2LUpmJ64A36GGe6Bs5ivfc9m,yMZvb8zaTtWwRqSLHNdXSE9CjhtTTZSpEx,yPer3w7GwWTwVbd2M5gwZbREsrndrjC4ju,yPkZFARXSXU8XPum5o6Mk81dvzvWERd7PF,yMjyCvtAQxxFJVWGTVUknT2umTKWLxoHPt,yPkxnnztuhhYyYT6zXkUmvASKPWXn191vr,yMxRiDUDPqp51D9eTAtSPpCtJrqcB7p5Mg,yNyC1poPe45FTkmtqTARekKkyYDEG8FPZD,ygAPvEiexcD3LrXXUUwUTk6BrDswJDz6JP,yYN7vnouqqiNnWYZJZsvxAcUUGoxYqAh1d,yierSZ7DzRjLyjP8WN5NLoziwCxCUCtV39,yQWUynQhD2PHRWzgUN45rKRdYkNkBhUK38,yWZqHvAJLp77fdApxCpRTn7fz1V8EuMhvn,yMp8yTcVsLGWmfRwwPDyDtdKqwCqQRgrZe,yhArTHM1Zge816QVeq9qTZVEjtT4HaSDGf,yZdgtKRTDVg9B9zzXr4FsET9pTtmC69kDk,yUFZCSEwQdZciXHpLYmc2B3VjmFCv6uYGk,ychK67wjRkoTNaVm7tV4jF3bXAifRfrNVA,yZF2yumqwL1oLK64VyKau1v7d7q54YS2Md,yNuRJoysLAiAp8rueyHX1pf7n6iYriXYec,yLPG4U83w4Ete45EJJwsEe5x6tJeMcoEj8,ySwfbguagCc8vYpsTbEmS6rDf9Yo2jiMKZ,ygwF4LkjBY79YBHUxKpJBuiSd33P6s48bk:{_from}:{_to} - connect ETIMEDOUT 159.89.8.31:3000
(node:25756) UnhandledPromiseRejectionWarning: Error: connect ETIMEDOUT 159.89.8.31:3000
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1113:14)
(node:25756) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 3)
error: Error fetching UTXO yXZHE87HnZzM9RdE29A9k4ChtNXnxsBH1b,yPywTqhYdTShcVGjdUvZ7oEVrDtLMuvmHd,yZy99o1pA5rLeJUAW8KTn9L7orb4ENUgoD,yhbgMHneshPk9AGkFKNuRXL9LEWzzoyAn7,yZqgZBEQx7LWW86hbrpHRjTsWKGJQMmXmt,yPDnxrjVXZXPXYp93huz8gj54wBvVnj16W,yaacFqcTTjzqfmzhE8TCTjpDfxB1VvrpqZ,ySfb5jSAyJgLaNL59dHmYhYGDcFa22ZMYw,ycHJ3cwn9UqdsqEBmJjU1PvGjX5WfPkVgV,yb97wbMADJ6xNu47dXpn5z9MQsmxxTEcf2,yULX46SvfWs9oVBBiRU8poCya1X55EoUqT,yYRMM4jpwrygyLC53B9XH4EuUPPUoTpy6f,ybVYawJ4XCvA6EDgiSyGkXBq6qN5VSVXvb,yR1qxxgtZFPnsvyjJkdzkZZkNf1BuJKYHu,yiiPLJbLppSf6EixjrcCMd4ZefZcvEfJcb,yahrxZx5aYsyDbypMiAbmPFV43XfoVBfBJ,yXVuuMPbw6snFrTgKbRZipg9UGNYnpKXrK,ybsX3WTYpbTgqbUavsiAd7WLCDSMNxzJib,yZa6ejoJWvr2oUqj4QQfJBKctZxf7aR98t,yfVR4Pwxbp2LUpmJ64A36GGe6Bs5ivfc9m,yMZvb8zaTtWwRqSLHNdXSE9CjhtTTZSpEx,yPer3w7GwWTwVbd2M5gwZbREsrndrjC4ju,yPkZFARXSXU8XPum5o6Mk81dvzvWERd7PF,yMjyCvtAQxxFJVWGTVUknT2umTKWLxoHPt,yPkxnnztuhhYyYT6zXkUmvASKPWXn191vr,yMxRiDUDPqp51D9eTAtSPpCtJrqcB7p5Mg,yNyC1poPe45FTkmtqTARekKkyYDEG8FPZD,ygAPvEiexcD3LrXXUUwUTk6BrDswJDz6JP,yYN7vnouqqiNnWYZJZsvxAcUUGoxYqAh1d,yierSZ7DzRjLyjP8WN5NLoziwCxCUCtV39,yQWUynQhD2PHRWzgUN45rKRdYkNkBhUK38,yWZqHvAJLp77fdApxCpRTn7fz1V8EuMhvn,yMp8yTcVsLGWmfRwwPDyDtdKqwCqQRgrZe,yhArTHM1Zge816QVeq9qTZVEjtT4HaSDGf,yZdgtKRTDVg9B9zzXr4FsET9pTtmC69kDk,yUFZCSEwQdZciXHpLYmc2B3VjmFCv6uYGk,ychK67wjRkoTNaVm7tV4jF3bXAifRfrNVA,yZF2yumqwL1oLK64VyKau1v7d7q54YS2Md,yNuRJoysLAiAp8rueyHX1pf7n6iYriXYec,yLPG4U83w4Ete45EJJwsEe5x6tJeMcoEj8,ySwfbguagCc8vYpsTbEmS6rDf9Yo2jiMKZ,ygwF4LkjBY79YBHUxKpJBuiSd33P6s48bk:{_from}:{_to} - connect ETIMEDOUT 159.89.8.31:3000
(node:25756) UnhandledPromiseRejectionWarning: Error: connect ETIMEDOUT 159.89.8.31:3000
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1113:14)
(node:25756) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 5)
(node:25756) UnhandledPromiseRejectionWarning: Error: connect ETIMEDOUT 159.89.8.31:3000
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1113:14)
(node:25756) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 7)
error: Error fetching UTXO yXZHE87HnZzM9RdE29A9k4ChtNXnxsBH1b,yPywTqhYdTShcVGjdUvZ7oEVrDtLMuvmHd,yZy99o1pA5rLeJUAW8KTn9L7orb4ENUgoD,yhbgMHneshPk9AGkFKNuRXL9LEWzzoyAn7,yZqgZBEQx7LWW86hbrpHR...

... (keeps adding "error: Error fetching UTXO"s and uncaught promise rejection warnings)

This is two errors in a row from dash (Failed to get dataContract and SDK apps fetching : failed to init), followed by an error from wallet-lib (error: Error fetching UTXO) that repeats until you send a SIGINT with control+c. Interwoven in the repeated Error fetching UTXO error are a bunch of uncaught promise rejections. I'm not sure, but I think this is being caused by the dash code/process, not my code. - I'm handling/catching errors correctly as far as I know).

The errors above aren't the issue here, that's covered in dashevo/js-dash-sdk#54. I'm just using them for illustration regarding error handling and logging in general. My two specific questions are:

  1. Are there any uncaught errors in dash and/or its dependencies as the errors above might suggest, and
  2. Should we be logging errors in Dash libraries, or would it be better to just throw them for the consumer to catch and handle as they wish?

I'm also wondering if the rationale for logging errors in addition to throwing them might be to see something more than a stack trace full of grpc references, which leaves out relevant detail of where the error(s) originate.

Personally I prefer not to have errors logged in libraries; I'd rather have them thrown for me to catch and handle. The UnhandledPromiseRejectionWarnings made me think there was something wrong with my code for a long time, and I'm wondering if maybe that's not the case after all.

Context & Reproduction

The errors above can be reproduced as described in dashevo/js-dash-sdk#54, but it's better to run the code without any automatic script restarts like --watch or --respawn so that you can see that the process doesn't quit on its own, even though it should.

Error: 3 INVALID_ARGUMENT: invalid transaction: Missing inputs. Code:-25

Expected Behavior

Spend funds from an account with a balance

Current Behavior

Get error as per title

Possible Solution

Investigate generated transaction inputs / script

Steps to Reproduce (for bugs)

const Dash = require('dash');

const clientOpts = {
    network: 'evonet',
    wallet: {
        mnemonic: "wrist ladder salute build walk other scrap stumble true hotel layer treat"
    }
};




async function sendFunds(amount, toAddress) {
    try {

        const client = new Dash.Client(clientOpts);
        const account = await client.wallet.getAccount();
        console.log(`retrieved account`)
        const accBalTotal = account.getTotalBalance();
        const accBalUnconf = account.getUnconfirmedBalance()
        const accBalConf = account.getConfirmedBalance()
        console.log(`Total balance: ${accBalTotal}`)
        console.log(`Unconfirmed balance: ${accBalUnconf}`)
        console.log(`Confirmed balance: ${accBalConf}`)
        const transaction = account.createTransaction({
            recipients: [
                {
                    recipient: toAddress,
                    satoshis: amount
                }
            ]
        });
        const result = await account.broadcastTransaction(transaction);
        console.log('Transaction broadcast!\nTransaction ID:', result);

        return;
    } catch (e) {
        throw e;
    }


}

(async () => {
    await sendFunds(1000000, 'yMAaR92yKhK7hcKbNGNvAwjRQngx2UR8et')
})()
warn: Running on a NodeJS env without any specified adapter. Data will not persist.
retrieved account
Total balance: 56514754820
Unconfirmed balance: 0
Confirmed balance: 56514754820
(node:243071) UnhandledPromiseRejectionWarning: Error: 3 INVALID_ARGUMENT: invalid transaction: Missing inputs. Code:-25
    at Object.exports.createStatusError (/home/nigel/Dev/autofaucet-express/node_modules/grpc/src/common.js:91:15)
    at Object.onReceiveStatus (/home/nigel/Dev/autofaucet-express/node_modules/grpc/src/client_interceptors.js:1209:28)
    at InterceptingListener._callNext (/home/nigel/Dev/autofaucet-express/node_modules/grpc/src/client_interceptors.js:568:42)
    at InterceptingListener.onReceiveStatus (/home/nigel/Dev/autofaucet-express/node_modules/grpc/src/client_interceptors.js:618:8)
    at InterceptingListener._callNext (/home/nigel/Dev/autofaucet-express/node_modules/grpc/src/client_interceptors.js:574:12)
    at InterceptingListener.onReceiveStatus (/home/nigel/Dev/autofaucet-express/node_modules/grpc/src/client_interceptors.js:618:8)
    at callback (/home/nigel/Dev/autofaucet-express/node_modules/grpc/src/client_interceptors.js:847:24)
(node:243071) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:243071) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Your Environment

nodejs 12.16.2
[email protected]

'npm install dash' return file not found error

NPM return a file not found error when executing 'npm install dash'.

Expected Behavior

Install dash.

Current Behavior

It does not install dash and returns a file not found error. (log file attached).

Possible Solution

Steps to Reproduce (for bugs)

  1. enter: 'npm install dash' at the terminal.

Context

Your Environment

  • Version used: WIN10

  • Environment name and version (e.g. Chrome 39, node.js 5.4):

  • Operating System and version (desktop, server, or mobile): Win10
    2021-05-01T16_18_08_551Z-debug.log

  • Link to your project:

Local Tenderdash Image is not used

If a local Tenderdash image is selected, that image is still being tried to be fetched from docker-hub.

Expected Behavior

It should use the local image.

Current Behavior

It pulls/attempts to pull an image from docker-hub.

Possible Solution

Don't pull if image already exists locally.

`CreateTransactionError: Error: utxosList must contain at least 1 utxo`

Current Behavior
This error occurs when attempting to spend funds. It appears the account is undefined. However, the code has also executed correctly, so the problem is intermittent.
The code being executed is here:
https://github.com/dashmachine/autofaucet-express/blob/master/index.js

Your Environment

Evonet 0.16

I am not sure if this is just dashevo/wallet-lib#178 under a different guise??

Error output:

Something went wrong: TypeError: Cannot read property 'getUnusedAddress' of undefined
    at getDrip (/home/nigel/autofaucet-express/index.js:32:33)
    at /home/nigel/autofaucet-express/index.js:83:15
    at Layer.handle [as handle_request] (/home/nigel/autofaucet-express/node_modules/express/lib/router/layer.js:95:5)
    at next (/home/nigel/autofaucet-express/node_modules/express/lib/router/route.js:137:13)
    at Route.dispatch (/home/nigel/autofaucet-express/node_modules/express/lib/router/route.js:112:3)
    at Layer.handle [as handle_request] (/home/nigel/autofaucet-express/node_modules/express/lib/router/layer.js:95:5)
    at /home/nigel/autofaucet-express/node_modules/express/lib/router/index.js:281:22
    at param (/home/nigel/autofaucet-express/node_modules/express/lib/router/index.js:354:14)
    at param (/home/nigel/autofaucet-express/node_modules/express/lib/router/index.js:365:14)
    at Function.process_params (/home/nigel/autofaucet-express/node_modules/express/lib/router/index.js:410:3)

No fee input added if deductFee is set to false and tx amount matches an account utxo

Consider a tx with the option deductFee: false and an amount of e.g. 2e6:

    const transaction = client.account.createTransaction({
      deductFee: false,
      recipients: [
        {
          recipient: "y...",
          satoshis: 2e6,
        },
      ],
    })

If the account has an UTXO with 2e6 the default strategy will select that sole input, apparently unaware of the deductFee: false option. As a result:

{code: 3, message: "invalid transaction: min relay fee not met, 0 < 192 (code 66). Code:-26", metadata: {โ€ฆ}}

is thrown since no additional input is added to cover the fee.

Firewall blocking Tenderdash communication with local setup

Expected Behavior

Setting up a local node (e.g. dashmate setup local --node-count=3) should complete successfully without requiring modifications to the local machine's firewall settings.

Current Behavior

Setup fails on the Register DPNS identity step. Drive logs seem to indicate Tenderdash communication issues.

dashmate verbose output

[STARTED] Initialize SDK
warn: Running on a NodeJS env without any specified adapter. Data will not persist.
warn: Running on a NodeJS env without any specified adapter. Data will not persist.
[DATA] HD private key: tprv8ZgxMBicQKs...
[SUCCESS] Initialize SDK [7s]
[STARTED] Register DPNS identity
[FAILED] State Transition is invalid: InvalidIdentityAssetLockProofSignatureError: Invalid Asset lock proof signature
[FAILED] State Transition is invalid: InvalidIdentityAssetLockProofSignatureError: Invalid Asset lock proof signature
[FAILED] State Transition is invalid: InvalidIdentityAssetLockProofSignatureError: Invalid Asset lock proof signature
[FAILED] State Transition is invalid: InvalidIdentityAssetLockProofSignatureError: Invalid Asset lock proof signature

drive_tenderdash log

E[2021-05-18|20:26:53.087] abci.socketClient failed to connect to tcp://drive_abci:26658.  Retrying after 3s... module=abci-client connection=query err="dial tcp 172.26.0.6:26658: connect: connection refused"
E[2021-05-18|20:26:56.088] abci.socketClient failed to connect to tcp://drive_abci:26658.  Retrying after 3s... module=abci-client connection=query err="dial tcp 172.26.0.6:26658: connect: connection refused"
E[2021-05-18|20:26:59.090] abci.socketClient failed to connect to tcp://drive_abci:26658.  Retrying after 3s... module=abci-client connection=query err="dial tcp 172.26.0.6:26658: connect: connection refused"
E[2021-05-18|20:27:02.092] abci.socketClient failed to connect to tcp://drive_abci:26658.  Retrying after 3s... module=abci-client connection=query err="dial tcp 172.26.0.6:26658: connect: connection refused"
E[2021-05-18|20:27:05.093] abci.socketClient failed to connect to tcp://drive_abci:26658.  Retrying after 3s... module=abci-client connection=query err="dial tcp 172.26.0.6:26658: connect: connection refused"
E[2021-05-18|20:27:08.094] abci.socketClient failed to connect to tcp://drive_abci:26658.  Retrying after 3s... module=abci-client connection=query err="dial tcp 172.26.0.6:26658: connect: connection refused"
E[2021-05-18|20:27:11.095] abci.socketClient failed to connect to tcp://drive_abci:26658.  Retrying after 3s... module=abci-client connection=query err="dial tcp 172.26.0.6:26658: connect: connection refused"
E[2021-05-18|20:27:14.096] abci.socketClient failed to connect to tcp://drive_abci:26658.  Retrying after 3s... module=abci-client connection=query err="dial tcp 172.26.0.6:26658: connect: connection refused"
E[2021-05-18|20:27:17.097] abci.socketClient failed to connect to tcp://drive_abci:26658.  Retrying after 3s... module=abci-client connection=query err="dial tcp 172.26.0.6:26658: connect: connection refused"
E[2021-05-18|20:27:20.099] abci.socketClient failed to connect to tcp://drive_abci:26658.  Retrying after 3s... module=abci-client connection=query err="dial tcp 172.26.0.6:26658: connect: connection refused"
E[2021-05-18|20:27:23.101] abci.socketClient failed to connect to tcp://drive_abci:26658.  Retrying after 3s... module=abci-client connection=query err="dial tcp 172.26.0.6:26658: connect: connection refused"
E[2021-05-18|20:27:26.101] abci.socketClient failed to connect to tcp://drive_abci:26658.  Retrying after 3s... module=abci-client connection=query err="dial tcp 172.26.0.6:26658: connect: connection refused"
E[2021-05-18|20:27:29.102] abci.socketClient failed to connect to tcp://drive_abci:26658.  Retrying after 3s... module=abci-client connection=query err="dial tcp 172.26.0.6:26658: connect: connection refused"
E[2021-05-18|20:27:32.103] abci.socketClient failed to connect to tcp://drive_abci:26658.  Retrying after 3s... module=abci-client connection=query err="dial tcp 172.26.0.6:26658: connect: connection refused"
E[2021-05-18|20:27:35.104] abci.socketClient failed to connect to tcp://drive_abci:26658.  Retrying after 3s... module=abci-client connection=query err="dial tcp 172.26.0.6:26658: connect: connection refused"
E[2021-05-18|20:27:38.105] abci.socketClient failed to connect to tcp://drive_abci:26658.  Retrying after 3s... module=abci-client connection=query err="dial tcp 172.26.0.6:26658: connect: connection refused"
E[2021-05-18|20:27:41.106] abci.socketClient failed to connect to tcp://drive_abci:26658.  Retrying after 3s... module=abci-client connection=query err="dial tcp 172.26.0.6:26658: connect: connection refused"
E[2021-05-18|20:27:44.108] abci.socketClient failed to connect to tcp://drive_abci:26658.  Retrying after 3s... module=abci-client connection=query err="dial tcp 172.26.0.6:26658: connect: connection refused"
E[2021-05-18|20:27:47.109] abci.socketClient failed to connect to tcp://drive_abci:26658.  Retrying after 3s... module=abci-client connection=query err="dial tcp 172.26.0.6:26658: connect: connection refused"
E[2021-05-18|20:27:50.110] abci.socketClient failed to connect to tcp://drive_abci:26658.  Retrying after 3s... module=abci-client connection=query err="dial tcp 172.26.0.6:26658: connect: connection refused"
I[2021-05-18|20:27:53.298] Version info                                 module=main software= block=11 p2p=8
I[2021-05-18|20:27:53.317] Starting Node service                        module=main impl=Node
I[2021-05-18|20:27:53.317] Starting StateSync service                   module=statesync impl=StateSync
I[2021-05-18|20:27:53.324] Started node                                 module=main nodeInfo="{ProtocolVersion:{P2P:8 Block:11 App:0} DefaultNodeID:e1b774005e49244b6765a153f936b06963d13ce9 ListenAddr:127.0.0.1:26656 Network:dash_masternode_local_48 Version: Channels:40202122233038606100 Moniker:f374327a46a5 Other:{TxIndex:on RPCAddress:tcp://0.0.0.0:26657}}"
E[2021-05-18|20:27:54.325] dialing failed (attempts: 1): dial tcp 172.17.0.1:26856: i/o timeout module=pex [email protected]:26856
E[2021-05-18|20:27:54.325] dialing failed (attempts: 1): dial tcp 172.17.0.1:26756: i/o timeout module=pex [email protected]:26756
E[2021-05-18|20:27:57.222] Error dialing peer                           module=p2p err="dial tcp 172.17.0.1:26856: i/o timeout"
E[2021-05-18|20:28:24.326] dialing failed (attempts: 2): dial tcp 172.17.0.1:26856: i/o timeout module=pex [email protected]:26856
E[2021-05-18|20:28:24.326] dialing failed (attempts: 2): dial tcp 172.17.0.1:26756: i/o timeout module=pex [email protected]:26756
E[2021-05-18|20:28:54.325] dialing failed (attempts: 3): dial tcp 172.17.0.1:26856: i/o timeout module=pex [email protected]:26856
E[2021-05-18|20:28:54.325] dialing failed (attempts: 3): dial tcp 172.17.0.1:26756: i/o timeout module=pex [email protected]:26756
E[2021-05-18|20:29:24.326] dialing failed (attempts: 4): dial tcp 172.17.0.1:26756: i/o timeout module=pex [email protected]:26756
E[2021-05-18|20:29:24.326] dialing failed (attempts: 4): dial tcp 172.17.0.1:26856: i/o timeout module=pex [email protected]:26856

Possible Solution

Not a solution, but a workaround. Allowing the following ports in ufw results in setup completing successfully. The first few for the initial steps of configuring the Core nodes, the last ones for Tenderdash. I'm not sure everything works correctly with these exceptions but at least the setup completes.

20101                      ALLOW       Anywhere                  
20201                      ALLOW       Anywhere                  
20301                      ALLOW       Anywhere                  
26656                      ALLOW       Anywhere                  
26756                      ALLOW       Anywhere                  
26856                      ALLOW       Anywhere   

Steps to Reproduce (for bugs)

  1. Run dashmate setup local --node-count=3 on Ubuntu 20.04 with ufw enabled and no exceptions

Context

Your Environment

  • Version used: v19
  • Environment name and version (e.g. Chrome 39, node.js 5.4): Docker 20.10.6, docker-compose 1.29.2
  • Operating System and version: Ubuntu 20.04 Vultr VPS (also the same on Linux Mint 19)
  • Link to your project: N/A

Calling wallet.getAccount() shows the occassional chunk encoding error in the debug console

Expected Behavior

Current Behavior

going through the call stack it seems to be triggered by: client.account = await client.wallet.getAccount({ index: 0 })

the error shown is:

POST http://54.244.203.43:3000/org.dash.platform.dapi.v0.Core/subscribeToTransactionsWithProofs net::ERR_INCOMPLETE_CHUNKED_ENCODING 200 (OK)

proofs

Discussion on discord:
https://discordapp.com/channels/670271785974890526/718217459144065045/758984358366543892

Reset should recreate collateral and protx for local node

Resetting a local node will need to recreate the collateral and protx before the system is usable again. We should recreate this when running reset on local, or alternatively automate something like mn reset && mn setup local.

Expected Behavior

Node should be immediately startable after reset

Current Behavior

Node needs to run through setup local again before becoming startable after reset, and config is different.

Possible Solution

Steps to Reproduce (for bugs)

  1. Spin up local node
  2. mn reset
  3. mn start

Context

Your Environment

  • Version used:
  • Environment name and version (e.g. Chrome 39, node.js 5.4):
  • Operating System and version (desktop, server, or mobile):
  • Link to your project:

add replacement method for removed insight api `getUTXOS` fast balance retrieval of external addresses

After removal of the insight api getUTXO method to retrieve the balance of an external address one must use a centralized insight server or use the low level subscribeToTransactionsWithProofs method which requires tracking the transaction and calculating the UTXOs and is slow.

Consider a user tipping a tweet, they would send some dash to an address associated with the tweet. The address is publicly known and associated with the ownerId. In the UI and for sorting by different metrics, we need to know how many tips were received by this address. A highlevel function to quickly and efficiently retrieve the address balance, or a masternode signed index of a snapshot of the address balance at a certain time are required to provide a usable experience for the users looking, sorting and filtering hundreds to thousands of tweets.

dashjs program not terminating

const connect = async function () {
  try {

    console.log('connected');
  } catch (e) {
    console.error('Something went wrong:', e);
  } finally {
    client.disconnect();
    console.log("disconnected")
  }
}
connect()

the program does not terminate after running (and disconnecting)

Environment: Windows 10, executing node on commandline

Revert config values written into config if command failed

Whenever command that writes values into config fails we end up with a dirty config that prevents subsequent runs of any command. It's then required to run mn config:reset which cleans any settings set manually before. And we have to re-set them again.

Expected Behavior

Current Behavior

Possible Solution

Maybe we can revert values written to a config by a command if it is failed.

Alternatives Considered

Somehow keep custom set values upon mn config:reset, but that would be significantly more complicated to implement.

Additional Context

Does this library support React Native?

I'm trying to create Dash Wallet App with React Native but I'm getting following error

Error: Unable to resolve module fs from /Users/kryptomind/Desktop/Development/RN-Projects/DashWalletMobileApps-KM/node_modules/bls-signatures/blsjs.js: fs could not be found within the project or in these directories:
node_modules

The only thing seems to causing error is "fs" module which is not supported in react-native.

Expected Behavior

It's not working correctly while generating mnemonic.

Current Behavior

Getting following error
Error: Unable to resolve module fs from /Users/kryptomind/Desktop/Development/RN-Projects/DashWalletMobileApps-KM/node_modules/bls-signatures/blsjs.js: fs could not be found within the project or in these directories:
node_modules

Possible Solution

Steps to Reproduce (for bugs)

  1. Create a react-native project ( npx react-native init AwesomeTSProject --template react-native-template-typescript )
  2. Install rn-nodefy in react-native project and hack the Node so you can use node core module ( https://www.npmjs.com/package/rn-nodeify )
  3. npm install dash
  4. Generate Mnemonic using following code
    import Dash from 'dash';
    const client = new Dash.Client({
    network: 'testnet',
    wallet: {
    mnemonic: null,
    },
    });
    const mnemonic = client.wallet?.exportWallet();

Context

I'm not able to use dash sdk since It was the main ingredient to create dash wallet and add functionalities like send/receive and get transactions.

Your Environment

  • Version used: 3.21.2
  • Environment name and version (e.g. Chrome 39, node.js 5.4): Node : v14.18.1, React-Native: 0.66.1
  • Operating System and version (desktop, server, or mobile): Android/IOS

Implement Disk Usage monitoring and take proactive steps to retain maximum functionality

Core is completely separated. The security properties declare that even if platform is completely compromised, it should not affect core. As exposed by recent testnet downtime, one problem is handling excessive disk usage.

Expected Behavior

In the case of excessively high disk usage, non-core / non-critical services are initially turned off, then if disk usage continues to advance, non-core / non-critical services are removed from the machine. This is done to ensure that core always has sufficient disk space to continue operating.

Current Behavior

mn-bootstrap will allow any container to use as much disk space as the machine has available.

Possible Solution

The values given are only examples
Once only 6 GB remain, mn-bootstrap should shutdown all DAPI related services. Once 5 GB remain, mn-boostrap should shutdown all Drive related components. Once only 1.5 GB remain mn-bootstrap should remove all DAPI related containers and their disk space. Once only 1 GB remain mn-bootstrap should remove all Drive related components and their disk space.

Read the Tendermint State-Transition blockheight for each document

Hi,
i would need information about ST block-number for certain documents already written and also current ST blockheight at dapp runtime.

Example Scenario:
User1 updated one of his documents and it doesnt meet the consensus rules I setup for the dapp anymore. I detect it as revision 2 document and Exclude / Invalidate User1 from further usage. But i need to read the original revision 1 document (that can be read from platform explorer at its original ST creation) to validate past dataset for all other users that interacted with User1.
-> This may be solved with immutable documents later, but there are more use-cases where one want to read old revisions

Here an example from Platform Explorer:
Initial doc: https://pce.cloudwheels.net/#/blocks/29503
Updated doc: https://pce.cloudwheels.net/#/blocks/29505
And i would need a reference from the updated document to the original document at block 29503 to find it fast and efficient

Another Scenario:
I want to link between two contracts (A and B) and need to know exactly if a document from contract B was written after a document in contract A and the other way around. I could use createdAt property, but it would lead to extra processing complexity and time. Having the ST block-number as reference would make things much more cleaner and efficient.

Add --reindex option

Expected Behavior

Sometimes it is necessary to start dashd with the --reindex option (e.g. if the chain is corrupt or new addresses were added). It should be possible to add a flag to the dashmate start command to achieve this.

Current Behavior

Currently this can be achieved with a workaround by editing templates/core/dash.conf.dot and adding reindex=1 there, then removing it again.

Possible Solution

Use a flag and add conditional login in the dash.conf.dot template.

Alternatives Considered

Additional Context

Dashmate should generate Dash and provide a faucet key and address to use

Expected Behavior

After starting a local node, it is often necessary to get a balance. This should be done and shown to the user during the local network setup.

Current Behavior

User currently needs to use dashmate --config=local_seed wallet:mint 1 to generate balance

Possible Solution

Alternatives Considered

Additional Context

wallet storage adapter butchers objects in node

The SDK should support a wallet storage adapter without the enduser having to wrap it, see:

So locaforage butchers objects it stores, and returns not what was passed to it. To make it work, there's a small wrapper needed
Here's the wrapper code:

  constructor() {
    this.forage = localforage;
    this.isConfig = false;
  }

  config() {
    this.isConfig = true;
  }

  async setItem(key, item) {
    console.log('setItem', key, item);
    if (typeof item === 'object') {
      await this.forage.setItem(key, JSON.stringify(item));
    } else {
      await this.forage.setItem(key, item);
    }

    return item;
  }

  async getItem(key) {
    console.log('get item', key);
    const item = await this.forage.getItem(key);
    let res;
    try {
      res = JSON.parse(item);
    } catch (e) {
      res = item;
    }
    return res || null;
  }
}

Configure miner during local network setup

Expected Behavior

The local network is working after starting nodes.

Current Behavior

Nodes are not starting because miner is disabled by default

Possible Solution

Propose to enable miner for specific interval during setup local network

Alternatives Considered

Additional Context

Wallet is disabled in seed node in local preset setup

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

  • Version used: 0.21.0
  • Environment name and version (e.g. Chrome 39, node.js 5.4): node v16.13.0
  • Operating System and version (desktop, server, or mobile): linux-x64 20.04 desktop
  • Link to your project:

identity topUp throws: "invalid transaction: min relay fee not met"

trying to topUp an identity throws the following error:

node topUp.js 
warn: Running on a NodeJS env without any specified adapter. Data will not persist.

Error: 3 INVALID_ARGUMENT: invalid transaction: min relay fee not met, 1000 < 1105 (code 66). Code:-26
    at Object.exports.createStatusError (rates/node_modules/grpc/src/common.js:91:15)
    at Object.onReceiveStatus (rates/node_modules/grpc/src/client_interceptors.js:1209:28)
    at InterceptingListener._callNext (rates/node_modules/grpc/src/client_interceptors.js:568:42)
    at InterceptingListener.onReceiveStatus (rates/node_modules/grpc/src/client_interceptors.js:618:8)
    at InterceptingListener._callNext (rates/node_modules/grpc/src/client_interceptors.js:574:12)
    at InterceptingListener.onReceiveStatus (rates/node_modules/grpc/src/client_interceptors.js:618:8)
    at callback (rates/node_modules/grpc/src/client_interceptors.js:847:24) {
  code: 3,
  metadata: Metadata {
    _internal_repr: {
      server: [ 'nginx/1.19.7' ],
      date: [ 'Thu, 01 Apr 2021 08:27:35 GMT' ],
      'content-length': [ '0' ]
    },
    flags: 0
  },
  details: 'invalid transaction: min relay fee not met, 1000 < 1105 (code 66). Code:-26'
}

Tested for topUp amounts from 1e6 to 1e8

More than one instance of dashcore-lib found.

Expected Behavior

No warning

Current Behavior

warning:

More than one instance of dashcore-lib found. Please make sure that you are not mixing instances of classes of the different versions of dashcore.

Context

every time when using DashJS

Creating a client and getting the account clobbers global values

it's bad style to do globals, but it probably still shouldn't happen.

Expected Behavior

using the library should leave global values alone

Current Behavior

const Dash = require('dash')
global.i = "pls no clobber"

function check(v) {
    return i === "pls no clobber" ? "thx for no clobber" : "y must u clobber?"
}

async function getAccount() {
    console.log(check(i))
    const client = new Dash.Client({
        network: 'evonet',
        wallet: {mnemonic: null},
    })
    console.log(check(i))
    const account = await client.wallet.getAccount()
    console.log(check(i))
    await account.isReady()
}

getAccount().then(() => process.exit())

Output:

thx for no clobber
warn: Running on a NodeJS env without any specified adapter. Data will not persist.
thx for no clobber
y must u clobber?

Possible Solution

Steps to Reproduce (for bugs)

  1. run code from example in a node.js env
  2. profit

Your Environment

  • Version used: dash 3.15.2
  • Environment name and version: node.js 14.14.0
  • Operating System and version (desktop, server, or mobile): Desktop Arch Linux

Show progress in Listr for slow tasks

Listr can appear to hang when doing a slow operation like downloading images for the first time. We should show this progress.

Expected Behavior

Progress bar should be included in Listr output

Current Behavior

Listr appears to hang

Possible Solution

Redirect stream from docker-compose to Listr task.output?

Alternatives Considered

Additional Context

Query problem for dpns contract

Following dpns query does not work. This only happens on dpns contract. Probably because of the duplicate dpns contract id in apps (as found from @Alex-Werner)

client.getApps().set("myContract", { "contractId" : "3VvS19qomuGSbEYWbTsRzeuRgawU3yK4fPMzLrbV62u8"} );
[...]
const documents = await client.platform.documents.get('MyContract.domain', { "where": [
      ["normalizedParentDomainName", "==", "dash"],
      ["normalizedLabel", "==", "dappuser"]
      ],
      "startAt": 1 }
      );

apps object:

apps: {
    dpns: { contractId: "3VvS19qomuGSbEYWbTsRzeuRgawU3yK4fPMzLrbV62u8" },
    myContract: { contractId: "3VvS19qomuGSbEYWbTsRzeuRgawU3yK4fPMzLrbV62u8" }
  }

It throws:
TypeError: Cannot read property 'getBinaryProperties' of undefined

Confirmation step for significant commands

Expected Behavior

It could be helpful to require confirmation for certain high-impact commands (like the mn reset -h I just accidentally ran on the wrong machine ๐Ÿคฆ).

Current Behavior

No confirmation required

Possible Solution

A simple yes/no option to prevent some accidental operations. It would be nice to see something similar to:
"You are about to <do operation> on <some info about node - IP/hostname or smth>. Please enter y to confirm"

Random password generator

We should use random passwords for RPC to increase security. We currently use the following username and password:

rpcuser=dashrpc
rpcpassword=password

It's not possible to randomly generate passwords in docker-compose because the files are supposed to be idempotent. My previous attempt at implementing this generated a random password when templating the config file, can we do something similar here with a helper script maybe, or is there another approach?

Get transaction history for address

I am using the Dash wallet, and I was looking for a way to get the transaction history of my account. I see that a lot is happening through the storage and synchronisation, but as I am building a mobile wallet, I do not want to keep everything locally. Is there a way to simply get the transactions for a given address directly from the node?

Cache wallet data during core chain sync

When using the SDK with a mnemonic, cache wallet account information so it is accessible immediately the next time the wallet account is used.

Expected Behavior

After initial sync for a particular wallet (mnemonic), future syncs would generally use locally cached data rather than syncing the entire chain again.

Current Behavior

Currently, the libraries underlying the SDK don't provide an option to cache wallet info locally so the entire core chain has to be synced when things like getWalletAccount() are run. This is problematic as it can take 5+ minutes on testnet.

Possible Solution

Get wallet-lib's persistence adapter working in conjunction with the SDK and other libraries (dapi-client?)

Alternatives Considered

Open to suggestions ๐Ÿ™‚

Additional Context

Many of the Readme portal tutorials take 5+ minutes to run on testnet due to syncing the chain on each run (e.g. https://dashplatform.readme.io/docs/tutorial-register-an-identity).

Opening this issue for tracking purposes

dapi throws 504

While syncing the wallet account, 504 Errors are thrown:

VM38170:1 POST http://35.166.79.235:3000/org.dash.platform.dapi.v0.Core/subscribeToTransactionsWithProofs 504 (Gateway Time-out)
(anonymous) @ VM38170:1
ic @ index.js?4f18:38
Bc @ index.js?4f18:59
eval @ index.js?4f18:55
Z.R @ index.js?4f18:55
proto.org.dash.platform.dapi.v0.CorePromiseClient.subscribeToTransactionsWithProofs @ core_grpc_web_pb.js?a73b:619
request @ GrpcTransport.js?b593:71
await in request (async)
subscribeToTransactionsWithProofs @ subscribeToTransactionsWithProofsFactory.js?2e1c:74
subscribeToTransactionsWithProofs @ subscribeToTransactionsWithProofs.js?82a0:47
syncUpToTheGapLimit @ syncUpToTheGapLimit.js?2ba9:35
startIncomingSync @ startIncomingSync.js?e7ae:28
await in startIncomingSync (async)
execute @ TransactionSyncStreamWorker.js?976e:159
execWorker @ Worker.js?2654:119
startWorker @ Worker.js?2654:70
VM38170:1 POST http://18.237.204.153:3000/org.dash.platform.dapi.v0.Core/subscribeToTransactionsWithProofs 504 (Gateway Time-out)
(anonymous) @ VM38170:1
ic @ index.js?4f18:38
Bc @ index.js?4f18:59
eval @ index.js?4f18:55
Z.R @ index.js?4f18:55
proto.org.dash.platform.dapi.v0.CorePromiseClient.subscribeToTransactionsWithProofs @ core_grpc_web_pb.js?a73b:619
request @ GrpcTransport.js?b593:71
await in request (async)
subscribeToTransactionsWithProofs @ subscribeToTransactionsWithProofsFactory.js?2e1c:74
subscribeToTransactionsWithProofs @ subscribeToTransactionsWithProofs.js?82a0:47
syncUpToTheGapLimit @ syncUpToTheGapLimit.js?2ba9:35
startIncomingSync @ startIncomingSync.js?e7ae:28
await in startIncomingSync (async)
startIncomingSync @ startIncomingSync.js?e7ae:48
await in startIncomingSync (async)
execute @ TransactionSyncStreamWorker.js?976e:159
execWorker @ Worker.js?2654:119
startWorker @ Worker.js?2654:70
VM38170:1 POST http://34.217.23.70:3000/org.dash.platform.dapi.v0.Core/subscribeToTransactionsWithProofs 504 (Gateway Time-out)
(anonymous) @ VM38170:1
ic @ index.js?4f18:38
Bc @ index.js?4f18:59
eval @ index.js?4f18:55
Z.R @ index.js?4f18:55
proto.org.dash.platform.dapi.v0.CorePromiseClient.subscribeToTransactionsWithProofs @ core_grpc_web_pb.js?a73b:619
request @ GrpcTransport.js?b593:71
await in request (async)
subscribeToTransactionsWithProofs @ subscribeToTransactionsWithProofsFactory.js?2e1c:74
subscribeToTransactionsWithProofs @ subscribeToTransactionsWithProofs.js?82a0:47
syncUpToTheGapLimit @ syncUpToTheGapLimit.js?2ba9:35
startIncomingSync @ startIncomingSync.js?e7ae:28
await in startIncomingSync (async)
startIncomingSync @ startIncomingSync.js?e7ae:48
await in startIncomingSync (async)
startIncomingSync @ startIncomingSync.js?e7ae:48
await in startIncomingSync (async)
execute @ TransactionSyncStreamWorker.js?976e:159
execWorker @ Worker.js?2654:119
startWorker @ Worker.js?2654:70
VM38170:1 POST http://52.41.198.242:3000/org.dash.platform.dapi.v0.Core/subscribeToTransactionsWithProofs 504 (Gateway Time-out)
(anonymous) @ VM38170:1
ic @ index.js?4f18:38
Bc @ index.js?4f18:59
eval @ index.js?4f18:55
Z.R @ index.js?4f18:55
proto.org.dash.platform.dapi.v0.CorePromiseClient.subscribeToTransactionsWithProofs @ core_grpc_web_pb.js?a73b:619
request @ GrpcTransport.js?b593:71
await in request (async)
subscribeToTransactionsWithProofs @ subscribeToTransactionsWithProofsFactory.js?2e1c:74
subscribeToTransactionsWithProofs @ subscribeToTransactionsWithProofs.js?82a0:47
syncUpToTheGapLimit @ syncUpToTheGapLimit.js?2ba9:35
startIncomingSync @ startIncomingSync.js?e7ae:28
await in startIncomingSync (async)
startIncomingSync @ startIncomingSync.js?e7ae:48
await in startIncomingSync (async)
startIncomingSync @ startIncomingSync.js?e7ae:48
await in startIncomingSync (async)
startIncomingSync @ startIncomingSync.js?e7ae:48
await in startIncomingSync (async)
execute @ TransactionSyncStreamWorker.js?976e:159
execWorker @ Worker.js?2654:119
startWorker @ Worker.js?2654:70
VM38170:1 POST http://34.222.6.55:3000/org.dash.platform.dapi.v0.Core/subscribeToTransactionsWithProofs 504 (Gateway Time-out)
(anonymous) @ VM38170:1
ic @ index.js?4f18:38
Bc @ index.js?4f18:59
eval @ index.js?4f18:55
Z.R @ index.js?4f18:55
proto.org.dash.platform.dapi.v0.CorePromiseClient.subscribeToTransactionsWithProofs @ core_grpc_web_pb.js?a73b:619
request @ GrpcTransport.js?b593:71
await in request (async)
subscribeToTransactionsWithProofs @ subscribeToTransactionsWithProofsFactory.js?2e1c:74
subscribeToTransactionsWithProofs @ subscribeToTransactionsWithProofs.js?82a0:47
syncUpToTheGapLimit @ syncUpToTheGapLimit.js?2ba9:35
startIncomingSync @ startIncomingSync.js?e7ae:28
await in startIncomingSync (async)
startIncomingSync @ startIncomingSync.js?e7ae:48
await in startIncomingSync (async)
startIncomingSync @ startIncomingSync.js?e7ae:48
await in startIncomingSync (async)
startIncomingSync @ startIncomingSync.js?e7ae:48
await in startIncomingSync (async)

Consider hardware wallets in register command

It would be great to still be able to use the register command when setting up mainnet (and testnet) masternodes with the collateral held on hardware wallets. In this case, it is not possible (or strongly not recommended) to export private keys from the hardware device. In this case, the register command will need some adjustment and interactive prompts to handle typical workflows for registering masternodes from hardware wallets. We also need to think about if and how DMT can play a role, or if we should document two separate approaches to hardware wallet collaterals.

Expected Behavior

It is possible to register a masternode using mn-bootstrap with the collateral held on a hardware wallet without exporting the funding private key.

Current Behavior

Private keys are required

Possible Solution

Interactive prompts, or different "modes" to the register command

Alternatives Considered

Some sort of tango involving copying transactions back and forth between DMT/Dash Core?

Containers do not accept new settings when restarted

Any changes to config that affect the configuration of a container will not be applied until the container is destroyed and recreated.

Expected Behavior

Changing config and restarting containers should apply config changes

Current Behavior

Changing config and restarting containers keeps the old config

Possible Solution

It should be possible to force docker-compose to rebuild the containers with new settings from images when restarting

Steps to Reproduce (for bugs)

  1. Start node
  2. Change settings (e.g. log level)
  3. Restart node
  4. New settings are not applied

Context

Cannot reconfigure nodes

Your Environment

  • Version used:
  • Environment name and version (e.g. Chrome 39, node.js 5.4):
  • Operating System and version (desktop, server, or mobile):
  • Link to your project:

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.