class RunCommand(Command): arguments = ( ("world", Unicode()), ("command", Unicode()), ("parameters", ListOf(Unicode())), ) response = (("output", ListOf(Unicode())), ) errors = { KeyError: "KEY_ERROR", ValueError: "VALUE_ERROR", }
class SeekGet(Command): """ Grab starting at a hash and moving backwards, with an offset and object count Grab starting at a hash and moving forward on the list, with an offset and object count Grab from the latest of the list, with an offset and object count """ """ type : hash : [list] foos : bar : [ abc, def, ghi, jkl, mno, pqr, stu, vwx, yz ] GET PAST foo stu OFFSET 1 COUNT 3 GET FUTURE foo ghi OFFSET 2 COUNT 2 GET CURRENT foo bar OFFSET 5 COUNT 2 """ arguments = [ (b'type', String()), (b'direction', String()), # Forward || reverse (b'hash', String()), # hash || "latest" (b'offset', Integer()), (b'count', Integer()) ] response = [(b'hashes', String())] # list of strings... arguments = [(b'keyspace', ObjHash()), (b'count', Integer()), (b'forward', Boolean())] # should be providing auths Responses = [(b'hashes', ListOf(ObjHash()))] """
class PrivateWhitelistView(Command): arguments = [(b'enc_req_nonce', EncBlob()), (b'enc_hash', EncHash()), (b'enc_sig', EncSig()), (b'sesh_key', PrivAES()), (b'sesh_hash', ObjHash()), (b'sesh_sig', ObjSig())] response = [(b'enc_blacklist', ListOf(EncAddress())), (b'sesh_hash', ObjHash()), (b'sesh_sig', ObjSig())] """
class AddError(Command): """ Add an error. """ arguments = [(b'testName', String()), (b'error', String()), (b'errorClass', String()), (b'frames', ListOf(String()))] response = [(b'success', Boolean())]
class AddFailure(Command): """ Add a failure. """ arguments = [(b'testName', String()), (b'fail', String()), (b'failClass', String()), (b'frames', ListOf(String()))] response = [(b'success', Boolean())]
class NodeStateCommand(Command): """ Used by a convergence agent to update the control service about the status of a particular node. """ arguments = [('state_changes', ListOf(SerializableArgument(NodeState, NonManifestDatasets))), ('eliot_context', _EliotActionArgument())] response = []
class AddError(Command): """ Add an error. """ arguments = [ (b"testName", NativeString()), (b"error", NativeString()), (b"errorClass", NativeString()), (b"frames", ListOf(NativeString())), ] response = [(b"success", Boolean())]
class AddFailure(Command): """ Add a failure. """ arguments = [ (b"testName", NativeString()), (b"fail", NativeString()), (b"failClass", NativeString()), (b"frames", ListOf(NativeString())), ] response = [(b"success", Boolean())]
class SyncCourierDirectoryAsk(Command): arguments = [(b'dir_pubkey', ListOf(ObjPubKey())), (b'dir_addrs', ListOf(ObjAddress())), (b'dir_ports', ListOf(Integer()))] response = [(b'dir_pubkey', ListOf(ObjPubKey())), (b'dir_addrs', ListOf(ObjAddress())), (b'dir_ports', ListOf(Integer()))] """
class MakeChunk(Command): arguments = [ ("x", Integer()), ("z", Integer()), ("seed", Integer()), ("generators", ListOf(String())), ] response = [ ("blocks", String()), ("metadata", String()), ("skylight", String()), ("blocklight", String()), ("heightmap", String()), ] errors = { Exception: "Exception", }
class SyncPeerDirectoryAsk(Command): # would have prefered dict capability. # these may need encoding... arguments = [(b'dir_pubkey', ListOf(ObjPubKey())), (b'dir_addrs', ListOf(ObjAddress())), (b'dir_ports', ListOf(Integer()))] response = [(b'dir_pubkey', ListOf(ObjPubKey())), (b'dir_addrs', ListOf(ObjAddress())), (b'dir_ports', ListOf(Integer()))] def __init__(self, commandType, *a, **kw): print('Command Created') super(SyncPeerDirectoryAsk).__init__(commandType, *a, **kw) """
class Listen(Command): """ A simple command for registering interest with an active Q2Q connection to hear from a server when others come calling. An occurrence of this command might have this appearance on the wire:: C: -Command: Listen C: -Ask: 1 C: From: [email protected] C: Protocols: q2q-example, q2q-example2 C: Description: some simple protocols C: S: -Answer: 1 S: This puts some state on the server side that will affect any Connect commands with q2q-example or q2q-example2 in the Protocol: header. """ commandName = 'listen' arguments = [('From', Q2QAddressArgument()), ('protocols', ListOf(String())), ('description', Unicode())] result = []
class SyncHavesWantsAsk(Command): arguments = [(b'have', ListOf(ObjHash)), (b'want', ListOf(ObjHash))] # should be providing auths Responses = [(b'have', ListOf(ObjHash)), (b'want', ListOf(ObjHash))] """
class CommandWithBigListArgument(Command): arguments = [ ("big", Big(ListOf(Integer()))), ]
class CommandWithSmallResponse(Command): response = [ ("small", ListOf(Integer())), ]
class SyncStorageAsk(Command): arguments = [(b'blobs', ListOf(ObjBlob))] # should be providing auths Responses = [(b'blobs', ListOf(ObjBlob))] """
class CommandWithBigResponse(Command): response = [ ("big", ListOf(Integer())), ]
class Benchmark(Command): arguments = [ (b'foo', String()), (b'bar', Integer()), (b'baz', ListOf(Float())), ]
class JMTXSigs(JMCommand): """Send signatures on the bitcoin transaction sent by TAKER """ arguments = [(b'nick', Unicode()), (b'sigs', ListOf(Unicode()))]
class JMMakeTx(JMCommand): """Send a hex encoded raw bitcoin transaction to a set of counterparties """ arguments = [(b'nick_list', ListOf(Unicode())), (b'tx', String())]
class Commands(Command): arguments = tuple() response = (("commands", ListOf(Unicode())), )