Skip to content

TON Jetton — Rest API open-source. A simple and efficient solution for interacting with the TON Blockchain

License

Notifications You must be signed in to change notification settings

TGRTON/TON-token-Rest-API

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


TON Jetton — Rest API open-source

A simple and efficient solution for interacting with the TON Blockchain

Report Bug . Request Feature

Downloads Contributors License

Table Of Contents

About The Project

This development was the result of a long unsuccessful process of finding a workable solution for interfacing with the TON Network and servicing balances, payments and transactions of TON coins and TGR tokens. This solution allows you to easily set up wallet creation, balance checking, payment sending, and transaction statistics output in PHP.

Built With

The docker container is written in .JS and communicates with the jsonRPC of the TON network. The user part is implemented in PHP.

Getting Started

Check the version of docker, it must be the latest version

docker -v

For example: Docker version 23.0.6, build ef23cbc

Prerequisites

Docker must be installed on the server. If iptables is used, one of the ports that will be used in the script must be open in it. For example: 5885

Installation

  1. Get an API Key at http://toncenter.com/api if you do not plan to setup your own ton-http API.

  2. Installing and running the ton-server Upload ton-server to your server.

Go to the ton-server folder:

cd ton-server

Build and run docker:

docker build -t ton-server .
docker run -d -p 127.0.0.1:5881:80 ton-server
  1. Install ton-http-api if you don't want to use https://toncenter.com/:
chmod +x /usr/local/bin/docker-compose
git clone https://github.com/toncenter/ton-http-api
cd ton-http-api/
mkdir private
curl -sL https://ton-blockchain.github.io/global.config.json > private/mainnet.json
./configure.py
  1. Open .env and change the TON_API_HTTP_PORT port to any free port, for example 5885.

  2. If you do not have docker-compose installed, you can do it with the command below:

curl -L "https://github.com/docker/compose/releases/download/v2.6.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
docker-compose build
docker-compose up -d

Usage

  1. Edit the file php/index.php by filling the following: a) API KEY for https://toncenter.com/api/v2/jsonRPC or change the host to your own ton-http API; b) uncomment the lines for required action and edit the proper values.

  2. Upload the "php" folder to the web-accessible place on your server.

  3. Run the script and get the rest.

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  • If you have suggestions for adding or removing projects, feel free to open an issue to discuss it, or directly create a pull request after you edit the README.md file with necessary changes.
  • Please make sure you check your spelling and grammar.
  • Create individual PR for each suggestion.
  • Please also read through the Code Of Conduct before posting your first idea as well.

Creating A Pull Request

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE for more information.

Authors

  • Lana Cool - Developer - Lana Cool - Telegram bots on PHP

About

TON Jetton — Rest API open-source. A simple and efficient solution for interacting with the TON Blockchain

Topics

Resources

License

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 61.4%
  • PHP 37.7%
  • Dockerfile 0.9%