diff --git a/packages/api/README.md b/packages/api/README.md index 30c5f42b7..a181cc5d9 100644 --- a/packages/api/README.md +++ b/packages/api/README.md @@ -106,15 +106,55 @@ HTTP /status hash: "DEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEF", timestamp: "2024-06-06T21:50:20.949Z" } + "epoch": { + "number": 3640, + "firstBlockHeight": 72534, + "firstCoreBlockHeight": 1160707, + "startTime": 1734457229495, + "feeMultiplier": 1, + "endTime": 1734460829495 + }, + "transactionsCount": 25912, + "totalCredits": 7288089799960610, + "totalCollectedFeesDay": 12733263640, + "transfersCount": 1849, + "dataContractsCount": 630, + "documentsCount": 15384, + "identitiesCount": 712, + "network": "dash-testnet-51", + "api": { + "version": "1.0.7", + "block": { + "height": 72555, + "hash": "EDA1CDF601224CD3ED168D35B4699DE2796F774B526103C64D371EF3AAFD8274", + "timestamp": "2024-12-17T17:57:08.758Z" + } + }, + "tenderdash": { + "version": "1.4.0", + "block": { + "height": 72555, + "hash": "EDA1CDF601224CD3ED168D35B4699DE2796F774B526103C64D371EF3AAFD8274", + "timestamp": "2024-12-17T17:57:08.758Z" + } + }, + "versions": { + "software": { + "dapi": "1.5.1", + "drive": "1.6.2", + "tenderdash": "1.4.0" }, - tenderdash: { - version: "0.14.0-dev.6", - block: { - height: 20154, - hash: "DEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEF", - timestamp: "2024-06-06T21:53:27.947Z" - } - } + "protocol": { + "tenderdash": { + "p2p": 10, + "block": 14 + }, + "drive": { + "latest": 6, + "current": 6 + } + } + } } ``` --- diff --git a/packages/api/package.json b/packages/api/package.json index 8b460ef85..570b94c37 100644 --- a/packages/api/package.json +++ b/packages/api/package.json @@ -12,9 +12,9 @@ "lint": "standard ." }, "dependencies": { + "@dashevo/wasm-dpp": "github:owl352/wasm-dpp", "@dashevo/dapi-client": "github:owl352/dapi-client", "@dashevo/dashd-rpc": "19.0.0", - "@dashevo/wasm-dpp": "github:owl352/wasm-dpp", "@fastify/cors": "^8.3.0", "@scure/base": "^1.1.5", "bs58": "^6.0.0", diff --git a/packages/api/src/DAPI.js b/packages/api/src/DAPI.js index 8649b4ad2..db7e425d7 100644 --- a/packages/api/src/DAPI.js +++ b/packages/api/src/DAPI.js @@ -106,6 +106,10 @@ class DAPI { } }) } + + async getStatus () { + return this.dapi.platform.getStatus() + } } module.exports = DAPI diff --git a/packages/api/src/controllers/MainController.js b/packages/api/src/controllers/MainController.js index b6a4883cc..0daaed244 100644 --- a/packages/api/src/controllers/MainController.js +++ b/packages/api/src/controllers/MainController.js @@ -22,9 +22,10 @@ class MainController { } getStatus = async (request, response) => { - const [blocks, stats, tdStatus, epochsInfo, totalCredits, totalCollectedFeesDay] = (await Promise.allSettled([ + const [blocks, stats, status, tdStatus, epochsInfo, totalCredits, totalCollectedFeesDay] = (await Promise.allSettled([ this.blocksDAO.getBlocks(1, 1, 'desc'), this.blocksDAO.getStats(), + this.dapi.getStatus(), TenderdashRPC.getStatus(), this.dapi.getEpochsInfo(1), this.dapi.getTotalCredits(), @@ -56,12 +57,29 @@ class MainController { } }, tenderdash: { - version: tdStatus?.version ?? null, + version: status?.version?.software.tenderdash ?? null, block: { height: tdStatus?.highestBlock?.height ?? null, hash: tdStatus?.highestBlock?.hash ?? null, timestamp: tdStatus?.highestBlock?.timestamp ?? null } + }, + versions: { + software: { + dapi: status?.version?.software.dapi ?? null, + drive: status?.version?.software.drive ?? null, + tenderdash: status?.version?.software.tenderdash ?? null + }, + protocol: { + tenderdash: { + p2p: status?.version?.protocol.tenderdash?.p2p ?? null, + block: status?.version?.protocol.tenderdash?.block ?? null + }, + drive: { + latest: status?.version?.protocol.drive?.latest ?? null, + current: status?.version?.protocol.drive?.current ?? null + } + } } }) } diff --git a/packages/api/test/integration/main.spec.js b/packages/api/test/integration/main.spec.js index 81cbc9796..c118f362b 100644 --- a/packages/api/test/integration/main.spec.js +++ b/packages/api/test/integration/main.spec.js @@ -43,6 +43,8 @@ describe('Other routes', () => { mock.method(DAPI.prototype, 'getIdentityKeys', async () => null) + mock.method(DAPI.prototype, 'getStatus', async () => null) + mock.method(tenderdashRpc, 'getBlockByHeight', async () => ({ block: { header: { @@ -384,8 +386,29 @@ describe('Other routes', () => { timestamp: new Date().toISOString() } } + const mockDapiStatus = { + version: { + software: { + dapi: '1.5.1', + drive: '1.6.2', + tenderdash: '1.4.0' + }, + protocol: { + tenderdash: { + p2p: 10, + block: 14 + }, + drive: { + latest: 6, + current: 6 + } + } + } + } + mock.reset() mock.method(DAPI.prototype, 'getTotalCredits', async () => 0) + mock.method(DAPI.prototype, 'getStatus', async () => mockDapiStatus) mock.method(DAPI.prototype, 'getEpochsInfo', async () => [{ number: 0, firstBlockHeight: 0, @@ -433,12 +456,29 @@ describe('Other routes', () => { } }, tenderdash: { - version: mockTDStatus?.version ?? null, + version: mockDapiStatus.version.software.tenderdash ?? null, block: { height: mockTDStatus?.highestBlock?.height, hash: mockTDStatus?.highestBlock?.hash, timestamp: mockTDStatus?.highestBlock?.timestamp } + }, + versions: { + software: { + dapi: mockDapiStatus.version.software.dapi ?? null, + drive: mockDapiStatus.version.software.drive ?? null, + tenderdash: mockDapiStatus.version.software.tenderdash ?? null + }, + protocol: { + tenderdash: { + p2p: mockDapiStatus.version.protocol.tenderdash.p2p ?? null, + block: mockDapiStatus.version.protocol.tenderdash.block ?? null + }, + drive: { + latest: mockDapiStatus.version.protocol.drive.latest ?? null, + current: mockDapiStatus.version.protocol.drive.current ?? null + } + } } } diff --git a/packages/frontend/src/app/api/content.md b/packages/frontend/src/app/api/content.md index 7696b75cb..ba0c6f3fd 100644 --- a/packages/frontend/src/app/api/content.md +++ b/packages/frontend/src/app/api/content.md @@ -73,15 +73,55 @@ HTTP /status hash: "DEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEF", timestamp: "2024-06-06T21:50:20.949Z" } + "epoch": { + "number": 3640, + "firstBlockHeight": 72534, + "firstCoreBlockHeight": 1160707, + "startTime": 1734457229495, + "feeMultiplier": 1, + "endTime": 1734460829495 + }, + "transactionsCount": 25912, + "totalCredits": 7288089799960610, + "totalCollectedFeesDay": 12733263640, + "transfersCount": 1849, + "dataContractsCount": 630, + "documentsCount": 15384, + "identitiesCount": 712, + "network": "dash-testnet-51", + "api": { + "version": "1.0.7", + "block": { + "height": 72555, + "hash": "EDA1CDF601224CD3ED168D35B4699DE2796F774B526103C64D371EF3AAFD8274", + "timestamp": "2024-12-17T17:57:08.758Z" + } + }, + "tenderdash": { + "version": "1.4.0", + "block": { + "height": 72555, + "hash": "EDA1CDF601224CD3ED168D35B4699DE2796F774B526103C64D371EF3AAFD8274", + "timestamp": "2024-12-17T17:57:08.758Z" + } + }, + "versions": { + "software": { + "dapi": "1.5.1", + "drive": "1.6.2", + "tenderdash": "1.4.0" }, - tenderdash: { - version: "0.14.0-dev.6", - block: { - height: 20154, - hash: "DEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEF", - timestamp: "2024-06-06T21:53:27.947Z" - } - } + "protocol": { + "tenderdash": { + "p2p": 10, + "block": 14 + }, + "drive": { + "latest": 6, + "current": 6 + } + } + } } ``` --- diff --git a/packages/indexer/Cargo.lock b/packages/indexer/Cargo.lock index 1ab801a20..adb1ea65b 100644 --- a/packages/indexer/Cargo.lock +++ b/packages/indexer/Cargo.lock @@ -594,7 +594,7 @@ dependencies = [ [[package]] name = "dashpay-contract" -version = "1.5.1" +version = "1.7.0" dependencies = [ "platform-value", "platform-version", @@ -604,7 +604,7 @@ dependencies = [ [[package]] name = "data-contracts" -version = "1.5.1" +version = "1.7.0" dependencies = [ "dashpay-contract", "dpns-contract", @@ -614,6 +614,7 @@ dependencies = [ "platform-version", "serde_json", "thiserror", + "wallet-utils-contract", "withdrawals-contract", ] @@ -711,7 +712,7 @@ checksum = "77c90badedccf4105eca100756a0b1289e191f6fcbdadd3cee1d2f614f97da8f" [[package]] name = "dpns-contract" -version = "1.5.1" +version = "1.7.0" dependencies = [ "platform-value", "platform-version", @@ -721,7 +722,7 @@ dependencies = [ [[package]] name = "dpp" -version = "1.5.1" +version = "1.7.0" dependencies = [ "anyhow", "async-trait", @@ -735,7 +736,7 @@ dependencies = [ "env_logger 0.11.5", "getrandom", "hex", - "indexmap 2.6.0", + "indexmap 2.7.0", "integer-encoding", "itertools", "json-schema-compatibility-validator", @@ -867,7 +868,7 @@ checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" [[package]] name = "feature-flags-contract" -version = "1.5.1" +version = "1.7.0" dependencies = [ "platform-value", "platform-version", @@ -1063,7 +1064,7 @@ dependencies = [ "futures-sink", "futures-util", "http", - "indexmap 2.6.0", + "indexmap 2.7.0", "slab", "tokio", "tokio-util", @@ -1144,11 +1145,11 @@ dependencies = [ [[package]] name = "home" -version = "0.5.9" +version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" +checksum = "589533453244b0995c858700322199b2becb13b627df2851f64a2775d024abcf" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -1305,9 +1306,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.6.0" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" +checksum = "62f822373a4fe84d4bb149bf54e584a7f4abec90e072ed49cda0edea5b95471f" dependencies = [ "equivalent", "hashbrown 0.15.0", @@ -1380,7 +1381,7 @@ dependencies = [ [[package]] name = "json-schema-compatibility-validator" -version = "1.5.1" +version = "1.7.0" dependencies = [ "json-patch", "once_cell", @@ -1419,12 +1420,12 @@ checksum = "8e9489c2807c139ffd9c1794f4af0ebe86a828db53ecdc7fea2111d0fed085d1" [[package]] name = "libloading" -version = "0.8.5" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4979f22fdb869068da03c9f7528f8297c6fd2606bc3a4affe42e6a823fdb8da4" +checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" dependencies = [ "cfg-if", - "windows-targets 0.52.6", + "windows-targets 0.48.5", ] [[package]] @@ -1451,7 +1452,7 @@ checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" [[package]] name = "masternode-reward-shares-contract" -version = "1.5.1" +version = "1.7.0" dependencies = [ "platform-value", "platform-version", @@ -1750,7 +1751,7 @@ checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" [[package]] name = "platform-serialization" -version = "1.5.1" +version = "1.7.0" dependencies = [ "bincode", "platform-version", @@ -1758,7 +1759,7 @@ dependencies = [ [[package]] name = "platform-serialization-derive" -version = "1.5.1" +version = "1.7.0" dependencies = [ "proc-macro2", "quote", @@ -1768,13 +1769,13 @@ dependencies = [ [[package]] name = "platform-value" -version = "1.5.1" +version = "1.7.0" dependencies = [ "base64 0.22.1", "bincode", "bs58", "hex", - "indexmap 2.6.0", + "indexmap 2.7.0", "lazy_static", "platform-serialization", "platform-version", @@ -1787,7 +1788,7 @@ dependencies = [ [[package]] name = "platform-version" -version = "1.5.1" +version = "1.7.0" dependencies = [ "bincode", "grovedb-version", @@ -1798,7 +1799,7 @@ dependencies = [ [[package]] name = "platform-versioning" -version = "1.5.1" +version = "1.7.0" dependencies = [ "proc-macro2", "quote", @@ -2321,9 +2322,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.23" +version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" +checksum = "3cb6eb87a131f756572d7fb904f6e7b68633f09cca868c5df1c4b8d1a694bbba" [[package]] name = "serde" @@ -2351,7 +2352,7 @@ version = "1.0.132" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d726bfaff4b320266d395898905d0eba0345aae23b54aee3a737e260fd46db03" dependencies = [ - "indexmap 2.6.0", + "indexmap 2.7.0", "itoa", "memchr", "ryu", @@ -2824,7 +2825,7 @@ version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.6.0", + "indexmap 2.7.0", "toml_datetime", "winnow 0.5.40", ] @@ -2835,7 +2836,7 @@ version = "0.22.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" dependencies = [ - "indexmap 2.6.0", + "indexmap 2.7.0", "serde", "serde_spanned", "toml_datetime", @@ -2986,6 +2987,16 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "wallet-utils-contract" +version = "1.7.0" +dependencies = [ + "platform-value", + "platform-version", + "serde_json", + "thiserror", +] + [[package]] name = "want" version = "0.3.1" @@ -3303,7 +3314,7 @@ dependencies = [ [[package]] name = "withdrawals-contract" -version = "1.5.1" +version = "1.7.0" dependencies = [ "num_enum 0.5.11", "platform-value", diff --git a/packages/indexer/Dockerfile b/packages/indexer/Dockerfile index 9c2e761ee..f7c39a6e0 100644 --- a/packages/indexer/Dockerfile +++ b/packages/indexer/Dockerfile @@ -2,7 +2,7 @@ FROM rust:1.82-alpine3.19 as build RUN apk add --no-cache git cmake clang openssl openssl-dev openssl-libs-static build-base WORKDIR / -RUN git clone --depth 1 --branch v1.5.1 https://github.com/dashevo/platform +RUN git clone --depth 1 --branch v1.7.0 https://github.com/dashevo/platform WORKDIR /app COPY Cargo.lock /app COPY Cargo.toml /app diff --git a/packages/indexer/src/entities/data_contract.rs b/packages/indexer/src/entities/data_contract.rs index 69ffe6f66..b125ceacd 100644 --- a/packages/indexer/src/entities/data_contract.rs +++ b/packages/indexer/src/entities/data_contract.rs @@ -92,7 +92,8 @@ impl From for DataContract { SystemDataContract::MasternodeRewards => "MasternodeRewards", SystemDataContract::FeatureFlags => "FeatureFlags", SystemDataContract::DPNS => "DPNS", - SystemDataContract::Dashpay => "Dashpay" + SystemDataContract::Dashpay => "Dashpay", + SystemDataContract::WalletUtils => "WalletUtils" }; let identifier = data_contract.id(); let source = data_contract.source(platform_version).unwrap(); diff --git a/packages/indexer/src/entities/identity.rs b/packages/indexer/src/entities/identity.rs index b69a6cb91..c09e9dc63 100644 --- a/packages/indexer/src/entities/identity.rs +++ b/packages/indexer/src/entities/identity.rs @@ -2,8 +2,8 @@ use std::env; use base64::Engine; use base64::engine::general_purpose; use dashcore_rpc::{Auth, Client, RpcApi}; +use dashcore_rpc::dashcore::Txid; use data_contracts::SystemDataContract; -use dpp::dashcore::{Transaction, Txid}; use dpp::identifier::Identifier; use dpp::identity::state_transition::AssetLockProved; use dpp::platform_value::string_encoding::Encoding::{Base58, Base64}; @@ -30,7 +30,7 @@ impl From for Identity { let asset_lock = state_transition.asset_lock_proof().clone(); let asset_lock_output_index = asset_lock.output_index(); - let transaction: Transaction = match asset_lock { + let transaction = match asset_lock { AssetLockProof::Instant(instant_lock) => instant_lock.transaction, AssetLockProof::Chain(chain_lock) => { let tx_hash = chain_lock.out_point.txid.to_string(); diff --git a/packages/indexer/src/processor/psql/mod.rs b/packages/indexer/src/processor/psql/mod.rs index c828b5844..872908909 100644 --- a/packages/indexer/src/processor/psql/mod.rs +++ b/packages/indexer/src/processor/psql/mod.rs @@ -431,6 +431,7 @@ impl PSQLProcessor { self.dao.create_document(dash_tld_document, None).await.unwrap(); } SystemDataContract::Dashpay => {} + SystemDataContract::WalletUtils => {} } }