Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/keri/app/agenting.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,8 @@ def receiptDo(self, tymth=None, tock=0.0):
witers.append(witer)
self.extend([witer])



# Check to see if we already have all the receipts we need for this event
wigs = hab.db.getWigs(dgkey)
completed = len(wigs) == len(wits)
Expand Down
6 changes: 3 additions & 3 deletions src/keri/app/cli/commands/challenge/verify.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@

from hio.base import doing

from keri import help
from keri.app import indirecting, challenging, connecting, signaling
from keri import help, mailbox
from keri.app import challenging, connecting, signaling
from keri.app.cli.commands.challenge.generate import generateWords
from keri.app.cli.common import existing
from keri.help import helping
Expand Down Expand Up @@ -82,7 +82,7 @@ def __init__(self, name, alias, base, bran, words, generate, strength, out, sign

challenging.loadHandlers(db=self.hby.db, signaler=signaler, exc=self.exc)

self.mbd = indirecting.MailboxDirector(hby=self.hby, topics=['/challenge'], exc=self.exc)
self.mbd = mailbox.Director(hby=self.hby, topics=['/challenge'], exc=self.exc)

doers = [self.mbd, doing.doify(self.verifyDo)]

Expand Down
10 changes: 5 additions & 5 deletions src/keri/app/cli/commands/delegate/confirm.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@

"""
import argparse
from ordered_set import OrderedSet as oset

from hio.base import doing
from ordered_set import OrderedSet as oset

from keri import help
from keri.app import habbing, indirecting, agenting, grouping, forwarding, delegating, notifying
from keri import core
from keri import help, mailbox
from keri.app import habbing, agenting, grouping, forwarding, delegating, notifying
from keri.app.cli.common import existing
from keri.app.habbing import GroupHab
from keri import core
from keri.core import coring, serdering
from keri.db import dbing
from keri.help import helping
Expand Down Expand Up @@ -82,7 +82,7 @@ def __init__(self, name, base, alias, bran, interact=False, auto=False, authenti
delegating.loadHandlers(hby=hby, exc=exc, notifier=self.notifier)
grouping.loadHandlers(exc=exc, mux=self.mux)

self.mbx = indirecting.MailboxDirector(hby=hby, topics=['/receipt', '/multisig', '/replay', '/delegate'],
self.mbx = mailbox.Director(hby=hby, topics=['/receipt', '/multisig', '/replay', '/delegate'],
exc=exc)
doers = [self.hbyDoer, self.witq, self.postman, self.counselor, self.mbx]
self.toRemove = list(doers)
Expand Down
6 changes: 3 additions & 3 deletions src/keri/app/cli/commands/ends/add.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

from hio.base import doing

from keri import help, kering
from keri.app import habbing, grouping, indirecting, forwarding
from keri import help, kering, mailbox
from keri.app import habbing, grouping, forwarding
from keri.app.agenting import WitnessPublisher
from keri.app.cli.common import existing
from keri.app.notifying import Notifier
Expand Down Expand Up @@ -65,7 +65,7 @@ def __init__(self, name, base, alias, bran, role, eid, timestamp=None):
exc = exchanging.Exchanger(hby=self.hby, handlers=[])
grouping.loadHandlers(exc, mux)

mbx = indirecting.MailboxDirector(hby=self.hby, topics=["/receipt", "/multisig", "/replay"], exc=exc)
mbx = mailbox.Director(hby=self.hby, topics=["/receipt", "/multisig", "/replay"], exc=exc)

if self.hab is None:
raise kering.ConfigurationError(f"unknown alias={alias}")
Expand Down
23 changes: 16 additions & 7 deletions src/keri/app/cli/commands/incept.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,17 @@

"""
import argparse
import warnings
from dataclasses import dataclass

from hio.base import doing

from keri import help
from keri.app import habbing, agenting, indirecting, configing, delegating, forwarding
from keri.app import habbing, agenting, configing, delegating, forwarding
from keri.app.cli.common import existing, incepting, config
from keri.core import coring
from keri.kering import ConfigurationError
from keri.mailbox import director

logger = help.ogler.getLogger()

Expand All @@ -23,7 +26,9 @@
parser.add_argument('--alias', '-a', help='human readable alias for the new identifier prefix', required=True)
parser.add_argument("--config", "-c", help="directory override for configuration data")
parser.add_argument("--receipt-endpoint", help="Attempt to connect to witness receipt endpoint for witness receipts.",
dest="endpoint", action='store_true')
dest="receipt_endpoint", action='store_true')
parser.add_argument("--endpoint", help="method receipt collection, synchronous or asynchronous",
dest="endpoint", action='store', default="sync")
parser.add_argument("--proxy", help="alias for delegation communication proxy", default="")

parser.add_argument('--file', '-f', help='Filename to use to create the identifier', default="", required=False)
Expand Down Expand Up @@ -71,8 +76,8 @@ def handler(args):

kwa = mergeArgsWithFile(args).__dict__

icpDoer = InceptDoer(name=name, base=base, alias=alias, bran=bran, endpoint=endpoint, proxy=proxy,
cnfg=config_dir, **kwa)
icpDoer = InceptDoer(name=name, base=base, alias=alias, bran=bran, endpoint=endpoint,
proxy=proxy, cnfg=config_dir, **kwa)

doers = [icpDoer]
return doers
Expand Down Expand Up @@ -127,7 +132,7 @@ class InceptDoer(doing.DoDoer):
""" DoDoer for creating a new identifier prefix and Hab with an alias.
"""

def __init__(self, name, base, alias, bran, endpoint, proxy=None, cnfg=None, **kwa):
def __init__(self, name, base, alias, bran, endpoint, async_receipts=False, proxy=None, cnfg=None, **kwa):

cf = None
if config is not None:
Expand All @@ -138,12 +143,13 @@ def __init__(self, name, base, alias, bran, endpoint, proxy=None, cnfg=None, **k
reopen=True,
clear=False)
self.endpoint = endpoint
self.async_reciepts = async_receipts
self.hby = existing.setupHby(name=name, base=base, bran=bran, cf=cf)
self.proxy = self.hby.habByName(proxy) if proxy is not None else None
self.hbyDoer = habbing.HaberyDoer(habery=self.hby) # setup doer
self.swain = delegating.Anchorer(hby=self.hby, proxy=self.proxy)
self.postman = forwarding.Poster(hby=self.hby)
self.mbx = indirecting.MailboxDirector(hby=self.hby, topics=['/receipt', "/replay", "/reply"])
self.mbx = director.Director(hby=self.hby, topics=['/receipt', "/replay", "/reply"])
doers = [self.hbyDoer, self.postman, self.mbx, self.swain, doing.doify(self.inceptDo)]

self.inits = kwa
Expand Down Expand Up @@ -179,11 +185,14 @@ def inceptDo(self, tymth, tock=0.0):
print("Waiting for witness receipts...")
if self.endpoint:
yield from receiptor.receipt(hab.pre, sn=0)
else:
if self.async_reciepts:
witDoer.msgs.append(dict(pre=hab.pre))
while not witDoer.cues:
_ = yield self.tock

if not self.async_reciepts and not self.endpoint:
raise ConfigurationError("No witness endpoint set")

if hab.kever.delpre:
if self.proxy is not None:
sender = self.proxy
Expand Down
6 changes: 3 additions & 3 deletions src/keri/app/cli/commands/interact.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@

from hio.base import doing

from keri import kering
from keri import kering, mailbox
from keri.help import helping
from ..common import existing
from ... import habbing, agenting, indirecting
from ... import habbing, agenting

parser = argparse.ArgumentParser(description='Create and publish an interaction event')
parser.set_defaults(handler=lambda args: interact(args))
Expand Down Expand Up @@ -91,7 +91,7 @@ def __init__(self, name, base, bran, alias, data: list = None, endpoint=False, a

self.hby = existing.setupHby(name=name, base=base, bran=bran)
self.hbyDoer = habbing.HaberyDoer(habery=self.hby) # setup doer
self.mbx = indirecting.MailboxDirector(hby=self.hby, topics=['/receipt', "/replay", "/reply"])
self.mbx = mailbox.Director(hby=self.hby, topics=['/receipt', "/replay", "/reply"])
doers = [self.hbyDoer, self.mbx, doing.doify(self.interactDo)]

super(InteractDoer, self).__init__(doers=doers)
Expand Down
6 changes: 3 additions & 3 deletions src/keri/app/cli/commands/ipex/admit.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@

from hio.base import doing

from keri.app import connecting, habbing, grouping, indirecting, agenting, forwarding
from keri import mailbox
from keri.app import connecting, habbing, grouping, agenting, forwarding
from keri.app.cli.common import existing
from keri.app.notifying import Notifier
from keri.core import parsing, coring, eventing
Expand All @@ -16,7 +17,6 @@
from keri.vdr import credentialing, verifying
from keri.vdr import eventing as teventing


parser = argparse.ArgumentParser(description='Accept a credential being issued or presented in response to an IPEX '
'grant')
parser.set_defaults(handler=lambda args: handler(args))
Expand Down Expand Up @@ -70,7 +70,7 @@ def __init__(self, name, alias, base, bran, said, message, timestamp ):
grouping.loadHandlers(self.exc, mux)
protocoling.loadHandlers(self.hby, exc=self.exc, notifier=notifier)

mbx = indirecting.MailboxDirector(hby=self.hby,
mbx = mailbox.Director(hby=self.hby,
topics=["/receipt", "/multisig", "/replay", "/credential"],
exc=self.exc, kvy=self.kvy, tvy=self.tvy, verifier=self.vry)

Expand Down
5 changes: 3 additions & 2 deletions src/keri/app/cli/commands/ipex/grant.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@

from hio.base import doing

from keri.app import forwarding, connecting, habbing, grouping, indirecting, signing
from keri import mailbox
from keri.app import forwarding, connecting, habbing, grouping, signing
from keri.app.cli.common import existing
from keri.app.notifying import Notifier
from keri.core import coring, parsing, serdering
Expand Down Expand Up @@ -64,7 +65,7 @@ def __init__(self, name, alias, base, bran, said, recp, message, timestamp):
grouping.loadHandlers(self.exc, mux)
protocoling.loadHandlers(self.hby, exc=self.exc, notifier=notifier)

mbx = indirecting.MailboxDirector(hby=self.hby,
mbx = mailbox.Director(hby=self.hby,
topics=["/receipt", "/multisig", "/replay", "/credential"],
exc=self.exc)

Expand Down
6 changes: 3 additions & 3 deletions src/keri/app/cli/commands/ipex/join.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

from hio.base import doing

from keri import help
from keri.app import habbing, indirecting, agenting, notifying, grouping, connecting, forwarding
from keri import help, mailbox
from keri.app import habbing, agenting, notifying, grouping, connecting, forwarding
from keri.app.cli.common import existing
from keri.core import parsing, routing, serdering, coring
from keri.peer import exchanging
Expand Down Expand Up @@ -80,7 +80,7 @@ def __init__(self, name, base, bran, auto=False):
self.credentialer = credentialing.Credentialer(hby=self.hby, rgy=self.rgy, registrar=self.registrar,
verifier=self.verifier)

self.mbx = indirecting.MailboxDirector(hby=self.hby, exc=self.exc, topics=['/receipt', '/multisig', '/replay',
self.mbx = mailbox.Director(hby=self.hby, exc=self.exc, topics=['/receipt', '/multisig', '/replay',
'/delegate'])
self.postman = forwarding.Poster(hby=self.hby)

Expand Down
8 changes: 4 additions & 4 deletions src/keri/app/cli/commands/ipex/list.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@

import argparse
import datetime
import os
import json
import os
import sys

from hio.base import doing

from keri import help, kering
from keri.app import indirecting, notifying, connecting
from keri import help, kering, mailbox
from keri.app import notifying, connecting
from keri.app.cli.common import existing, terming
from keri.core import scheming
from keri.help import helping
Expand Down Expand Up @@ -82,7 +82,7 @@ def __init__(self, name, alias, base, bran, poll=False, verbose=False, said=Fals
self.vry = verifying.Verifier(hby=self.hby, reger=self.rgy.reger)
self.exc = exchanging.Exchanger(hby=self.hby, handlers=[])
protocoling.loadHandlers(self.hby, self.exc, self.notifier)
self.mbx = indirecting.MailboxDirector(hby=self.hby, topics=['/replay', '/reply', '/credential'],
self.mbx = mailbox.Director(hby=self.hby, topics=['/replay', '/reply', '/credential'],
exc=self.exc, verifier=self.vry)

self.doers = [self.mbx]
Expand Down
8 changes: 4 additions & 4 deletions src/keri/app/cli/commands/ipex/spurn.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@

from hio.base import doing

from keri.app import forwarding, connecting, habbing, grouping, indirecting
from keri import mailbox
from keri.app import forwarding, connecting, habbing, grouping
from keri.app.cli.common import existing
from keri.app.notifying import Notifier
from keri.core import parsing, coring, eventing
from keri.core import parsing, eventing
from keri.peer import exchanging
from keri.vc import protocoling
from keri.vc.protocoling import Ipex
from keri.vdr import credentialing, verifying
from keri.vdr import eventing as teventing


parser = argparse.ArgumentParser(description='Reject an IPEX apply, offer, agree or grant message')
parser.set_defaults(handler=lambda args: handler(args))
parser.add_argument('--name', '-n', help='keystore name and file location of KERI keystore', required=True)
Expand Down Expand Up @@ -67,7 +67,7 @@ def __init__(self, name, alias, base, bran, said, message):
grouping.loadHandlers(self.exc, mux)
protocoling.loadHandlers(self.hby, exc=self.exc, notifier=notifier)

mbx = indirecting.MailboxDirector(hby=self.hby,
mbx = mailbox.Director(hby=self.hby,
topics=["/receipt", "/multisig", "/replay", "/credential"],
exc=self.exc)

Expand Down
7 changes: 3 additions & 4 deletions src/keri/app/cli/commands/kevers.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@
"""
import argparse
import datetime

import sys

from hio.base import doing

from keri import help
from keri.app import indirecting
from keri import help, mailbox
from keri.app.cli.common import displaying, existing
from keri.core import serdering
from keri.help import helping
Expand Down Expand Up @@ -46,7 +45,7 @@ def __init__(self, name, base, bran, prefix, poll=False, verbose=False):
self.poll = poll
self.verbose = verbose
self.hby = existing.setupHby(name=name, base=base, bran=bran)
self.mbx = indirecting.MailboxDirector(hby=self.hby,
self.mbx = mailbox.Director(hby=self.hby,
topics=["/receipt", "/replay", "/multisig", "/credential", "/delegate",
"/challenge", "/oobi"])
doers = [self.mbx, doing.doify(self.kevers)]
Expand Down
7 changes: 4 additions & 3 deletions src/keri/app/cli/commands/local/watch.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
import time

from hio.base import doing
from keri import help
from keri.app import agenting, indirecting, habbing, forwarding

from keri import help, mailbox
from keri.app import agenting, habbing, forwarding
from keri.app.cli.common import existing, terming
from keri.app.habbing import GroupHab
from keri.app.watching import States, diffState
Expand Down Expand Up @@ -46,7 +47,7 @@ def __init__(self, name, base, bran, **kwa):
self.hbyDoer = habbing.HaberyDoer(habery=self.hby) # setup doer
self.cues = help.decking.Deck()

self.mbd = indirecting.MailboxDirector(hby=self.hby, topics=["/replay", "/receipt", "/reply"])
self.mbd = mailbox.Director(hby=self.hby, topics=["/replay", "/receipt", "/reply"])
self.postman = forwarding.Poster(hby=self.hby)
doers.extend([self.hbyDoer, self.mbd, self.postman, doing.doify(self.cueDo)])

Expand Down
7 changes: 3 additions & 4 deletions src/keri/app/cli/commands/location/add.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@
import argparse
from urllib.parse import urlparse


from hio.base import doing

from keri import help, kering
from keri.app import habbing, grouping, indirecting, forwarding
from keri import help, kering, mailbox
from keri.app import habbing, grouping, forwarding
from keri.app.agenting import WitnessPublisher
from keri.app.cli.common import existing
from keri.app.notifying import Notifier
Expand Down Expand Up @@ -66,7 +65,7 @@ def __init__(self, name, base, alias, bran, url, eid, timestamp=None):
exc = exchanging.Exchanger(hby=self.hby, handlers=[])
grouping.loadHandlers(exc, mux)

mbx = indirecting.MailboxDirector(hby=self.hby, topics=["/receipt", "/multisig", "/replay"], exc=exc)
mbx = mailbox.Director(hby=self.hby, topics=["/receipt", "/multisig", "/replay"], exc=exc)

if self.hab is None:
raise kering.ConfigurationError(f"unknown alias={alias}")
Expand Down
9 changes: 9 additions & 0 deletions src/keri/app/cli/commands/mailbox/add.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

"""
import argparse
import warnings

from hio.base import doing
from hio.help import Hict
Expand All @@ -16,6 +17,14 @@

logger = help.ogler.getLogger()

warnings.warn(
"Mailbox commands will be removed in a future release. "
"Functionality has been moved to its own repository: https://github.com/keri-foundation/mailbox",
DeprecationWarning,
stacklevel=2,
)


parser = argparse.ArgumentParser(description='Add mailbox role')
parser.set_defaults(handler=lambda args: add(args),
transferable=True)
Expand Down
Loading