Git Product home page Git Product logo

chia-config-loader's Introduction

Chia Config Loader

chia-config-loader is a simple utility that allows you to load Chia's configuration file in your project. This is the file thats located at //config/config.yaml leverages memoization to optimize loading the configuration, ensuring that the file is read only once during the lifetime of your application.

If you have a system variable called CHIA_ROOT it will use this to locate the file. Otherwise it will default to ~/.chia/mainnet

Installation

You can install chia-config-loader using npm:

npm install chia-config-loader

Usage

After importing chia-config-loader into your project, you can easily access Chia's configuration using the provided getChiaConfig function.

Example

Here's how you can use chia-config-loader in your code:

const { getChiaConfig } = require("chia-config-loader");

// Fetch Chia's configuration
const config = getChiaConfig();

// Access any desired configuration property
console.log(config.data_layer.host_port);

Function

getChiaConfig()

Returns the Chia configuration object. The result is memoized, so subsequent calls to getChiaConfig return the same object without re-reading the file.

Dependencies

This module depends on chia-root-resolver to find the root folder of the Chia blockchain software. Ensure that you have this package in your project if you're going to use chia-config-loader.

License

MIT

chia-config-loader's People

Contributors

michaeltaylor3d avatar

Watchers

 avatar

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.