Git Product home page Git Product logo

kristsplit's Introduction

Kristsplit

Simple applicaiton to redirect your krist!

image of docker status image of ci status

Configuring

To get started download the config.example.json file as config.json. You will need to modify it to your own needs. Hopefully you can understand how the format works based on the contents. There is a JSON schema which will help you with autocompletition if you use a supported IDE, like VSCode.

The JSON file is an object, which has the following properties:

  • splits
  • node

node refers to the krist syncnode to use. This property is optional, and is set to the krist.dev node by default.

splits is an array of different splits. Each item in this array is an object which features the following properties:

  • secret
  • output
  • walletFormat

The secret field will contain the private key (or password) of your wallet. Check out the section about "Getting private key from KristWeb"!

output is either a string with the krist address which all krist should be sent to, or an object. If you go the route of objects, you have to make a key-value pair where the key is an output address, and the value is a number representing the percent to send to it.

walletFormat refers to the wallet format you want to use with your private key. You most likly want KristWallet, but in some cases your private key might already be transformed, and you should use api. This field is optional, and if you don't specify it, it will make an educated guess.

conditions is a set of conditions on which the transaction will be split. If a condition fails, the transaction will be ignored. These are the following conditions you can use:

  • sender filters for a specific sender. This can be an address
  • destination filters for a the destination. This can be a name, with or without metaname
  • minAmount filters for the minimum (inclusive) krist amount sent to split
  • maxAmount filters for the maximum (inclusive) krist amount sent to split

Anywhere in the config that you can put an address, you can also put a krist name with or without a metaname.

FAQ

Getting your private key from KristWeb

  1. Go to "My Wallets"
  2. Find the wallet you want to use
  3. Find and press the "..." menu
  4. Press "Wallet info"
  5. Find where it says "Privatekey", click "Reveal".

Can I use my Kristsplit config between major version updates?

No. You cannot use your Kristsplit configs accross major version bumps without migration.

Krist?

Krist is a virtual currency used on some Minecraft servers, mainly SwitchCraft. More information about Krist is available at krist's website.

Private key? Password?

Private key and password are two different things in the krist world! A password, is what you give into a wallet hasher, and it outputs a private key! If you have a private key (hashed password), you should set the format to API.

Division rest?

Let's say we have a 50/50 split is configured, but it receives k3 from someone. It will then give k2 to the first address in the split configuration, and k1 to the other.

Deploying

Docker run

Run the following in the same directory as the config.

docker run -d -it --mount type=bind,source="$(pwd)/config.json",target="/usr/src/app/config.json" ghcr.io/erb3/kristsplit:latest

Docker compose

To run with docker compose, add this to your composefile:

kristsplit:
  image: ghcr.io/erb3/kristsplit:latest
  container_name: kristsplit
  restart: unless-stopped
  volumes:
    - type: bind
      source: "[Output of `pwd` in the directory of your config]/config.json"
      target: "/usr/src/app/config.json"

Tests

This application is tested-ish with the Bun test runner. After installing dependencies, you can run bun run test to run the tests.

Linting

Kristsplit uses Biome to lint and format the code. Use bun run lint to lint the code, bun run format to format the code, or bun run check for both. In linting you can automatically fix some problems by using --apply or --apply-unsafe.

Todo

Currently implemented:

  • Split krist sent to an address
  • Split krist sent to a specific (meta)name

Not done yet:

  • Real tests with alternative krist nodes
  • Loop detection
  • Config examples
  • Config builder
  • Condition actions
  • Prometheus

kristsplit's People

Contributors

dependabot[bot] avatar erb3 avatar renovate[bot] avatar

Watchers

 avatar

Forkers

tomodachi94

kristsplit's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Awaiting Schedule

These updates are awaiting their schedule. Click on a checkbox to get an update now.

  • chore(deps): update docker/build-push-action digest to ef6cba3
  • chore(deps): update docker/login-action digest to 0d4c9c5

Detected dependencies

bun
package.json
  • krist ^3.0.0
  • tslog ^4.9.2
  • zod ^3.22.4
  • @biomejs/biome 1.7.3
  • typescript ^5.2.2
dockerfile
Dockerfile
  • oven/bun 1
github-actions
.github/workflows/ci.yml
  • actions/checkout v4
  • oven-sh/setup-bun v1
.github/workflows/docker-image.yml
  • actions/checkout v4
  • docker/login-action 70fccc794acd729b2b22dd6a326895f286447728
  • docker/metadata-action f7b4ed12385588c3f9bc252f0a2b520d83b52d48
  • docker/build-push-action 2a53c6ccda456d31fb62eedc658aae06e238b7bd
regex
biome.json
  • @biomejs/biome 1.7.3

  • Check this box to trigger a request for Renovate to run again on this repository

Action Required: Fix Renovate Configuration

There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.

Location: renovate.json
Error type: The renovate configuration file contains some invalid settings
Message: Invalid schedule: Invalid schedule: Failed to parse "* * * 1,3,6,97 *"

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.