Created
November 25, 2020 18:34
-
-
Save keefertaylor/be298f365636d9365a70c26f4f30ed9e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import fetch from 'node-fetch' | |
import { getLogger } from 'loglevel' | |
import { WrappedTezosHelper, registerFetch, registerLogger } from 'conseiljs' | |
import { Utils } from '@tacoinfra/harbinger-lib' | |
import { TezosNodeReader } from '../../../conseiljs/dist' | |
const TOKEN_ADDR = "KT1JYf7xjCJAqFDfNpuump9woSMaapy1WcMY" | |
const BIG_MAP_ID = 14566 | |
const OVEN_LIST_BIG_MAP_ID = 14569 | |
const OVEN_ADDR = "KT1N6R5hn15yQoJWXJwiAADkkYQJNdgGyUqD" | |
const CORE_ADDR = "KT1S98ELFTo6mdMBqhAVbGgKAVgLbdPP3AX8" | |
const KEEFERS_ACCOUNT = "tz1fzHtv2UqtXzFUBHuBPh2xXVv5Pv5MTh5Z" | |
const DEST_ACCOUNT = "tz1PnUd6R31MnjEE8VhfZhZdbGc1hrWQvjnK" | |
const TEZOS_NODE_URL = "https://rpczero.tzbeta.net" | |
const TOKEN_CONTRACT_SCRIPT = "" | |
const OVEN_CONTRACT_SCRIPT = "" | |
const CORE_CONTRACT_SCRIPT = "" | |
const PRIV_KEY = "<REDACTED>" | |
const CONSEIL_URL = "https://conseil-dev.cryptonomic-infra.tech:443" | |
const CONSEIL_KEY = "<REDACTED>" | |
async function main() { | |
// Configure Conseil | |
const logger = getLogger('conseiljs') | |
logger.setLevel('info', false) | |
registerLogger(logger) | |
registerFetch(fetch) | |
const keystore = await Utils.keyStoreFromPrivateKey(PRIV_KEY) | |
const signer = await Utils.signerFromKeyStore(keystore) | |
console.log('========================================') | |
console.log('SANITY CHECKS') | |
console.log('========================================') | |
// Verify contracts | |
const contractMatched = await WrappedTezosHelper.verifyDestination(TEZOS_NODE_URL, TOKEN_ADDR, OVEN_ADDR, CORE_ADDR) | |
console.log("Contract matched: " + contractMatched) | |
console.log("") | |
// Verify scripts | |
// const scriptsMatch = await WrappedTezosTokenHelper.verifyScript(TOKEN_CONTRACT_SCRIPT, OVEN_CONTRACT_SCRIPT, CORE_CONTRACT_SCRIPT) | |
console.log('========================================') | |
console.log('CORE CONTRACT') | |
console.log('========================================') | |
const serverInfo = { | |
url: CONSEIL_URL, | |
apiKey: CONSEIL_KEY, | |
network: 'delphinet' | |
} | |
const result = await WrappedTezosHelper.listOvens(serverInfo, CORE_ADDR, KEEFERS_ACCOUNT, OVEN_LIST_BIG_MAP_ID) | |
console.log(JSON.stringify(result)) | |
} | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment