How to use the iroha-helpers/lib/cryptoHelper.js.default.generateKeyPair function in iroha-helpers

To help you get started, we’ve selected a few iroha-helpers examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github hyperledger / caliper / packages / caliper-iroha / lib / iroha.js View on Github external
let commands = args.map(item => {
            let keypairs = generateKeypair.generateKeyPair();
            let argsIroha = {
                accountName: item.account,
                domainId: context.domain,
                publicKey: keypairs.publicKey,
                verb: item.verb
            };
            return context.contract[contractID](context, argsIroha);
        });
github hyperledger / caliper / packages / caliper-iroha / lib / iroha.js View on Github external
name += seed.charAt(Math.floor(Math.random() * seed.length));
                }
                if(accountNames.indexOf(name) < 0) {
                    return name;
                }
                else {
                    return generateName();
                }
            };
            let promises = [];
            for(let i = 0 ; i < number ; i++) {
                let name = generateName();
                let id   = name + '@' + domain;
                accountNames.push(name);

                let keypairs = generateKeypair.generateKeyPair();
                //client information
                result.push({
                    name:    name,
                    domain:  domain,
                    id:      id,
                    pubKey:  keypairs.publicKey,
                    privKey: keypairs.privateKey
                });

                let commands = [{
                    fn: 'createAccount',
                    args: {accountName: name, domainId: domain, publicKey: keypairs.publicKey}
                },
                {
                    fn: 'appendRole',
                    args: {accountId: id, roleName: 'admin'}