# Attention: These commands should be executed within truffle console and in the directory (../solidity/bmc)
truffle console --network moonbeamlocal
# Below commands working with BMCPeriphery contract
# First, get an instance of BMCPeriphery contract
let bmcPeriphery = await BMCPeriphery.deployed()
# Query BTP address of BMCPeriphery - Caller: Any
truffle(moonbeamlocal)> await bmcPeriphery.getBmcBtpAddress()
# Get status of a given link 'Link Name' - Caller: Any
truffle(moonbeamlocal)> await bmcPeriphery.getStatus("Link Name")
# Below commands working with BMCManagement contract
# First, get an instance of BMCManagement contract
let bmcManagement = await BMCManagement.deployed()
# Set a new address of BMCPeriphery contract - Caller: Owner
truffle(moonbeamlocal)> await bmcManagement.setBMCPeriphery("Address of BMCPerif")
# Add additional Ownership role - Caller: Owner
truffle(moonbeamlocal)> await bmcManagement.addOwner("Address of an additional Owner")
# Remove current Ownership role - Caller: Owner
truffle(moonbeamlocal)> await bmcManagement.removeOwner("Address of Owner being removed")
# Check whether one address has an Ownership role - Caller: Owner
truffle(moonbeamlocal)> await bmcManagement.isOwner("Address of account being verified")
# Register BSH Service - Caller: Owner
truffle(moonbeamlocal)> await bmcManagement.addService("Service Name", "Address of BSH Service")
# Remove current BSH Service - Caller: Owner
truffle(moonbeamlocal)> await bmcManagement.removeService("Service Name")
# Get all services - Caller: Any
# Return ['Service Name', 'Address of BSH']
truffle(moonbeamlocal)> await bmcManagement.getServices()
# Register BMV - Caller: Owner
truffle(moonbeamlocal)> await bmcManagement.addVerifier("Netword ID", "Address of BMV")
# Remove current BMV - Caller: Owner
truffle(moonbeamlocal)> await bmcManagement.removeVerifier("Netword ID")
# Get all BMVs - Caller: Any
# Return ['Netword ID', 'Address of BMV']
truffle(moonbeamlocal)> await bmcManagement.getVerifiers()
# Add connecting link - Caller: Owner
truffle(moonbeamlocal)> await bmcManagement.addLink("BTP address of connecting BMC")
# Remove connected link - Caller: Owner
truffle(moonbeamlocal)> await bmcManagement.removeLink("BTP address of connected BMC")
# Get current connected links - Caller: Any
truffle(moonbeamlocal)> await bmcManagement.getLinks()
# Set new configuration of connected link - Caller: Any
truffle(moonbeamlocal)> await bmcManagement.setLink("BTP address of connected BMC", _blockInterval, _maxAggregation, _delayLimit)
# Add Route - Caller: Owner
truffle(moonbeamlocal)> await bmcManagement.addRoute("BTP address of destination BMC", "BTP address of BMC before destination")
# Remove Route - Caller: Owner
truffle(moonbeamlocal)> await bmcManagement.removeRoute("BTP address of destination BMC")
# Get Route - Caller: Any
truffle(moonbeamlocal)> await bmcManagement.getRoutes("BTP address of destination BMC")
# Add Relays - Caller: Owner
truffle(moonbeamlocal)> await bmcManagement.addRelay("BTP address of connected BMC", Array address of Relays)
# Remove Relay - Caller: Owner
truffle(moonbeamlocal)> await bmcManagement.removeRelay("BTP address of connected BMC", "Address of Relay being removed")
# Get Relays - Caller: Any
truffle(moonbeamlocal)> await bmcManagement.getRelays("BTP address of connected BMC")