Skip to content

Commit

Permalink
Merge pull request #21 from DIG-Network/release/v0.0.1-alpha.23
Browse files Browse the repository at this point in the history
Release/v0.0.1 alpha.23
  • Loading branch information
MichaelTaylor3D authored Sep 26, 2024
2 parents 6eb31e1 + 4555762 commit cdadf1f
Showing 4 changed files with 33 additions and 20 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -2,6 +2,10 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

### [0.0.1-alpha.23](https://github.com/DIG-Network/dig-incentive-server/compare/v0.0.1-alpha.22...v0.0.1-alpha.23) (2024-09-26)

### [0.0.1-alpha.22](https://github.com/DIG-Network/dig-incentive-server/compare/v0.0.1-alpha.21...v0.0.1-alpha.22) (2024-09-26)

### [0.0.1-alpha.21](https://github.com/DIG-Network/dig-incentive-server/compare/v0.0.1-alpha.20...v0.0.1-alpha.21) (2024-09-26)


12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dig-incentive-server",
"version": "0.0.1-alpha.21",
"version": "0.0.1-alpha.23",
"description": "",
"type": "commonjs",
"main": "./dist/index.js",
@@ -24,7 +24,7 @@
"LICENSE"
],
"dependencies": {
"@dignetwork/dig-sdk": "0.0.1-alpha.88",
"@dignetwork/dig-sdk": "^0.0.1-alpha.92",
"async-mutex": "^0.5.0",
"chia-server-coin": "^0.0.5",
"datalayer-driver": "^0.1.21",
33 changes: 21 additions & 12 deletions src/tasks/payouts.ts
Original file line number Diff line number Diff line change
@@ -87,7 +87,10 @@ const runIncentiveProgram = async (
while (!payoutMade) {
console.log("Sampling up to 50 peers from the current epoch...");

const serverCoins = await serverCoin.sampleCurrentEpoch(50, peerBlackList);
const serverCoins = await serverCoin.sampleCurrentEpoch(
50,
peerBlackList
);
console.log(`Peers sampled: ${serverCoins.length}`);

if (serverCoins.length === 0) {
@@ -103,7 +106,9 @@ const runIncentiveProgram = async (
response = await digPeer.contentServer.headStore();
console.log(`Peer ${peerIp} responded to headStore request`);
} catch (error: any) {
console.error(`Failed to connect to peer ${peerIp}: ${error.message}`);
console.error(
`Failed to connect to peer ${peerIp}: ${error.message}`
);
await program.addToBlacklist(peerIp);
continue;
}
@@ -133,11 +138,12 @@ const runIncentiveProgram = async (
hexKey
)}`
);
const peerChallengeResponse = await digPeer.contentServer.getKey(
hexToUtf8(hexKey),
rootHash,
serializedChallenge
);
const peerChallengeResponse =
await digPeer.contentServer.getKey(
hexToUtf8(hexKey),
rootHash,
serializedChallenge
);
const expectedChallengeResponse =
await digChallenge.createChallengeResponse(challenge);
console.log(
@@ -148,7 +154,8 @@ const runIncentiveProgram = async (
console.error(
`Error during challenge for peer ${peerIp}: ${error.message}`
);
await program.addToBlacklist(peerIp);
// Disabling blacklist for alpha program
// await program.addToBlacklist(peerIp);
return false;
}
});
@@ -176,11 +183,13 @@ const runIncentiveProgram = async (
console.log(`Valid peers found: ${validPeers.length}`);
const paymentAddresses = Array.from(
new Set(
await Promise.all(
validPeers.map(
async (peer) => await peer.contentServer.getPaymentAddress()
(
await Promise.all(
validPeers.map(
async (peer) => await peer.contentServer.getPaymentAddress()
)
)
)
).filter((address) => address !== null)
)
);

0 comments on commit cdadf1f

Please sign in to comment.