From dcc3ad290bd0edc21bcacdd380ccc44cece4ec7d Mon Sep 17 00:00:00 2001 From: Satya <35016438+satran004@users.noreply.github.com> Date: Fri, 18 Oct 2024 14:03:08 +0800 Subject: [PATCH 1/6] Update gradle.properties --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 4eaa9e11..accf7a39 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,3 +1,3 @@ group = com.bloxbean.cardano artifactId = yaci -version = 0.3.3 +version = 0.3.4-SNAPSHOT From 284c53711b2585ab1608f8be90dfd55cbabccaae Mon Sep 17 00:00:00 2001 From: Satya <35016438+satran004@users.noreply.github.com> Date: Mon, 21 Oct 2024 18:55:22 +0800 Subject: [PATCH 2/6] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ee1f5c4c..d043089a 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ previous blocks, query information from a local node, monitor the local mempool, - [0.2.5](https://github.com/bloxbean/yaci/releases/tag/v0.2.5) (Compatible with Cardano Client Lib 0.5.0) **Latest Release :** -- [0.3.2](https://github.com/bloxbean/yaci/releases/tag/v0.3.2) (Supports Conway era) +- [0.3.3](https://github.com/bloxbean/yaci/releases/tag/v0.3.3) (Supports Conway era) **Development Branch:** main From ee13772bb1b7118552ee68c5edef55a7d901ee07 Mon Sep 17 00:00:00 2001 From: Sotatek-HuyLe3a Date: Fri, 8 Nov 2024 14:50:47 +0700 Subject: [PATCH 3/6] chore: Add GetFuturePParams query --- .../queries/GetFuturePParamsQuery.java | 335 ++++++++++++++++++ .../queries/GetFuturePParamsQueryResult.java | 14 + .../yaci/helper/LocalStateQueryClientIT.java | 8 + 3 files changed, 357 insertions(+) create mode 100644 core/src/main/java/com/bloxbean/cardano/yaci/core/protocol/localstate/queries/GetFuturePParamsQuery.java create mode 100644 core/src/main/java/com/bloxbean/cardano/yaci/core/protocol/localstate/queries/GetFuturePParamsQueryResult.java diff --git a/core/src/main/java/com/bloxbean/cardano/yaci/core/protocol/localstate/queries/GetFuturePParamsQuery.java b/core/src/main/java/com/bloxbean/cardano/yaci/core/protocol/localstate/queries/GetFuturePParamsQuery.java new file mode 100644 index 00000000..d6e3491d --- /dev/null +++ b/core/src/main/java/com/bloxbean/cardano/yaci/core/protocol/localstate/queries/GetFuturePParamsQuery.java @@ -0,0 +1,335 @@ +package com.bloxbean.cardano.yaci.core.protocol.localstate.queries; + +import co.nstant.in.cbor.model.*; +import com.bloxbean.cardano.client.util.Tuple; +import com.bloxbean.cardano.yaci.core.model.DrepVoteThresholds; +import com.bloxbean.cardano.yaci.core.model.PoolVotingThresholds; +import com.bloxbean.cardano.yaci.core.model.ProtocolParamUpdate; +import com.bloxbean.cardano.yaci.core.protocol.handshake.messages.AcceptVersion; +import com.bloxbean.cardano.yaci.core.protocol.localstate.api.Era; +import com.bloxbean.cardano.yaci.core.protocol.localstate.api.EraQuery; +import com.bloxbean.cardano.yaci.core.util.CborSerializationUtil; +import com.bloxbean.cardano.yaci.core.util.HexUtil; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.ToString; + +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.LinkedHashMap; +import java.util.List; + +import static com.bloxbean.cardano.yaci.core.util.CborSerializationUtil.*; + +@Getter +@AllArgsConstructor +@ToString +public class GetFuturePParamsQuery implements EraQuery { + private Era era; + + public GetFuturePParamsQuery() { + this.era = Era.Conway; + } + + @Override + public DataItem serialize(AcceptVersion protocolVersion) { + Array queryArray = new Array(); + queryArray.add(new UnsignedInteger(33)); + + return wrapWithOuterArray(queryArray); + } + + @Override + public GetFuturePParamsQueryResult deserializeResult(AcceptVersion protocolVersion, DataItem[] di) { + var resultDI = extractResultArray(di[0]); + var outerArray = (Array)resultDI.get(0); + + if (outerArray.getDataItems().isEmpty()) { + return new GetFuturePParamsQueryResult(null); + } + + Array futurePParamArray = (Array)outerArray.getDataItems().get(0); + ProtocolParamUpdate futureProtocolParam = deserializePPResult(futurePParamArray.getDataItems()); + + return new GetFuturePParamsQueryResult(futureProtocolParam); + } + + public ProtocolParamUpdate deserializePPResult(List paramsDIList) { + if (paramsDIList.isEmpty()) { + return null; + } + + DataItem itemDI = paramsDIList.get(0); + Integer minFeeA = itemDI != null ? toInt(itemDI) : null; + + itemDI = paramsDIList.get(1); + Integer minFeeB = itemDI != null ? toInt(itemDI) : null; + + itemDI = paramsDIList.get(2); + Integer maxBlockSize = itemDI != null ? toInt(itemDI) : null; + + itemDI = paramsDIList.get(3); + Integer maxTxSize = itemDI != null ? toInt(itemDI) : null; + + itemDI = paramsDIList.get(4); + Integer maxBlockHeaderSize = itemDI != null ? toInt(itemDI) : null; + + itemDI = paramsDIList.get(5); + BigInteger keyDeposit = itemDI != null ? toBigInteger(itemDI) : null; + + itemDI = paramsDIList.get(6); + BigInteger poolDeposit = itemDI != null ? toBigInteger(itemDI) : null; + + itemDI = paramsDIList.get(7); + Integer maxEpoch = itemDI != null ? toInt(itemDI) : null; + + itemDI = paramsDIList.get(8); + Integer nOpt = itemDI != null ? toInt(itemDI) : null; + + itemDI = paramsDIList.get(9); + BigDecimal poolPledgeInfluence = itemDI != null ? toRationalNumber(itemDI) : null; + + itemDI = paramsDIList.get(10); + BigDecimal expansionRate = itemDI != null ? toRationalNumber(itemDI) : null; + + itemDI = paramsDIList.get(11); + BigDecimal treasuryGrowthRate = itemDI != null ? toRationalNumber(itemDI) : null; + + Integer protocolMajorVersion = null; + Integer protocolMinorVersion = null; + itemDI = paramsDIList.get(12); + if (itemDI != null) { + List protocolVersions = ((Array) itemDI).getDataItems(); + protocolMajorVersion = toInt(protocolVersions.get(0)); + protocolMinorVersion = toInt(protocolVersions.get(1)); + } + + itemDI = paramsDIList.get(13); + BigInteger minPoolCost = itemDI != null ? toBigInteger(itemDI) : null; + + itemDI = paramsDIList.get(14); + BigInteger adaPerUtxoBytes = itemDI != null ? toBigInteger(itemDI) : null; + + //CostModels + java.util.Map costModelMap = null; + itemDI = paramsDIList.get(15); + if (itemDI != null) { + costModelMap = new LinkedHashMap<>(); + Map itemDIMap = (Map) itemDI; + for (DataItem key : itemDIMap.getKeys()) { + Integer version = toInt(key); + String costModel = HexUtil.encodeHexString(CborSerializationUtil.serialize(itemDIMap.get(key))); + costModelMap.put(version, costModel); + } + } + + //exUnits prices + BigDecimal priceMem = null; + BigDecimal priceSteps = null; + itemDI = paramsDIList.get(16); + if (itemDI != null) { + List exUnitPriceList = ((Array) itemDI).getDataItems(); + Tuple tuple = getExUnitPrices(exUnitPriceList); + priceMem = tuple._1; + priceSteps = tuple._2; + } + + //max tx exunits + BigInteger maxTxExMem = null; + BigInteger maxTxExSteps = null; + itemDI = paramsDIList.get(17); + if (itemDI != null) { + List exUnits = ((Array) itemDI).getDataItems(); + Tuple tuple = getExUnits(exUnits); + maxTxExMem = tuple._1; + maxTxExSteps = tuple._2; + } + + //max block exunits + BigInteger maxBlockExMem = null; + BigInteger maxBlockExSteps = null; + itemDI = paramsDIList.get(18); + if (itemDI != null) { + List exUnits = ((Array) itemDI).getDataItems(); + Tuple tuple = getExUnits(exUnits); + maxBlockExMem = tuple._1; + maxBlockExSteps = tuple._2; + } + + itemDI = paramsDIList.get(19); + Long maxValueSize = itemDI != null ? toLong(itemDI) : null; + + itemDI = paramsDIList.get(20); + Integer collateralPercent = itemDI != null ? toInt(itemDI) : null; + + Integer maxCollateralInputs = null; + itemDI = paramsDIList.get(21); + maxCollateralInputs = itemDI != null ? toInt(itemDI) : null; + + //Pool Voting Threshold + itemDI = paramsDIList.get(22); + BigDecimal motionNoConfidence = null; + BigDecimal committeeNormal = null; + BigDecimal committeeNoConfidence = null; + BigDecimal hardForkInitiation = null; + BigDecimal ppSecurityGroup = null; + if (itemDI != null) { + List poolVotingThresholdList = ((Array) itemDI).getDataItems(); + if (poolVotingThresholdList.size() != 5) + throw new IllegalStateException("Invalid pool voting threshold list"); + + var pvtMotionNoConfidenceDI = (RationalNumber) poolVotingThresholdList.get(0); + var pvtCommitteeNormalDI = (RationalNumber) poolVotingThresholdList.get(1); + var pvtCommitteeNoConfidenceDI = (RationalNumber) poolVotingThresholdList.get(2); + var pvtHardForkInitiationDI = (RationalNumber) poolVotingThresholdList.get(3); + var pvtPPSecurityGroupDI = (RationalNumber) poolVotingThresholdList.get(4); + + motionNoConfidence = toRationalNumber(pvtMotionNoConfidenceDI); + committeeNormal = toRationalNumber(pvtCommitteeNormalDI); + committeeNoConfidence = toRationalNumber(pvtCommitteeNoConfidenceDI); + hardForkInitiation = toRationalNumber(pvtHardForkInitiationDI); + ppSecurityGroup = toRationalNumber(pvtPPSecurityGroupDI); + } + + //DRep voting thresholds + itemDI = paramsDIList.get(23); + BigDecimal dvtMotionNoConfidence = null; + BigDecimal dvtCommitteeNormal = null; + BigDecimal dvtCommitteeNoConfidence = null; + BigDecimal dvtUpdateToConstitution = null; + BigDecimal dvtHardForkInitiation = null; + BigDecimal dvtPPNetworkGroup = null; + BigDecimal dvtPPEconomicGroup = null; + BigDecimal dvtPPTechnicalGroup = null; + BigDecimal dvtPPGovGroup = null; + BigDecimal dvtTreasuryWithdrawal = null; + + if (itemDI != null) { + List dRepVotingThresholdList = ((Array) itemDI).getDataItems(); + if (dRepVotingThresholdList.size() != 10) + throw new IllegalStateException("Invalid dRep voting threshold list"); + + var dvtMotionNoConfidenceDI = (RationalNumber) dRepVotingThresholdList.get(0); + var dvtCommitteeNormalDI = (RationalNumber) dRepVotingThresholdList.get(1); + var dvtCommitteeNoConfidenceDI = (RationalNumber) dRepVotingThresholdList.get(2); + var dvtUpdateToConstitutionDI = (RationalNumber) dRepVotingThresholdList.get(3); + var dvtHardForkInitiationDI = (RationalNumber) dRepVotingThresholdList.get(4); + var dvtPPNetworkGroupDI = (RationalNumber) dRepVotingThresholdList.get(5); + var dvtPPEconomicGroupDI = (RationalNumber) dRepVotingThresholdList.get(6); + var dvtPPTechnicalGroupDI = (RationalNumber) dRepVotingThresholdList.get(7); + var dvtPPGovGroupDI = (RationalNumber) dRepVotingThresholdList.get(8); + var dvtTreasuryWithdrawalDI = (RationalNumber) dRepVotingThresholdList.get(9); + + dvtMotionNoConfidence = toRationalNumber(dvtMotionNoConfidenceDI); + dvtCommitteeNormal = toRationalNumber(dvtCommitteeNormalDI); + dvtCommitteeNoConfidence = toRationalNumber(dvtCommitteeNoConfidenceDI); + dvtUpdateToConstitution = toRationalNumber(dvtUpdateToConstitutionDI); + dvtHardForkInitiation = toRationalNumber(dvtHardForkInitiationDI); + dvtPPNetworkGroup = toRationalNumber(dvtPPNetworkGroupDI); + dvtPPEconomicGroup = toRationalNumber(dvtPPEconomicGroupDI); + dvtPPTechnicalGroup = toRationalNumber(dvtPPTechnicalGroupDI); + dvtPPGovGroup = toRationalNumber(dvtPPGovGroupDI); + dvtTreasuryWithdrawal = toRationalNumber(dvtTreasuryWithdrawalDI); + } + + itemDI = paramsDIList.get(24); + Integer minCommitteeSize = itemDI != null ? toInt(itemDI) : null; + + itemDI = paramsDIList.get(25); + Integer committeeTermLimit = itemDI != null ? toInt(itemDI) : null; + + itemDI = paramsDIList.get(26); + Integer governanceActionValidityPeriod = itemDI != null ? toInt(itemDI) : null; + + itemDI = paramsDIList.get(27); + BigInteger governanceActionDeposit = itemDI != null ? toBigInteger(itemDI) : null; + + itemDI = paramsDIList.get(28); + BigInteger drepDeposit = itemDI != null ? toBigInteger(itemDI) : null; + + itemDI = paramsDIList.get(29); + Integer drepInactivityPeriod = itemDI != null ? toInt(itemDI) : null; + + BigDecimal minFeeRefScriptCostPerByte = null; + if (paramsDIList.size() > 30) { + itemDI = paramsDIList.get(30); + minFeeRefScriptCostPerByte = itemDI != null ? toRationalNumber(itemDI) : null; + } + + return ProtocolParamUpdate.builder() + .minFeeA(minFeeA) + .minFeeB(minFeeB) + .maxBlockSize(maxBlockSize) + .maxTxSize(maxTxSize) + .maxBlockHeaderSize(maxBlockHeaderSize) + .keyDeposit(keyDeposit) + .poolDeposit(poolDeposit) + .maxEpoch(maxEpoch) + .nOpt(nOpt) + .poolPledgeInfluence(poolPledgeInfluence) + .expansionRate(expansionRate) + .treasuryGrowthRate(treasuryGrowthRate) + .protocolMajorVer(protocolMajorVersion) + .protocolMinorVer(protocolMinorVersion) + .minPoolCost(minPoolCost) + .adaPerUtxoByte(adaPerUtxoBytes) + .costModels(costModelMap) + .priceMem(priceMem) + .priceStep(priceSteps) + .maxTxExMem(maxTxExMem) + .maxTxExSteps(maxTxExSteps) + .maxBlockExMem(maxBlockExMem) + .maxBlockExSteps(maxBlockExSteps) + .maxValSize(maxValueSize) + .collateralPercent(collateralPercent) + .maxCollateralInputs(maxCollateralInputs) + .poolVotingThresholds(PoolVotingThresholds.builder() + .pvtMotionNoConfidence(motionNoConfidence) + .pvtCommitteeNormal(committeeNormal) + .pvtCommitteeNoConfidence(committeeNoConfidence) + .pvtHardForkInitiation(hardForkInitiation) + .pvtPPSecurityGroup(ppSecurityGroup) + .build()) + .drepVotingThresholds(DrepVoteThresholds.builder() + .dvtMotionNoConfidence(dvtMotionNoConfidence) + .dvtCommitteeNormal(dvtCommitteeNormal) + .dvtCommitteeNoConfidence(dvtCommitteeNoConfidence) + .dvtUpdateToConstitution(dvtUpdateToConstitution) + .dvtHardForkInitiation(dvtHardForkInitiation) + .dvtPPNetworkGroup(dvtPPNetworkGroup) + .dvtPPEconomicGroup(dvtPPEconomicGroup) + .dvtPPTechnicalGroup(dvtPPTechnicalGroup) + .dvtPPGovGroup(dvtPPGovGroup) + .dvtTreasuryWithdrawal(dvtTreasuryWithdrawal) + .build()) + .committeeMinSize(minCommitteeSize) + .committeeMaxTermLength(committeeTermLimit) + .govActionLifetime(governanceActionValidityPeriod) + .govActionDeposit(governanceActionDeposit) + .drepDeposit(drepDeposit) + .drepActivity(drepInactivityPeriod) + .minFeeRefScriptCostPerByte(minFeeRefScriptCostPerByte) + .build(); + } + + private Tuple getExUnits(List exunits) { + BigInteger mem = toBigInteger(exunits.get(0)); + + BigInteger steps = null; + if (exunits.size() > 1) + steps = toBigInteger(exunits.get(1)); + + return new Tuple<>(mem, steps); + } + + private Tuple getExUnitPrices(List exunits) { + RationalNumber memPriceRN = (RationalNumber) exunits.get(0); + RationalNumber stepPriceRN = (RationalNumber) exunits.get(1); + + BigDecimal memPrice = toRationalNumber(memPriceRN); + BigDecimal stepPrice = toRationalNumber(stepPriceRN); + + return new Tuple<>(memPrice, stepPrice); + } + +} diff --git a/core/src/main/java/com/bloxbean/cardano/yaci/core/protocol/localstate/queries/GetFuturePParamsQueryResult.java b/core/src/main/java/com/bloxbean/cardano/yaci/core/protocol/localstate/queries/GetFuturePParamsQueryResult.java new file mode 100644 index 00000000..6633a021 --- /dev/null +++ b/core/src/main/java/com/bloxbean/cardano/yaci/core/protocol/localstate/queries/GetFuturePParamsQueryResult.java @@ -0,0 +1,14 @@ +package com.bloxbean.cardano.yaci.core.protocol.localstate.queries; + +import com.bloxbean.cardano.yaci.core.model.ProtocolParamUpdate; +import com.bloxbean.cardano.yaci.core.protocol.localstate.api.QueryResult; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.ToString; + +@Getter +@AllArgsConstructor +@ToString +public class GetFuturePParamsQueryResult implements QueryResult { + private ProtocolParamUpdate futurePParams; +} diff --git a/helper/src/integrationTest/java/com/bloxbean/cardano/yaci/helper/LocalStateQueryClientIT.java b/helper/src/integrationTest/java/com/bloxbean/cardano/yaci/helper/LocalStateQueryClientIT.java index d00259d9..4f48adff 100644 --- a/helper/src/integrationTest/java/com/bloxbean/cardano/yaci/helper/LocalStateQueryClientIT.java +++ b/helper/src/integrationTest/java/com/bloxbean/cardano/yaci/helper/LocalStateQueryClientIT.java @@ -409,4 +409,12 @@ void getRatifyState() { assertThat(result.getRatifyState()).isNotNull(); } + @Test + void getFuturePParams() { + Mono mono = localStateQueryClient.executeQuery(new GetFuturePParamsQuery()); + + GetFuturePParamsQueryResult result = mono.block(); + + assertThat(result).isNotNull(); + } } From 6620b0cc34438d0578b2f3ee01d685d7e538b394 Mon Sep 17 00:00:00 2001 From: Sotatek-HuyLe3a Date: Fri, 8 Nov 2024 14:51:33 +0700 Subject: [PATCH 4/6] chore: Add NodeToClientV_18 --- .../core/protocol/handshake/util/N2CVersionTableConstant.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/src/main/java/com/bloxbean/cardano/yaci/core/protocol/handshake/util/N2CVersionTableConstant.java b/core/src/main/java/com/bloxbean/cardano/yaci/core/protocol/handshake/util/N2CVersionTableConstant.java index 0b6914af..df0ea68f 100644 --- a/core/src/main/java/com/bloxbean/cardano/yaci/core/protocol/handshake/util/N2CVersionTableConstant.java +++ b/core/src/main/java/com/bloxbean/cardano/yaci/core/protocol/handshake/util/N2CVersionTableConstant.java @@ -26,6 +26,7 @@ public class N2CVersionTableConstant { public final static long PROTOCOL_V15 = 32783; public final static long PROTOCOL_V16 = 32784; public final static long PROTOCOL_V17 = 32785; + public final static long PROTOCOL_V18 = 32786; public static VersionTable v1AndAbove(long networkMagic) { OldN2CVersionData oldVersionData = new OldN2CVersionData(networkMagic); @@ -49,6 +50,7 @@ public static VersionTable v1AndAbove(long networkMagic) { versionTableMap.put(PROTOCOL_V15, versionData); versionTableMap.put(PROTOCOL_V16, versionData); versionTableMap.put(PROTOCOL_V17, versionData); + versionTableMap.put(PROTOCOL_V18, versionData); return new VersionTable(versionTableMap); } From 9bd84d2a4e066b55ffd56df7c629bfcd4ea0845f Mon Sep 17 00:00:00 2001 From: Sotatek-HuyLe3a Date: Fri, 8 Nov 2024 14:54:05 +0700 Subject: [PATCH 5/6] chore: Add NodeToNodeV_14 --- .../core/protocol/handshake/util/N2NVersionTableConstant.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/src/main/java/com/bloxbean/cardano/yaci/core/protocol/handshake/util/N2NVersionTableConstant.java b/core/src/main/java/com/bloxbean/cardano/yaci/core/protocol/handshake/util/N2NVersionTableConstant.java index 921cd91d..4d06164f 100644 --- a/core/src/main/java/com/bloxbean/cardano/yaci/core/protocol/handshake/util/N2NVersionTableConstant.java +++ b/core/src/main/java/com/bloxbean/cardano/yaci/core/protocol/handshake/util/N2NVersionTableConstant.java @@ -18,6 +18,7 @@ public class N2NVersionTableConstant { public final static long PROTOCOL_V11 = 11; public final static long PROTOCOL_V12 = 12; public final static long PROTOCOL_V13 = 13; + public final static long PROTOCOL_V14 = 14; public static VersionTable v4AndAbove(long networkMagic) { N2NVersionData versionData = new N2NVersionData(networkMagic, true); @@ -33,6 +34,7 @@ public static VersionTable v4AndAbove(long networkMagic) { versionTableMap.put(PROTOCOL_V11, versionData); versionTableMap.put(PROTOCOL_V12, versionData); versionTableMap.put(PROTOCOL_V13, versionData); + versionTableMap.put(PROTOCOL_V14, versionData); return new VersionTable(versionTableMap); } @@ -48,6 +50,7 @@ public static VersionTable v11AndAbove(long networkMagic, boolean initiatorOnlyD versionTableMap.put(PROTOCOL_V11, versionData); versionTableMap.put(PROTOCOL_V12, versionData); versionTableMap.put(PROTOCOL_V13, versionData); + versionTableMap.put(PROTOCOL_V14, versionData); return new VersionTable(versionTableMap); } From 616e8eab646c97fb082b38988c0b0e645bf60d33 Mon Sep 17 00:00:00 2001 From: Satya <35016438+satran004@users.noreply.github.com> Date: Tue, 26 Nov 2024 12:39:32 +0800 Subject: [PATCH 6/6] Deprecate old relay addresses and update to public versions (#102) * Deprecate old relay addresses and update to public versions Replace old IOHK relay addresses with new public relay addresses and mark them as deprecated since version 0.3.4. Also, update the project version from 0.3.4-SNAPSHOT to 0.3.4. * Remove support for LEGACY_TESTNET. * Fix for SonarQube warning * Fix for SonarQube warning --- .../cardano/yaci/core/common/Constants.java | 71 +++++++++++++------ gradle.properties | 2 +- .../yaci/helper/reactive/BlockStreamer.java | 6 -- 3 files changed, 52 insertions(+), 27 deletions(-) diff --git a/core/src/main/java/com/bloxbean/cardano/yaci/core/common/Constants.java b/core/src/main/java/com/bloxbean/cardano/yaci/core/common/Constants.java index 1778e861..10cb6cc7 100644 --- a/core/src/main/java/com/bloxbean/cardano/yaci/core/common/Constants.java +++ b/core/src/main/java/com/bloxbean/cardano/yaci/core/common/Constants.java @@ -3,31 +3,62 @@ import com.bloxbean.cardano.yaci.core.protocol.chainsync.messages.Point; public class Constants { - public final static Point WELL_KNOWN_MAINNET_POINT = new Point(16588737, "4e9bbbb67e3ae262133d94c3da5bffce7b1127fc436e7433b87668dba34c354a"); - public final static Point WELL_KNOWN_TESTNET_POINT = new Point(13694363, "b596f9739b647ab5af901c8fc6f75791e262b0aeba81994a1d622543459734f2"); - public final static Point WELL_KNOWN_PREPROD_POINT = new Point(87480, "528c3e6a00c82dd5331b116103b6e427acf447891ce3ade6c4c7a61d2f0a2b1c"); - public final static Point WELL_KNOWN_PREVIEW_POINT = new Point(8000, "70da683c00985e23903da00656fae96644e1f31dce914aab4ed50e35e4c4842d"); - public final static Point WELL_KNOWN_SANCHONET_POINT = new Point(20, "6a7d97aae2a65ca790fd14802808b7fce00a3362bd7b21c4ed4ccb4296783b98"); + public static final Point WELL_KNOWN_MAINNET_POINT = new Point(16588737, "4e9bbbb67e3ae262133d94c3da5bffce7b1127fc436e7433b87668dba34c354a"); + public static final Point WELL_KNOWN_PREPROD_POINT = new Point(87480, "528c3e6a00c82dd5331b116103b6e427acf447891ce3ade6c4c7a61d2f0a2b1c"); + public static final Point WELL_KNOWN_PREVIEW_POINT = new Point(8000, "70da683c00985e23903da00656fae96644e1f31dce914aab4ed50e35e4c4842d"); + public static final Point WELL_KNOWN_SANCHONET_POINT = new Point(20, "6a7d97aae2a65ca790fd14802808b7fce00a3362bd7b21c4ed4ccb4296783b98"); - public final static long MAINNET_PROTOCOL_MAGIC = NetworkType.MAINNET.getProtocolMagic(); - public final static long LEGACY_TESTNET_PROTOCOL_MAGIC = NetworkType.LEGACY_TESTNET.getProtocolMagic(); - public final static long PREPROD_PROTOCOL_MAGIC = NetworkType.PREPROD.getProtocolMagic(); - public final static long PREVIEW_PROTOCOL_MAGIC = NetworkType.PREVIEW.getProtocolMagic(); - public final static long SANCHONET_PROTOCOL_MAGIC = NetworkType.SANCHONET.getProtocolMagic(); + public static final long MAINNET_PROTOCOL_MAGIC = NetworkType.MAINNET.getProtocolMagic(); + public static final long PREPROD_PROTOCOL_MAGIC = NetworkType.PREPROD.getProtocolMagic(); + public static final long PREVIEW_PROTOCOL_MAGIC = NetworkType.PREVIEW.getProtocolMagic(); + public static final long SANCHONET_PROTOCOL_MAGIC = NetworkType.SANCHONET.getProtocolMagic(); - public final static String TESTNET_IOHK_RELAY_ADDR = "relays-new.cardano-testnet.iohkdev.io"; - public final static int TESTNET_IOHK_RELAY_PORT = 3001; + /** + * @deprecated Use MAINNET_PUBLIC_RELAY_ADDR + */ + @Deprecated(since = "0.3.4") + public static final String MAINNET_IOHK_RELAY_ADDR = "backbone.cardano.iog.io"; - public final static String MAINNET_IOHK_RELAY_ADDR = "relays-new.cardano-mainnet.iohk.io"; - public final static int MAINNET_IOHK_RELAY_PORT = 3001; + /** + * @deprecated Use MAINNET_PUBLIC_RELAY_PORT + */ + @Deprecated(since = "0.3.4") + public static final int MAINNET_IOHK_RELAY_PORT = 3001; - public final static String PREPROD_IOHK_RELAY_ADDR = "preprod-node.world.dev.cardano.org"; - public final static int PREPROD_IOHK_RELAY_PORT = 30000; + /** + * @deprecated Use PREPROD_PUBLIC_RELAY_ADDR + */ + @Deprecated(since = "0.3.4") + public static final String PREPROD_IOHK_RELAY_ADDR = "preprod-node.play.dev.cardano.org"; - public final static String PREVIEW_IOHK_RELAY_ADDR = "preview-node.world.dev.cardano.org"; - public final static int PREVIEW_IOHK_RELAY_PORT = 30002; + /** + * @deprecated Use PREPROD_PUBLIC_RELAY_PORT + */ + @Deprecated(since = "0.3.4") + public static final int PREPROD_IOHK_RELAY_PORT = 3001; - public final static String SANCHONET_PUBLIC_RELAY_ADDR = "sanchonet-node.play.dev.cardano.org"; - public final static int SANCHONET_PUBLIC_RELAY_PORT = 3001; + /** + * @deprecated Use PREVIEW_PUBLIC_RELAY_ADDR + */ + @Deprecated(since = "0.3.4") + public static final String PREVIEW_IOHK_RELAY_ADDR = "preview-node.world.dev.cardano.org"; + + /** + * @deprecated Use PREVIEW_PUBLIC_RELAY_PORT + */ + @Deprecated(since = "0.3.4") + public static final int PREVIEW_IOHK_RELAY_PORT = 3001; + + public static final String MAINNET_PUBLIC_RELAY_ADDR = "backbone.cardano.iog.io"; + public static final int MAINNET_PUBLIC_RELAY_PORT = 3001; + + public static final String PREPROD_PUBLIC_RELAY_ADDR = "preprod-node.play.dev.cardano.org"; + public static final int PREPROD_PUBLIC_RELAY_PORT = 3001; + + public static final String PREVIEW_PUBLIC_RELAY_ADDR = "preview-node.play.dev.cardano.org"; + public static final int PREVIEW_PUBLIC_RELAY_PORT = 3001; + + public static final String SANCHONET_PUBLIC_RELAY_ADDR = "sanchonet-node.play.dev.cardano.org"; + public static final int SANCHONET_PUBLIC_RELAY_PORT = 3001; } diff --git a/gradle.properties b/gradle.properties index accf7a39..cb50497b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,3 +1,3 @@ group = com.bloxbean.cardano artifactId = yaci -version = 0.3.4-SNAPSHOT +version = 0.3.4 diff --git a/helper/src/main/java/com/bloxbean/cardano/yaci/helper/reactive/BlockStreamer.java b/helper/src/main/java/com/bloxbean/cardano/yaci/helper/reactive/BlockStreamer.java index 9784b4ff..bca91058 100644 --- a/helper/src/main/java/com/bloxbean/cardano/yaci/helper/reactive/BlockStreamer.java +++ b/helper/src/main/java/com/bloxbean/cardano/yaci/helper/reactive/BlockStreamer.java @@ -51,8 +51,6 @@ public static BlockStreamer fromLatest(NetworkType networkType) { switch (networkType) { case MAINNET: return fromLatest(MAINNET_IOHK_RELAY_ADDR, MAINNET_IOHK_RELAY_PORT, WELL_KNOWN_MAINNET_POINT, networkType.getN2NVersionTable()); - case LEGACY_TESTNET: - return fromLatest(TESTNET_IOHK_RELAY_ADDR, TESTNET_IOHK_RELAY_PORT, WELL_KNOWN_TESTNET_POINT, networkType.getN2NVersionTable()); case PREPROD: return fromLatest(PREPROD_IOHK_RELAY_ADDR, PREPROD_IOHK_RELAY_PORT, WELL_KNOWN_PREPROD_POINT, networkType.getN2NVersionTable()); case PREVIEW: @@ -73,8 +71,6 @@ public static BlockStreamer fromPoint(NetworkType networkType, Point point) { switch (networkType) { case MAINNET: return fromPoint(MAINNET_IOHK_RELAY_ADDR, MAINNET_IOHK_RELAY_PORT, point, networkType.getN2NVersionTable()); - case LEGACY_TESTNET: - return fromPoint(TESTNET_IOHK_RELAY_ADDR, TESTNET_IOHK_RELAY_PORT, point, networkType.getN2NVersionTable()); case PREPROD: return fromPoint(PREPROD_IOHK_RELAY_ADDR, PREPROD_IOHK_RELAY_PORT, point, networkType.getN2NVersionTable()); case PREVIEW: @@ -242,8 +238,6 @@ public static BlockStreamer forRange(NetworkType networkType, Point fromPoint, P switch (networkType) { case MAINNET: return forRange(MAINNET_IOHK_RELAY_ADDR, MAINNET_IOHK_RELAY_PORT, fromPoint, toPoint, networkType.getN2NVersionTable()); - case LEGACY_TESTNET: - return forRange(TESTNET_IOHK_RELAY_ADDR, TESTNET_IOHK_RELAY_PORT, fromPoint, toPoint, networkType.getN2NVersionTable()); case PREPROD: return forRange(PREPROD_IOHK_RELAY_ADDR, PREPROD_IOHK_RELAY_PORT, fromPoint, toPoint, networkType.getN2NVersionTable()); case PREVIEW: