Example #1
0
 def share_sizes(
         storage_index_or_slot=StorageIndex,
         # Notionally, ChoiceOf(None, SetOf(int, maxLength=MAX_BUCKETS)).
         # However, support for such a construction appears to be
         # unimplemented in Foolscap.  So, instead...
         sharenums=Any(),
 ):
     """
     Get the size of the given shares in the given storage index or slot.  If a
     share has no stored state, its size is reported as 0.
     """
     return DictOf(int, Offset)
Example #2
0
    def stat_shares(storage_indexes_or_slots=ListOf(StorageIndex), ):
        """
        Get various metadata about shares in the given storage index or slot.

        :return [{int: ShareStat}]: A list of share stats.  Dictionaries in
            the list corresponds to the results for each storage index
            requested by the ``storage_indexes_or_slots`` argument.  Items in
            the dictionary give share stats for each share known to this
            server to be associated with the corresponding storage index.
            Keys are share numbers and values are the stats.
        """
        # Any() should be ShareStat but I don't know how to spell that.
        return ListOf(DictOf(int, Any()))
Example #3
0
 def get_version():
     return DictOf(str, Any())
Example #4
0
#     "permutation-seed-base32" (both for service="storage").
# * sig_vs (str): "v0-"+base32(signature(msg))
# * claimed_key_vs (str): "v0-"+base32(pubkey)

# (nickname, my_version, oldest_supported) refer to the client as a whole.
# The my_version/oldest_supported strings can be parsed by an
# allmydata.util.version.Version instance, and then compared. The first goal
# is to make sure that nodes are not confused by speaking to an incompatible
# peer. The second goal is to enable the development of
# backwards-compatibility code.

# Note that old v1 clients (which are gone now) did not sign messages, so v2
# servers would deliver v2-format messages with sig_vs=claimed_key_vs=None.
# These days we should always get a signature and a pubkey.

Announcement_v2 = Any()


class RIIntroducerSubscriberClient_v2(RemoteInterface):
    __remote_name__ = "RIIntroducerSubscriberClient_v2.tahoe.allmydata.com"

    def announce_v2(announcements=SetOf(Announcement_v2)):
        """I accept announcements from the publisher."""
        return None


SubscriberInfo = DictOf(str, Any())


class RIIntroducerPublisherAndSubscriberService_v2(RemoteInterface):
    """To publish a service to the world, connect to me and give me your
Example #5
0
 def get_version():
     return DictOf(bytes, Any())
Example #6
0
#     "permutation-seed-base32" (both for service="storage").
# * sig_vs (bytes): "v0-"+base32(signature(msg))
# * claimed_key_vs (bytes): "v0-"+base32(pubkey)

# (nickname, my_version, oldest_supported) refer to the client as a whole.
# The my_version/oldest_supported strings can be parsed by an
# allmydata.util.version.Version instance, and then compared. The first goal
# is to make sure that nodes are not confused by speaking to an incompatible
# peer. The second goal is to enable the development of
# backwards-compatibility code.

# Note that old v1 clients (which are gone now) did not sign messages, so v2
# servers would deliver v2-format messages with sig_vs=claimed_key_vs=None.
# These days we should always get a signature and a pubkey.

Announcement_v2 = Any()

class RIIntroducerSubscriberClient_v2(RemoteInterface):
    __remote_name__ = native_str("RIIntroducerSubscriberClient_v2.tahoe.allmydata.com")

    def announce_v2(announcements=SetOf(Announcement_v2)):
        """I accept announcements from the publisher."""
        return None

SubscriberInfo = DictOf(bytes, Any())

class RIIntroducerPublisherAndSubscriberService_v2(RemoteInterface):
    """To publish a service to the world, connect to me and give me your
    announcement message. I will deliver a copy to all connected subscribers.
    To hear about services, connect to me and subscribe to a specific
    service_name."""
Example #7
0
 def echo(argument=Any()):
     return Any()
 def whatever_method(arg=Any()):
     return Any()