From 6e3f6b37493946b9c556d70bfc34ff63ecbaa6a7 Mon Sep 17 00:00:00 2001 From: Geoffrey Casper Date: Tue, 26 Mar 2024 17:42:11 -0400 Subject: [PATCH] contract engine: pin contract code in block parser (#22) --- src/services/new/contractEngineV2.ts | 3 +++ src/services/new/witness/versionManager.ts | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/services/new/contractEngineV2.ts b/src/services/new/contractEngineV2.ts index 6c27070..28c66ca 100644 --- a/src/services/new/contractEngineV2.ts +++ b/src/services/new/contractEngineV2.ts @@ -117,6 +117,9 @@ export class ContractEngineV2 { })).cid const bech32Addr = bech32.encode('vs4', bech32.toWords(contractIdHash.bytes)); + + console.log('pinning contract CID', json.code); + await this.self.ipfs.pin.add(json.code) console.log('smart contract addr', bech32Addr) await this.contractDb.findOneAndUpdate({ diff --git a/src/services/new/witness/versionManager.ts b/src/services/new/witness/versionManager.ts index 2e38b63..3a0ab7b 100644 --- a/src/services/new/witness/versionManager.ts +++ b/src/services/new/witness/versionManager.ts @@ -6,7 +6,7 @@ import { Collection } from "mongodb"; export const VersionConfig = { - index_reset_id: 8, + index_reset_id: 9, //Match with package.json and tag version_id: 'v0.1.2' }