Skip to content

Commit

Permalink
passing in threads as argument
Browse files Browse the repository at this point in the history
  • Loading branch information
onetrickwolf committed Oct 5, 2023
1 parent 812a329 commit c59cd66
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test-templates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on: [push]
jobs:
test-node-template:

runs-on: macos-latest
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
Expand All @@ -18,4 +18,4 @@ jobs:
run: npm install
- name: Run app
working-directory: create-aleo-app/template-node
run: npm start
run: npm start -- --threads 2
9 changes: 9 additions & 0 deletions create-aleo-app/template-node/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
import {Account, initThreadPool, PrivateKey, ProgramManager,} from "@aleohq/sdk";

let threadPoolSize = 10;

const threadsIndex = process.argv.indexOf('--threads');
if (threadsIndex !== -1 && process.argv[threadsIndex + 1]) {
threadPoolSize = parseInt(process.argv[threadsIndex + 1], 10);
}

await initThreadPool(threadPoolSize);

const hello_hello_program =
"program hello_hello.aleo;\n" +
"\n" +
Expand Down

0 comments on commit c59cd66

Please sign in to comment.