npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

lisk-genesis

v0.1.0

Published

Lisk Genesis Block Creator

Downloads

8

Readme

Lisk Genesis Block Creator

Build Status Coverage Status Dependencies Status License: GPL v3

What is the Lisk Genesis Block Creator

The genesis block creator gives developers the possibility to customise their own genesis block for sidechain and blockchain app prototypes during the Lisk alpha SDK phase.

This is by no means meant to support the production phase yet.

Now with v2 genesis block support.

Installation

You can install Lisk Genesis by using npm

npm install [email protected]

Or using yarn

yarn add [email protected]

Usage

After installation you can use lisk-genesis. Below you the find possible function examples.

Construction

Starting with construction there are two options, use a generated passphrase for the genesis account or use a passphrase of your choosing.

const { GenesisBlock } = require('lisk-genesis');
const genesisBlock = new GenesisBlock('applicationName');
const { GenesisBlock } = require('lisk-genesis');
const genesisBlock = new GenesisBlock("applicationName", "medal differ embody nose prepare inherit popular allow pizza design youth more");

Add Transfer

To add funds to an account you can use the addTransfer() function

genesisBlock.addTransfer({
    recipientId: "18254294583320434366L",
    amount: "10000000000"
});

It's also possible to add multiple transfer transactions at once

genesisBlock.addTransfer([
    {
        recipientId: "18254294583320434366L",
        amount: "10000000000"
    },
    {
        recipientId: "7979485526436233387L",
        amount: "10000000000"
    }
]);

Add Delegate

To add delegates to your genesis block use the addDelegate() function

// Passphrase is optional if not given a random passphrase will be used and saved to genesis_delegates.json
genesisBlock.addDelegate({
    username: "genesis_0",
    passphrase: "trigger oblige mom orchard please knife slow mixed afraid until suspect setup"
});

It's also possible to add multiple delegates at once

genesisBlock.addDelegate([
    { username: "genesis_0" },
    { username: "genesis_1" },
    { username: "genesis_2" },
    { username: "genesis_3" },
    { username: "genesis_4" }
]);

Add Votes

To vote for delegates you can use the addVote() function. addVote uses two arguments passphrase and an array with usernames.

genesisBlock.addVote(
    "same swamp fade drink radio fancy matter error picnic dial tone cinnamon",
    ["genesis_1", "genesis_0"]
);

Save the Genesis Block

To save the genesis_block.json, genesis_account.json and genesis_delegates.json use the saveGenesisBlock() function.

genesisBlock.saveGenesisBlock('.', true);

Optional arguments are path default '.' and saveGenesisAccount default true.

Credits

Lisk Foundation for providing the basic building blocks for this module

License

Copyright © 2019 - 2020 Corbifex

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.


Copyright © 2019 - 2020 Corbifex

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.