Skip to content

Commit

Permalink
Merge pull request #3 from Doot-Foundation/test
Browse files Browse the repository at this point in the history
Recent Version v1.0.5
  • Loading branch information
br0wnD3v authored Jan 21, 2024
2 parents b869a9e + 0dcd59a commit ce43397
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 44 deletions.
7 changes: 7 additions & 0 deletions src/cache.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { Doot } from './Doot.js';

import { Cache } from 'o1js';

const cache: Cache = Cache.FileSystem('./dootCache');
const { verificationKey } = await Doot.compile({ cache });
console.log(verificationKey);
44 changes: 0 additions & 44 deletions src/interact.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import dotenv from 'dotenv';
dotenv.config();

import { Doot, IpfsCID } from './Doot.js';

import {
Expand All @@ -18,52 +15,17 @@ async function frameKey(key: CircuitString) {
return Poseidon.hash(key.toFields());
}

// async function getAndUpdateIPFSData() {
// try {
// const response = await axios.get(url);
// const data = response.data; // Assuming the fetched data is in the form of an object

// // Append fetched data to the end of 'historical'
// data.historical = {
// ...data.historical,
// ...data.latest,
// };

// data.latest = {
// currentTimestamp: {
// price,
// decimal,
// lastUpdated,
// signature,
// active,
// urls,
// prices,
// signatures,
// tlsnProofs,
// l1MerkleMapWitness,
// },
// };

// console.log('Updated data:', data);
// } catch (error) {
// console.error('Error fetching data:', error);
// }
// }

const doProofs = false;

let Local = Mina.LocalBlockchain({ proofsEnabled: doProofs });
Mina.setActiveInstance(Local);
// let initialBalance = 10_000_000_000;

let oraclePK = Local.testAccounts[0].privateKey;
let oracle = oraclePK.toPublicKey();

let zkappKey = PrivateKey.random();
let zkappAddress = zkappKey.toPublicKey();

// let lighouseKey = process.env.LIGHTHOUSE_KEY;

let minaKey = await frameKey(CircuitString.fromString('Mina'));
let bitcoinKey = await frameKey(CircuitString.fromString('Bitcoin'));
let chainlinkKey = await frameKey(CircuitString.fromString('Chainlink'));
Expand Down Expand Up @@ -99,12 +61,6 @@ if (doProofs) {
await Doot.compile();
}

/*
`txn.send()` returns a promise with two closures - `.wait()` and `.hash()`
`.hash()` returns the transaction hash, as the name might indicate
`.wait()` automatically resolves once the transaction has been included in a block. this is redundant for the LocalBlockchain, but very helpful for live testnets
*/

let tx = await Mina.transaction(oracle, () => {
AccountUpdate.fundNewAccount(oracle);
dootZkApp.deploy({ zkappKey: zkappKey });
Expand Down

0 comments on commit ce43397

Please sign in to comment.