Skip to content

Commit

Permalink
chore: cat log
Browse files Browse the repository at this point in the history
  • Loading branch information
achingbrain committed Nov 22, 2023
1 parent eab54a6 commit 58333fd
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 5 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions perf/impl/js-libp2p/v1.0-optimistic/noise/dist/src/crypto/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

25 changes: 25 additions & 0 deletions perf/impl/js-libp2p/v1.0-optimistic/noise/src/crypto/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,31 @@ export const defaultCrypto: ICryptoInterface = {
privateKey: privateKey.subarray(16)
}
},
generateX25519KeyPairFromSeed (seed: Uint8Array): KeyPair {
const privateKey = crypto.createPrivateKey({
key: Buffer.concat([
Buffer.from([0x30, 0x2e, 0x02, 0x01, 0x00, 0x30, 0x05, 0x06, 0x03, 0x2b, 0x65, 0x6e, 0x04, 0x22, 0x04, 0x20]),
seed
]),
type: 'pkcs8',
format: 'der'
})

const publicKey = crypto.createPublicKey({
// @ts-expect-errort types are wrong
key: privateKey,
type: 'spki',
format: 'der'
}).export({
type: 'spki',
format: 'der'
}).subarray(12)

return {
publicKey,
privateKey: seed
}
},
generateX25519SharedKey (privateKey: Uint8Array, publicKey: Uint8Array): Uint8Array {
publicKey = uint8ArrayConcat([
Buffer.from([0x30, 0x2a, 0x30, 0x05, 0x06, 0x03, 0x2b, 0x65, 0x6e, 0x03, 0x21, 0x00]),
Expand Down
4 changes: 2 additions & 2 deletions perf/runner/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,11 @@ function runBenchmarkAcrossVersions(args: ArgsRunBenchmarkAcrossVersions): Bench

console.error(`=== Starting server ${version.implementation}/${version.id}`);

const killCMD = `ssh -o StrictHostKeyChecking=no ec2-user@${args.serverPublicIP} 'kill $(cat pidfile); rm pidfile; rm server.log || true'`;
const killCMD = `ssh -o StrictHostKeyChecking=no ec2-user@${args.serverPublicIP} 'kill $(cat pidfile); rm pidfile; cat server.log && rm server.log || true'`;
const killSTDOUT = execCommand(killCMD);
console.error(killSTDOUT);

const serverCMD = `ssh -o StrictHostKeyChecking=no ec2-user@${args.serverPublicIP} 'nohup ./impl/${version.implementation}/${version.id}/perf --run-server --server-address 0.0.0.0:4001 2>&1 & echo \$! > pidfile '`;
const serverCMD = `ssh -o StrictHostKeyChecking=no ec2-user@${args.serverPublicIP} 'nohup ./impl/${version.implementation}/${version.id}/perf --run-server --server-address 0.0.0.0:4001 > server.log 2>&1 & echo \$! > pidfile '`;
const serverSTDOUT = execCommand(serverCMD);
console.error(serverSTDOUT);

Expand Down

0 comments on commit 58333fd

Please sign in to comment.