simulation

package
v0.0.0-...-910d698 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const PATH = "./iotdata/IoT_normal_fridge_1.log"
View Source
const WALLET_PATH = "./bc_sim.wallet"

Variables

This section is empty.

Functions

func CreateBlock

func CreateBlock() bool

func LoadRawdata

func LoadRawdata(path string, msg chan string)

func LoadRawdataFromRandom

func LoadRawdataFromRandom(msg chan string)

Types

type Handler

type Handler struct {
	Ready bool
	Nodes *map[string]dtype.NodeInfo
	// contains filtered or unexported fields
}

func NewSimAgent

func NewSimAgent(db dbagent.DBAgent, nodes *map[string]dtype.NodeInfo) *Handler

func (*Handler) SimulateAccessPattern

func (h *Handler) SimulateAccessPattern(pid *int) bool

func (*Handler) SimulateTransaction

func (h *Handler) SimulateTransaction(id int) *blockchain.Transaction

type SensorData

type SensorData struct {
	Id          int     `json:"id"`
	Timestamp   int64   `json:"Timestamp"`
	Temperature float64 `json:"Fridge_Temperature"`
	Condition   string  `json:"Temp_Condition"`
}

Jump to

Keyboard shortcuts

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