Skip to content

Commit

Permalink
rollback
Browse files Browse the repository at this point in the history
  • Loading branch information
argonmining committed Aug 27, 2024
1 parent 5ff640f commit 980db72
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 9 deletions.
2 changes: 1 addition & 1 deletion config/config.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"node" : ["https://us-east.nachowyborski.xyz/", "https://us-west.nachowyborski.xyz/", "https://de.nachowyborksi.xyz/", "https://turkey.nachowyborski.xyz/", "https://india.nachowyborski.xyz/", "https://singapore.nachowyborski.xyz/", "https://brazil.nachowyborski.xyz/", "https://italy.nachowyborski.xyz/"],
"network" : "mainnet",
"network" : "testnet-10",
"paymentInterval": 1,
"pool_id" : "us-katpool1",
"location" : "us-east",
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"module": "index.ts",
"type": "module",
"devDependencies": {
"@types/bun": "latest"
"@types/bun": "latest",
"@types/pg": "^8.11.6"
},
"peerDependencies": {
"typescript": "^5.0.0"
Expand Down
24 changes: 24 additions & 0 deletions pg.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
declare module 'pg' {
export class Pool {
constructor(config: any);
connect(): Promise<PoolClient>;
end(): Promise<void>;
}

export class Client {
constructor(config: any);
connect(): Promise<void>;
query(queryText: string, values?: any[]): Promise<QueryResult>;
end(): Promise<void>;
}

export interface PoolClient {
query(queryText: string, values?: any[]): Promise<QueryResult>;
release(): void;
}

export interface QueryResult {
rows: any[];
rowCount: number;
}
}
2 changes: 1 addition & 1 deletion src/monitoring/styling.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ export function getReadableDate () {

export function getReadableTime () {
return (new Date()).toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/, '$1')
}
}
2 changes: 1 addition & 1 deletion src/pool/database/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,4 +108,4 @@ export default class Database {
client.release();
}
}
}
}
2 changes: 1 addition & 1 deletion src/prometheus/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,4 +172,4 @@ export class PushMetrics {
updateGaugeInc(gauge: Gauge, labels: string[]) {
queue.add(() => gauge.labels(...labels).inc(1));
}
}
}
2 changes: 1 addition & 1 deletion src/stratum/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export default class Stratum extends EventEmitter {
varDiffWindow: 0,
minDiff: this.difficulty,
recentShares: new Denque<{ timestamp: number, difficulty: number }>(),
hashrate: 0, // Add this line
hashrate: 0,
}
});
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/stratum/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,4 @@ export default class Server {
socket.end()
}
}
}
}
2 changes: 1 addition & 1 deletion src/stratum/templates/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export default class Templates {
this.rpc.addEventListener('new-block-template', async () => {
const template = (await this.rpc.getBlockTemplate({
payAddress: this.address,
extraData: "Ghostpool"
extraData: "Katpool"
})).block

if (this.templates.has(template.header.hash)) return
Expand Down
2 changes: 1 addition & 1 deletion src/stratum/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ export function getAverageHashrateGHs(stats: WorkerStats): number {
const timeDifference = (Date.now() - relevantShares[0].timestamp) / 1000; // in seconds

return (avgDifficulty * relevantShares.length) / timeDifference;
}
}

0 comments on commit 980db72

Please sign in to comment.