services icon indicating copy to clipboard operation
services copied to clipboard

New Project: Transaction Policy Test

Open skycoin-manager opened this issue 7 years ago • 3 comments

1> Create a folder transaction-policy-testing

2> Create a command line script, see

  • https://github.com/skycoin/services/issues/6

  • runs on command line

  • takes in a -seed="wallet seed" parameter-

  • connects to a running skycoin node (locally) -- see github.com/skycoin/skycoin for instructions to run

  • generates first skycoin address generated by the wallet seed and prints it

  • checks that there are coins in the first address generated from the wallet seed

  • prints the balance and unspent outputs for the wallet address

3>

The command line utility will

  • create a transaction
  • inject the transaction into the network
  • record how many blocks the transaction took
  • record the physical time (log in seconds) between transactions and how long 10 transactions took

We will try different "policies" and then record how long and how many blocks, that ten sequential transactions takes

  • we record the head block (skycoin json API) when we start and print out the block number
  • we create a transaction that spends all of the coins in our wallet address (Generated from the seed value), sending the coins back to the wallet address (we send from address A, to address B)
  • we track the transaction status and wait until the transaction is finished
  • then we get the new balance and repeat, again with another transaction
  • if there are insufficient coinhours to do a transaction, the creation of the transaction may fail and we may have to wait 1 second, then try again and keep trying until it succeeds

We are testing different "transaction policies" or implementations of the Skycoin send function.

The transactions we are testing will be constructed with different policies, based upon the "policy" chosen on the command line

  • Default Policy. a transaction type that uses the default send method/coin for constructing the transaction (see github.com/skycoin/skycoin /src/gui/ and look for send and the wallet functions, which are in visor
  • a transaction using a send function that sends 0 coinhours to each output (transaction outputs created by transaction). Just set coinhours out to 0 for each transaction output in the transaction
  • a send function that sets the coin hours in each output to 1
  • a send function that sets the coin hours in each output to 2

The transaction struct is in github.com/skycoin/skycoin /src/coin

There are examples of send function being used in the skycoin repo under /src/cli under send function

4> Write a blog post in github.com/skycoin/skycoin.net, documenting the process of

  • programmatically generating a skycoin address
  • checking the balance of a skycoin address
  • creating a skycoin address from a seed
  • creating a transaction
  • checking the status of a transaction

skycoin-manager avatar Jan 22 '18 11:01 skycoin-manager

@skycoin-manager In theory, could this be a feature of #6 tool? e.g. modify #6 to also record/output number of blocks, then call it with y "-num_addresses 1" and "-num_transactions 10" or similar? I.e. is there a difference such as how they connect which would preclude this?

nutmix avatar Jan 22 '18 15:01 nutmix

I am taking this on today. Hope to be done by EOD. Perhaps prepare a blog post tomorrow.

sky-90091 avatar Feb 01 '18 03:02 sky-90091

Rename folder Load-Testing to Transaction-test

skycoin-manager avatar Feb 11 '18 17:02 skycoin-manager