Code Monkey home page Code Monkey logo

Comments (6)

deckb avatar deckb commented on July 30, 2024 1

You need to pass an EOSKey as creator_privkey

See lines 35/36

https://github.com/eosnewyork/eospy/blob/master/examples/push_transaction.py#L35

from eospy.

deckb avatar deckb commented on July 30, 2024

the eospy library already supports multisig account creation. If you look at this part at the newaccount you could modify this part to add two keys to the owner key. It would look something like:

owner_auth = {
                "threshold": 1,
                "keys": [{
                    "key": "EOSxxxxxxxxxxxxxxx1",
                    "weight": 1
                },{
                    "key": "EOSxxxxxxxxxxxxxxx1",
                    "weight": 1
                }],
                "accounts": [],
                "waits": []
            }

The same could be done for the active key.

To answer your two questions I would run:

cleos create key -f <some_file_name>
chmod 600 <some_file_name>

Then I would use the parse_key_file to extract the private key in your python file and pass that to the push_transaction function. I am working on adding support for other signing methods but it is currently low on the priority list.

from eospy.

amitsharma8891 avatar amitsharma8891 commented on July 30, 2024

Thanks, @deckb for your response. I used the cleos create key -f <some_file_name> and generated private and public key now when I tried to create an account using these keys it throws following error

raise EOSKeyError('Must pass a class that extends the eospy.Signer class')
eospy.exceptions.EOSKeyError: Must pass a class that extends the eospy.Signer class

and here is my create account code.

ce = cleos.Cleos(url=settings.BLOCKCHAIN_URL)
    key1 = generate_keys()
    key2 = generate_keys()
    print(key1)
    print(key2)

    ca = ce.create_account(creator=settings.CREATOR,
                           creator_privkey=settings.CREATOR_PRIVATE_KEY,
                           acct_name=account_name,
                           owner_key=key1['public_key'],
                            active_key=key2['public_key'],
                           stake_net='1.0000 EOS', stake_cpu='1.0000 EOS', ramkb=8, permission='active',
                           transfer=False, broadcast=True
                           )

Can you tell me where am I doing wrong?

Thanks

from eospy.

amitsharma8891 avatar amitsharma8891 commented on July 30, 2024

Thanks, @deckb, it was a really great help, actually, I am trying to set multisig permission, before I was using following cleos command to set the permission:
For active
cleos --url https://api-kylin.eosasia.one:443 set account permission mymultisig14 active '{"threshold":2,"keys":[],"accounts":[{"permission":{"actor":"mcttoken1233","permission":"active"},"weight":1},{"permission":{"actor":"mcttoken1234","permission":"active"},"weight":1},{"permission":{"actor":"mcttoken1235","permission":"active"},"weight":1}],"waits":[]}' owner -p mymultisig14@owner
For owner
cleos --url https://api-kylin.eosasia.one:443 set account permission mymultisig14 owner '{"threshold":2,"keys":[],"accounts":[{"permission":{"actor":"mcttoken1233","permission":"owner"},"weight":1},{"permission":{"actor":"mcttoken1234","permission":"owner"},"weight":1},{"permission":{"actor":"mcttoken1235","permission":"owner"},"weight":1}],"waits":[]}' -p mymultisig14@owner

I am not able to set multisig permission, I tried your previous suggestions still no luck.

Thanks

from eospy.

deckb avatar deckb commented on July 30, 2024

I guess I was confused by what you were originally asking. What error message are you seeing when you run those commands?

from eospy.

deckb avatar deckb commented on July 30, 2024

Closed with no response

from eospy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.