samchelper

package module
v0.0.0-...-9152453 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2018 License: MIT Imports: 16 Imported by: 0

README

samc helper

Helper library for SAMC integration.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecAt

func ExecAt(nodeID, fnName string, fn func() error)

ExecAt executes fn if current node is equals to nodeID

func Init

func Init()

Init inits the samchelper package It sets:

  • nodeID from NODE_ID env
  • ipcDir from IPC_DIR env
  • ipcPrefix from IPC_PREFIX env
  • nodesFile from NODES_FILE

func NewIPC

func NewIPC(data map[string]int, toID string) (string, error)

NewIPC writes data into subPath The data will be written into ipcDir/subPath/md5(data) It uses NODES environment variable to determine node number from toID

func ReadIPC

func ReadIPC(subPath string) (map[string]string, error)

ReadIPC reads ipc located at subPath

func ResolveNodeID

func ResolveNodeID(peerID string) int

ResolveNodeID resolves ethereum peerID into nodeID

func SendIPC

func SendIPC(fileName string) error

SendIPC moves new ipc file located at subPath into send folder

func SendRPC

func SendRPC(addr string, payload map[string]interface{}) (map[string]interface{}, error)

func WaitForAckIPC

func WaitForAckIPC(fileName string)

WaitForAckIPC waits until given fileName exists inside ack folder

Types

This section is empty.

Jump to

Keyboard shortcuts

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