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

goodchain

v3.0.5

Published

GoodChain: Blockchain for Everyone

Downloads

35

Readme

GoodChain

Welcome to GoodChain, a blockchain platform designed for both beginners and experienced users, seeking simplicity and flexibility. Built with TypeScript and LevelDB, GoodChain offers a customizable environment for experimenting with consensus algorithms, including a default Simple Proof-of-Work (PoW) option.

GoodChain is a distributed ledger that enables secure and irreversible transactions across a peer-to-peer distributed network of nodes, ensuring the integrity of data.

Key Features 🚀

  • Pluggable Consensus: Experiment with your consensus algorithms or use the default PoW implementation
  • RESTful API: Seamlessly integrate external systems with GoodChain's user-friendly API
  • Wallet Management: Efficiently manage digital wallets, track balances, and handle transactions
  • Node Discovery and Synchronization: Discover and sync with other nodes in the network to maintain a consistent state across the blockchain
  • Transaction Pool: Manage pending transactions with our built-in transaction pool
  • Chain Validation: Verify the integrity of the blockchain by validating blocks and transactions
  • EKVS: Embeddable persistent key-value stores are databases that can be embedded into your application. This means no separate server or process is needed to manage the database. LevelDB is a popular example of an EKVS. GoodChain uses the Level library, a Node.js wrapper for LevelDB.

Getting Started 🛠️

To embark on your GoodChain adventure, simply clone the repository and install the dependencies:

# Clone the repository
git clone https://github.com/mlibre/GoodChain.git
cd GoodChain

# Install global dependencies
sudo npm install -g nodemon tsx typescript eslint vitest

# Install project dependencies
npm install

# Generate your miner keys for the first time
tsx src/test/generateKeys.ts

# Mine the very first block
tsx src/test/init.ts

# You may also run Node.js files directly
node dist/test/init.js

# Run the GoodChain node
npm run dev

REST API

Running REST API 🌐

Start the RESTful API server:

npm run dev
# OR
npm start -- --host "http://localhost:3000" --nodes "http://localhost:3001" --dbPath "./assets/db/" --minerKeysFile "./assets/keys/miner.json" --name "GoodChain"

Running Multiple REST Nodes 🌟

Run multiple nodes in the GoodChain network! Each node will have its own unique identity and contribute to the decentralized network. For example:

# Node 1
npm run 3000

# Node 2
npm run 3001

# Node 3
npm run 3002

Each node will have its own blockchain data, wallets, and nodes list, but they can communicate and synchronize with each other to maintain a consistent state.

RESTful API Endpoints 🛣️

GoodChain provides a rich set of HTTP API endpoints for your blockchain interactions. Explore, experiment, and have fun building amazing applications!

| Endpoint | Method | Description | | --------------------- | ------ | ---------------------------------------------------------------------------------------------- | | /block | GET | Retrieves information about a specific block or the latest block if no parameters are provided | | /block | POST | Adds a new block to the blockchain | | /block/broadcast | GET | Broadcasts the latest block to all nodes in the network | | /chain | GET | Retrieves the entire blockchain | | /chain/update | POST | Updates the local blockchain by fetching blocks from other nodes | | /mine | GET | Mines a new block and adds it to the blockchain | | /node | GET | Retrieves information about all nodes in the network | | /node | POST | Adds a new node to the network | | /node/update | POST | Updates the local node's knowledge of the network by fetching data from other nodes | | /node/broadcast | GET | Introduces the local node to all other nodes in the network | | /transaction | GET | Retrieves pending transactions | | /transaction | POST | Adds a new transaction to the transaction pool | | /transaction/update | GET | Updates the local transaction pool by fetching transactions from other nodes | | /transaction/sign | POST | Signs a transaction with a private key | | /wallet | GET | Retrieves information about wallets in the blockchain |

Testing the Project 🧪

To ensure the reliability and correctness of the GoodChain project, you can run tests.

Running All Tests

Run the entire test suite using vitest:

npm run test
# OR
vitest run

Running Tests with the UI

For an interactive testing experience, use the vitest UI:

npm run test-ui
# OR
vitest --ui

Running Specific Tests

To run a specific test file, for example, the blockchain tests:

npm run test src/test/blockchain.test.ts

Support and Resources 🤝

Check out the Bruno collection in the assets folder for a quick start with API requests. For further assistance, consider reaching out through our GitHub Issues page.

License 📜

This project is licensed under the GNU General Public License.

Version History

Version 1

The first version of GoodChain was a simple blockchain implementation used to learn about blockchain technology. It used json files to store the blockchain data. Check out the releases to see the code.

Version 2

The second version of GoodChain was built using Node.js and Express.js, and used git to store the blockchain data. Check out the releases to see the code.

Version 3 (latest version)

The third version of GoodChain is built using TypeScript, Express.js, and LevelDB.

Donate 💖

If you find GoodChain helpful and would like to support its development, you can donate ETH to the following address:

0xc9b64496986E7b6D4A68fDF69eF132A35e91838e