Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revisit my Freedom Coop hacks #4

Open
bhaugen opened this issue Mar 2, 2017 · 7 comments
Open

Revisit my Freedom Coop hacks #4

bhaugen opened this issue Mar 2, 2017 · 7 comments
Assignees
Labels

Comments

@bhaugen
Copy link
Contributor

bhaugen commented Mar 2, 2017

I did a bunch of hacks to get OCP to work for Freedom Coop. I made those hacks optional when I fixed this issue in the DEEP repo: https://github.com/gopacifia/DEEP/issues/2

But I need to revisit all of them from two perspectives:

  • rethink them to see if they can be done in a less hacky way, and
  • make sure they still work for Freedom Coop.

You can see the hacks and how I made them optional in this commit:
https://github.com/gopacifia/DEEP/commit/1303e6a7cb81650231e92f834c7d6e3e98b8cde3

I'll come back later and summarize them here and see if we can figure out how to make them less hacky.

I'm calling them a bug, although they seem to actually work in production, because they just shot @pospi in the foot trying to get his docker installation to run in development.

@bhaugen bhaugen added the bug label Mar 2, 2017
@bhaugen bhaugen self-assigned this Mar 2, 2017
@bhaugen
Copy link
Contributor Author

bhaugen commented Mar 4, 2017

The hacks:

  • FairCoins are named explicitly as a digital currency, and are the only digital currency supported.
    • EconomicAgents may have FairCoin addresses in a single FairCoin wallet.
  • An EconomicAgent named "Freedom Coop" is required.
    • Being an active "Freedom Coop" member is required for some permissions
    • Becoming such a member requires a share payment in FairCoins.
  • Share payments are sent to settings.SEND_MEMBERSHIP_PAYMENT_TO
    • that's not as bad as a specific agent name, but still a hack.

(I could have missed some other hacks, but those are the ones I made optional for DEEP to work.)

Clearly, GoPacifia and Matrioshka will not have an agent named "Freedom Coop". GoPacifia may not want to use FairCoins. And neither of them may have membership shares, or require memberships for any permissions.

Moreover, even OCP wants to support multiple currencies, both digital and otherwise.

Those hacks are all required for Freedom Coop, one way or another. I made them optional by adding another hack, settings.USE_FAIRCOINS. If this is False, then some of the other hacks do not apply. At least enough for DEEP to get up and running.

I think, if USE_FAIRCOINS == True, then all of those hacks will still work for OCP. But I haven't tested them.

And I'd like to make django-rea work for OCP without such hacks, which means figuring out better ways to enable the necessary features.

So what are the features?

  • FairCoins are a special digital currency.
  • Freedom Coop is a special Economic Agent.
  • Users must represent other agents that are members of this special agent for several system permissions.
  • A share payment is required to become a member.
  • This share payment must be a quantity of FairCoins.

All of those features could be supported by more settings. But they could also be supported by some configuration model in the database. Or some other way I have not thought of.

So, refactoring gang, please suggest better ways to support those features for OCP.

The OCP membership protocol is another feature that should also probably become optional, although we will need to find out from GoPacifia and Matrioshka if they want anything like it.

@fosterlynn
Copy link
Contributor

Re. FairCoin hacks - seems like when integrating/interfacing Freecoin at the hackathon would be a great time to make the currency connections configurable and modular/pluggable in whatever way is best. And especially true if there will be work on interfacing a bank thing.

@bhaugen
Copy link
Contributor Author

bhaugen commented Mar 7, 2017

NameError at /work/profile/
global name 'use_faircoins' is not defined

This is because work.views.profile() does:

    balance = 0
    faircoin_account = None
    if use_faircoins:
        faircoin_account = agent.faircoin_resource()
        if faircoin_account:
            balance = faircoin_account.digital_currency_balance()

use_faircoins here is not necessary. This will all work fine as in the original code:

    faircoin_account = agent.faircoin_resource()
    balance = 0
    if faircoin_account:
        balance = faircoin_account.digital_currency_balance()

@fosterlynn
Copy link
Contributor

@bum2 @XaviP do you know what the "business reason" for the Freedom Coop related permissions are? Sorry for corporate name for that, it is like the real reason in the organization (not thinking about the code so much). And what permissions are affected? That might help to define how to make it configurable.

@XaviP
Copy link
Contributor

XaviP commented Mar 25, 2017

do you know what the "business reason" for the Freedom Coop related permissions are? Sorry for corporate name for that, it is like the real reason in the organization (not thinking about the code so much). And what permissions are affected? That might help to define how to make it configurable.

Sorry, I don't understand the question.

@fosterlynn
Copy link
Contributor

do you know what the "business reason" for the Freedom Coop related permissions are? Sorry for corporate name for that, it is like the real reason in the organization (not thinking about the code so much). And what permissions are affected? That might help to define how to make it configurable.

Sorry, I don't understand the question.

Sorry, unclear. I'm looking for why we put in the Freedom Coop check in the first place. Why did we need it? If it is only permissions, then what permissions are allowed if Freedom Coop (or not Freedom Coop)? Is there something besides permissions that is only applicable to Freedom Coop (or not Freedom Coop)?

@ghost
Copy link

ghost commented Mar 25, 2017

I'd work toward standardizing digital currencies under a unique gateway or facade. I think the ExchangeService is well suited for this. A transact method would make wonders given a recipient URI. We'd need to think of a URI scheme to address currencies. Think of account:iban:ES0920000000000000000000 or account:faircoin:<some_address>.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants