From 0c9134702d52be4ed5637a3816b691b4adfe0303 Mon Sep 17 00:00:00 2001 From: Luke Schoen Date: Tue, 17 Dec 2024 12:12:53 +1100 Subject: [PATCH] chore: Add mock values for public key of Secret Gateway deployed on Localhost --- _SETUP.md | 4 ++++ packages/secret-contracts-scripts/src/config/deploy.ts | 6 ++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/_SETUP.md b/_SETUP.md index 0c7d4de..13f4dfd 100644 --- a/_SETUP.md +++ b/_SETUP.md @@ -351,6 +351,10 @@ git submodule update --init --recursive * View on Secret Localhost block explorer * Reference https://docs.scrt.network/secret-network-documentation/development/readme-1/compile-and-deploy + * Note: In order to populate the `secret.localhost.secretGateway.gatewayContractPublicKey` and `secret.localhost.secretGateway.gatewayContractEncryptionKeyForChaChaPoly1305`, according to Alex at Secret Network, you can't get a public key for it because it relies on the on-chain randomness (Secret VRF) to get a private key first. As such, you have to make some mock code to make it usable on a local testnet (where secretVRF from env.block.random is not available). + + * Next, deploy the Nunya Secret contract... + * IGNORE - Terminal Tab 2: Option B (SecretCLI) Compile, Upload, Instantiate: * [Compile](https://docs.scrt.network/secret-network-documentation/development/readme-1/compile-and-deploy#compile-the-code). Note: Outputs contract.wasm or contract.wasm.gz file in the root directory being the ./SecretPath/TNLS-Gateways/secret/ folder. Using `make build-mainnet-reproducible` will remove contract.wasm so only the optimised contract.wasm.gz remains. Warning: If you only run `make build-mainnet` then you will get this error https://github.com/svub/nunya/issues/8 when deploying. diff --git a/packages/secret-contracts-scripts/src/config/deploy.ts b/packages/secret-contracts-scripts/src/config/deploy.ts index 5d35412..bf02e71 100644 --- a/packages/secret-contracts-scripts/src/config/deploy.ts +++ b/packages/secret-contracts-scripts/src/config/deploy.ts @@ -83,8 +83,10 @@ const config = { gatewayContractCodeId: "1", // only know after upload gatewayContractAddress: "secret1mfk7n6mc2cg6lznujmeckdh4x0a5ezf6hx6y8q", // only know after instantiate gatewayContractCodeHash: "97653655266e70774ab8f0bf2ee2c17ff4a7f47d2e2fd477c69b52476841277b", // only know after upload - gatewayContractPublicKey: "", - gatewayContractEncryptionKeyForChaChaPoly1305: "", + // note: mock value hard-coded + gatewayContractPublicKey: "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + // note: mock value hard-coded + gatewayContractEncryptionKeyForChaChaPoly1305: "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", gatewayContractWasmPath: "secret-gateway-contract.wasm.gz", } }