Skip to content
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/dapi-grpc/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ fn configure_platform(mut platform: MappingConfig) -> MappingConfig {
// Derive features for versioned messages
//
// "GetConsensusParamsRequest" is excluded as this message does not support proofs
const VERSIONED_REQUESTS: [&str; 40] = [
const VERSIONED_REQUESTS: [&str; 39] = [
"GetDataContractHistoryRequest",
"GetDataContractRequest",
"GetDataContractsRequest",
Expand Down Expand Up @@ -121,7 +121,7 @@ fn configure_platform(mut platform: MappingConfig) -> MappingConfig {
// - "GetStatusResponse"
//
// "GetEvonodesProposedEpochBlocksResponse" is used for 2 Requests
const VERSIONED_RESPONSES: [&str; 39] = [
const VERSIONED_RESPONSES: [&str; 38] = [
"GetDataContractHistoryResponse",
"GetDataContractResponse",
"GetDataContractsResponse",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3134,13 +3134,13 @@ public com.google.common.util.concurrent.ListenableFuture<org.dash.platform.dapi
private static final int METHODID_GET_IDENTITY_TOKEN_INFOS = 33;
private static final int METHODID_GET_IDENTITIES_TOKEN_INFOS = 34;
private static final int METHODID_GET_TOKEN_STATUSES = 35;
private static final int METHODID_GET_TOKEN_PRE_PROGRAMMED_DISTRIBUTIONS = 36;
private static final int METHODID_GET_TOKEN_TOTAL_SUPPLY = 37;
private static final int METHODID_GET_GROUP_INFO = 38;
private static final int METHODID_GET_GROUP_INFOS = 39;
private static final int METHODID_GET_GROUP_ACTIONS = 40;
private static final int METHODID_GET_GROUP_ACTION_SIGNERS = 41;
private static final int METHODID_GET_TOKEN_DIRECT_PURCHASE_PRICES = 36;
private static final int METHODID_GET_TOKEN_PRE_PROGRAMMED_DISTRIBUTIONS = 37;
private static final int METHODID_GET_TOKEN_TOTAL_SUPPLY = 38;
private static final int METHODID_GET_GROUP_INFO = 39;
private static final int METHODID_GET_GROUP_INFOS = 40;
private static final int METHODID_GET_GROUP_ACTIONS = 41;
private static final int METHODID_GET_GROUP_ACTION_SIGNERS = 42;

private static final class MethodHandlers<Req, Resp> implements
io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>,
Expand Down
59 changes: 5 additions & 54 deletions packages/dapi/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,64 +5,15 @@

A decentralized API for the Dash network

## Table of Contents
- [Install](#install)
- [Dependencies](#dependencies)
- [Usage](#usage)
- [Configuration](#configuration)
- [Making requests](#making-basic-requests)
- [API Reference](#api-reference)
- [Contributing](#contributing)
- [License](#license)
## Overview

## Install
DAPI (Decentralized API) is the decentralized HTTP API layer for the Dash Evolution platform. It provides a simple interface for accessing the Dash network, both for traditional Dash functionality and for the Dash Platform features.

```sh
npm install
```
DAPI is designed to be run on the Dash masternode network, providing a decentralized, high-availability API service with no single point of failure.

### Dependencies
## Documentation

DAPI targets the latest v20 release of Node.js.

DAPI requires the latest version of [dashcore](https://github.com/dashevo/dash-evo-branches/tree/evo) with Evolution features (special branch repo).

1. **Install core.** You can use the docker image (`dashcore:evo`) or clone code from [the repository](https://github.com/dashevo/dash-evo-branches/tree/evo), switch to the `evo` branch, and build it by yourself. Note: you need to build image with ZMQ and wallet support. You can follow the build instructions located [here](https://github.com/dashevo/dash-evo-branches/tree/evo/doc)
2. **Configure core.** DAPI needs dashcore's ZMQ interface to be exposed and all indexes enabled. You can find the example config for dashcore [here](doc/dependencies_configs/dash.conf). To start dashcore process with this config, copy it somewhere to your system, and then run `./src/dashd -conf=/path/to/your/config`.

## Usage

After you've installed all the dependencies, you can start DAPI by running the `npm start` command inside the DAPI repo directory.

```sh
npm start
```

## Configuration

DAPI is configured via environment variables either explicitly passed or present in the `.env` dotfile. For example, to change the DAPI port, execute DAPI with the following arguments: `RPC_SERVER_PORT=3010 npm start`. Consult the sample environment [file](.env.example). You can see the full list of available options [here](doc/CONFIGURATION.md).

## Making basic requests

DAPI uses [JSON-RPC 2.0](https://www.jsonrpc.org/specification) as the main interface. If you want to confirm that DAPI is functioning and synced, you can request the best block height.

Send the following json to your DAPI instance:

```json
{"jsonrpc": "2.0","method": "getBestBlockHeight", "id": 1}
```

Note that you always need to specify an id, otherwise the server will respond with an empty body, as mentioned in the [spec](https://www.jsonrpc.org/specification#notification).

## API Reference

A list of all available RPC commands, along with their various arguments and expected responses can be found [here](doc/REFERENCE.md)

Implementation of these commands can be viewed [here](lib/rpcServer/commands).

## Contributing

Feel free to dive in! [Open an issue](https://github.com/dashpay/platform/issues/new/choose) or submit PRs.
DAPI documentaion is available in the [doc](./doc/index.md) directory and [website](https://docs.dash.org/projects/platform/en/stable/docs/explanations/dapi.html).

## License

Expand Down
26 changes: 0 additions & 26 deletions packages/dapi/doc/CONFIGURATION.md

This file was deleted.

7 changes: 0 additions & 7 deletions packages/dapi/doc/README.md

This file was deleted.

57 changes: 0 additions & 57 deletions packages/dapi/doc/REFERENCE.md

This file was deleted.

Loading