Skip to content

Commit

Permalink
simple testnet generator, fixes #21
Browse files Browse the repository at this point in the history
  • Loading branch information
michielbdejong committed Mar 2, 2024
1 parent 4cf0e9a commit c6eb958
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -12,7 +12,7 @@ What I have so far:

```
npm install ngraph.generators
node ./src/network-generator.js
node ./src/network-generator.js > testnet.csv
```


Expand Down
5 changes: 3 additions & 2 deletions src/network-generator.js
@@ -1,14 +1,15 @@
const ngraphGen = require('ngraph.generators')
const graph = ngraphGen.wattsStrogatz(100, 20, 0.50)
console.log('from to fromMaxBalance fromExchangeRate toMaxBalance toExchangeRate')
graph.forEachLink(function(link) {
link.data = {
fromMaxBalance: Math.floor(Math.random() * 1000),
fromExchangeRate: Math.random() * 5 + 1,
toMaxBalance: Math.floor(Math.random() * 1000),
toExchangeRate: Math.random() * 5 + 1
}
console.dir(link);
});
console.log(`${link.fromId} ${link.toId} ${link.data.fromMaxBalance} ${link.data.fromExchangeRate} ${link.data.toMaxBalance} ${link.data.toExchangeRate}`)
})
// const NUM_NODES = 100;
// const NUM_NEIGHBORS = 10; // each node will have 10 neighbors
// const maxMaxBalance = 1000;
Expand Down

0 comments on commit c6eb958

Please sign in to comment.