@helium/helium-admin-cli 0.6.1 → 0.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/esm/tsconfig.esm.tsbuildinfo +1 -1
- package/package.json +13 -13
- package/lib/cjs/temp-claim-failed-claims.js +0 -149
- package/lib/cjs/temp-claim-failed-claims.js.map +0 -1
- package/lib/cjs/temp-repair-marker-sizes.js +0 -82
- package/lib/cjs/temp-repair-marker-sizes.js.map +0 -1
- package/lib/esm/src/temp-claim-failed-claims.js +0 -107
- package/lib/esm/src/temp-claim-failed-claims.js.map +0 -1
- package/lib/esm/src/temp-repair-marker-sizes.js +0 -41
- package/lib/esm/src/temp-repair-marker-sizes.js.map +0 -1
- package/lib/types/src/temp-claim-failed-claims.d.ts +0 -2
- package/lib/types/src/temp-claim-failed-claims.d.ts.map +0 -1
- package/lib/types/src/temp-repair-marker-sizes.d.ts +0 -2
- package/lib/types/src/temp-repair-marker-sizes.d.ts.map +0 -1
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"registry": "https://registry.npmjs.org/"
|
|
6
6
|
},
|
|
7
7
|
"license": "Apache-2.0",
|
|
8
|
-
"version": "0.6.
|
|
8
|
+
"version": "0.6.2",
|
|
9
9
|
"description": "CLI to bootstrap the network",
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|
|
@@ -40,18 +40,18 @@
|
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@coral-xyz/anchor": "^0.28.0",
|
|
42
42
|
"@helium/address": "^4.10.2",
|
|
43
|
-
"@helium/circuit-breaker-sdk": "^0.6.
|
|
43
|
+
"@helium/circuit-breaker-sdk": "^0.6.2",
|
|
44
44
|
"@helium/crypto": "^4.10.2",
|
|
45
|
-
"@helium/data-credits-sdk": "^0.6.
|
|
46
|
-
"@helium/distributor-oracle": "^0.6.
|
|
47
|
-
"@helium/fanout-sdk": "^0.6.
|
|
48
|
-
"@helium/helium-entity-manager-sdk": "^0.6.
|
|
49
|
-
"@helium/helium-sub-daos-sdk": "^0.6.
|
|
50
|
-
"@helium/lazy-distributor-sdk": "^0.6.
|
|
51
|
-
"@helium/mobile-entity-manager-sdk": "^0.6.
|
|
52
|
-
"@helium/price-oracle-sdk": "^0.6.
|
|
53
|
-
"@helium/spl-utils": "^0.6.
|
|
54
|
-
"@helium/treasury-management-sdk": "^0.6.
|
|
45
|
+
"@helium/data-credits-sdk": "^0.6.2",
|
|
46
|
+
"@helium/distributor-oracle": "^0.6.2",
|
|
47
|
+
"@helium/fanout-sdk": "^0.6.2",
|
|
48
|
+
"@helium/helium-entity-manager-sdk": "^0.6.2",
|
|
49
|
+
"@helium/helium-sub-daos-sdk": "^0.6.2",
|
|
50
|
+
"@helium/lazy-distributor-sdk": "^0.6.2",
|
|
51
|
+
"@helium/mobile-entity-manager-sdk": "^0.6.2",
|
|
52
|
+
"@helium/price-oracle-sdk": "^0.6.2",
|
|
53
|
+
"@helium/spl-utils": "^0.6.2",
|
|
54
|
+
"@helium/treasury-management-sdk": "^0.6.2",
|
|
55
55
|
"@solana/spl-account-compression": "^0.1.7",
|
|
56
56
|
"@solana/spl-governance": "^0.3.18",
|
|
57
57
|
"@solana/spl-token": "^0.3.8",
|
|
@@ -70,5 +70,5 @@
|
|
|
70
70
|
"typescript": "^5.2.2"
|
|
71
71
|
},
|
|
72
72
|
"author": "",
|
|
73
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "7ed79f96b308c946585fd68defdaf1b192c96395"
|
|
74
74
|
}
|
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
29
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
30
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
31
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
-
});
|
|
33
|
-
};
|
|
34
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
35
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
36
|
-
};
|
|
37
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
-
exports.run = void 0;
|
|
39
|
-
const helium_sub_daos_sdk_1 = require("@helium/helium-sub-daos-sdk");
|
|
40
|
-
const anchor = __importStar(require("@coral-xyz/anchor"));
|
|
41
|
-
const web3_js_1 = require("@solana/web3.js");
|
|
42
|
-
const bn_js_1 = require("bn.js");
|
|
43
|
-
const os_1 = __importDefault(require("os"));
|
|
44
|
-
const yargs_1 = __importDefault(require("yargs/yargs"));
|
|
45
|
-
const spl_utils_1 = require("@helium/spl-utils");
|
|
46
|
-
function run(args = process.argv) {
|
|
47
|
-
var _a, _b, _c;
|
|
48
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
49
|
-
const yarg = (0, yargs_1.default)(args).options({
|
|
50
|
-
wallet: {
|
|
51
|
-
alias: "k",
|
|
52
|
-
describe: "Anchor wallet keypair",
|
|
53
|
-
default: `${os_1.default.homedir()}/.config/solana/id.json`,
|
|
54
|
-
},
|
|
55
|
-
url: {
|
|
56
|
-
alias: "u",
|
|
57
|
-
default: "http://127.0.0.1:8899",
|
|
58
|
-
describe: "The solana url",
|
|
59
|
-
},
|
|
60
|
-
});
|
|
61
|
-
const argv = yield yarg.argv;
|
|
62
|
-
process.env.ANCHOR_WALLET = argv.wallet;
|
|
63
|
-
process.env.ANCHOR_PROVIDER_URL = argv.url;
|
|
64
|
-
anchor.setProvider(anchor.AnchorProvider.local(argv.url));
|
|
65
|
-
const epoch = 19624;
|
|
66
|
-
const provider = anchor.getProvider();
|
|
67
|
-
const heliumSubDaosProgram = yield (0, helium_sub_daos_sdk_1.init)(provider);
|
|
68
|
-
const connection = new web3_js_1.Connection(provider.connection.rpcEndpoint, "confirmed");
|
|
69
|
-
const subDaoEpochInfos = [
|
|
70
|
-
(0, helium_sub_daos_sdk_1.subDaoEpochInfoKey)((0, helium_sub_daos_sdk_1.subDaoKey)(spl_utils_1.IOT_MINT)[0], new bn_js_1.BN(epoch).mul(new bn_js_1.BN(helium_sub_daos_sdk_1.EPOCH_LENGTH)))[0],
|
|
71
|
-
(0, helium_sub_daos_sdk_1.subDaoEpochInfoKey)((0, helium_sub_daos_sdk_1.subDaoKey)(spl_utils_1.MOBILE_MINT)[0], new bn_js_1.BN(epoch).mul(new bn_js_1.BN(helium_sub_daos_sdk_1.EPOCH_LENGTH)))[0],
|
|
72
|
-
];
|
|
73
|
-
console.log(subDaoEpochInfos);
|
|
74
|
-
const coder = new anchor.BorshCoder(heliumSubDaosProgram.idl);
|
|
75
|
-
for (const subDaoEpochInfo of subDaoEpochInfos) {
|
|
76
|
-
const sigs = [];
|
|
77
|
-
let before = undefined;
|
|
78
|
-
while (true) {
|
|
79
|
-
const newSigs = yield connection.getSignaturesForAddress(subDaoEpochInfo, {
|
|
80
|
-
limit: 1000,
|
|
81
|
-
before,
|
|
82
|
-
});
|
|
83
|
-
sigs.push(...newSigs);
|
|
84
|
-
if (newSigs.length < 1000) {
|
|
85
|
-
break;
|
|
86
|
-
}
|
|
87
|
-
before = newSigs[newSigs.length - 1].signature;
|
|
88
|
-
}
|
|
89
|
-
let foundIssue = false;
|
|
90
|
-
for (const sig of sigs) {
|
|
91
|
-
const tx = yield connection.getTransaction(sig.signature);
|
|
92
|
-
if (((_a = tx === null || tx === void 0 ? void 0 : tx.meta) === null || _a === void 0 ? void 0 : _a.err) || !tx) {
|
|
93
|
-
continue;
|
|
94
|
-
}
|
|
95
|
-
// Should have been before this
|
|
96
|
-
if (tx.blockTime && tx.blockTime > 1695652196) {
|
|
97
|
-
continue;
|
|
98
|
-
}
|
|
99
|
-
for (const instruction of ((tx === null || tx === void 0 ? void 0 : tx.transaction.message.instructions) || []).filter((ix) => tx.transaction.message.accountKeys[ix.programIdIndex].equals(heliumSubDaosProgram.programId))) {
|
|
100
|
-
const accountMetas = instruction.accounts.map((idx) => ({
|
|
101
|
-
pubkey: tx.transaction.message.accountKeys[idx],
|
|
102
|
-
isSigner: tx.transaction.message.isAccountSigner(idx),
|
|
103
|
-
isWritable: tx.transaction.message.isAccountWritable(idx),
|
|
104
|
-
}));
|
|
105
|
-
const ix = coder.instruction.decode(instruction.data, "base58");
|
|
106
|
-
if (!ix) {
|
|
107
|
-
continue;
|
|
108
|
-
}
|
|
109
|
-
const formatted = coder.instruction.format(ix, accountMetas);
|
|
110
|
-
if (ix.name === "issueRewardsV0") {
|
|
111
|
-
foundIssue = true;
|
|
112
|
-
}
|
|
113
|
-
if (!foundIssue) {
|
|
114
|
-
continue;
|
|
115
|
-
}
|
|
116
|
-
if (ix.name !== "claimRewardsV0") {
|
|
117
|
-
continue;
|
|
118
|
-
}
|
|
119
|
-
// @ts-ignore
|
|
120
|
-
if (ix.data.args.epoch.eq(new anchor.BN())) {
|
|
121
|
-
continue;
|
|
122
|
-
}
|
|
123
|
-
const position = (_b = formatted === null || formatted === void 0 ? void 0 : formatted.accounts.find((a) => a.name === "Position")) === null || _b === void 0 ? void 0 : _b.pubkey;
|
|
124
|
-
const subDao = (_c = formatted === null || formatted === void 0 ? void 0 : formatted.accounts.find((a) => a.name === "Sub Dao")) === null || _c === void 0 ? void 0 : _c.pubkey;
|
|
125
|
-
if (!subDao || !position) {
|
|
126
|
-
throw new Error("Subdao or position missing");
|
|
127
|
-
}
|
|
128
|
-
const method = heliumSubDaosProgram.methods
|
|
129
|
-
.tempClaimFailedClaims()
|
|
130
|
-
.accounts({
|
|
131
|
-
authority: provider.wallet.publicKey,
|
|
132
|
-
position,
|
|
133
|
-
subDao,
|
|
134
|
-
subDaoEpochInfo,
|
|
135
|
-
});
|
|
136
|
-
const { block } = yield method.pubkeys();
|
|
137
|
-
if (!(yield connection.getAccountInfo(block))) {
|
|
138
|
-
console.log("Repairing", position.toBase58());
|
|
139
|
-
yield method.rpc({
|
|
140
|
-
skipPreflight: true,
|
|
141
|
-
});
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
});
|
|
147
|
-
}
|
|
148
|
-
exports.run = run;
|
|
149
|
-
//# sourceMappingURL=temp-claim-failed-claims.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"temp-claim-failed-claims.js","sourceRoot":"","sources":["../../src/temp-claim-failed-claims.ts"],"names":[],"mappings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k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
29
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
30
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
31
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
-
});
|
|
33
|
-
};
|
|
34
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
35
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
36
|
-
};
|
|
37
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
-
exports.run = void 0;
|
|
39
|
-
const anchor = __importStar(require("@coral-xyz/anchor"));
|
|
40
|
-
const os_1 = __importDefault(require("os"));
|
|
41
|
-
const yargs_1 = __importDefault(require("yargs/yargs"));
|
|
42
|
-
const voter_stake_registry_sdk_1 = require("@helium/voter-stake-registry-sdk");
|
|
43
|
-
function run(args = process.argv) {
|
|
44
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
45
|
-
const yarg = (0, yargs_1.default)(args).options({
|
|
46
|
-
wallet: {
|
|
47
|
-
alias: "k",
|
|
48
|
-
describe: "Anchor wallet keypair",
|
|
49
|
-
default: `${os_1.default.homedir()}/.config/solana/id.json`,
|
|
50
|
-
},
|
|
51
|
-
url: {
|
|
52
|
-
alias: "u",
|
|
53
|
-
default: "http://127.0.0.1:8899",
|
|
54
|
-
describe: "The solana url",
|
|
55
|
-
},
|
|
56
|
-
});
|
|
57
|
-
const argv = yield yarg.argv;
|
|
58
|
-
process.env.ANCHOR_WALLET = argv.wallet;
|
|
59
|
-
process.env.ANCHOR_PROVIDER_URL = argv.url;
|
|
60
|
-
anchor.setProvider(anchor.AnchorProvider.local(argv.url));
|
|
61
|
-
const provider = anchor.getProvider();
|
|
62
|
-
const voterStakeRegistryProgram = yield (0, voter_stake_registry_sdk_1.init)(provider);
|
|
63
|
-
const markers = yield voterStakeRegistryProgram.account.voteMarkerV0.all();
|
|
64
|
-
console.log(`${markers.length} total`);
|
|
65
|
-
let i = 0;
|
|
66
|
-
for (const marker of markers) {
|
|
67
|
-
i++;
|
|
68
|
-
yield voterStakeRegistryProgram.methods
|
|
69
|
-
.repairVoteMarkerSizes()
|
|
70
|
-
.accounts({
|
|
71
|
-
marker: marker.publicKey,
|
|
72
|
-
voter: marker.account.voter,
|
|
73
|
-
payer: provider.wallet.publicKey,
|
|
74
|
-
})
|
|
75
|
-
.rpc({ skipPreflight: true });
|
|
76
|
-
console.log(`Closed ${i}/${markers.length}`);
|
|
77
|
-
}
|
|
78
|
-
console.log("Done");
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
exports.run = run;
|
|
82
|
-
//# sourceMappingURL=temp-repair-marker-sizes.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"temp-repair-marker-sizes.js","sourceRoot":"","sources":["../../src/temp-repair-marker-sizes.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,0DAA4C;AAS5C,4CAAoB;AACpB,wDAAgC;AAEhC,+EAAwD;AAExD,SAAsB,GAAG,CAAC,OAAY,OAAO,CAAC,IAAI;;QAChD,MAAM,IAAI,GAAG,IAAA,eAAK,EAAC,IAAI,CAAC,CAAC,OAAO,CAAC;YAC/B,MAAM,EAAE;gBACN,KAAK,EAAE,GAAG;gBACV,QAAQ,EAAE,uBAAuB;gBACjC,OAAO,EAAE,GAAG,YAAE,CAAC,OAAO,EAAE,yBAAyB;aAClD;YACD,GAAG,EAAE;gBACH,KAAK,EAAE,GAAG;gBACV,OAAO,EAAE,uBAAuB;gBAChC,QAAQ,EAAE,gBAAgB;aAC3B;SACF,CAAC,CAAC;QAEH,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC;QAC7B,OAAO,CAAC,GAAG,CAAC,aAAa,GAAG,IAAI,CAAC,MAAM,CAAC;QACxC,OAAO,CAAC,GAAG,CAAC,mBAAmB,GAAG,IAAI,CAAC,GAAG,CAAC;QAC3C,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;QAE1D,MAAM,QAAQ,GAAG,MAAM,CAAC,WAAW,EAA2B,CAAC;QAC/D,MAAM,yBAAyB,GAAG,MAAM,IAAA,+BAAI,EAAC,QAAQ,CAAC,CAAC;QACvD,MAAM,OAAO,GAAG,MAAM,yBAAyB,CAAC,OAAO,CAAC,YAAY,CAAC,GAAG,EAAE,CAAC;QAE3E,OAAO,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,MAAM,QAAQ,CAAC,CAAA;QACtC,IAAI,CAAC,GAAG,CAAC,CAAC;QACV,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE;YAC5B,CAAC,EAAE,CAAA;YACH,MAAM,yBAAyB,CAAC,OAAO;iBACpC,qBAAqB,EAAE;iBACvB,QAAQ,CAAC;gBACR,MAAM,EAAE,MAAM,CAAC,SAAS;gBACxB,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,KAAK;gBAC3B,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,SAAS;aACjC,CAAC;iBACD,GAAG,CAAC,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;YAChC,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;SAC9C;QACD,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;IACrB,CAAC;CAAA;AAtCD,kBAsCC"}
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
import { EPOCH_LENGTH, init as initDao, subDaoEpochInfoKey, subDaoKey, } from "@helium/helium-sub-daos-sdk";
|
|
2
|
-
import * as anchor from "@coral-xyz/anchor";
|
|
3
|
-
import { Connection, } from "@solana/web3.js";
|
|
4
|
-
import { BN } from "bn.js";
|
|
5
|
-
import os from "os";
|
|
6
|
-
import yargs from "yargs/yargs";
|
|
7
|
-
import { IOT_MINT, MOBILE_MINT } from "@helium/spl-utils";
|
|
8
|
-
export async function run(args = process.argv) {
|
|
9
|
-
const yarg = yargs(args).options({
|
|
10
|
-
wallet: {
|
|
11
|
-
alias: "k",
|
|
12
|
-
describe: "Anchor wallet keypair",
|
|
13
|
-
default: `${os.homedir()}/.config/solana/id.json`,
|
|
14
|
-
},
|
|
15
|
-
url: {
|
|
16
|
-
alias: "u",
|
|
17
|
-
default: "http://127.0.0.1:8899",
|
|
18
|
-
describe: "The solana url",
|
|
19
|
-
},
|
|
20
|
-
});
|
|
21
|
-
const argv = await yarg.argv;
|
|
22
|
-
process.env.ANCHOR_WALLET = argv.wallet;
|
|
23
|
-
process.env.ANCHOR_PROVIDER_URL = argv.url;
|
|
24
|
-
anchor.setProvider(anchor.AnchorProvider.local(argv.url));
|
|
25
|
-
const epoch = 19624;
|
|
26
|
-
const provider = anchor.getProvider();
|
|
27
|
-
const heliumSubDaosProgram = await initDao(provider);
|
|
28
|
-
const connection = new Connection(provider.connection.rpcEndpoint, "confirmed");
|
|
29
|
-
const subDaoEpochInfos = [
|
|
30
|
-
subDaoEpochInfoKey(subDaoKey(IOT_MINT)[0], new BN(epoch).mul(new BN(EPOCH_LENGTH)))[0],
|
|
31
|
-
subDaoEpochInfoKey(subDaoKey(MOBILE_MINT)[0], new BN(epoch).mul(new BN(EPOCH_LENGTH)))[0],
|
|
32
|
-
];
|
|
33
|
-
console.log(subDaoEpochInfos);
|
|
34
|
-
const coder = new anchor.BorshCoder(heliumSubDaosProgram.idl);
|
|
35
|
-
for (const subDaoEpochInfo of subDaoEpochInfos) {
|
|
36
|
-
const sigs = [];
|
|
37
|
-
let before = undefined;
|
|
38
|
-
while (true) {
|
|
39
|
-
const newSigs = await connection.getSignaturesForAddress(subDaoEpochInfo, {
|
|
40
|
-
limit: 1000,
|
|
41
|
-
before,
|
|
42
|
-
});
|
|
43
|
-
sigs.push(...newSigs);
|
|
44
|
-
if (newSigs.length < 1000) {
|
|
45
|
-
break;
|
|
46
|
-
}
|
|
47
|
-
before = newSigs[newSigs.length - 1].signature;
|
|
48
|
-
}
|
|
49
|
-
let foundIssue = false;
|
|
50
|
-
for (const sig of sigs) {
|
|
51
|
-
const tx = await connection.getTransaction(sig.signature);
|
|
52
|
-
if (tx?.meta?.err || !tx) {
|
|
53
|
-
continue;
|
|
54
|
-
}
|
|
55
|
-
// Should have been before this
|
|
56
|
-
if (tx.blockTime && tx.blockTime > 1695652196) {
|
|
57
|
-
continue;
|
|
58
|
-
}
|
|
59
|
-
for (const instruction of (tx?.transaction.message.instructions || []).filter((ix) => tx.transaction.message.accountKeys[ix.programIdIndex].equals(heliumSubDaosProgram.programId))) {
|
|
60
|
-
const accountMetas = instruction.accounts.map((idx) => ({
|
|
61
|
-
pubkey: tx.transaction.message.accountKeys[idx],
|
|
62
|
-
isSigner: tx.transaction.message.isAccountSigner(idx),
|
|
63
|
-
isWritable: tx.transaction.message.isAccountWritable(idx),
|
|
64
|
-
}));
|
|
65
|
-
const ix = coder.instruction.decode(instruction.data, "base58");
|
|
66
|
-
if (!ix) {
|
|
67
|
-
continue;
|
|
68
|
-
}
|
|
69
|
-
const formatted = coder.instruction.format(ix, accountMetas);
|
|
70
|
-
if (ix.name === "issueRewardsV0") {
|
|
71
|
-
foundIssue = true;
|
|
72
|
-
}
|
|
73
|
-
if (!foundIssue) {
|
|
74
|
-
continue;
|
|
75
|
-
}
|
|
76
|
-
if (ix.name !== "claimRewardsV0") {
|
|
77
|
-
continue;
|
|
78
|
-
}
|
|
79
|
-
// @ts-ignore
|
|
80
|
-
if (ix.data.args.epoch.eq(new anchor.BN())) {
|
|
81
|
-
continue;
|
|
82
|
-
}
|
|
83
|
-
const position = formatted?.accounts.find((a) => a.name === "Position")?.pubkey;
|
|
84
|
-
const subDao = formatted?.accounts.find((a) => a.name === "Sub Dao")?.pubkey;
|
|
85
|
-
if (!subDao || !position) {
|
|
86
|
-
throw new Error("Subdao or position missing");
|
|
87
|
-
}
|
|
88
|
-
const method = heliumSubDaosProgram.methods
|
|
89
|
-
.tempClaimFailedClaims()
|
|
90
|
-
.accounts({
|
|
91
|
-
authority: provider.wallet.publicKey,
|
|
92
|
-
position,
|
|
93
|
-
subDao,
|
|
94
|
-
subDaoEpochInfo,
|
|
95
|
-
});
|
|
96
|
-
const { block } = await method.pubkeys();
|
|
97
|
-
if (!(await connection.getAccountInfo(block))) {
|
|
98
|
-
console.log("Repairing", position.toBase58());
|
|
99
|
-
await method.rpc({
|
|
100
|
-
skipPreflight: true,
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
//# sourceMappingURL=temp-claim-failed-claims.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"temp-claim-failed-claims.js","sourceRoot":"","sources":["../../../src/temp-claim-failed-claims.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,YAAY,EACZ,IAAI,IAAI,OAAO,EACf,kBAAkB,EAClB,SAAS,GACV,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAGL,UAAU,GAEX,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAE3B,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,KAAK,MAAM,aAAa,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAE1D,MAAM,CAAC,KAAK,UAAU,GAAG,CAAC,OAAY,OAAO,CAAC,IAAI;IAChD,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC;QAC/B,MAAM,EAAE;YACN,KAAK,EAAE,GAAG;YACV,QAAQ,EAAE,uBAAuB;YACjC,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,EAAE,yBAAyB;SAClD;QACD,GAAG,EAAE;YACH,KAAK,EAAE,GAAG;YACV,OAAO,EAAE,uBAAuB;YAChC,QAAQ,EAAE,gBAAgB;SAC3B;KACF,CAAC,CAAC;IAEH,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC;IAC7B,OAAO,CAAC,GAAG,CAAC,aAAa,GAAG,IAAI,CAAC,MAAM,CAAC;IACxC,OAAO,CAAC,GAAG,CAAC,mBAAmB,GAAG,IAA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c,CAAC,KAAM,CAAC,CAAC,EAAE;oBAC9C,OAAO,CAAC,GAAG,CAAC,WAAW,EAAE,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAC;oBAC9C,MAAM,MAAM,CAAC,GAAG,CAAC;wBACf,aAAa,EAAE,IAAI;qBACpB,CAAC,CAAC;iBACJ;aACF;SACF;KACF;AACH,CAAC"}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import * as anchor from "@coral-xyz/anchor";
|
|
2
|
-
import os from "os";
|
|
3
|
-
import yargs from "yargs/yargs";
|
|
4
|
-
import { init } from "@helium/voter-stake-registry-sdk";
|
|
5
|
-
export async function run(args = process.argv) {
|
|
6
|
-
const yarg = yargs(args).options({
|
|
7
|
-
wallet: {
|
|
8
|
-
alias: "k",
|
|
9
|
-
describe: "Anchor wallet keypair",
|
|
10
|
-
default: `${os.homedir()}/.config/solana/id.json`,
|
|
11
|
-
},
|
|
12
|
-
url: {
|
|
13
|
-
alias: "u",
|
|
14
|
-
default: "http://127.0.0.1:8899",
|
|
15
|
-
describe: "The solana url",
|
|
16
|
-
},
|
|
17
|
-
});
|
|
18
|
-
const argv = await yarg.argv;
|
|
19
|
-
process.env.ANCHOR_WALLET = argv.wallet;
|
|
20
|
-
process.env.ANCHOR_PROVIDER_URL = argv.url;
|
|
21
|
-
anchor.setProvider(anchor.AnchorProvider.local(argv.url));
|
|
22
|
-
const provider = anchor.getProvider();
|
|
23
|
-
const voterStakeRegistryProgram = await init(provider);
|
|
24
|
-
const markers = await voterStakeRegistryProgram.account.voteMarkerV0.all();
|
|
25
|
-
console.log(`${markers.length} total`);
|
|
26
|
-
let i = 0;
|
|
27
|
-
for (const marker of markers) {
|
|
28
|
-
i++;
|
|
29
|
-
await voterStakeRegistryProgram.methods
|
|
30
|
-
.repairVoteMarkerSizes()
|
|
31
|
-
.accounts({
|
|
32
|
-
marker: marker.publicKey,
|
|
33
|
-
voter: marker.account.voter,
|
|
34
|
-
payer: provider.wallet.publicKey,
|
|
35
|
-
})
|
|
36
|
-
.rpc({ skipPreflight: true });
|
|
37
|
-
console.log(`Closed ${i}/${markers.length}`);
|
|
38
|
-
}
|
|
39
|
-
console.log("Done");
|
|
40
|
-
}
|
|
41
|
-
//# sourceMappingURL=temp-repair-marker-sizes.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"temp-repair-marker-sizes.js","sourceRoot":"","sources":["../../../src/temp-repair-marker-sizes.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAC;AAS5C,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,KAAK,MAAM,aAAa,CAAC;AAEhC,OAAO,EAAE,IAAI,EAAE,MAAM,kCAAkC,CAAC;AAExD,MAAM,CAAC,KAAK,UAAU,GAAG,CAAC,OAAY,OAAO,CAAC,IAAI;IAChD,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC;QAC/B,MAAM,EAAE;YACN,KAAK,EAAE,GAAG;YACV,QAAQ,EAAE,uBAAuB;YACjC,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,EAAE,yBAAyB;SAClD;QACD,GAAG,EAAE;YACH,KAAK,EAAE,GAAG;YACV,OAAO,EAAE,uBAAuB;YAChC,QAAQ,EAAE,gBAAgB;SAC3B;KACF,CAAC,CAAC;IAEH,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC;IAC7B,OAAO,CAAC,GAAG,CAAC,aAAa,GAAG,IAAI,CAAC,MAAM,CAAC;IACxC,OAAO,CAAC,GAAG,CAAC,mBAAmB,GAAG,IAAI,CAAC,GAAG,CAAC;IAC3C,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IAE1D,MAAM,QAAQ,GAAG,MAAM,CAAC,WAAW,EAA2B,CAAC;IAC/D,MAAM,yBAAyB,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,CAAC;IACvD,MAAM,OAAO,GAAG,MAAM,yBAAyB,CAAC,OAAO,CAAC,YAAY,CAAC,GAAG,EAAE,CAAC;IAE3E,OAAO,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,MAAM,QAAQ,CAAC,CAAA;IACtC,IAAI,CAAC,GAAG,CAAC,CAAC;IACV,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE;QAC5B,CAAC,EAAE,CAAA;QACH,MAAM,yBAAyB,CAAC,OAAO;aACpC,qBAAqB,EAAE;aACvB,QAAQ,CAAC;YACR,MAAM,EAAE,MAAM,CAAC,SAAS;YACxB,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,KAAK;YAC3B,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,SAAS;SACjC,CAAC;aACD,GAAG,CAAC,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;QAChC,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;KAC9C;IACD,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;AACrB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"temp-claim-failed-claims.d.ts","sourceRoot":"","sources":["../../../src/temp-claim-failed-claims.ts"],"names":[],"mappings":"AAsBA,wBAAsB,GAAG,CAAC,IAAI,GAAE,GAAkB,iBA6HjD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"temp-repair-marker-sizes.d.ts","sourceRoot":"","sources":["../../../src/temp-repair-marker-sizes.ts"],"names":[],"mappings":"AAuBA,wBAAsB,GAAG,CAAC,IAAI,GAAE,GAAkB,iBAsCjD"}
|