Added caching util function with tests and applied in:
- parser.Block.Transactions(),
- parser.Payload.ChannelHeader(),
- parser.Payload.SignatureHeader(),
- parser.NamespaceReadWriteSet.ReadWriteSet(),
- parser.EndorserTransaction.ReadWriteSets(),
methods, as it was in the typescript sample.
Corrected Println usage and added comments to util functions.
Signed-off-by: Stanislav Jakuschevskij <stas@two-giants.com>
Created parser, contract and utils packages and extracted each piece of
functionality into its own files. Removed "Get" prefix from methods and
changed return values from interfaces to structs.
Signed-off-by: Stanislav Jakuschevskij <stas@two-giants.com>
Created project structure, fixed typos. Implemented connect.go and
getAllAssets.go. The latter uses an assetTransferBasic struct which
provides a simple API for basic asset operations like create, transfer,
etc.
Added transact.go with some util functions. Using google uuid package to
generate random UUIDs for the transactions.
Implemented pretty printing of JSON results.
Implemented app.go entry point with error handling. The existing
commands are getAllAssets, transact and listen. They can be called from
the command line via: "go run . <command> <command> ...". They will be
executed in order and if a command is not known an the application
panics and aborts before executing any of the commands.
Implementing listen.go. Added checkpointer, context setups, call to
BlockEvents and all the interfaces needed for parsing. Started
implementing the interfaces needed to represent a block bottom up in
structs. Finished NamespaceReadWriteSet, ReadWriteSet and
EndorserTransaction.
Signed-off-by: Stanislav Jakuschevskij <stas@two-giants.com>