dotnet new
CLI templates for blockchain integration services - sign service, transaction executor and block reader.
lkebil2sign
lkebil2tx
lkebil2blocks
-
Clone repository to a local folder;
-
Install templates. For each internal directory run:
$ dotnet new -i ${path}
where
${path}
is the path to the template directory (where folder .template.config placed). On Windows it must be the full path without trailing slash.To install blocks reader template run
dotnet new -i ./Lykke.Bil2.Templates/Lykke.Bil2.BlocksReader
-
Generate solutions:
Generally, run
dotnet new ${templateName} -n ${integrationName} -o ${outputPath}
to generate solution in specified directory.
Or create directory with required name,
cd
into created directory and rundotnet new ${templateName} -n ${integrationName}
to generate solution from the inside.
dotnet new lkebil2sign -n Bitcoin -o Lykke.Bil2.Bitcoin.SignService
For sign service implementation details see Lykke.Bil2.Bcn.SignService/IMPLEMENTATION.md.
Transactions executor template contains additional parameters:
-tm
(or--transactionModel
) for choosing betweentransfer amount
andtransfer coins
transaction model, one ofamount|coins
, if not specified -amount
is used;-fa
(or--fromatAddress
) for adding code for address formatting, used if the blockchain supports multiple address formats,false
by default;
dotnet new lkebil2tx -n Bitcoin -o Lykke.Bil2.Bitcoin.TransactionsExecutor [-tm amount|coins] [-fa]
For transactions executor implementation details see Lykke.Bil2.Bcn.TransactionsExecutor/IMPLEMENTATION.md.
Blocks reader template contains additional parameter -is
(or --irreversibilityStrategy
) for irreversible block obtaining strategy, one of none|pull|push
, if not specified - none
is used:
dotnet new lkebil2blocks -n Bitcoin -o Lykke.Bil2.Bitcoin.BlocksReader [-is none|pull|push]
Use none
or skip -is
parameter if blockchain does not support irreversible blocks.
Use push
model if used blockchain tools allow to determine changes of last irreversible block number (f.e. via web-sockets). IrreversibleBlockHandler
class and corresponding registrations are generated in this case. Use IIrreversibleBlockListener
provided by DI to emit LastIrreversibleBlockUpdatedEvent
.
Use pull
model if dedicated request is required to retrieve irreversible block data. IrreversibleBlockProvider
class and corresponding registrations are generated in this case.
For transactions executor implementation details see Lykke.Bil2.Bcn.BlocksReader/IMPLEMENTATION.md.