server

package
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 29, 2022 License: Unlicense Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultPort = 8080

Variables

This section is empty.

Functions

This section is empty.

Types

type Amount added in v1.0.1

type Amount struct {
	// contains filtered or unexported fields
}

func NewAmount added in v1.0.1

func NewAmount(address string) *Amount

func (*Amount) GetRequest added in v1.0.1

func (amount *Amount) GetRequest() *neighborhood.AmountRequest

type AmountRequest added in v1.0.1

type AmountRequest struct {
	Address *string
}

func (*AmountRequest) IsInvalid added in v1.0.1

func (amountRequest *AmountRequest) IsInvalid() bool

type AmountResponse

type AmountResponse struct {
	Amount float64 `json:"amount"`
}

type Controller

type Controller struct {
	// contains filtered or unexported fields
}

func NewController

func NewController(mnemonic string, derivationPath string, password string, privateKey string, port uint16, hostIp string, hostPort uint16, templatesPath string, level log.Level) *Controller

func (*Controller) BlockchainClient

func (controller *Controller) BlockchainClient() *network.Neighbor

func (*Controller) CreateTransaction

func (controller *Controller) CreateTransaction(writer http.ResponseWriter, req *http.Request)

func (*Controller) GetTransactions

func (controller *Controller) GetTransactions(writer http.ResponseWriter, req *http.Request)

func (*Controller) Index

func (controller *Controller) Index(w http.ResponseWriter, req *http.Request)

func (*Controller) Mine

func (controller *Controller) Mine(writer http.ResponseWriter, req *http.Request)

func (*Controller) Port

func (controller *Controller) Port() uint16

func (*Controller) Run

func (controller *Controller) Run()

func (*Controller) StartMining

func (controller *Controller) StartMining(writer http.ResponseWriter, req *http.Request)

func (*Controller) StopMining

func (controller *Controller) StopMining(writer http.ResponseWriter, req *http.Request)

func (*Controller) Wallet

func (controller *Controller) Wallet(writer http.ResponseWriter, req *http.Request)

func (*Controller) WalletAmount

func (controller *Controller) WalletAmount(writer http.ResponseWriter, req *http.Request)

type Transaction added in v1.0.1

type Transaction struct {
	// contains filtered or unexported fields
}

func NewTransaction added in v1.0.1

func NewTransaction(recipientAddress string, senderAddress string, senderPublicKey *encryption.PublicKey, timestamp int64, value uint64) *Transaction

func (*Transaction) GetRequest added in v1.0.1

func (transaction *Transaction) GetRequest() neighborhood.TransactionRequest

func (*Transaction) MarshalJSON added in v1.0.1

func (transaction *Transaction) MarshalJSON() ([]byte, error)

func (*Transaction) Sign added in v1.0.1

func (transaction *Transaction) Sign(privateKey *encryption.PrivateKey) (err error)

type TransactionRequest

type TransactionRequest struct {
	SenderPrivateKey *string `json:"sender_private_key"`
	SenderAddress    *string `json:"sender_address"`
	RecipientAddress *string `json:"recipient_address"`
	SenderPublicKey  *string `json:"sender_public_key"`
	Value            *string `json:"value"`
}

func (*TransactionRequest) IsInvalid

func (transactionRequest *TransactionRequest) IsInvalid() bool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL