Skip to content

Commit

Permalink
scripts experiments
Browse files Browse the repository at this point in the history
  • Loading branch information
aii23 committed Jul 16, 2024
1 parent a8a32ab commit 6175c60
Show file tree
Hide file tree
Showing 4 changed files with 101 additions and 1 deletion.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
},
"dependencies": {
"@types/node": "^20.12.13",
"axios": "^1.7.2",
"esbuild": "^0.21.5",
"minimist": "^1.2.8",
"zkapp-cli": "^0.21.5"
Expand Down
64 changes: 64 additions & 0 deletions pnpm-lock.yaml

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

27 changes: 27 additions & 0 deletions scripts/hash_proof.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import axios from 'axios';

let response = await axios.post(
'https://api.minascan.io/node/devnet/v1/graphql',
JSON.stringify({
query: `
query {
bestChain(maxLength:1) {
protocolState {
consensusState {
blockHeight,
slotSinceGenesis
}
}
}
}
`,
}),
{
headers: {
'Content-Type': 'application/json',
},
responseType: 'json',
}
);

console.log(response.data);
10 changes: 9 additions & 1 deletion scripts/proof.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,15 @@
* Run with node: `$ node build/scripts/buy_ticket.js <deployAlias>`.
*/
import fs from 'fs/promises';
import { Cache, Mina, NetworkId, PrivateKey, UInt32, fetchAccount } from 'o1js';
import {
Cache,
Mina,
NetworkId,
PrivateKey,
UInt32,
fetchAccount,
fetchLastBlock,
} from 'o1js';
import { DistibutionProgram } from '../src/DistributionProof.js';
import { PLottery } from '../src/PLottery.js';
import { TicketReduceProgram } from '../src/TicketReduceProof.js';
Expand Down

0 comments on commit 6175c60

Please sign in to comment.