$ cd cardano-sl
- Go to branch with
dbgen
:$ git checkout master
- Build:
$ ./scripts/build/cardano-sl.sh
- Clean wallet database:
$ ./scripts/clean/db.sh
- Launch dev cluster:
$ ./scripts/launch/demo-with-wallet-api.sh
- Copy value from
System start
, for example,1518114979000000
, from any tmux window. It will be used in next steps. - Generate keys:
$ stack exec -- cardano-keygen --system-start 1518114979000000 generate-keys-by-spec --genesis-out-dir tmp-secrets
- Get your first money:
$ curl -X POST --insecure https://localhost:8090/api/wallets/keys -H 'cache-control: no-cache' -H 'content-type: application/json' -d '"/home/denis/Code/cardano-sl/tmp-secrets/generated-keys/poor/key0.sk"'
. You should see something like this:
As you can see, we have a wallet, and{"Right":{"cwId":"Ae2tdPwUPEZEK5DvxPMtnTnUfQg8coWAAbNfLEvQ4GqWTe9h8d6AEkBDMce","cwMeta":{"cwName":"Genesis wallet","cwAssurance":"CWANormal","cwUnit":0},"cwAccountsNumber":1,"cwAmount":{"getCCoin":"37499999999166"},"cwHasPassphrase":false,"cwPassphraseLU":1.518106557627431431e9}}
getCCoin
isn't empty. - Please keep wallet id, we'll use it later.
- Check an account in your new wallet:
$ curl -k https://localhost:8090/api/accounts
. You should see something like this:{"Right":[{"caId":"Ae2tdPwUPEZEK5DvxPMtnTnUfQg8coWAAbNfLEvQ4GqWTe9h8d6AEkBDMce@2147483648","caMeta":{"caName":"Genesis account"},"caAddresses":[{"cadId":"DdzFFzCqrhsg9ngNRhHEa49se7qEMKyubT9tcE13Fkvh8QC82trpTDsNvdQV7mg9SCZiuENkf77zrtwPXrTyGMNznUsSinPC1gb2ZCqK","cadAmount":{"getCCoin":"37499999999166"},"cadIsUsed":false,"cadIsChange":false}],"caAmount":{"getCCoin":"37499999999166"}}]}
- Copy account id, we'll use it later.
- Open
tools/src/dbgen/config.json
and paste:
So, we want 100 addresses and 100 transactions. Change these values if you need.{ "wallets":1, "walletSpec":{ "accounts":1, "accountSpec":{"addresses":100}, "fakeUtxoCoinDistr":{"type":"range","range":100,"amount":1}, "fakeTxsHistory":{"type":"simple","txsCount":100,"numOutgoingAddress":3} } }
- Stop the cluster and create addresses and transactions:
$ stack exec dbgen -- --add-to Ae2tdPwUPEZEK5DvxPMtnTnUfQg8coWAAbNfLEvQ4GqWTe9h8d6AEkBDMce@2147483648 --config ./tools/src/dbgen/config.json --nodeDB run/node-db3 --secretKey node-3.secret.key --configProf dev --walletDB wallet-db --configPath node/configuration.yaml --systemStart 1518077932000000
- Wait for a while. ;-)
- Revert:
$ git checkout -- tools/src/dbgen/config.json
- Go to wallet bench branch:
$ git checkout feature/CBR-23-wallet-bench
- Build again:
$ ./scripts/build/cardano-sl.sh
- Wait for a while. ;-)
- Check it again:
$ curl -k https://localhost:8090/api/wallets
. You should see something like this:{"Right":[{"cwId":"Ae2tdPwUPEYxziM5uuHFok9fjeADJX7mf1kwuERMHmDcr5C1vipvvDjwEL1","cwMeta":{"cwName":"Wallet #1","cwAssurance":"CWANormal","cwUnit":0},"cwAccountsNumber":2,"cwAmount":{"getCCoin":"100000000000"},"cwHasPassphrase":false,"cwPassphraseLU":1.518078888483675628e9}]}
- Get some addresses:
$ curl -k https://localhost:8090/api/accounts
. You will see a lot of addresses, copy few of them. - Open wallets config
wallet/bench/config/Wallets.yaml
and paste here wallet id, account id and addresses.- wallet id - from step 19,
- account id - from step 10,
- addresses (at least one) - from step 20.
- Open endpoints config
wallet/bench/config/Endpoints.csv
and specify benchmarks for particular endpoints. For example, based on CSL-2249:
Specify full paths to reports that are actual for your system.BenchName,NumberOfMeasures,MinDelayBetweenCalls,MaxDelayBetweenCalls,PathToReportFile,PathToResponseReportsFile NewPaymentBench,10,0.0,0.0,/home/denis/Code/cardano-sl/wallet/bench/results/NewPaymentBenchReport.csv,/home/denis/Code/cardano-sl/wallet/bench/results/NewPaymentResponseReports.txt GetWalletsBench,10,55.0,59.0,/home/denis/Code/cardano-sl/wallet/bench/results/GetWalletsBenchReport.csv,/home/denis/Code/cardano-sl/wallet/bench/results/GetWalletsResponseReports.txt GetHistoryBench,10,0.0,0.0,/home/denis/Code/cardano-sl/wallet/bench/results/GetHistoryBenchReport.csv,/home/denis/Code/cardano-sl/wallet/bench/results/GetHistoryResponseReports.txt
- Launch benchmarking:
$ stack bench cardano-sl-wallet-new --benchmark-arguments "--tls-pub-cert=$PWD/scripts/tls-files/ca.crt --tls-priv-key=$PWD/scripts/tls-files/server.key --wal-conf=$PWD/wallet-new/bench/config/Wallets.yaml --ep-conf=$PWD/wallet-new/bench/config/Endpoints.csv --analyze --async"
- Wait for a while again. ;-)
- After
Benchmark cardano-sl-wallet-bench: RUNNING...
, see responses from the wallet in:wallet/bench/results/NewPaymentResponseReports.txt
wallet/bench/results/GetWalletsResponseReports.txt
wallet/bench/results/GetHistoryResponseReports.txt
Last active
March 7, 2018 11:21
-
-
Save denisshevchenko/f4893539c70eda0e0f310f8066990aa3 to your computer and use it in GitHub Desktop.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment