node

package
v0.0.0-...-ee16f00 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2019 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const AccountNumber = 10000

Variables

This section is empty.

Functions

This section is empty.

Types

type Block

type Block struct {
	Tansactions []string
	Timestamp   time.Time
}

type MockSigner

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

func NewMockSigner

func NewMockSigner() *MockSigner

func (*MockSigner) Algorithm

func (m *MockSigner) Algorithm() crypto.Algorithm

func (*MockSigner) InitSigner

func (m *MockSigner) InitSigner(privateKey []byte) error

func (*MockSigner) RecoverPublicKey

func (m *MockSigner) RecoverPublicKey(data []byte, signature *crypto.Signature) (publicKey []byte, err error)

func (*MockSigner) Sign

func (m *MockSigner) Sign(data []byte) (signature *crypto.Signature, err error)

func (*MockSigner) Verify

func (m *MockSigner) Verify(publicKey []byte, data []byte, signature *crypto.Signature) bool

type Node

type Node struct {
	Tetris *tetris2.Tetris

	Report chan bool

	States     map[uint]*State
	Blockchain []Block
	// contains filtered or unexported fields
}

func NewNode

func NewNode(id, number uint) (*Node, error)

func (*Node) AddressFromPublicKey

func (n *Node) AddressFromPublicKey(publicKey []byte) ([]byte, error)

func (*Node) BroadcastTransactions

func (n *Node) BroadcastTransactions(rps uint, num uint)

func (*Node) GetPrivateKeyOfDefaultAccount

func (n *Node) GetPrivateKeyOfDefaultAccount() ([]byte, error)

func (*Node) GetSigner

func (n *Node) GetSigner() crypto.Signer

mock_core, 实现ICORE

func (*Node) Running

func (n *Node) Running() bool

func (*Node) Start

func (n *Node) Start(wg *sync.WaitGroup) error

func (*Node) Stop

func (n *Node) Stop() error

type State

type State struct {
	Nonce      uint64
	Balance    uint64
	PendingTxs []common.Hash
}

Jump to

Keyboard shortcuts

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