Phantasma Blocks is a A dynamic transactional engine optimized for consistent, high-frequency operations. Designed to process 10 transactions per minute, Phantasma-Blocks offers a seamless blend of speed and reliability, ensuring that every transaction, like a phantom, moves swiftly and effortlessly through the digital realm.
Before you begin, ensure you have met the following requirements:
- [Software or tool name] - [Version] (e.g., Node.js v14+)
-
Clone the Repository:
git clone https://github.com/phantasma-io/Phantasma-Blocks.git cd Phantasma-Blocks -
Install Dependencies:
npm install
-
Configuration:
- Rename
.env.mainnetto.env(if applicable) - Edit
.envto include your settings and save the file.
- Rename
-
Build the Project (if applicable):
npm run build
-
Start the application:
npm start
To configure the Run Blockz service to work with your setup, you will need to modify the ExecStart path in the existing service file. This ensures that the service correctly points to the autostart.sh script in your repository. Follow these steps:
-
Locate the Service File: Find the
runblockz.servicefile. This is typically located in the/etc/systemd/system/directory. -
Edit the Service File: Open the
runblockz.servicefile in a text editor with administrative privileges. You can use editors likenanoorvim. For instance:sudo nano /etc/systemd/system/runblockz.service -
Modify the ExecStart Path: In the service file, locate the
ExecStartline. Change the path to point to yourautostart.shscript within the cloned repository. For example:ExecStart=sh /path/to/your/repo/autostart.shReplace
/path/to/your/repo/with the actual path where your repository is located. -
Save the Changes: After making the changes, save the file and exit the editor. For
nano, you can do this by pressingCTRL+X, thenYto confirm, andEnterto save. -
Reload Systemd: To apply the changes, reload the systemd configuration:
sudo systemctl daemon-reload -
Restart the Service: Restart the
Run Blockzservice to apply the new configuration:sudo systemctl restart runblockz.service -
Verify the Service: Ensure that the service is running with the new settings:
sudo systemctl status runblockz.service -
Check Logs for Debugging: If needed, you can check the service logs for any issues:
journalctl -u runblockz.service
By following these steps, you will have successfully configured the Run Blockz service to use the autostart.sh script from your repository. This ensures that the service will behave as expected with your setup.
If you're using npm or bun in your Run Blockz service, it's important to ensure that the autostart.sh script points to the correct executable paths. This involves updating the PATH variable within the script to include the directories where npm or bun are located. Here's how to do it:
-
Locate the Autostart Script: Find the
autostart.shscript within your cloned repository. -
Edit the Autostart Script: Open
autostart.shin a text editor. You might need administrative rights to modify this file. -
Update the PATH Variable: Look for a commented
PATHvariable line in the script:#PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/binUncomment and modify this line to include the paths to
npmorbun. For instance, ifnpmis located in/usr/local/bin/npmandbunin/usr/local/bin/bun, ensure these paths are included:PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
If you're unsure of where
npmorbunare installed, you can usewhich npmorwhich bunin your terminal to find out. -
Save and Close the File: After adjusting the
PATH, save your changes and close the editor. -
Make the Script Executable: Confirm that the
autostart.shscript is executable:chmod +x /path/to/your/repo/autostart.sh -
Restart the Service: Apply the changes by restarting the
Run Blockzservice:sudo systemctl restart runblockz.service -
Check the Service Status: Verify that the service is functioning correctly with the new script configuration:
sudo systemctl status runblockz.service
By customizing the PATH in the autostart.sh script, you ensure that the correct versions of npm or bun are used by the Run Blockz service. This step is crucial for the proper operation of your application.
If you want to contribute to Phantasma Blocks, see the CONTRIBUTING.md for details.
This project is licensed under the [License Name] License - see the LICENSE.md file for details.
If you want to contact the maintainers, you can reach out at [info@phantasma.io].