From d52a56039c880cd48aa2923fb26b8844e5cdf95a Mon Sep 17 00:00:00 2001 From: simonpure Date: Sun, 19 Jun 2022 11:06:15 -0700 Subject: [PATCH] repl: add arweave secret fn --- packages/services/repl.js | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/packages/services/repl.js b/packages/services/repl.js index 9c1ba2ae9..7f04ffb2f 100644 --- a/packages/services/repl.js +++ b/packages/services/repl.js @@ -8,9 +8,20 @@ Promise.all([ console.log('done') return (async () => { try { - var secretClient = async (projectId) => secretService.build({ projectId }) - var projectId = 'kernel-signature-staging' - global.client = await secretClient(projectId) + global.secretClient = async (projectId) => secretService.build({ projectId }) + global.addArweaveSecret = async (filename) => { + if (!filename) { + console.log('missing filename') + return + } + const data = fs.readFileSync(filename) + const projectId = 'kernel-signature-prod' + const client = await secretClient(projectId) + const secretId = 'arweaveJwk' + //const result = await client.list() + const result = await client.add({ secretId, data }) + return result + } //var secret = await client.access({secretId: 'arweaveJwk'}) } catch (error) { console.log(error)