GithubHelp home page GithubHelp logo

kin-starters / kinetic-node-starter Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 2.0 928 KB

This starter shows how to implement a simple API that allows you to send KIN to a Solana account using Kinetic.

Home Page: https://github.com/kin-starters/kinetic-node-starter/pkgs/container/kinetic-node-starter

License: MIT License

Shell 5.70% TypeScript 79.32% JavaScript 0.54% Dockerfile 14.44%
airdrop kin kinetic solana web3js

kinetic-node-starter's Introduction

kinetic-node-starter

This starter shows how to implement a simple API that allows you to send KIN to a Solana account using Kinetic.

Read the details in .env.example about how to create an Payment Account.

Make sure to protect your endpoints for malicious users, so they don't drain your Payment Account.

It also implements the webhook listener for the Kinetic API.

Requirements

  • Basic Node and TypeScript knowledge
  • Node 16+
  • Yarn 1.22.x

Running this project

1. Clone the repo

git clone https://github.com/kin-starters/kinetic-node-starter.git
cd kinetic-node-starter

2. Install the dependencies

yarn install

3. Configure your environment

You need to create the .env file and configure the settings. All the env vars are required.

Read the .env.example file for configuration options.

// Or use your editor to copy the file...
cp .env.example .env

4. Run the server

yarn dev

5. Invoke the endpoint

You can now invoke the /payment endpoint on the API, adding the public key of the Solana destination account as the first and the amount of KIN to send as second parameter:

curl http://localhost:9876/payment/FaFGzKRFhrQffH7voPUgzpJA2ngsvJvtYPXcye6w4DJ9/42

Docker

You can also run this project using Docker.

cp .env.example .env
# Edit the .env file
docker compose up

kinetic-node-starter's People

Contributors

beeman avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

akonobi1 deskaone

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.