Documentation ¶
Index ¶
- Variables
- type BlockChainService
- type BlockChainServiceImpl
- func (b *BlockChainServiceImpl) Consensus() error
- func (b *BlockChainServiceImpl) CreateTransaction(ctx context.Context, t transaction.Request) error
- func (b *BlockChainServiceImpl) DeleteTransactions() error
- func (b *BlockChainServiceImpl) GetBlockChain() []*blockchain.Block
- func (b *BlockChainServiceImpl) GetWalletBalance(blockchainAddress string) float32
- func (b *BlockChainServiceImpl) ListTransactions() ([]*transaction.Transaction, int)
- func (b *BlockChainServiceImpl) Run()
- func (b *BlockChainServiceImpl) UpdateTransaction(t transaction.Request) error
- type WalletService
- type WalletServiceImpl
Constants ¶
This section is empty.
Variables ¶
View Source
var (
DB map[string]*blockchain.BlockChain = make(map[string]*blockchain.BlockChain) // in-memory database
)
Functions ¶
This section is empty.
Types ¶
type BlockChainService ¶
type BlockChainService interface { CreateTransaction(ctx context.Context, t transaction.Request) error UpdateTransaction(t transaction.Request) error ListTransactions() ([]*transaction.Transaction, int) DeleteTransactions() error Consensus() error Run() GetBlockChain() []*blockchain.Block GetWalletBalance(blockchainAddress string) float32 }
func NewBlockChainServiceImpl ¶
func NewBlockChainServiceImpl(port uint16) BlockChainService
type BlockChainServiceImpl ¶
type BlockChainServiceImpl struct {
// contains filtered or unexported fields
}
func (*BlockChainServiceImpl) Consensus ¶
func (b *BlockChainServiceImpl) Consensus() error
func (*BlockChainServiceImpl) CreateTransaction ¶
func (b *BlockChainServiceImpl) CreateTransaction(ctx context.Context, t transaction.Request) error
func (*BlockChainServiceImpl) DeleteTransactions ¶
func (b *BlockChainServiceImpl) DeleteTransactions() error
func (*BlockChainServiceImpl) GetBlockChain ¶
func (b *BlockChainServiceImpl) GetBlockChain() []*blockchain.Block
func (*BlockChainServiceImpl) GetWalletBalance ¶
func (b *BlockChainServiceImpl) GetWalletBalance(blockchainAddress string) float32
func (*BlockChainServiceImpl) ListTransactions ¶
func (b *BlockChainServiceImpl) ListTransactions() ([]*transaction.Transaction, int)
func (*BlockChainServiceImpl) Run ¶
func (b *BlockChainServiceImpl) Run()
func (*BlockChainServiceImpl) UpdateTransaction ¶
func (b *BlockChainServiceImpl) UpdateTransaction(t transaction.Request) error
type WalletService ¶
type WalletService interface { CreateTransaction(ctx context.Context, tr wallet.TransactionRequest) error CreateWallet() (*wallet.Wallet, error) GetWalletBalance(ctx context.Context, blockchainAddress string) (float32, error) }
func NewWalletServiceImpl ¶
func NewWalletServiceImpl(port uint16, gateway string) (WalletService, error)
type WalletServiceImpl ¶
type WalletServiceImpl struct {
// contains filtered or unexported fields
}
func (*WalletServiceImpl) CreateTransaction ¶
func (w *WalletServiceImpl) CreateTransaction(ctx context.Context, tr wallet.TransactionRequest) error
func (*WalletServiceImpl) CreateWallet ¶
func (w *WalletServiceImpl) CreateWallet() (*wallet.Wallet, error)
func (*WalletServiceImpl) GetWalletBalance ¶
Click to show internal directories.
Click to hide internal directories.