An efficient and straightforward solution for interacting with the TON Blockchain
Report Bug
.
Request Feature
- About the Project
- Built With
- Getting Started
- Expanded Usage Instructions
- Enhanced Contribution Guidelines
- Licensing Details
- Acknowledgements
This project emerged from the need for a reliable and efficient way to interface with the TON Network, managing balances, payments, and transactions of TON coins and TGR tokens. It provides a user-friendly PHP interface for setting up wallet creation, balance checking, payment sending, and viewing transaction statistics.
The project comprises a docker container developed in .JS, which interfaces with the TON network's jsonRPC. The user interface is built using PHP for ease of use and accessibility.
Ensure your docker version is up to date:
docker -v
Example output: Docker version 23.0.6, build ef23cbc
Docker installed on the server. Open the necessary port in iptables, e.g., 5885.
-
Obtain an API Key from http://toncenter.com/api or set up your own ton-http API.
-
Set up the ton-server:
- Upload ton-server to your server.
- Navigate to the ton-server folder:
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
- 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
-
Open .env and change the TON_API_HTTP_PORT port to any free port, for example 5885.
-
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
-
Editing the PHP Script:
- Locate the
php/index.php
file in your project directory. - Update the following configurations: a) Insert your API Key for the TON API service at https://toncenter.com/api/v2/jsonRPC. Alternatively, if you are using a custom ton-http API, modify the host details accordingly. b) Identify the section in the script where actions are defined. Uncomment the lines corresponding to the actions you want to perform (e.g., wallet creation, balance inquiry). Ensure you input the correct parameters in these lines for accurate functioning.
- Locate the
-
Deploying the Script:
- Once the
php/index.php
file is configured, prepare to upload it to your server. - Transfer the entire "php" folder to a directory on your server that is accessible via the web. This ensures that the script can be executed through a web interface.
- Once the
-
Running the Script:
- After uploading, navigate to the location of the
index.php
file through your web browser. - Execute the script by accessing its URL. The script will interact with the TON Blockchain as per the configured actions and parameters.
- After uploading, navigate to the location of the
Contributions are a vital part of the open-source community, fostering learning, inspiration, and creativity. Here's how you can contribute:
-
Suggesting Changes:
- If you have ideas for improvements or notice any issues, please feel free to open an issue on our GitHub repository. This could include adding new features or removing existing ones.
- When suggesting changes, please be clear and concise in your descriptions to facilitate understanding and implementation.
-
Before Contributing:
- Ensure your contributions are well-considered and carefully planned.
- Pay attention to spelling and grammar in your contributions to maintain the quality of documentation.
- For each suggestion or improvement, create a separate pull request (PR). This helps in better tracking and managing changes.
-
Adhering to Conduct:
- Before you submit your first contribution, please read through our Code Of Conduct. This ensures a respectful and collaborative environment for all contributors.
-
Forking the Project:
- Begin by forking the repository. This creates a copy of the project in your GitHub account, allowing you to make changes without affecting the original.
-
Creating a Feature Branch:
- In your forked repository, create a new branch for your feature or fix. Use the command:
git checkout -b feature/AmazingFeature
(replace 'AmazingFeature' with a descriptive name for your feature).
- In your forked repository, create a new branch for your feature or fix. Use the command:
-
Committing Changes:
- Make your changes in the new branch and commit them with a clear and descriptive message, using:
git commit -m 'Add some AmazingFeature'
.
- Make your changes in the new branch and commit them with a clear and descriptive message, using:
-
Pushing to GitHub:
- Push the changes to your GitHub repository using:
git push origin feature/AmazingFeature
.
- Push the changes to your GitHub repository using:
-
Opening a Pull Request:
- Once your feature is ready and pushed to GitHub, navigate to the original repository you forked.
- Click on the 'Pull Request' button and then on 'New Pull Request'.
- Select your 'feature/AmazingFeature' branch and provide a detailed description of the changes you've made.
- Submit the pull request for review by the project maintainers.
This project is distributed under the MIT License, offering wide-reaching flexibility and freedom for use and modification. See LICENSE for more information.
- Primary Developer: Lana Cool
- Expertise: Development of Telegram bots using PHP.
- GitHub Profile: Lana Cool
- Lana has been instrumental in developing and maintaining this project, ensuring it remains a robust and user-friendly tool for interacting with the TON Blockchain.