Code Monkey home page Code Monkey logo

hashgraph-tools's Introduction

hashgraph-tools

The following are currently included:

  • Account Key Reset - (account_key_reset.js) An example of the transaction required to update an account's mnemonic phrase, and derived private & public keys.
  • Burning NFTs - (burn.js) An example of the burn transaction used to burn NFTs.
  • Generate Accounts - (generate_accounts.js) An example of a transaction that will create a list of new accounts (and output all credentials).
  • Generate Keys - (generate_keys.js) An quick utility to generate new key pairs for working with NFTs
  • Minting NFTs - (mint.js) An example of the transactions required to mint NFTs underneath a parent Token ID (i.e. collection) - More info coming....(bear with me)
  • Token Key Reset - (token_key_reset.js) An example of the transaction used to reset the keys on your Tokens.

Getting Started

To use these scripts:

  • Download / Clone the repo to your local machine
  • Install NodeJS - https://nodejs.dev/learn/how-to-install-nodejs
  • Install all dependencies using npm install (using the terminal inside VSCode for example)
  • Configure the script that you want to run in package.json
  • Run npm start

Further Information

Please see the wiki for further notes / information on each transaction.

Disclaimer

The following disclaimers are noted:

  • Use of this code is at your own risk.
  • No warranty is implied in the sharing of this code.
  • No liability is assumed in the sharing of this code.
  • This code has been created for a development environment use-case only (i.e. not for production grade applications).

Donations

If you've found these scripts useful and you'd like to donate to support my work, please send your donation to Hedera Account ID: 0.0.508156

hashgraph-tools's People

Contributors

edufolios-matt avatar swirlds-matt avatar woodwardmatt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

hashgraph-tools's Issues

Error: Using Differentiated Keys seems to throw errors

CONTEXT:
The recent update to use differentiated keys seems to be causing some issues. Needs some further R & D with Hedera devs.

ERRORS:
An error minting the nft: StatusError: receipt for transaction 0.0.0@00000000000000000 contained error status INVALID_SIGNATURE

WORKAROUND:
Revert to using the single account for all key types until a further update is provided.

The importance of knowing what keys to set

Hi Matt. This is less of a bug and more of an awareness piece. Your scripts are a great resource for getting someone up and running but it's important they know what the keys do if/when they come to mint a larger collection that they want to put out to the public.

Right now I believe you can't remove the keys once set. If someone runs the mint token script then all their keys will be set which might not be what they're after.

Having a Wipe key set for example would let them burn a token in someone else's account which might not be what they're after.

The update might just be a simple change to the Readme and also a comment in an .env.example file with what each key is for:
.env.example

# The supply key lets you mint new tokens under the token ID
# SUPPLY_KEY=

# The admin key lets you update the global properties of your token such as the name, symbol and the treasury account. If you want your token to be immutable then don't set this
# ADMIN_KEY=

etc

and then to add conditional keys only if they're set in the .env file.

const adminKey = process.env.ADMIN_KEY
const supplyKey = process.env.SUPPLY_KEY
if (adminKey) {
    transaction.setAdminKey(PrivateKey.fromString(adminKey))
}
if (supplyKey) {
    transaction.setSupplyKey(PrivateKey.fromString(supplyKey))
}
etc…

On a side note, I have added a HIP proposal to address the fact that you can't remove keys once set. I'd appreciate it if you had a moment to add any comments/feedback. Thanks!

hashgraph/hedera-improvement-proposal#540

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.