├── .github
└── FUNDING.yml
├── README.md
├── assets
├── Download-Cryptocurrency-Exchange-Script-Cryptocurrency-Exchange-Software.png
├── crypto-exchange.webp
├── crypto_trading_leaderboard.png
├── cryptocurrency_Exchange_script.png
├── cryptocurrency_Exchange_script_binance_clone_codono.png
├── cryptocurrency_exchange_software_mobile_app.png
└── deposit_withdrawal_troubleshooting_for_Evm.png
├── changelog.md
├── docs
├── WebSocketConfigLiquidity.md
├── bep20-setup.md
├── binance-cross-trading-setup.md
├── blockgum-coin-setup.md
├── blockgum-integration.md
├── blockgum-withdrawal-processing.md
├── bnb_client_info.md
├── cryptoapis.io.setup.md
├── exchange-app.md
├── exchange-setup.md
├── geth-codono-working.md
├── google-login-setup.md
├── how-does-codono-work.md
├── multi_server
│ ├── README.md
│ └── multi-server-setup.sh
├── must-follow-security.md
├── oneinstack_setup
│ ├── README.md
│ ├── check_oneinstack_status.sh
│ ├── run1_all_in_onestack_setup.sh
│ ├── run2_domain_and_unzip.sh
│ ├── run3_config_part.sh
│ ├── run4_db_create_and_import.sh
│ ├── run5_websocket.sh
│ ├── run6_cron_setup.sh
│ └── run7_show_admin_login.sh
├── php-dex-decentalized-exchange.md
├── security-tips.md
├── shuftipro-setup-requirements.md
├── substrate-node-solution.md
├── things-to-avoid.md
├── trc20-setup.md
├── tron_setup.md
├── trx-trc20-withdrawal.md
└── xrp-setup-crypto-exchange.md
├── features
└── leaderboard.md
├── install_check.php
├── manage
├── README.md
├── airdrop.md
├── coins.md
├── competition.md
├── faucet.md
├── launchpad.md
├── market.md
├── mining.md
└── staking.md
├── node-setup
├── bnb.md
├── btc.md
├── btc_prune_node_setup.sh
├── dogecoin_prune_node_setup.sh
├── eth.md
├── klay.md
├── ltc_prune_node.sh
├── polkadot-substrate.md
└── readme.md
├── scrape
├── bscscan-etherscan-scraping.md
└── bscscan-tokens.csv
└── tools
└── admin_change.sh
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | ethereum_payment_info:
2 | address: "0xb6135acb77b20293f998ffd8e4c73c7d65426091"
3 | currency: "ETH"
4 | instructions: |
5 | To send Ethereum (ETH) to this address, follow these steps:
6 | 1. Open your Ethereum wallet.
7 | 2. Choose the option to send ETH.
8 | 3. Enter this Ethereum address as the recipient: 0xb6135acb77b20293f998ffd8e4c73c7d65426091
9 | 4. Enter the amount of ETH you wish to send.
10 | 5. Review the transaction details and confirm the transaction.
11 | note: |
12 | Please ensure that you send only ETH to this address.
13 | Transactions on the Ethereum blockchain are irreversible.
14 | For any queries or issues, contact me at [your contact information].
15 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 | ## Discover the Power of Codono's Cryptocurrency Exchange Script
3 |
4 |
5 |
6 |
7 | Experience a Revolution in Crypto Trading with Codono's [Cryptocurrency Exchange Script](https://codono.com)
8 |
9 | Unveil the Future of Crypto Trading
10 |
11 | - **Auto Detection of Deposits:** Enjoy the seamless detection and instant crediting of deposits. Each user is assigned a unique deposit per coin, ensuring accuracy and efficiency.
12 |
13 | - **Binance Clone:** Leverage the power of Codono's Binance clone to create cryptocurrency exchanges akin to Binance, Huobi, and Coinbase. Begin your crypto exchange journey within a week.
14 |
15 |
16 | Explore the Universe of [Binance Clone](https://codono.com)
17 |
18 | - **Asset Trading Solution:** Trade a diverse array of assets including cryptocurrencies, tokens, and fiats. Benefit from market-making and liquidity options for enhanced trading experiences.
19 |
20 | - **Fiat-Crypto Market:** Codono supports all fiat currencies, allowing you to establish markets between Fiat-Crypto, Fiat-Fiat, and Crypto-Crypto pairs.
21 |
22 | - **Wide Token Compatibility:** Enjoy compatibility with numerous coins and tokens, from Bitcoin (BTC), Litecoin (LTC), Dogecoin (DOGE), Tron [TRC10+TRC20]*, Ethereum based tokens [ETH-ERC20, BNB-BEP20, FTM, SOL, Private Networks], XRP, XMR, Waves, Coinpayments, and more.
23 |
24 | [Cryptocurrency Nodes Setup Guide](node-setup/) for codono
25 |
26 | 
27 |
28 | Elevate Your Trading with [Cryptocurrency Exchange Software](https://codono.com/download/)
29 |
30 | - **6 Years of Expertise:** Codono's Binance clone has evolved over 6 years, making it suitable for businesses of all scales, from small startups to enterprise giants.
31 |
32 | - **Web and Mobile App Deployment:** Access the world of crypto trading seamlessly through web and mobile applications, ensuring a user-friendly experience.
33 |
34 | ### Documentation for cryptocurrency exchange
35 | - [Codono Setup fully automatic method](docs/oneinstack_setup/README.md)
36 | - [How Does Codono Work](docs/how-does-codono-work.md)
37 | - [WebSocketConfigLiquidity](docs/WebSocketConfigLiquidity.md)
38 | - [PHP Dex Decentralized Exchange](docs/php-dex-decentalized-exchange.md)
39 | - [BEP20 Setup](docs/bep20-setup.md)
40 | - [Security Tips](docs/security-tips.md)
41 | - [Binance Cross Trading Setup](docs/binance-cross-trading-setup.md)
42 | - [Shuftipro Setup Requirements](docs/shuftipro-setup-requirements.md)
43 | - [Blockgum Integration](docs/blockgum-integration.md)
44 | - [Substrate Node Solution](docs/substrate-node-solution.md)
45 | - [BNB Client Info](docs/bnb_client_info.md)
46 | - [Things to Avoid](docs/things-to-avoid.md)
47 | - [Cryptoapis.io Setup](docs/cryptoapis.io.setup.md)
48 | - [TRC20 Setup](docs/trc20-setup.md)
49 | - [Exchange Setup Manually](docs/exchange-setup.md)
50 | - [Tron Setup](docs/tron_setup.md)
51 | - [Google Login Setup](docs/google-login-setup.md)
52 | - [XRP Setup for Crypto Exchange](docs/xrp-setup-crypto-exchange.md)
53 |
54 | ## White Label Blockchain Solution: Elevate Your Crypto Business with Codono
55 |
56 | If you're on the hunt for a white-label blockchain solution provider, look no further than Codono. With their turn-key solutions, crypto business owners can quickly establish their presence and operations. Codono offers unparalleled service offerings that cater to your every need. Their unique white label solutions are built on proven frameworks, ensuring reliability and adaptability.
57 |
58 | ### Crypto Exchange Script: Unveiling a World of Possibilities
59 |
60 | The Crypto Exchange Script, a cutting-edge white label blockchain solution, stands as an open-source software masterpiece. Liberated from the grasp of centralized entities, it presents a world of limitless possibilities. Its codebase, openly accessible and globally tested, is a testament to its robustness. The innovative minds at Codono, a leading Blockchain software development company, have crafted a secure and adaptable white label version. This version empowers developers to seamlessly deploy and customize cryptocurrency exchange services.
61 |
62 | **Why Choose Codono's Crypto Exchange Script?**
63 |
64 | - **Freedom and Flexibility:** Embrace the liberty of an open-source solution that is not bound by constraints. Customize, modify, and innovate to your heart's content.
65 |
66 | - **Security First:** Rest assured with a software solution built on blockchain technology, fortified against vulnerabilities and threats.
67 |
68 | - **Global Validation:** With its codebase tested and approved by developers worldwide, you're in the company of a robust and credible solution.
69 |
70 | - **Partnered Excellence:** Codono collaborates with Blockgum, a leading Blockchain software development company, ensuring you benefit from a wealth of expertise.
71 |
72 | - **Commercial Licensing:** Embrace the assurance of a software licensed under the Commercial License, delivering legality and peace of mind.
73 |
74 | ### Harness the Power of Codono's White Label Blockchain Solution
75 |
76 | Elevate your crypto business, forge your unique path, and experience the freedom to innovate with Codono's exceptional white-label blockchain solution. Partner with a trusted name that places your success at the forefront.
77 |
78 | For more information, visit [Codono's official website](https://codono.com).
79 |
80 | Discover your potential, redefine possibilities – Codono's White Label Blockchain Solution.
81 |
82 |
83 | 
84 | ## Crypto Exchange Script: Empowering Your Exchange Platform
85 |
86 | The Crypto Exchange Script is a versatile solution for building a comprehensive cryptocurrency exchange platform. It functions as a dynamic software development kit that integrates both public and private libraries, allowing for the seamless development of a cryptocurrency exchange. Built on blockchain technology and offered as an open-source platform, the Crypto Exchange Script empowers businesses to create their own private and white-label exchange solutions that cater to their specific customer base.
87 |
88 | ### Key Features and Benefits:
89 |
90 | - **Customizable Backend and User Interface:** The Crypto Exchange Script provides a fully customizable backend infrastructure and a user-friendly interface. Its administration panel empowers platform administrators to efficiently manage operations and activities.
91 |
92 | - **Multi-Level Referral Systems:** The platform supports multi-level referral systems, enhancing user engagement and incentivizing growth within the exchange ecosystem.
93 |
94 | - **Double-Entry Accounting:** With double-entry accounting, financial transactions are accurately recorded and managed, ensuring transparency and accuracy in the exchange's financial operations.
95 |
96 | - **API Key Integration for Trading Bots:** Trading bots can be seamlessly integrated using API keys, enabling automated trading strategies and enhancing liquidity.
97 |
98 | - **Trusted by Industry Leaders:** The Crypto Exchange Script enjoys a strong reputation and is trusted by prominent players in the financial industry.
99 |
100 | ### Comprehensive Feature Set:[Exchange Script](https://codono.com/features/)
101 |
102 | 1. **Spot Classic:** Trade a variety of cryptocurrencies in real-time with basic trading features.
103 | 2. **Spot Pro:** Advanced trading platform with tools for professional traders.
104 | 3. **OTC:** Trade large volumes directly between users, avoiding public order books.
105 | 4. **Easy Trade:** User-friendly interface for newcomers to navigate and execute trades.
106 | 5. **FX Quote [Xe API]:** Real-time foreign exchange rates for crypto-to-fiat conversions.
107 | 6. **Voting:** Empower your community with coin voting for new token listings.
108 | 7. **Listing Competition:** Engage users through listing competitions for new tokens.
109 | 8. **P2P Trading:** Enable peer-to-peer trading with customizable terms.
110 | 9. **ICO / IEO Launchpad:** Launch token offerings, providing users exclusive access.
111 | 10. **Store:** Shop with cryptocurrencies, expanding their utility.
112 | 11. **Airdrop:** Distribute free tokens for marketing campaigns.
113 | 12. **Faucet:** Users can claim free tokens to encourage engagement.
114 | 13. **Staking / Invest:** Stake cryptocurrencies for rewards or invest in assets.
115 | 14. **Mining Module:** Enable cryptocurrency mining with rewards.
116 | 15. **Dex Sell [Metamask]:** Integrate DEX for token trading via Metamask wallets.
117 | 16. **LeaderBoard** Leaderboard is a dynamic feature designed to enhance user engagement and foster a competitive spirit among the users of our platform.[Leaderboard](features/leaderboard.md)
118 | 17. **All Standard Features:** User registration, security (2FA, recaptcha), order book, trade history, real-time price charts, and more.
119 |
120 | ### Whitelabel Crypto Exchange Script: A Swift Path to Market
121 |
122 | The Whitelabel Crypto Exchange Script platform offers a turnkey solution for launching a white-label cryptocurrency exchange with exceptional speed-to-market. The platform ensures that users retain control of their private keys, promoting a non-custodial approach to security. Cost-effective and boasting a customizable user interface, the front-end of the Crypto Exchange Script has been optimized for enhanced search visibility and SEO performance.
123 |
124 | ### High-Performance and Ready for Diverse Tokens
125 |
126 | Built on a go-based implementation, the Crypto Exchange Script delivers high-performance trading functionality. The platform is capable of hosting more than 2000 cryptocurrencies and tokens, offering users a diverse range of trading options.
127 |
128 | ### Unparalleled Compliance and Security
129 |
130 | The Crypto Exchange Script is aligned with the latest regulatory guidelines, facilitating easy adaptation to changing rules. The platform's foundation on smart contracts empowers it to efficiently implement compliance changes across the system, safeguarding against fraud and undesirable activities.
131 |
132 | ### Seamless Integration and Collaboration
133 |
134 | Codono's white label blockchain solution is designed to integrate seamlessly with various systems and networks. This flexibility allows for smooth integration into the client's existing environment, enhancing interoperability.
135 |
136 | Experience the Future of Cryptocurrency Exchange with Codono's Innovative Solutions.
137 |
138 | > "Codono is not just a platform; it's a revolution in the way we approach cryptocurrency exchange development. Join us as we redefine the possibilities of the blockchain ecosystem."
139 |
140 |
141 |
142 | Here's a list of additional wallet features and integrated nodes, along with supported cryptocurrencies and fiat gateways:
143 |
144 | **Integrated Nodes:**
145 |
146 | 1. **BTC Type [BTC, BCH, LTC, DOGE, DASH, ZCASH, PivX, etc]:** Support for various Bitcoin-type cryptocurrencies including Bitcoin, Bitcoin Cash, Litecoin, Dogecoin, Dash, Zcash, PivX, and more.
147 |
148 | 2. **ALL EVM CHAINS [ERC20/BEP20/FTM20/AVAX20]:** Integration with All EVM networks and support for all standard ERC20 tokens built on the EVM blockchain. See [chainlist](https://chainlist.org/) to see complete list of supported evm chains.
149 |
150 | 3. **TRX TRC20/TRC10:** Support for TRON's TRC20 and TRC10 tokens, available with the Pro and Ultra editions.
151 |
152 | 4. **XMR and Cryptonote:** Support for Monero (XMR) and other cryptocurrencies using the Cryptonote protocol.
153 |
154 | 5. **Block.io:** Integration with Block.io
155 |
156 | 6. **XRP:** Integration with the Ripple (XRP) blockchain, allowing users to hold and trade XRP.
157 |
158 | 7. **CoinPayments [2000+ Coins and Tokens]:** Integration with CoinPayments to support over 2000+ cryptocurrencies and tokens.
159 |
160 | 8. **Waves and Tokens:** Integration with the Waves blockchain and support for tokens created on the Waves platform.
161 |
162 | 9. **Blockgum Integration:** Integration with [Blockgum](https://codono.com) Node for enhanced functionality for All EVM chains and Cross chain wallet.
163 |
164 | 10. **Polkadot:** Support for the Polkadot blockchain ecosystem.
165 |
166 | 11. **Nexa Chain and Tokens:** Integration with Nexa Chain and support for its native tokens.
167 |
168 | 12. **CryptoApis.io:** Integration with Cryptoapis.io
169 |
170 |
171 | **Fiat Gateways:**
172 |
173 | 1. **Bank Deposit:** Allow users to deposit funds directly from their bank accounts.
174 |
175 | 2. **Authorize.net:** Integration with the Authorize.net payment gateway for fiat transactions.
176 |
177 | 3. **YocoPayments:** Support for YocoPayments as a payment gateway for fiat transactions.
178 |
179 | 4. **Uganda Mobile Payments:** Integration with mobile payment methods popular in Uganda.
180 |
181 | These additional wallet features and integrated nodes expand the range of cryptocurrencies and payment methods your platform can support, providing users with a diverse and comprehensive trading and payment experience.
182 | We can add any Crypto method or Fiat gateway to Exchange software
183 |
184 | ## Expanding Possibilities with Integrated Wallet Features and Nodes
185 |
186 | Enhance your cryptocurrency exchange platform's capabilities with the integrated wallet features and nodes offered by Codono. These additions broaden the range of supported cryptocurrencies and payment methods, providing your users with a comprehensive trading and payment experience. Our flexible solution allows seamless integration of various crypto methods and fiat gateways into your exchange software, giving you the power to cater to a diverse user base.
187 |
188 | ## Codono's White-Label Blockchain Solution: Leveraging Innovation
189 |
190 | Codono's white-label blockchain solution empowers financial institutions and businesses to harness cutting-edge technology and create compliant digital asset ecosystems. Our end-to-end products streamline tokenization of traditional assets and significantly reduce administrative overhead by up to 70%. Leveraging an automated compliance engine, Codono ensures minimal fees and swift transaction speeds comparable to modern centralized applications.
191 |
192 | ### Advantages of Codono's White-Label Blockchain Solution
193 |
194 | Codono's compliance infrastructure is underpinned by advanced protocols, enabling institutions to conduct secure and compliant operations. Our solution offers:
195 |
196 | - Streamlined compliance testing
197 | - Staking benefits exploration
198 | - Proven success with institutional participants
199 | - Syndicated cover for DeFi products
200 | - Accessible global utility
201 |
202 | ## Your Path to a Seamless Exchange
203 |
204 | For those seeking a comprehensive white-label blockchain solution, Codono's team delivers a software kit that transcends language barriers and offers international utility. Our marketplace fosters development of plugins and KYC features, enabling tailor-made solutions for every jurisdiction.
205 |
206 | ### Quick Setup and Launch
207 |
208 | Setting up your exchange is a breeze with Codono's user-friendly approach:
209 |
210 | 1. Choose a plan and hosting
211 | 2. Opt for hosted or cloud exchange
212 | 3. Initiate setup process
213 | 4. Customize theme and graphics
214 | 5. Launch your exchange within 30 minutes
215 |
216 | ## Codono: Empowering Startups and Businesses
217 |
218 | Aspiring startups and established businesses find Codono an ideal white-label cryptocurrency exchange solution. It's open-source, eliminating third-party authorization hurdles. Download our exchange kit from GitHub, host it locally or via the cloud, and leverage our marketing tools for a successful entry into the crypto industry.
219 |
220 | ## Get Started with Codono
221 |
222 | To build your exchange website, download the Codono kit for free. Customize themes and graphics to match your brand's identity. Engage with our team through Telegram or live chat to explore the full range of features and discuss any queries.
223 |
224 | [Get Codono Kit](https://codono.com/download/)
225 | ---
226 |
227 |
228 |
229 |
--------------------------------------------------------------------------------
/assets/Download-Cryptocurrency-Exchange-Script-Cryptocurrency-Exchange-Software.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodonoTeam/cryptocurrency-exchange-script/0319486995bccd6e77beb98358c0fb27c615721e/assets/Download-Cryptocurrency-Exchange-Script-Cryptocurrency-Exchange-Software.png
--------------------------------------------------------------------------------
/assets/crypto-exchange.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodonoTeam/cryptocurrency-exchange-script/0319486995bccd6e77beb98358c0fb27c615721e/assets/crypto-exchange.webp
--------------------------------------------------------------------------------
/assets/crypto_trading_leaderboard.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodonoTeam/cryptocurrency-exchange-script/0319486995bccd6e77beb98358c0fb27c615721e/assets/crypto_trading_leaderboard.png
--------------------------------------------------------------------------------
/assets/cryptocurrency_Exchange_script.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodonoTeam/cryptocurrency-exchange-script/0319486995bccd6e77beb98358c0fb27c615721e/assets/cryptocurrency_Exchange_script.png
--------------------------------------------------------------------------------
/assets/cryptocurrency_Exchange_script_binance_clone_codono.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodonoTeam/cryptocurrency-exchange-script/0319486995bccd6e77beb98358c0fb27c615721e/assets/cryptocurrency_Exchange_script_binance_clone_codono.png
--------------------------------------------------------------------------------
/assets/cryptocurrency_exchange_software_mobile_app.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodonoTeam/cryptocurrency-exchange-script/0319486995bccd6e77beb98358c0fb27c615721e/assets/cryptocurrency_exchange_software_mobile_app.png
--------------------------------------------------------------------------------
/assets/deposit_withdrawal_troubleshooting_for_Evm.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodonoTeam/cryptocurrency-exchange-script/0319486995bccd6e77beb98358c0fb27c615721e/assets/deposit_withdrawal_troubleshooting_for_Evm.png
--------------------------------------------------------------------------------
/changelog.md:
--------------------------------------------------------------------------------
1 | # Changelog
2 |
3 | ## 7.5.5
4 | - Withdrawal Fees in other coins, Example: Pay BNB for USDT [Bep20] as fees
5 | - New Staking version
6 | - Transfer Wallet and Fees Configuration
7 | - P2P Upgrade
8 | - Code Refactoring
9 | - Code Improvements
10 |
11 | ## 7.5.2
12 | - Improved Websocket Version
13 | - Blockgum Api Extension
14 | - Multi wallet support and transfer
15 | - Security Updates
16 | - Better Email Triggers
17 | - Admin Debug + Analytics
18 |
--------------------------------------------------------------------------------
/docs/WebSocketConfigLiquidity.md:
--------------------------------------------------------------------------------
1 | ## Disclaimer:
2 |
3 | **Before proceeding with the following steps, please ensure that you have a good understanding of the tasks involved. Modifying server configurations and using supervisorctl can have a significant impact on your server, and any incorrect configuration can cause issues. Make sure to have a backup of your system before making any changes.**
4 |
5 | ### Step 1: Open other_config.php
6 |
7 | Open the `other_config.php` file in a text editor.
8 |
9 | Make sure the following values are enabled/added:
10 |
11 | ```php
12 | define('SOCKET_WS_ENABLE', 1); // This Socket server URL
13 | define('SOCKET_WS_URL', "wss://rapid.codono.com/wsocket"); // wss for live sites
14 | ```
15 |
16 | Change `wss://rapid.codono.com/wsocket` to your own domain or server URL where your WebSocket server will be running.
17 |
18 | ### Step 2: Enabling Port 7272 for WSS
19 |
20 | You would need to enable port 7272 on your server for WebSocket, so the system can broadcast messages and read from it.
21 |
22 | ### Step 3: Starting Sockets
23 |
24 | On the root of your Codono installation, type in the following command to start the socket server:
25 |
26 | ```bash
27 | php socketbot.php start
28 | ```
29 |
30 | You can also make it run in the background as a daemon process.
31 |
32 | ### NGINX Forwarding
33 |
34 | Add the following NGINX configuration to forward requests for the `/wsocket` path to the WebSocket server:
35 |
36 | ```nginx
37 | location ~/wsocket(.*)$ {
38 | proxy_set_header X-Real-IP $remote_addr;
39 | proxy_set_header X-Forwarded-For $remote_addr;
40 | proxy_set_header Host $host;
41 | proxy_pass http://127.0.0.1:7272;
42 | }
43 | ```
44 |
45 | ### Step 4: Setting up Socket bot in Supervisorctl to Run Always
46 |
47 | 1. Make sure supervisor is installed. If not, you can install it using the following command:
48 |
49 | ```bash
50 | sudo apt-get install supervisor
51 | ```
52 |
53 | 2. Navigate to the supervisor configuration directory:
54 |
55 | ```bash
56 | cd /etc/supervisor/conf.d/
57 | ```
58 |
59 | 3. Create a new configuration file for the socket bot:
60 |
61 | ```bash
62 | sudo nano socketbot.conf
63 | ```
64 |
65 | 4. Add the following configuration to the `socketbot.conf` file:
66 |
67 | ```ini
68 | [program:socketbot]
69 | directory=/data/wwwroot/codebase ; Replace with your Codono installation directory
70 | command=/usr/local/php/bin/php socketbot.php start
71 | autostart=true
72 | autorestart=true
73 | stderr_logfile=/var/log/supervisor/socketbot.err.log
74 | stdout_logfile=/var/log/supervisor/socketbot.out.log
75 | ```
76 |
77 | 5. Save the file and exit the text editor.
78 |
79 | 6. Reload supervisorctl to apply the changes:
80 |
81 | ```bash
82 | supervisorctl reload
83 | ```
84 |
85 | 7. You can now start the socket bot using the following command:
86 |
87 | ```bash
88 | supervisorctl start socketbot
89 | ```
90 |
91 | 8. To check the status and logs of the socket bot, use the following commands:
92 |
93 | ```bash
94 | supervisorctl
95 | tail -f /var/log/supervisor/socketbot.out.log
96 | ```
97 |
98 | Please note that the paths and commands may vary depending on your server environment and Codono installation. Make sure to replace `/data/wwwroot/codebase` with the actual path to your Codono installation and `/usr/local/php/bin/php` with the path to your PHP executable. However its correct if you are following our guide using oneinstack.
99 |
100 | Always ensure that you have proper permissions and access rights while making changes to the server configuration. If you are not familiar with these configurations, it's best to consult with a system administrator or expert.
101 |
--------------------------------------------------------------------------------
/docs/bep20-setup.md:
--------------------------------------------------------------------------------
1 | #[Codono.com](https://codono.com) BEP20 Setup Guide
2 |
3 | You will need following information once you are done with setup
4 | ```
5 | WALLETSERVERIP
6 | WALLETSERVERPORT
7 | MAINACCOUNTPWD
8 | MAINACCOUNTADDRESS
9 | ```
10 | YOURSITEHERE :Exchange URL
11 | CRONKEYHERE: Secure cron key defined in pure_config.php
12 |
13 |
14 | For BNB Coin only
15 | ```
16 | Symbol :bnb
17 | Title: Binance Coin
18 | CoinType: Esmart
19 | Token of :none
20 | RPC Type:Light
21 | Public RPC URL:https://bsc-dataseed.binance.org/
22 | Wallet Server IP :WALLETSERVERIP
23 | Wallet Server Port:WALLETSERVERPORT
24 | Server Username: EMPTY [Leave Blank only]
25 | Wallet Server Password: [of MAIN ACCOUNT]:MAINACCOUNTPWD
26 | Main Account :MAINACCOUNTADDRESS
27 | Block Explorer : https://bscscan.com/tx/
28 | Decimals: 8
29 | Automatic Withdrawal :0.0001 [Amount that is auto approved for withdrawal without admin concent]
30 | ```
31 |
32 | Adding BEP20
33 | Goto Contract address on bscscan.com to get detail first [ Example for BUSD ]
34 | https://bscscan.com/token/0xe9e7cea3dedca5984780bafc599bd69add087d56
35 |
36 |
37 | ```
38 | Symbol :busd
39 | Title: Binance-Peg BUSD Token
40 | CoinType: Esmart
41 | Token of :BNB
42 | RPC Type:Light
43 | Public RPC URL:https://bsc-dataseed.binance.org/
44 | Wallet Server IP :WALLETSERVERIP
45 | Wallet Server Port:WALLETSERVERPORT
46 | Server Username: 0xe9e7cea3dedca5984780bafc599bd69add087d56 [get from bscscan.com]
47 | Wallet Server Password: [of MAIN ACCOUNT]:MAINACCOUNTPWD
48 | Main Account :MAINACCOUNTADDRESS
49 | Block Explorer : https://bscscan.com/tx/
50 | Decimals: 18 [get from bscscan.com]
51 | Automatic Withdrawal :0.0001 [Amount that is auto approved for withdrawal without admin concent]
52 | ```
53 |
54 |
55 | A .Deposit Detection [ We have set cron to check every min]
56 |
57 | https://YOURSITEHERE/Coin/esmart_deposit/securecode/CRONKEYHERE/chain/bnb
58 |
59 | About main account: This is account where all funds would be move to , and from here only all withdrawals will take place.
60 |
61 | B. Moving User Token [bep20] to Main account
62 |
63 | /* Note :
64 | Only run manually in browser Address Bar, Moving any token will cost gas [BNB] If user account does not have enough BNB , Then it will extract enough BNB from Main account and send it to user account , When above url run again in browser , user account will have enough gas to move token and Tokens will move to Main account , Since gas price is moderarte on BNB We suggest moving Tokens with higher value .
65 | */
66 |
67 | https://YOURSITEHERE/Coin/esmart_token_to_main/securecode/CRONKEYHERE/coinname/busd
68 |
69 |
70 |
71 |
72 | C. Moving BNB to Main account
73 |
74 | /* Note :
75 | Only run manually in browser Address Bar, Moving any BNB will cost gas [BNB] so main account would receive Balance - Gas .
76 | */
77 |
78 | https://YOURSITEHERE/Coin/esmart_to_main/securecode/CRONKEYHERE/coin/bnb
79 |
80 |
81 |
82 | Importing Main account into Metamask->
83 | Download your Main account Keystore file from /home/geth/mainnet/keystore/ UTC ... address of mainaccount
84 |
85 | Then follow this tutorial to import wallet to metamask [Step2 ]
86 | https://medium.com/publicaio/how-import-a-wallet-to-your-metamask-account-dcaba25e558d#3ec7
87 |
--------------------------------------------------------------------------------
/docs/binance-cross-trading-setup.md:
--------------------------------------------------------------------------------
1 | # Liquidity Bot in the Codono Script
2 |
3 | In the Codono script, the "Liquidity Bot" refers to a software component designed to provide liquidity in cryptocurrency trading. Liquidity refers to the ease with which an asset can be bought or sold without significantly affecting its price. The Liquidity Bot's primary goal is to ensure there is enough supply and demand for a particular cryptocurrency trading pair, minimizing slippage and enhancing trading efficiency.
4 |
5 | ## How the Liquidity Bot Works
6 |
7 | - **Order Book Monitoring:** The Liquidity Bot constantly monitors the order books of various market pairs.
8 |
9 | - **Orderbook Creation:** Periodically, the Liquidity Bot identifies trading pairs and automatically places both buy and sell orders at prices close to the current market price. These orders are usually smaller than typical market orders and have a markup commission set in the admin area.
10 |
11 | - **Market Maker Strategy:** The bot follows a market maker strategy. It aims to profit from the spread between buy and sell orders. By placing buy orders slightly below the market price and sell orders slightly above the market price, the bot provides liquidity to traders who wish to execute trades quickly.
12 |
13 | - **Order Adjustment:** As the market price fluctuates, the Liquidity Bot adjusts its orders to maintain a competitive spread and adapt to changing market conditions.
14 |
15 | - **Risk Management:** The bot includes risk management mechanisms to prevent large losses. For instance, it may set maximum order sizes.
16 |
17 | - **Cross Trading:** The bot may also cross trade and match on Binance Exchange for the same orders that got executed on your exchange.
18 |
19 | By providing liquidity, the Liquidity Bot helps create a more efficient trading environment, attracting more traders and investors to the platform. This, in turn, can enhance the overall trading experience and potentially increase trading volumes on the Codono platform.
20 |
21 |
22 | # Bot Setup on Codono System
23 |
24 | ## Step 1: Configure 2 Spot API Keys in `other_config.php`
25 |
26 | Open the `other_config.php` file in a text editor.
27 |
28 | Configure two Spot API keys in the file as follows:
29 |
30 | ```php
31 | // Replace 'your_api_key1' and 'your_api_secret1' with your first API key credentials
32 | define('API_KEY_1', 'your_api_key1');
33 | define('API_SECRET_1', 'your_api_secret1');
34 |
35 | // Replace 'your_api_key2' and 'your_api_secret2' with your second API key credentials
36 | define('API_KEY_2', 'your_api_key2');
37 | define('API_SECRET_2', 'your_api_secret2');
38 | ```
39 |
40 | Ensure that you obtain these API keys from your Binance account or exchange and keep them secure. These keys will be used for trading and accessing your Binance account.
41 |
42 | ## Step 2: Update Market Settings in Admin Panel
43 |
44 | 1. Log in to your Codono admin panel.
45 | 2. Navigate to `Admin -> Trade -> Market -> Edit`.
46 | 3. Configure the following settings:
47 |
48 | - **Liquidity**: Switch it to "Binance Engine".
49 | - **External Orderbook Markup**: Set it to a value between 0.1% to 10% (or any profitable percentage) based on your preferences.
50 | - **Cross Ordering From Binance**: Enable this option.
51 |
52 | 4. After making the changes, remember to clear the cache from the admin panel. You can usually find the option to clear the cache in the top right menu of the admin panel.
53 |
54 | ## Step 3: Set Up the Cron Job
55 |
56 | Make sure to run the following cron job every minute:
57 |
58 | ```
59 | http://codono.local/Xtrade/cronMe/securecode/cronkey/
60 | ```
61 |
62 | Replace `codono.local` with your actual website URL or server IP address, and `cronkey` with the cron key you have set up in your system.
63 |
64 | For example, if your Codono site is running on `http://exchange.mydomain.com/` and your cron key is `mycronkey123`, the cron job URL would be:
65 |
66 | ```
67 | http://exchange.mydomain.com/Xtrade/cronMe/securecode/mycronkey123/
68 | ```
69 |
70 | This cron job is essential for maintaining the proper functioning of the exchange and should be executed at regular intervals (ideally every minute) to keep the market data up-to-date and execute trades efficiently. Ensure that the cron job runs successfully without any errors.
71 |
--------------------------------------------------------------------------------
/docs/blockgum-coin-setup.md:
--------------------------------------------------------------------------------
1 | # Blockgum Multichain EVM Wallet Configuration
2 |
3 | ## Wallet Configuration for BNB Coin
4 |
5 | ### General Details
6 | - **Symbol**: bnb
7 | - **Title**: Binance Coin
8 | - **CoinType**: Blockgum EVM Wallet
9 | - **Token of**: None
10 | - **Contract Address**: [Leave Blank]
11 | - **Main Account**: MAINACCOUNTADDRESS
12 | - **Block Explorer**: [https://bscscan.com/tx/](https://bscscan.com/tx/)
13 | - **Decimals**: 8
14 | - **Automatic Withdrawal**: 0.0001 (Amount auto-approved for withdrawal without admin consent)
15 |
16 | ---
17 |
18 | ### Adding BEP20 Tokens
19 |
20 | 1. Go to the contract address on [bscscan.com](https://bscscan.com/token/0xe9e7cea3dedca5984780bafc599bd69add087d56) to get token details (e.g., **BUSD**).
21 |
22 | #### Token Details Example (for BUSD)
23 | - **Symbol**: busd
24 | - **Title**: Binance-Peg BUSD Token
25 | - **CoinType**: Blockgum EVM Wallet
26 | - **Token of**: BNB
27 | - **Contract address**: 0xe9e7cea3dedca5984780bafc599bd69add087d56 (Get from bscscan.com)
28 | - **Main Account**: MAINACCOUNTADDRESS
29 | - **Block Explorer**: [https://bscscan.com/tx/](https://bscscan.com/tx/)
30 | - **Decimals**: 18 (Get from bscscan.com)
31 | - **Automatic Withdrawal**: 0.0001 (Amount auto-approved for withdrawal without admin consent)
32 |
33 | ---
34 |
35 | ## Cron Jobs
36 |
37 | ### Required Cron Jobs
38 | 1. **Blockgum Deposit Detection**
39 | - **Command**:
40 | ```bash
41 | * * * * * cd /data/wwwroot/codebase/yourdomain.com && php index.php Coin/blockgum_deposit/securecode/cronkey/
42 | ```
43 | - **URL**:
44 | [http://exchange.local/Coin/blockgum_deposit/securecode/cronkey/](http://exchange.local/Coin/blockgum_deposit/securecode/cronkey/)
45 | - **Frequency**: Every minute
46 |
47 | 2. **Blockgum Withdrawal Hash Retrieval**
48 | - **Command**:
49 | ```bash
50 | */5 * * * * cd /data/wwwroot/codebase/yourdomain.com && php index.php Coin/getWithdrawalIdBlockgum/securecode/cronkey/
51 | ```
52 | - **URL**:
53 | [http://exchange.local/Coin/getWithdrawalIdBlockgum/securecode/cronkey/](http://exchange.local/Coin/getWithdrawalIdBlockgum/securecode/cronkey/)
54 | - **Frequency**: Every 5 minutes
55 |
56 | ---
57 |
58 | ### On-Demand Tools
59 |
60 | 1. **Move Tokens to Main**
61 | - URL:
62 | [http://exchange.local/Coin/blockgum_token_to_main/securecode/cronkey/coinname/tokenNameHere](http://exchange.local/Coin/blockgum_token_to_main/securecode/cronkey/coinname/tokenNameHere)
63 |
64 | 2. **Move Coins to Main**
65 | - URL:
66 | [http://exchange.local/Coin/blockgum_coin_to_main/securecode/cronkey/coinname/coinNameHere](http://exchange.local/Coin/blockgum_coin_to_main/securecode/cronkey/coinname/coinNameHere)
67 |
68 | 3. **Token Watch (For New EVM Tokens)**
69 | - URL:
70 | [http://exchange.local/Coin/blockgum_watch/securecode/cronkey/](http://exchange.local/Coin/blockgum_watch/securecode/cronkey/)
71 |
72 | ---
73 |
74 | This document details the full setup and operational guidelines for Blockgum Multichain EVM Wallet integration in **Codono**. Ensure all configurations and cron jobs are set up correctly for optimal operation.
75 |
--------------------------------------------------------------------------------
/docs/blockgum-integration.md:
--------------------------------------------------------------------------------
1 | # Blockgum Multichain EVM Wallet
2 |
3 | ## Integration with Blockgum Wallet Server App
4 |
5 | ### Setup
6 |
7 | 1. Follow the instructions on [Blockgum GitHub Repository](https://github.com/blockgum/blockgum).
8 | 2. Download [Ian Coleman's BIP39 Tool](https://github.com/iancoleman/bip39) (disconnect from the internet, optional).
9 | 3. Once setup is completed, grab the `xprv` and `xpub` from your seed using the following path:
10 | ```
11 | m/44'/60'/0'/0
12 | ```
13 | - Ensure the selected coin is **ETH**.
14 | - Under **Derivation Path**, select **BIP32**.
15 | - Set the **Client** to: Custom derivation path.
16 | - Enter the path:
17 | ```
18 | m/44'/60'/0'/0
19 | ```
20 | 4. Paste or generate mnemonics.
21 | 5. Verify that the 0th address matches the one shown in MetaMask (to confirm everything is set up correctly).
22 | 6. Copy the **BIP32 Extended Private Key** and **BIP32 Extended Public Key**.
23 | 7. Paste the above information during the Blockgum setup process.
24 |
25 | ### Linking to Blockgum Dashboard
26 |
27 | 1. Copy the server information from the Blockgum setup and save it to [Blockgum Dashboard](https://dash.blockgum.com/).
28 | 2. Make an order on the Blockgum Dashboard.
29 | 3. After placing the order:
30 | - Go to **Orders** and click **Activate**.
31 | - Select the server information from the dropdown.
32 | 4. Copy the license or scan it with the Blockgum App to update.
33 |
34 | ### Final Steps
35 |
36 | 1. Change the `CLIENTID` in the `.env` file.
37 | 2. Restart the Blockgum app using:
38 | ```bash
39 | systemctl restart blockgum
40 | ```
41 | 3. Paste the Blockgum information into the **Admin/Options** section in the exchange admin area.
42 | 4. Check the URL:
43 | ```
44 | yoursite.com/Test/blockgum
45 | ```
46 | Ensure debug mode is enabled to verify if Blockgum is working correctly.
47 |
--------------------------------------------------------------------------------
/docs/blockgum-withdrawal-processing.md:
--------------------------------------------------------------------------------
1 | # Blockgum Withdrawal Processing Guide for Codono
2 |
3 | This guide outlines the steps required to process withdrawals using Blockgum in the Codono cryptocurrency exchange platform. Follow these steps to ensure a smooth withdrawal process for BNB, ETH, and similar coins.
4 |
5 | ## Step 1: Configuration Check
6 |
7 | - **Cross Check**: First, ensure that Blockgum is configured correctly in the **Admin/options** area of Codono.
8 | - **Coin Configuration**: Navigate to **Admin/Config/coin** and check that coins like BNB and ETH have their main address configured correctly.
9 | - **Connect mobile app**: Check if mobile app can connect with blockgum node or not. If not then Blockgum node may be down or need license update due to expiry.
10 |
11 | ## Step 2: Verify Main Address Balance
12 |
13 | 1. **Note Main Address**: Write down or copy the main address for the coin you are interested in.
14 | 2. **Explorer Check**: Use the respective blockchain explorer (e.g., [Etherscan](https://etherscan.io) for ETH, [BscScan](https://bscscan.com) for BNB) to verify that the main address has sufficient balance for the withdrawal.
15 | 3. **Gas Funds**: Ensure that the main address also has enough balance to cover the gas fees for the transaction.
16 |
17 | ## Step 3: Balance Top-Up (If Required)
18 |
19 | - If the main address does not have enough balance, navigate to the URL structured as follows to transfer tokens to the main address:
20 |
21 | **Move Tokens like usdt to main address***
22 | ```
23 | http://exchange.local/Coin/blockgum_token_to_main/securecode/cronkey/coinname/tokenNameHere
24 |
25 | ```
26 |
27 | - **URL Replacement**: Replace `exchange.local` with your exchange's URL and `tokenNameHere` with the specific token's name you're processing.
28 | - **Process Execution**: Follow the on-screen instructions to complete the token transfer.
29 |
30 | **Move Main coins like eth/bnb to main address***
31 | ```
32 | http://exchange.local/Coin/blockgum_coin_to_main/securecode/cronkey/coinname/coinNameHere
33 |
34 | ```
35 |
36 | - **URL Replacement**: Replace `exchange.local` with your exchange's URL and `coinNameHere` with the specific coin's name you're processing , like eth , bnb .
37 | - **Process Execution**: Follow the on-screen instructions to complete the token transfer.
38 |
39 |
40 | ## Step 4: Reconfirmation
41 |
42 | - **Block Explorer Check**: After completing the top-up process (either through the provided URL or by sending funds externally), recheck the main address on the appropriate block explorer to confirm the updated balance.
43 |
44 | ## Step 5: Processing Withdrawals
45 |
46 | 1. **Crypto Withdrawal Page**: Navigate to the Crypto withdrawal page in the Codono admin panel.
47 | 2. **Initiate Payment**: Click on the `pay now` button next to the withdrawal request you wish to process.
48 | 3. **Transaction ID**: Wait for up to 2 minutes for the transaction ID to appear in the admin panel. This ID is essential for tracking and confirmation purposes.
49 |
50 | ## Notes
51 | - Never Click Pay now twice , always check etherscan /bscscan if funds were sent, or not . Wait for cooling off period of 2 mins before 2nd attempt.
52 | - Always ensure that the main address for each coin is correctly set up and funded to prevent delays in the withdrawal process.
53 | - Regularly monitor gas prices to allocate sufficient funds for transaction fees, especially during times of network congestion.
54 |
55 |
--------------------------------------------------------------------------------
/docs/bnb_client_info.md:
--------------------------------------------------------------------------------
1 | ## Wallet Configuration for BNB Coin
2 |
3 | ### Symbol: bnb
4 | - Title: Binance Coin
5 | - CoinType: Esmart
6 | - Token of: none
7 | - RPC Type: Light
8 | - Public RPC URL: [https://bsc-dataseed.binance.org/](https://bsc-dataseed.binance.org/)
9 | - Wallet Server IP: WALLETSERVERIP
10 | - Wallet Server Port: WALLETSERVERPORT
11 | - Server Username: [Leave Blank only]
12 | - Wallet Server Password: [of MAIN ACCOUNT]: MAINACCOUNTPWD
13 | - Main Account: MAINACCOUNTADDRESS
14 | - Block Explorer: [https://bscscan.com/tx/](https://bscscan.com/tx/)
15 | - Decimals: 8
16 | - Automatic Withdrawal: 0.0001 (Amount that is auto approved for withdrawal without admin consent)
17 |
18 | ### Adding BEP20
19 |
20 | Goto Contract address on [bscscan.com](https://bscscan.com/token/0xe9e7cea3dedca5984780bafc599bd69add087d56) to get details first [Example for BUSD]
21 |
22 | ### Symbol: busd
23 | - Title: Binance-Peg BUSD Token
24 | - CoinType: Esmart
25 | - Token of: BNB
26 | - RPC Type: Light
27 | - Public RPC URL: [https://bsc-dataseed.binance.org/](https://bsc-dataseed.binance.org/)
28 | - Wallet Server IP: WALLETSERVERIP
29 | - Wallet Server Port: WALLETSERVERPORT
30 | - Server Username: 0xe9e7cea3dedca5984780bafc599bd69add087d56 (get from bscscan.com)
31 | - Wallet Server Password: [of MAIN ACCOUNT]: MAINACCOUNTPWD
32 | - Main Account: MAINACCOUNTADDRESS
33 | - Block Explorer: [https://bscscan.com/tx/](https://bscscan.com/tx/)
34 | - Decimals: 18 (get from bscscan.com)
35 | - Automatic Withdrawal: 0.0001 (Amount that is auto approved for withdrawal without admin consent)
36 |
37 | ## Usage Steps
38 |
39 | A. Deposit Detection [We have set cron to check every minute]
40 | - URL: [https://YOURSITEHERE/Coin/esmart_deposit/securecode/CRONKEYHERE/chain/bnb](https://YOURSITEHERE/Coin/esmart_deposit/securecode/CRONKEYHERE/chain/bnb)
41 |
42 | About main account: This is the account where all funds would be moved to, and from here only all withdrawals will take place.
43 |
44 | B. Moving User Token [BEP20] to Main Account
45 |
46 | Note: Only run manually in the browser's Address Bar. Moving any token will cost gas [BNB]. If the user account does not have enough BNB, then it will extract enough BNB from the Main account and send it to the user account. When the above URL is run again in the browser, the user account will have enough gas to move tokens, and tokens will move to the Main account.
47 |
48 | - URL: [https://YOURSITEHERE/Coin/esmart_token_to_main/securecode/CRONKEYHERE/coinname/busd](https://YOURSITEHERE/Coin/esmart_token_to_main/securecode/CRONKEYHERE/coinname/busd)
49 |
50 | C. Moving BNB to Main Account
51 |
52 | Note: Only run manually in the browser's Address Bar. Moving any BNB will cost gas [BNB], so the main account would receive Balance - Gas.
53 |
54 | - URL: [https://YOURSITEHERE/Coin/esmart_to_main/securecode/CRONKEYHERE/coin/bnb](https://YOURSITEHERE/Coin/esmart_to_main/securecode/CRONKEYHERE/coin/bnb)
55 |
56 | ### Importing Main Account into Metamask
57 | - Download your Main account Keystore file from `/home/geth/mainnet/keystore/ UTC` ... address of the main account.
58 | - Follow this tutorial to import the wallet to Metamask [Step 2](https://medium.com/publicaio/how-import-a-wallet-to-your-metamask-account-dcaba25e558d#3ec7)
59 |
--------------------------------------------------------------------------------
/docs/cryptoapis.io.setup.md:
--------------------------------------------------------------------------------
1 | ## CryptoApis Integration Setup
2 |
3 | ### Step 1: Create API Key
4 |
5 | 1. Login to [https://my.cryptoapis.io/](https://my.cryptoapis.io/)
6 | 2. Create a new API Key.
7 | 3. Enable the API Key and give all route permissions.
8 | 4. Save the `api_key` in Notepad.
9 |
10 | ### Step 2: Create New Wallet
11 |
12 | 1. Go to the Dashboard of CryptoApis.
13 | 2. Go to My Wallet -> New Mainnet Wallet.
14 | 3. Save the `WalletId` in Notepad.
15 |
16 | ### Step 3: Create Ethereum Account (Only for Ethereum)
17 |
18 | 1. Go to the Dashboard of CryptoApis.
19 | 2. Go to My Wallet -> Addresses -> New Deposit Address.
20 | 3. Label: `mainAccount`, Blockchain Protocol: Ethereum, Network: Mainnet.
21 | 4. Save the generated Address to notepad.
22 |
23 | ### Adding Ethereum
24 |
25 | Symbol: eth
26 | - Title: Ethereum
27 | - CoinType: CryptoApis
28 | - Token of: none
29 | - Network: mainnet
30 | - Walletid: WalletID saved in Step 2
31 | - Contract Address: Leave Blank
32 | - API Key: Api_key saved in Step 1
33 | - Main Account: mainAccount saved in Step 3
34 | - Block Explorer: [https://etherscan.io/tx/](https://etherscan.io/tx/)
35 | - Decimals: 8
36 |
37 | ### Adding Bitcoin
38 |
39 | Symbol: btc
40 | - Title: Bitcoin
41 | - CoinType: CryptoApis
42 | - Network Type: mainnet
43 | - Walletid: WalletID saved in Step 2
44 | - Contract Address: Leave Blank
45 | - API Key: Api_key saved in Step 1
46 | - Main Account: Leave Blank
47 | - Block Explorer: [https://www.blockchain.com/btc/tx/](https://www.blockchain.com/btc/tx/)
48 | - Decimals: 8
49 |
50 | ### IPN Generated URL
51 |
52 | Your website must run on HTTPS (SSL) to support callback.
53 | - IPN URL: [https://yoursite.com/IPN/callback_cryptoapis](https://yoursite.com/IPN/callback_cryptoapis)
54 |
55 | ### Cron URL
56 |
57 | Run every 10 minutes max to manage API requests.
58 | - Cron URL: [https://yoursite.com/Coin/deposit_cryptoapis/securecode/cronkey](https://yoursite.com/Coin/deposit_cryptoapis/securecode/cronkey)
59 |
60 | ### Step 6: Create Coin and Token
61 |
62 | In Step 5, you selected the default coin and its network. Now, you can create a coin and token on the same network to sell it against the token.
63 |
64 | Go to Admin -> Trade -> Dex -> Dex Coins, and then Add or Edit the coin details:
65 |
66 | - Status: Enabled [Coin status]
67 | - Is Default In Spend: NA [Select only one coin as default status either ETH or BNB]
68 | - Is Token?: Token [Only One main coin]
69 | - Name Of Coin: DAI [Name of coin]
70 | - Symbol Of Coin: dai [symbol in small letters, e.g., usdt]
71 | - Image: Click Add Picture 80px*80px
72 | - Contract Address: 0xad6d458402f60fd3bd25163575031acdce07538d [Contract Address of token, Empty in case of the main coin]
73 | - Decimals: 18 [Only One main coin]
74 | - Price: 0.01010000 [Price of your token]
75 | - Min Buy Quantity: 0.01000000 [Minimum Buy Quantity]
76 | - Max Buy Quantity: 10000.00000000
77 |
78 | ### Note
79 | Replace placeholders like WALLETSERVERIP, WALLETSERVERPORT, MAINACCOUNTPWD, MAINACCOUNTADDRESS, YOURSITEHERE, and CRONKEYHERE with the actual values as needed.
80 |
--------------------------------------------------------------------------------
/docs/exchange-app.md:
--------------------------------------------------------------------------------
1 | ---
2 |
3 | # Codono Mobile App Documentation
4 |
5 | Welcome to the Codono Mobile App documentation. This guide is designed to help developers set up, compile, and make necessary changes to the app, which is built using Ionic 6.
6 |
7 | ## Table of Contents
8 |
9 | - [Prerequisites](#prerequisites)
10 | - [Setting Up the Development Environment](#setting-up-the-development-environment)
11 | - [Preparing App Icon and Splash Screen](#preparing-app-icon-and-splash-screen)
12 | - [Compilation Instructions](#compilation-instructions)
13 | - [Android](#android)
14 | - [iOS](#ios)
15 | - [Making Changes](#making-changes)
16 | - [Troubleshooting](#troubleshooting)
17 | - [Additional Resources](#additional-resources)
18 |
19 | ## Prerequisites
20 |
21 | Before you begin, ensure you have the following installed:
22 |
23 | - Node.js
24 | - npm
25 | - Ionic CLI
26 | - Cordova
27 | - Android Studio (for Android development)
28 | - Xcode (for iOS development)
29 |
30 | ## Setting Up the Development Environment
31 |
32 | 1. Clone the project repository to your local machine.
33 | 2. Navigate to the project directory and run `npm install` to install the required dependencies.
34 |
35 | ## Preparing App Icon and Splash Screen
36 |
37 | Before proceeding with the compilation of the app, you need to prepare the app icon and splash screen images. Create an icon image with dimensions 1024x1024 pixels and name it `icon.png`. Also, create a splash screen image with dimensions 2732x2732 pixels and name it `splash.png`. Place both images in the `/resources/` directory of your project.
38 |
39 | This step is crucial for ensuring that your app has a professional appearance and adheres to the platform's guidelines.
40 |
41 | ## Compilation Instructions
42 |
43 | ### Android
44 |
45 | To compile the app for Android, execute the following commands in sequence:
46 |
47 | ```shell
48 | ionic capacitor add android
49 | ionic capacitor copy
50 | cordova-res android --skip-config --copy
51 | ionic capacitor build android
52 | ```
53 |
54 | ### iOS
55 |
56 | To compile the app for iOS, follow these steps:
57 |
58 | ```shell
59 | ionic capacitor add ios
60 | ionic capacitor copy
61 | cordova-res ios --skip-config --copy
62 | ionic capacitor build ios
63 | ```
64 |
65 | After the build process, add the following entry to your `Info.plist` to handle camera permissions for QR code scanning:
66 |
67 | ```xml
68 | NSCameraUsageDescription
69 | $(PRODUCT_NAME) uses Camera permission for QR code scanning
70 | ```
71 |
72 | ## Making Changes
73 |
74 | To modify the base currencies used in the app, change the following lines:
75 |
76 | - In `src\app\pages\home\home.page.ts`, around line 141:
77 | ```typescript
78 | this.decoded.base = ['USDT', 'BNB', 'BUSD', 'TRY'];
79 | ```
80 |
81 | - In `src\app\pages\market\market.page.ts`, around line 71:
82 | ```typescript
83 | this.decoded.base = ['USDT', 'BNB', 'BUSD', 'TRY'];
84 | ```
85 |
86 | To update the API URL, make the following changes:
87 |
88 | - In `src\app\app.component.ts`, replace:
89 | ```typescript
90 | Exchangeurl = 'https://yourexchange.com/';
91 | ```
92 | - In `src\app\auth.service.ts`, modify:
93 | ```typescript
94 | let apiUrl = 'https://yourexchange.com/Api/';
95 | ```
96 |
97 | ## Troubleshooting
98 |
99 | ### Issue 1: Version Code Conflict
100 |
101 | If you encounter a version code conflict in Android, navigate to `app\build.gradle` in Android Studio and increment the `versionCode`:
102 |
103 | ```gradle
104 | versionCode 3 // Increment this by 1 from the current value
105 | ```
106 |
107 | ### Issue 2: Target API Level
108 |
109 | To address the requirement of targeting at least API level 31, modify `variables.gradle`:
110 |
111 | ```gradle
112 | targetSdkVersion = 31
113 | ```
114 |
115 | Then, ensure your `AndroidManifest.xml` includes `android:exported="true"` for the main activity:
116 |
117 | ```xml
118 |
119 | ```
120 |
121 | ## Additional Resources
122 |
123 | - [Ionic Documentation](https://ionicframework.com/docs)
124 | - [Android Developer Guide](https://developer.android.com/guide)
125 | - [iOS Developer Guide](https://developer.apple.com/documentation)
126 |
127 | ---
128 |
--------------------------------------------------------------------------------
/docs/exchange-setup.md:
--------------------------------------------------------------------------------
1 | ## Codono Installation Setup Tutorial
2 |
3 | To set up Codono on your server, follow these steps:
4 |
5 | ### Step 1: Download Codono
6 |
7 | 1. Download the Codono zip file from the provided download link.
8 | 2. Extract the contents to your preferred directory.
9 |
10 | ### Step 2: Edit `pure_config.php`
11 |
12 | 1. Open the `pure_config.php` file in a text editor.
13 | 2. Modify the necessary configurations, such as `SITE_URL`, `DB_HOST`, `DB_NAME`, and others.
14 |
15 | ### Step 3: Configure Database Settings
16 |
17 | 1. Set the database connection parameters according to your database setup in the `pure_config.php` file.
18 |
19 | Example:
20 | ```php
21 | const DB_TYPE = 'mysql';
22 | const DB_HOST = '127.0.0.1';
23 | const DB_NAME = 'codonoexchange';
24 | const DB_USER = 'root';
25 | const DB_PWD = '';
26 | const DB_PORT = '3306';
27 | ```
28 |
29 | ### Step 4: Configure Other Settings
30 |
31 | In this step, review and adjust other settings in the `pure_config.php` file based on your specific requirements. Here are some of the key settings you might want to consider:
32 |
33 | - `APP_DEMO`: Set this to `0` to run Codono in production mode. If set to `1`, Codono will run in DEMO mode.
34 | - `MOBILE_CODE`: Set this to `0` to enable SMS authentication. Setting it to `1` will bypass SMS authentication (risky).
35 | - `MOBILE_LAUNCHED`: Set this to `1` if you want to integrate and enable MOBILE APP LOGIN.
36 | - `ENABLE_MOBILE_VERIFY`: Set this to `1` to enable mobile verification.
37 | - `M_ONLY`: Set this to `0` to allow users without SMS verification to use the system. Setting it to `1` will restrict the system to only users with SMS verification.
38 | - `M_DEBUG`: Set this to `0` for production mode. If set to `1`, it enables site-wide debugging (not recommended for production).
39 | - `ADMIN_DEBUG`: Set this to `0` for production mode. If set to `1`, it enables full debugging for the admin.
40 | - `DEBUG_WINDOW`: Set this to `0` for production mode. If set to `1`, it shows a debug window on every page.
41 | - `KYC_OPTIONAL`: Set this to `0` to turn on KYC on user signup and make it optional. If set to `1`, KYC will be optional during signup.
42 | - `ENFORCE_KYC`: Set this to `0` to allow users without KYC to withdraw and trade. If set to `1`, only users with KYC will be able to withdraw and trade.
43 | - `ADMIN_KEY`: Set this to alphanumeric minimum 16-32 char for keeping your admin URL secure
44 | - `CRON_KEY`: Set this to alphanumeric minimum 16-20 char for keeping your Cron URL secure
45 |
46 | Make sure to save the `pure_config.php` file after making the necessary changes.
47 |
48 |
49 | Example Admin URL after `ADMIN_KEY` is set
50 | ```
51 | http://exchange.local/Admin/Login/index/securecode/securekey
52 | ```
53 | Complete Cronlist here
54 | ```
55 | http://exchange.local/Admin/Login/index/securecode/securekey
56 | ```
57 |
58 | **Note:** Review all other settings in the file carefully and update them based on your specific requirements.
59 |
60 | ### Step 5: Set Up Redis Caching (Optional but Recommended)
61 |
62 | Codono supports Redis caching for improved performance. To enable Redis caching, follow these steps:
63 |
64 | 1. Ensure that you have Redis installed on your server. If not, install Redis by referring to the official Redis documentation for your operating system.
65 |
66 | 2. In the `pure_config.php` file, set the `REDIS_ENABLED` constant to `1` to enable Redis caching.
67 |
68 | 3. Set the `REDIS_PASSWORD` constant to your Redis password. If you haven't set a password for your Redis instance, leave the value as an empty string (`''`).
69 |
70 | ```php
71 | // Enable Redis caching (1 for enabled, 0 for disabled)
72 | const REDIS_ENABLED = 1;
73 |
74 | // Set this as your Redis password
75 | const REDIS_PASSWORD = 'your_redis_password_here';
76 | ```
77 |
78 | 4. Save the changes to `pure_config.php`.
79 |
80 | ### Step 6: Configure PHP Extensions
81 |
82 | Codono requires specific PHP extensions to be installed and enabled. Ensure you have the following PHP extensions enabled in your `php.ini` configuration file:
83 |
84 | ```ini
85 | extension=exec
86 | extension=openssl
87 | extension=redis
88 | extension=pdo_mysql
89 | extension=mbstring
90 | extension=curl
91 | extension=tokenizer
92 | extension=xml
93 | extension=fileinfo
94 | extension=ctype
95 | extension=json
96 | extension=bcmath
97 | extension=zip
98 | extension=gd
99 | extension=allow_url_fopen
100 | extension=iconv
101 | extension=libsodium
102 | extension=stream_socket_server
103 | ```
104 |
105 | Please note that the exact method of enabling PHP extensions may vary depending on your server environment. After making changes to the `php.ini` file, remember to restart your web server for the changes to take effect.
106 |
107 | ### Step 7: Prepare the Codono Files
108 |
109 | 1. Extract the contents of the downloaded ZIP file to your web server's document root or the desired directory.
110 |
111 | 2. Ensure that the web server has proper read and write permissions for the Codono files and directories.
112 |
113 | ### Step 8: Set Up the Database
114 |
115 | 1. Create a new database for Codono in your MariaDB environment. You can do this using a graphical tool like phpMyAdmin or the MySQL command line.
116 |
117 | 2. Open the `pure_config.php` file and fill in the database connection details:
118 |
119 | ```php
120 | // Database Type
121 | const DB_TYPE = 'mysql';
122 | // DB Host
123 | const DB_HOST = 'your_database_host'; // Usually 'localhost'
124 | // DB Name
125 | const DB_NAME = 'your_database_name';
126 | // DB User
127 | const DB_USER = 'your_database_username';
128 | // DB PASSWORD
129 | const DB_PWD = 'your_database_password';
130 | // DB PORT (If not sure, leave it as default)
131 | const DB_PORT = '3306';
132 | ```
133 |
134 | 3. Save the changes to `pure_config.php`.
135 |
136 | 4. Import codonoexchange_x.sql to your_database_name.
137 | ### Step 9: Connect Required Nodes
138 |
139 | You would need to setup coin nodes or thirdparty services to setup wallet system on exchange . Please refer to Docuemntation for Coin nodes setup.
140 |
141 | ### Step 10: Perform the Installation
142 |
143 | 1. Open your web browser and navigate to the URL where you placed the Codono files.
144 |
145 | 2. Goto exchange.local/install_check.php to see if all requirements are met.
146 |
147 | 3. Once the installation is complete, remove the `install_check.php` file.
148 | 4. Setup all crons by visiting this link http://exchange.local/Cronlist/index/securecode/cronkey
149 | 5. You can now visit exchange.local
150 |
151 | ### Step 11: Test Your Exchange
152 |
153 | Congratulations! Your Codono exchange is now set up and ready to go. Test various functionalities, including user registration, trading, deposits, withdrawals, and admin features, to ensure everything works as expected.
154 |
155 | Please remember to keep your server and Codono installation secure by regularly updating software, using strong passwords, and following other security best practices.
156 | ### Additional Tutorials:
157 |
158 | - [Binance Liquidity Setup Tutorial](binance-cross-trading-setup.md)
159 | - [Socket Setup for Huobi](WebSocketConfigLiquidity.md)
160 | - [Emptying Tables for Fresh System](tables_to_empty_for_fresh_system.txt)
161 | - [ShuftiPro Setup Tutorial](shuftipro-setup-requirements.md)
162 | - [Binance Client Info Setup](bnb_client_info.md)
163 | - [Crypto APIs Setup Tutorial](cryptoapis.io.setup.md)
164 | - [Tron Setup Tutorial](tron_setup.md)
165 | - [DEX Setup Tutorial](php-dex-decentalized-exchange.md)
166 | - [XRP Setup Tutorial](xrp-setup-crypto-exchange.md)
167 | - [Google Login Setup Tutorial](google-login-setup.md)
168 |
--------------------------------------------------------------------------------
/docs/geth-codono-working.md:
--------------------------------------------------------------------------------
1 | # Codono + Geth Integration Guide
2 |
3 | ## Manual Token and Ethereum Transfer
4 |
5 | ### User Accounts
6 |
7 | Users are provided with distinct addresses so that once balance is transferred to these addresses, it is identified by an automatic cron job named `esmart_deposit`. Each user's wallet balance must be transferred to the main account to be utilized by the exchange. The main account is an Ethereum address created during the Geth setup; its public address and password (used to encrypt the private key) are stored in the backend coin configuration.
8 |
9 | **Important:** Each user's private key is encrypted with a password specified in `pure_config.php` under the name `ETH_USER_PASS`. Changing this password inappropriately can result in losing access to all user private keys. It is advisable only to change this password during the initial setup of Ethereum and ERC20 tokens with the exchange. To change the password safely, first, transfer all user funds to the main account, then proceed with the password update.
10 |
11 | ### Token Moving Cron (User to Main)
12 |
13 | To transfer token funds to the main account, run the following URL in your browser carefully:
14 |
15 | ```
16 | http://YourSiteURL/Coin/esmart_token_to_main/coinname/TOKENNAMEHERE/securecode/cronkey
17 | ```
18 |
19 | - Replace `YourSiteURL` with your website's URL.
20 | - `cronkey` should be defined in `pure_config.php`.
21 | - Replace `TOKENNAMEHERE` with the actual token name, e.g., USDT.
22 |
23 | #### Example URL
24 |
25 | ```
26 | https://myexchange.com/Coin/esmart_token_to_main/coinname/usdt/securecode/g587g5478
27 | ```
28 |
29 | ### Ethereum Moving Cron (User to Main)
30 |
31 | To move Ethereum funds to the main account, use the following URL format:
32 |
33 | ```
34 | http://YourSiteURL/Coin/esmart_to_main/coin/{coin}/securecode/cronkey
35 | ```
36 |
37 | Replace `YourSiteURL` and `cronkey` as before.
38 |
39 | #### Example URLs
40 |
41 | ```
42 | https://myexchange.com/Coin/esmart_to_main/coin/bnb/securecode/g587g5478
43 | https://myexchange.com/Coin/esmart_to_main/coin/eth/securecode/g587g5478
44 | ```
45 |
46 | **Note:** Always transfer tokens before Ethereum because tokens require Ethereum as gas. If insufficient gas is available, the main account will provide gas to the user accounts, which could be costly.
47 |
48 | ### Codono Missing Transactions for Eth/ERC20
49 |
50 | To trace missing deposits for Ethereum/ERC20:
51 |
52 | 1. **Find the transaction ID (txid)** from sources like Etherscan.
53 | 2. **Identify the current block** being read by the exchange by running the `walleteth` cron manually.
54 | 3. Go to `Frontend -> Finance -> Trace Missing`, enter the txid, select the correct chain, and execute the tracing to deposit any missing funds.
55 |
56 | **Final Note:** While the above cron jobs facilitate fund transfers, for long-term efficiency, consider using `blockgum`, as they are faster and less expensive.
57 |
--------------------------------------------------------------------------------
/docs/google-login-setup.md:
--------------------------------------------------------------------------------
1 | # Integrating Google Sign-In into Your Crypto Exchange
2 |
3 | Integrating Google Sign-In can streamline the login process by allowing users to authenticate using their Google account. This guide will help you create a Google Client ID and Client Secret for your crypto exchange platform.
4 |
5 | **Pre-requisites:**
6 | - A Google account is required to access the Google Developers Console.
7 |
8 | ## Steps to Obtain Google Client ID and Client Secret
9 |
10 | 1. **Access Google Developers Console**
11 | - Navigate to the [Google Developers Console](https://console.cloud.google.com/).
12 |
13 | 2. **Create a New Project**
14 | - Click on "Select a project" at the top of the screen, then choose "New Project." Complete the form and click "Create."
15 |
16 | 3. **Configure OAuth Consent Screen**
17 | - Select Api & Services > "OAuth consent screen" from the sidebar. Choose your User Type (usually 'External' for crypto exchanges) and click "Create."
18 |
19 | 4. **Enter Application Information**
20 | - Provide the following details:
21 | - Application name
22 | - Support email
23 | - Authorized domain (e.g., `yoursite.com`)
24 | - Developer contact information
25 | - Click "Save and Continue."
26 |
27 | 5. **Complete OAuth Consent Steps**
28 | - Complete the required steps indicated on the OAuth consent screen, then click "Back to Dashboard."
29 |
30 | 6. **Create Credentials**
31 | - Navigate to the "Credentials" tab, click "Create Credentials," and select "OAuth client ID."
32 |
33 | 7. **Register Application Type**
34 | - Choose "Web application" as the "Application type." Provide a name for your OAuth 2.0 client.
35 |
36 | 8. **Set Authorized URIs**
37 | - Under "Authorized JavaScript origins," add your site URL.
38 | - For "Authorized redirect URIs," enter the URL where users will be redirected after authentication (e.g., `https://yoursite.com/Login/googleRedirect`).
39 | - Click "Create."
40 |
41 | > **Important:**
42 | > - Authorized JavaScript Origins: `https://yoursite.com`
43 | > - Authorized Redirect URL: `https://yoursite.com/Login/googleRedirect`
44 |
45 | 9. **Retrieve Client ID and Secret**
46 | - Copy the Client ID and Client Secret from the confirmation screen.[ Or even save JSON file for future reference]
47 |
48 | 10. **Update Your Configuration**
49 | - In your site's configuration file (e.g., `other_config.php`), set `GOOGLE_LOGIN_ALLOWED` to `1`.
50 | - Add your `GOOGLE_CLIENT_ID` and `GOOGLE_CLIENT_SECRET` to the respective fields.
51 |
52 | ## Next Steps
53 |
54 | With the Client ID and Client Secret, you can now integrate Google Sign-In into your site's authentication system. Ensure to follow security best practices when handling and storing these credentials.
55 |
--------------------------------------------------------------------------------
/docs/how-does-codono-work.md:
--------------------------------------------------------------------------------
1 | Codono script is a powerful and versatile cryptocurrency exchange platform solution that allows you to create your own cryptocurrency exchange and trading platform. Here's an overview of how Codono script works:
2 |
3 | 1. **Installation and Setup:**
4 | You acquire the Codono script package and initiate the installation process. The setup involves configuring the script to run on your server. This can be done with the help of provided documentation and support from Codono.
5 |
6 | 2. **Platform Customization:**
7 | After the installation, you can customize various aspects of your exchange platform. You can set up the platform name, logo, color scheme, and other branding elements to align with your business identity.
8 |
9 | 3. **Feature Selection:**
10 | Depending on your chosen package (Spot Classic, Spot Pro, Ultra, etc.), you can enable and configure specific features for your exchange. These features can include spot trading, P2P trading, OTC trading, easy trade, FX quote integration, voting, listing competitions, ICO/IEO launchpad, store module, airdrop functionality, staking/investment options, mining module, DEX (Decentralized Exchange) integration, and more.
11 |
12 | 4. **Coin and Token Integration:**
13 | Codono script supports a wide range of cryptocurrencies and tokens. You can integrate various cryptocurrencies like BTC, ETH, XRP, and others, as well as tokens such as ERC-20, BEP-20, TRC-20, and more. Users can trade, deposit, and withdraw these assets on your platform.
14 |
15 | 5. **User Registration and Security:**
16 | Users can create accounts on your exchange platform, providing necessary information for identity verification and security purposes. Codono provides security features like Google Recaptcha, Two-Factor Authentication (2FA), and input filtering to ensure the safety of user accounts.
17 |
18 | 6. **Trading and Exchange:**
19 | Once registered and verified, users can start trading on your platform. They can place market orders, limit orders, and stop-limit orders for buying and selling cryptocurrencies. The trading interface is user-friendly and intuitive.
20 |
21 | 7. **Wallet Integration:**
22 | Users have individual wallets for each supported cryptocurrency. They can deposit funds into their wallets, trade with those funds, and withdraw them as needed. Wallets are secured with private keys and other encryption methods.
23 |
24 | 8. **Administrative Control:**
25 | As the platform administrator, you have access to an admin panel where you can manage user accounts, monitor trading activities, configure settings, manage listings, and perform various administrative tasks.
26 |
27 | 9. **Payment Gateways:**
28 | Codono supports fiat gateways like bank deposits, Authorize.net, YocoPayments, and more. These gateways allow users to deposit and withdraw funds using traditional fiat currencies.
29 |
30 | 10. **Support and Updates:**
31 | Codono provides support and regular updates to ensure that your platform stays secure, up-to-date, and in line with the latest industry trends.
32 |
33 | In summary, Codono script offers a comprehensive solution for creating a cryptocurrency exchange platform with various customizable features, a wide range of supported cryptocurrencies and tokens, security measures, user-friendly interfaces, and administrative control. It allows you to enter the crypto exchange market quickly and efficiently while providing a seamless experience for your users.
34 |
--------------------------------------------------------------------------------
/docs/multi_server/README.md:
--------------------------------------------------------------------------------
1 | # Codono Multi-Server Setup Script README
2 |
3 | ## Overview
4 | This script automates the configuration of a secure, high-availability multi-server environment with MariaDB master-slave replication, Memcached for session storage, and necessary security configurations. It creates a production-ready environment while addressing security, performance, and reliability concerns.
5 |
6 | ## Features
7 | - Automated MariaDB master-slave replication setup
8 | - Secure credentials management with strong password generation
9 | - Memcached distributed session storage
10 | - Redis configuration for memory caching
11 | - PHP environment setup with required extensions
12 | - Web server configuration with basic authentication
13 | - Support for both single-server and multi-server deployments
14 | - Comprehensive logging of the installation process
15 |
16 | ## Prerequisites
17 | - Ubuntu/Debian-based operating system
18 | - Root or sudo access
19 | - Network connectivity between servers
20 | - DNS resolution configured properly
21 | - Open ports: 3306 (MariaDB), 11211 (Memcached), 6379 (Redis)
22 |
23 | ## Usage
24 |
25 | ### Initial Setup on Master Server
26 | 1. Download the script:
27 | ```bash
28 | wget https://raw.githubusercontent.com/CodonoTeam/cryptocurrency-exchange-script/main/docs/multi_server/multi-server-setup.sh
29 | chmod +x multi-server-setup.sh
30 | ```
31 | 2. Run the script:
32 | ```bash
33 | ./multi-server-setup.sh
34 | ```
35 | 3. Follow the prompts:
36 | - Enter your domain name
37 | - Choose "n" for multi-server setup
38 | - Enter the master server IP
39 | - Enter the slave server IP
40 |
41 | ### Setup on Slave Server
42 | 1. Copy the credentials.yml file from master to slave:
43 | ```bash
44 | scp /opt/credentials.yml user@slave_ip:/opt/
45 | ```
46 | 2. Download and run the script:
47 | ```bash
48 | wget https://raw.githubusercontent.com/CodonoTeam/cryptocurrency-exchange-script/main/docs/multi_server/multi-server-setup.sh
49 | chmod +x multi-server-setup.sh
50 | ./multi-server-setup.sh
51 | ```
52 |
53 | ## Architecture
54 | - **Master Server**: Primary database server with write capabilities
55 | - **Slave Server**: Secondary database server for read operations
56 | - **Memcached**: Distributed session storage across both servers
57 | - **Redis**: Local caching with password protection
58 | - **Load Balancer**: Distributes traffic between servers (not included in script)
59 |
60 | ## Security Considerations
61 | - All credentials are stored in credentials.yml
62 | - Replication user has restricted access
63 | - SSL is required for database replication
64 | - Redis and Memcached are configured with authentication
65 | - .htaccess protects web directories
66 | - Credentials file has restricted permissions
67 |
68 | ## Maintenance
69 | - Regularly update passwords in credentials.yml
70 | - Monitor database replication status
71 | - Check server health and resource usage
72 | - Update software packages regularly
73 |
74 | ## Troubleshooting
75 | - Verify network connectivity between servers
76 | - Check MariaDB error logs
77 | - Ensure firewall rules are correctly configured
78 | - Validate credentials in credentials.yml
79 |
80 | ## Footer Note
81 | This script was developed to simplify multi-server environment setup while maintaining security and performance standards.
82 |
--------------------------------------------------------------------------------
/docs/multi_server/multi-server-setup.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # Define log file
4 | LOG_FILE="/var/log/codono-install.log"
5 |
6 | # Function to log messages with redaction for sensitive information
7 | log() {
8 | case "$1" in
9 | *PASSWORD*|*SECRET_KEY*)
10 | echo "*** Redacted Sensitive Information ***" | tee -a "$LOG_FILE"
11 | ;;
12 | *)
13 | echo "$1" | tee -a "$LOG_FILE"
14 | ;;
15 | esac
16 | }
17 |
18 |
19 | # Check if 'screen' is installed, if not then install it
20 | if ! command -v screen &> /dev/null; then
21 | echo "'screen' is not installed. Attempting to install..."
22 | # Use apt-get if you are on Debian/Ubuntu. Adjust as needed for other distros (yum, zypper, pacman, etc.)
23 | sudo apt-get update && sudo apt-get install -y screen
24 | if [ $? -eq 0 ]; then
25 | echo "'screen' successfully installed."
26 | else
27 | echo "Failed to install 'screen'. Exiting."
28 | exit 1
29 | fi
30 | fi
31 |
32 | # Check if inside a screen session. If not, start a new screen session to run this script.
33 | if [ -z "$STY" ]; then
34 | screen -dm -S codono /bin/bash "$0"
35 | echo "Started setup in a screen session named codono , This process can take upto 10-20 mins. You can reattach to it with 'screen -r codono'."
36 | exit
37 | fi
38 |
39 |
40 | # Function to load credentials from credentials.yml using yq if available
41 | load_credentials() {
42 | if command -v yq &> /dev/null; then
43 | HTACCESS_USERNAME=$(yq e '.HTACCESS_USERNAME' /opt/credentials.yml)
44 | HTACCESS_PASSWORD=$(yq e '.HTACCESS_PASSWORD' /opt/credentials.yml)
45 | REDIS_PASSWORD=$(yq e '.REDIS_PASSWORD' /opt/credentials.yml)
46 | MYSQL_NEW_ROOT_PASSWORD=$(yq e '.MYSQL_NEW_ROOT_PASSWORD' /opt/credentials.yml)
47 | DB_NAME=$(yq e '.DB_NAME' /opt/credentials.yml)
48 | ADMIN_KEY=$(yq e '.ADMIN_KEY' /opt/credentials.yml)
49 | CRON_KEY=$(yq e '.CRON_KEY' /opt/credentials.yml)
50 | ADMIN_USER=$(yq e '.ADMIN_USER' /opt/credentials.yml)
51 | ADMIN_PASS=$(yq e '.ADMIN_PASS' /opt/credentials.yml)
52 | TWO_FA_SECRET_KEY=$(yq e '.TWO_FA_SECRET_KEY' /opt/credentials.yml)
53 | REPLICATION_USER_PASSWORD=$(yq e '.REPLICATION_USER_PASSWORD' /opt/credentials.yml)
54 | domain=$(yq e '.DOMAIN' /opt/credentials.yml)
55 | master_ip=$(yq e '.MASTER_IP' /opt/credentials.yml)
56 | slave_ip=$(yq e '.SLAVE_IP' /opt/credentials.yml)
57 | MEMCACHED_SERVERS=$(yq e '.MEMCACHED_SERVERS' /opt/credentials.yml)
58 | else
59 | log "Warning: 'yq' not installed. Falling back to awk for parsing."
60 | HTACCESS_USERNAME=$(awk -F': ' '/HTACCESS_USERNAME/ {print $2}' /opt/credentials.yml)
61 | HTACCESS_PASSWORD=$(awk -F': ' '/HTACCESS_PASSWORD/ {print $2}' /opt/credentials.yml)
62 | REDIS_PASSWORD=$(awk -F': ' '/REDIS_PASSWORD/ {print $2}' /opt/credentials.yml)
63 | MYSQL_NEW_ROOT_PASSWORD=$(awk -F': ' '/MYSQL_NEW_ROOT_PASSWORD/ {print $2}' /opt/credentials.yml)
64 | DB_NAME=$(awk -F': ' '/DB_NAME/ {print $2}' /opt/credentials.yml)
65 | ADMIN_KEY=$(awk -F': ' '/ADMIN_KEY/ {print $2}' /opt/credentials.yml)
66 | CRON_KEY=$(awk -F': ' '/CRON_KEY/ {print $2}' /opt/credentials.yml)
67 | ADMIN_USER=$(awk -F': ' '/ADMIN_USER/ {print $2}' /opt/credentials.yml)
68 | ADMIN_PASS=$(awk -F': ' '/ADMIN_PASS/ {print $2}' /opt/credentials.yml)
69 | TWO_FA_SECRET_KEY=$(awk -F': ' '/TWO_FA_SECRET_KEY/ {print $2}' /opt/credentials.yml)
70 | REPLICATION_USER_PASSWORD=$(awk -F': ' '/REPLICATION_USER_PASSWORD/ {print $2}' /opt/credentials.yml)
71 | domain=$(awk -F': ' '/DOMAIN/ {print $2}' /opt/credentials.yml)
72 | master_ip=$(awk -F': ' '/MASTER_IP/ {print $2}' /opt/credentials.yml)
73 | slave_ip=$(awk -F': ' '/SLAVE_IP/ {print $2}' /opt/credentials.yml)
74 | MEMCACHED_SERVERS=$(awk -F': ' '/MEMCACHED_SERVERS/ {print $2}' /opt/credentials.yml)
75 | fi
76 | }
77 |
78 | # Function to validate domain format
79 | validate_domain() {
80 | local domain_regex="^([a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$"
81 | [[ $1 =~ $domain_regex ]]
82 | }
83 |
84 | # Check if credentials.yml exists
85 | if [ -f /opt/credentials.yml ]; then
86 | if [ ! -w /opt/credentials.yml ]; then
87 | log "Error: /opt/credentials.yml is not writable. Please check permissions."
88 | exit 1
89 | fi
90 | log "credentials.yml already exists. Using existing credentials."
91 | load_credentials
92 | is_single="n"
93 | else
94 | # Check if /opt is writable
95 | if [ ! -w /opt/ ]; then
96 | log "Error: /opt/ directory is not writable. Please check permissions."
97 | exit 1
98 | fi
99 |
100 | # Prompt for domain name with validation
101 | while [[ -z "$domain" || ! $(validate_domain "$domain") ]]; do
102 | read -p "Please input domain (example: example.com): " domain
103 | domain=${domain,,} # Convert to lowercase
104 | domain=$(echo "$domain" | sed -e 's/^https:\/\///' -e 's/^www\.//' -e 's/\/$//')
105 | done
106 |
107 | # Ask if single or multi-server setup
108 | while [[ ! "$is_single" =~ ^[YyNn]$ ]]; do
109 | read -p "Is this a single server setup? (y/n): " is_single
110 | is_single=${is_single,,} # Convert to lowercase
111 | done
112 |
113 | if [ "$is_single" != "y" ]; then
114 | while [[ -z "$master_ip" ]]; do
115 | read -p "Enter MariaDB master server IP: " master_ip
116 | done
117 | while [[ -z "$slave_ip" ]]; do
118 | read -p "Enter MariaDB slave server IP: " slave_ip
119 | done
120 |
121 | # Automatically configure memcached servers using master and slave IPs
122 | MEMCACHED_SERVERS="${master_ip}:11211,${slave_ip}:11211"
123 | fi
124 |
125 | # Step 0: Create random credentials
126 | generate_password() {
127 | openssl rand -hex 16
128 | }
129 | generate_2fa_secret_key() {
130 | local random_bytes=$(openssl rand 10)
131 | local secret_key=$(echo -n "$random_bytes" | base32 | tr -d '=')
132 | echo "$secret_key"
133 | }
134 |
135 | # Generating credentials
136 | HTACCESS_USERNAME=$(generate_password)
137 | HTACCESS_PASSWORD=$(generate_password)
138 | REDIS_PASSWORD=$(generate_password)
139 | MYSQL_NEW_ROOT_PASSWORD=$(generate_password)
140 | REPLICATION_USER_PASSWORD=$(generate_password)
141 | ADMIN_USER=$(generate_password)
142 | ADMIN_PASS=$(generate_password)
143 | DB_NAME=$(generate_password)
144 | ADMIN_KEY=$(generate_password)
145 | CRON_KEY=$(generate_password)
146 | TWO_FA_SECRET_KEY=$(generate_2fa_secret_key)
147 |
148 | # Save credentials to a YAML file in /opt
149 | cat </opt/credentials.yml
150 | HTACCESS_USERNAME: $HTACCESS_USERNAME
151 | HTACCESS_PASSWORD: $HTACCESS_PASSWORD
152 | REDIS_PASSWORD: $REDIS_PASSWORD
153 | MYSQL_NEW_ROOT_PASSWORD: $MYSQL_NEW_ROOT_PASSWORD
154 | DB_NAME: $DB_NAME
155 | ADMIN_KEY: $ADMIN_KEY
156 | CRON_KEY: $CRON_KEY
157 | ADMIN_USER: $ADMIN_USER
158 | ADMIN_PASS: $ADMIN_PASS
159 | TWO_FA_SECRET_KEY: $TWO_FA_SECRET_KEY
160 | REPLICATION_USER_PASSWORD: $REPLICATION_USER_PASSWORD
161 | DOMAIN: $domain
162 | EOF
163 | if [ "$is_single" != "y" ]; then
164 | echo "MASTER_IP: $master_ip" >> /opt/credentials.yml
165 | echo "SLAVE_IP: $slave_ip" >> /opt/credentials.yml
166 | echo "MEMCACHED_SERVERS: $MEMCACHED_SERVERS" >> /opt/credentials.yml
167 | fi
168 | chmod 600 /opt/credentials.yml
169 | log "Credentials have been saved to /opt/credentials.yml."
170 | fi
171 |
172 | # Step 1: Install OneInStack
173 | cd /opt/ || { log "Failed to cd to /opt"; exit 1; }
174 | if ! (wget -c http://mirrors.oneinstack.com/oneinstack-full.tar.gz -O oneinstack-full.tar.gz); then
175 | log "Primary mirror failed. Trying backup mirror..."
176 | if ! (wget -c http://mirrors.linuxeye.com/oneinstack-full.tar.gz -O oneinstack-full.tar.gz); then
177 | log "Both mirrors failed. Exiting."
178 | exit 1
179 | fi
180 | fi
181 |
182 | # Check if the file is a valid tar archive
183 | if ! tar tzf oneinstack-full.tar.gz &>/dev/null; then
184 | log "Downloaded file is corrupt. Exiting."
185 | rm -f oneinstack-full.tar.gz
186 | exit 1
187 | fi
188 |
189 | tar xzf oneinstack-full.tar.gz || { log "Extraction failed. Exiting."; exit 1; }
190 | export MYSQL_NEW_ROOT_PASSWORD
191 | if ! (./oneinstack/install.sh --nginx_option 1 --apache --apache_mpm_option 1 --apache_mode_option 1 \
192 | --php_option 9 --phpcache_option 1 --php_extensions fileinfo,redis,swoole,memcached \
193 | --phpmyadmin --db_option 5 --dbinstallmethod 1 --dbrootpwd "$MYSQL_NEW_ROOT_PASSWORD" --redis --memcached); then
194 | log "OneInStack installation failed."
195 | exit 1
196 | fi
197 |
198 | # Step 2: Modify php.ini
199 | PHP_INI="/usr/local/php/etc/php.ini"
200 | if [ -f "$PHP_INI" ]; then
201 | sed -i 's/disable_functions\s*=\s*/disable_functions = /' "$PHP_INI"
202 | log "Updated php.ini. Restarting PHP service..."
203 | systemctl restart php-fpm
204 | else
205 | log "php.ini file not found. Skipping modifications."
206 | fi
207 |
208 | # Step 3: Install GMP extension
209 | cd /opt/oneinstack/src || { log "Failed to cd to /opt/oneinstack/src"; exit 1; }
210 | tar xzf php-7.4.33.tar.gz || { log "Failed to extract php-7.4.33.tar.gz"; exit 1; }
211 | cd php-7.4.33/ext/gmp || { log "Failed to cd to php-7.4.33/ext/gmp"; exit 1; }
212 | if ! (apt install libgmp-dev -y && /usr/local/php/bin/phpize && ./configure --with-php-config=/usr/local/php/bin/php-config && make && make install); then
213 | log "GMP extension installation failed."
214 | exit 1
215 | fi
216 | echo 'extension=gmp.so' > /usr/local/php/etc/php.d/gmp.ini
217 | if ! (systemctl restart php-fpm); then
218 | log "Failed to restart PHP-FPM after GMP installation."
219 | exit 1
220 | fi
221 | log "GMP extension installation is complete."
222 |
223 | # Step 4: Configure MySQL Master-Slave Replication
224 | if [ "$is_single" != "y" ]; then
225 | current_ip=$(hostname -I | awk '{print $1}')
226 |
227 | # Master Server Configuration
228 | if [ "$current_ip" == "$master_ip" ]; then
229 | # Configure master
230 | if ! (sed -i '/\[mariadb\]/a log_bin\nserver_id=1\nbinlog_format=mixed\nlog-basename=master1' /etc/my.cnf && systemctl restart mariadb); then
231 | log "Failed to configure MariaDB master settings."
232 | exit 1
233 | fi
234 |
235 | # Create replication user with SSL requirement
236 | if ! (mysql -e "CREATE USER 'replication_user'@'$slave_ip' IDENTIFIED BY '$REPLICATION_USER_PASSWORD';" && mysql -e "GRANT REPLICATION SLAVE ON *.* TO 'replication_user'@'$slave_ip';" && mysql -e "FLUSH PRIVILEGES;"); then
237 | log "Failed to create replication user."
238 | exit 1
239 | fi
240 |
241 | # Get master status
242 | MASTER_LOG_FILE=$(mysql -e "SHOW MASTER STATUS;" | awk '{print $1}')
243 | MASTER_LOG_POS=$(mysql -e "SHOW MASTER STATUS;" | awk '{print $2}')
244 |
245 | # Save master status to credentials.yml
246 | sed -i "/MYSQL_NEW_ROOT_PASSWORD/a MASTER_LOG_FILE: $MASTER_LOG_FILE" /opt/credentials.yml
247 | sed -i "/MASTER_LOG_FILE/a MASTER_LOG_POS: $MASTER_LOG_POS" /opt/credentials.yml
248 |
249 | # Configure SSL for replication
250 | if ! (mysql -e "CREATE SSL CERTIFICATE IF NOT EXISTS 'replication_ssl' IDENTIFIED BY '$REPLICATION_USER_PASSWORD';" && mysql -e "GRANT REPLICATION SLAVE ON *.* TO 'replication_user'@'$slave_ip' REQUIRE SSL;"); then
251 | log "Failed to configure SSL for replication."
252 | exit 1
253 | fi
254 | fi
255 |
256 | # Slave Server Configuration
257 | if [ "$current_ip" == "$slave_ip" ]; then
258 | # Configure slave
259 | if ! (sed -i '/\[mariadb\]/a server_id=2' /etc/my.cnf && systemctl restart mariadb); then
260 | log "Failed to configure MariaDB slave settings."
261 | exit 1
262 | fi
263 |
264 | # Configure replication with SSL
265 | if ! (mysql -e "CHANGE MASTER TO MASTER_HOST='$master_ip', MASTER_USER='replication_user', MASTER_PASSWORD='$REPLICATION_USER_PASSWORD', MASTER_LOG_FILE='$MASTER_LOG_FILE', MASTER_LOG_POS=$MASTER_LOG_POS, MASTER_SSL=1;" && mysql -e "START SLAVE;"); then
266 | log "Failed to configure replication on slave."
267 | exit 1
268 | fi
269 |
270 | # Verify replication status
271 | mysql -e "SHOW SLAVE STATUS\G" | grep -e "Slave_IO_Running" -e "Slave_SQL_Running" | tee -a "$LOG_FILE"
272 | fi
273 | fi
274 |
275 | # Step 5: Setup .htaccess authentication
276 | HTPASSWD_DIR="/usr/local/apache"
277 | HTPASSWD_FILE="$HTPASSWD_DIR/.htpasswd"
278 | PROTECTED_DIR="/data/wwwroot/default"
279 |
280 | if [ ! -d $HTPASSWD_DIR ]; then
281 | mkdir -p $HTPASSWD_DIR
282 | fi
283 |
284 | if ! (/usr/local/apache/bin/htpasswd -cb $HTPASSWD_FILE $HTACCESS_USERNAME $HTACCESS_PASSWORD && echo "AuthType Basic
285 | AuthName \"Restricted Access\"
286 | AuthUserFile $HTPASSWD_FILE
287 | Require valid-user" > $PROTECTED_DIR/.htaccess && systemctl restart httpd); then
288 | log "Failed to configure .htaccess authentication."
289 | exit 1
290 | fi
291 |
292 | # Step 6: Configure Redis for memory caching across servers
293 | # Configure Redis to listen on all interfaces
294 | if ! (sed -i 's/bind 127.0.0.1/bind 0.0.0.0/' /usr/local/redis/etc/redis.conf && sed -i "s/^# requirepass foobared/requirepass $REDIS_PASSWORD/" /usr/local/redis/etc/redis.conf && systemctl restart redis-server); then
295 | log "Failed to configure Redis."
296 | exit 1
297 | fi
298 |
299 | # Step 7: Configure Memcached for session storage
300 | if ! command -v memcached &> /dev/null; then
301 | if ! (sudo apt-get install -y memcached); then
302 | log "Failed to install memcached."
303 | exit 1
304 | fi
305 | fi
306 |
307 | if ! (sed -i 's/-l 127.0.0.1/-l 0.0.0.0/' /etc/memcached.conf && systemctl restart memcached); then
308 | log "Failed to configure Memcached."
309 | exit 1
310 | fi
311 |
312 | # Configure PHP to use Memcached for sessions
313 | cat </usr/local/php/etc/php.d/memcached-session.ini
314 | session.save_handler = memcached
315 | session.save_path = "$MEMCACHED_SERVERS"
316 | EOF
317 |
318 | # Configure PHP to use Redis for caching
319 | cat </usr/local/php/etc/php.d/redis-caching.ini
320 | extension=redis.so
321 | redis.cache.save_path = "tcp://$master_ip:6379?auth=$REDIS_PASSWORD,tcp://$slave_ip:6379?auth=$REDIS_PASSWORD"
322 | EOF
323 |
324 | if ! (systemctl restart php-fpm); then
325 | log "Failed to restart PHP-FPM after session configuration."
326 | exit 1
327 | fi
328 |
329 | # Print credentials
330 | log "MySQL Root Password: $MYSQL_NEW_ROOT_PASSWORD"
331 | log "Redis Password: $REDIS_PASSWORD"
332 | log ".htaccess Username: $HTACCESS_USERNAME"
333 | log ".htaccess Password: $HTACCESS_PASSWORD"
334 | if [ "$is_single" != "y" ]; then
335 | log "MariaDB Master IP: $master_ip"
336 | log "MariaDB Slave IP: $slave_ip"
337 | log "Replication User Password: $REPLICATION_USER_PASSWORD"
338 | log "Master Log File: $MASTER_LOG_FILE"
339 | log "Master Log Position: $MASTER_LOG_POS"
340 | log "Memcached Servers: $MEMCACHED_SERVERS"
341 | fi
342 |
--------------------------------------------------------------------------------
/docs/must-follow-security.md:
--------------------------------------------------------------------------------
1 | # Security Measures for Codono Exchange
2 |
3 | To ensure the highest level of security for the Codono Exchange platform, it is crucial to follow these guidelines rigorously. Below, we detail important security practices that must be implemented and regularly monitored.
4 |
5 | ## 1. Two-Factor Authentication (2FA) for Admin Accounts
6 |
7 | - **Action:** Always keep Two-Factor Authentication (2FA) enabled for Admin accounts.
8 | - **Rationale:** 2FA adds an extra layer of security by requiring a second form of verification beyond just a password. This significantly reduces the risk of unauthorized access, even if a password is compromised.
9 |
10 | ## 2. Regularly Change ADMIN_KEY
11 |
12 | - **Action:** Regularly update the `ADMIN_KEY` in the `pure_config.php` file.
13 | - **Rationale:** Changing the `ADMIN_KEY` periodically helps in preventing unauthorized access. In the event of a key leakage, frequent updates limit the time window an attacker has to exploit the exposed key.
14 |
15 | ## 3. Secure the Cron Key
16 |
17 | - **Action:** Do not share the Cron Key (`CRON_KEY`) with anyone.
18 | - **Rationale:** The Cron Key is used to authenticate scheduled tasks running in the background. Exposure of this key could allow an attacker to trigger or manipulate scheduled tasks, leading to potential security breaches.
19 |
20 | ## 4. Change the Default SSH Port
21 |
22 | - **Action:** Modify the default SSH port (22) to a custom port within the range of 10000 to 64000.
23 | - **Instructions:** You can change the SSH port in the SSH configuration file (`/etc/ssh/sshd_config`) by altering the `Port` directive.
24 | - **Rationale:** Changing the default SSH port reduces the risk of automated attacks and scans targeting port 22, the default SSH port, making it harder for attackers to identify open SSH services.
25 |
26 | ## 5. Regular Database Backups
27 |
28 | - **Action:** Utilize the backup options available in `/opt/oneinstack` for regular database backups. Options for off-site backups like Dropbox or other cloud storage services should be considered.
29 | - **Rationale:** Regular backups are crucial for disaster recovery and ensuring data integrity. Off-site backups provide an additional safety net against data loss due to hardware failure, cyber attacks, or other catastrophic events.
30 |
31 | ## 6. Conceal Exchange IP with Cloudflare Proxy
32 |
33 | - **Action:** Always conceal your exchange's IP address behind Cloudflare's proxy services.
34 | - **Rationale:** Using Cloudflare to hide the real IP address of your exchange server can protect against DDoS attacks. Cloudflare's proxy service acts as a buffer, absorbing and filtering malicious traffic before it can reach your server.
35 |
36 | ## 7. Securing the Code Layer
37 |
38 | - **Action:** Add the /data/wwwroot/codebase directory to a private Git repository to enable version control and collaboration while securing your code. Ensure codebase/pure_config.php, codebase/other_config.php, and codebase/Runtime folders are added to .gitignore to prevent sensitive configuration data from being exposed.
39 | - **Rationale:** Protecting the source code is crucial for maintaining the integrity and security of your exchange.
40 | By adhering to these security practices, you can significantly enhance the protection of your Codono Exchange platform against a wide array of cyber threats. Regular audits and updates to your security measures are recommended to adapt to evolving security challenges.
41 |
--------------------------------------------------------------------------------
/docs/oneinstack_setup/README.md:
--------------------------------------------------------------------------------
1 | *** Step 1
2 | First Upload your zip codono_unpack.zip to /opt folder of server
3 | You can use scp or upload using filezilla
4 | *** Step 2
5 | Run following
6 | ```
7 | cd /opt/ &&
8 | wget https://raw.githubusercontent.com/CodonoTeam/cryptocurrency-exchange-script/main/docs/oneinstack_setup/run1_all_in_onestack_setup.sh &&
9 | wget https://raw.githubusercontent.com/CodonoTeam/cryptocurrency-exchange-script/main/docs/oneinstack_setup/run2_domain_and_unzip.sh &&
10 | wget https://raw.githubusercontent.com/CodonoTeam/cryptocurrency-exchange-script/main/docs/oneinstack_setup/run3_config_part.sh &&
11 | wget https://raw.githubusercontent.com/CodonoTeam/cryptocurrency-exchange-script/main/docs/oneinstack_setup/run4_db_create_and_import.sh &&
12 | wget https://raw.githubusercontent.com/CodonoTeam/cryptocurrency-exchange-script/main/docs/oneinstack_setup/run5_websocket.sh &&
13 | wget https://raw.githubusercontent.com/CodonoTeam/cryptocurrency-exchange-script/main/docs/oneinstack_setup/run6_cron_setup.sh &&
14 | wget https://raw.githubusercontent.com/CodonoTeam/cryptocurrency-exchange-script/main/docs/oneinstack_setup/run7_show_admin_login.sh
15 | chmod +x run1_all_in_onestack_setup.sh &&
16 | chmod +x run2_domain_and_unzip.sh &&
17 | chmod +x run3_config_part.sh &&
18 | chmod +x run4_db_create_and_import.sh &&
19 | chmod +x run5_websocket.sh &&
20 | chmod +x run6_cron_setup.sh &&
21 | chmod +x run7_show_admin_login.sh
22 | ```
23 |
24 | Step 3.
25 | Environment setup, make sure codono_unpack.zip was uploaded to /opt folder already.
26 | ```
27 | cd /opt/
28 | ./run1_all_in_onestack_setup.sh
29 | ```
30 |
31 | Step 4.
32 | Run to create domain directory , unzip code and place them in correct place.
33 | ```
34 | cd /opt/
35 | ./run2_domain_and_unzip.sh
36 | ```
37 |
38 |
39 | Step 5.
40 | Run to create pure_config update db and other info using credentials.yml.
41 | ```
42 | cd /opt/
43 | ./run3_config_part.sh
44 | ```
45 |
46 | Step 6.
47 | Run to create db , import SQL file in it and update admin credentials.
48 | ```
49 | cd /opt/
50 | ./run4_db_create_and_import.sh
51 | ```
52 |
53 |
54 | Step 7.
55 | Run to start websocket for Liquidity markets
56 | ```
57 | cd /opt/
58 | ./run5_websocket.sh
59 | ```
60 |
61 | Step 8.
62 | Run to setup crons with www user in crontab . We suggest double checking crons.
63 | ```
64 | cd /opt/
65 | ./run6_cron_setup.sh.sh
66 | ```
67 |
68 | Step 9.
69 | Run to show admin login information , also one qrcode shows , which you can scan with authy like app to generate 6 digit 2fa for admin login
70 |
71 | ```
72 | cd /opt/
73 | ./run7_show_admin_login.sh
74 | ```
75 |
--------------------------------------------------------------------------------
/docs/oneinstack_setup/check_oneinstack_status.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | echo "=========================================="
4 | echo " Checking OneinStack Installation Status "
5 | echo "=========================================="
6 |
7 | # Load credentials from /opt/credentials.yml
8 | CREDENTIALS_FILE="/opt/credentials.yml"
9 |
10 | if [ -f "$CREDENTIALS_FILE" ]; then
11 | echo "[✔] Loading credentials from $CREDENTIALS_FILE"
12 | REDIS_PASSWORD=$(grep "REDIS_PASSWORD" "$CREDENTIALS_FILE" | awk '{print $2}')
13 | MYSQL_ROOT_PASSWORD=$(grep "MYSQL_NEW_ROOT_PASSWORD" "$CREDENTIALS_FILE" | awk '{print $2}')
14 | DOMAIN=$(grep "DOMAIN" "$CREDENTIALS_FILE" | awk '{print $2}')
15 | else
16 | echo "[✘] Credentials file not found at $CREDENTIALS_FILE"
17 | exit 1
18 | fi
19 |
20 | # Function to check service status
21 | check_service() {
22 | systemctl is-active --quiet "$1"
23 | if [ $? -eq 0 ]; then
24 | echo "[✔] $1 is running"
25 | else
26 | echo "[✘] $1 is NOT running"
27 | fi
28 | }
29 |
30 | # Check services
31 | check_service nginx
32 | check_service httpd
33 | check_service mysqld # Corrected for MariaDB
34 | check_service redis
35 |
36 | echo "------------------------------------------"
37 | echo "Checking Versions:"
38 | echo "------------------------------------------"
39 |
40 | # Check versions
41 | echo -n "PHP Version: " && php -v | head -n 1
42 | echo -n "MariaDB Version: " && mysql -V
43 | echo -n "Nginx Version: " && nginx -v 2>&1 | awk -F'[: ]' '{print $3}'
44 | echo -n "Apache Version: " && httpd -v | grep "Server version"
45 | echo -n "Redis Version: " && redis-cli --version
46 |
47 | echo "------------------------------------------"
48 | echo "Checking Nginx Configuration:"
49 | echo "------------------------------------------"
50 | nginx -t
51 |
52 | echo "------------------------------------------"
53 | echo "Checking Redis Connection:"
54 | echo "------------------------------------------"
55 | if redis-cli -a "$REDIS_PASSWORD" ping | grep -q "PONG"; then
56 | echo "[✔] Redis is responding with PONG"
57 | else
58 | echo "[✘] Redis authentication failed"
59 | fi
60 |
61 | echo "------------------------------------------"
62 | echo "Checking PHP Modules:"
63 | echo "------------------------------------------"
64 | php -m | grep -E "redis|mysqli|pdo_mysql"
65 |
66 | echo "------------------------------------------"
67 | echo "Checking Web Server Response:"
68 | echo "------------------------------------------"
69 | curl -I http://127.0.0.1/ 2>/dev/null | head -n 1
70 |
71 | echo "------------------------------------------"
72 | echo "Checking MySQL Connection:"
73 | echo "------------------------------------------"
74 | mysql -u root -p"$MYSQL_ROOT_PASSWORD" -e "SHOW DATABASES;" >/dev/null 2>&1
75 | if [ $? -eq 0 ]; then
76 | echo "[✔] Successfully connected to MySQL (MariaDB)"
77 | else
78 | echo "[✘] MySQL connection failed"
79 | fi
80 |
81 | echo "------------------------------------------"
82 | echo "Checking Logs for Errors:"
83 | echo "------------------------------------------"
84 |
85 | # Function to check logs with fallback
86 | check_log() {
87 | if [ -f "$1" ]; then
88 | echo "$2:"
89 | tail -n 5 "$1"
90 | else
91 | echo "[!] Log file $1 not found."
92 | fi
93 | }
94 |
95 | # Updated log file locations based on your setup
96 | NGINX_LOG="/data/wwwlogs/error_nginx.log"
97 | APACHE_LOG="/data/wwwlogs/error_apache.log"
98 | MARIADB_LOG="/data/mariadb/mysql-error.log"
99 | REDIS_LOG="/usr/local/redis/var/redis.log" # Updated Redis log path
100 |
101 | # Display last 5 log entries
102 | check_log "$NGINX_LOG" "Nginx Errors"
103 | check_log "$APACHE_LOG" "Apache Errors"
104 | check_log "$MARIADB_LOG" "MariaDB Errors"
105 | check_log "$REDIS_LOG" "Redis Logs"
106 |
107 | echo "=========================================="
108 | echo " OneinStack Status Check Completed!"
109 | echo "=========================================="
110 |
--------------------------------------------------------------------------------
/docs/oneinstack_setup/run1_all_in_onestack_setup.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # Check if 'screen' is installed, if not then install it
4 | if ! command -v screen &> /dev/null; then
5 | echo "'screen' is not installed. Attempting to install..."
6 | # Use apt-get if you are on Debian/Ubuntu. Adjust as needed for other distros (yum, zypper, pacman, etc.)
7 | sudo apt-get update && sudo apt-get install -y screen
8 | if [ $? -eq 0 ]; then
9 | echo "'screen' successfully installed."
10 | else
11 | echo "Failed to install 'screen'. Exiting."
12 | exit 1
13 | fi
14 | fi
15 |
16 | # Check if inside a screen session. If not, start a new screen session to run this script.
17 | if [ -z "$STY" ]; then
18 | screen -dm -S codono /bin/bash "$0"
19 | echo "Started setup in a screen session named codono , This process can take upto 10-20 mins. You can reattach to it with 'screen -r codono'."
20 | exit
21 | fi
22 |
23 | # Check if credentials.yml exists
24 | if [ -f /opt/credentials.yml ]; then
25 | echo "credentials.yml already exists. Using existing credentials."
26 | # Load existing credentials
27 | HTACCESS_USERNAME=$(grep 'HTACCESS_USERNAME' /opt/credentials.yml | awk '{print $2}')
28 | HTACCESS_PASSWORD=$(grep 'HTACCESS_PASSWORD' /opt/credentials.yml | awk '{print $2}')
29 | REDIS_PASSWORD=$(grep 'REDIS_PASSWORD' /opt/credentials.yml | awk '{print $2}')
30 | MYSQL_NEW_ROOT_PASSWORD=$(grep 'MYSQL_NEW_ROOT_PASSWORD' /opt/credentials.yml | awk '{print $2}')
31 | DB_NAME=$(grep 'DB_NAME' /opt/credentials.yml | awk '{print $2}')
32 | ADMIN_KEY=$(grep 'ADMIN_KEY' /opt/credentials.yml | awk '{print $2}')
33 | CRON_KEY=$(grep 'CRON_KEY' /opt/credentials.yml | awk '{print $2}')
34 | ADMIN_USER=$(grep 'ADMIN_USER' /opt/credentials.yml | awk '{print $2}')
35 | ADMIN_PASS=$(grep 'ADMIN_PASS' /opt/credentials.yml | awk '{print $2}')
36 | TWO_FA_SECRET_KEY=$(grep 'TWO_FA_SECRET_KEY' /opt/credentials.yml | awk '{print $2}')
37 | domain=$(grep 'DOMAIN' /opt/credentials.yml | awk '{print $2}')
38 | else
39 | # Prompt user for domain name input if DOMAIN is not in credentials.yml
40 | read -p "Please input domain (example: example.com): " domain
41 | domain=${domain,,} # Convert domain to lowercase to avoid issues
42 |
43 | # Clean the input: remove https://, www, and trailing slashes
44 | domain=$(echo "$domain" | sed -e 's/^https:\/\///' -e 's/^www\.//' -e 's/\/$//')
45 |
46 | # Step 0: Create random credentials
47 | generate_password() {
48 | local length=$1
49 | tr -dc A-Za-z0-9 credentials.yml
78 | HTACCESS_USERNAME: $HTACCESS_USERNAME
79 | HTACCESS_PASSWORD: $HTACCESS_PASSWORD
80 | REDIS_PASSWORD: $REDIS_PASSWORD
81 | MYSQL_NEW_ROOT_PASSWORD: $MYSQL_NEW_ROOT_PASSWORD
82 | DB_NAME: $DB_NAME
83 | ADMIN_KEY: $ADMIN_KEY
84 | CRON_KEY: $CRON_KEY
85 | ADMIN_USER: $ADMIN_USER
86 | ADMIN_PASS: $ADMIN_PASS
87 | TWO_FA_SECRET_KEY: $TWO_FA_SECRET_KEY
88 | DOMAIN: $domain
89 | EOF
90 | echo "Credentials have been saved to credentials.yml."
91 | fi
92 |
93 | # Step 1: Install OneInStack
94 | cd /opt/ && wget -c http://mirrors.oneinstack.com/oneinstack-full.tar.gz && tar xzf oneinstack-full.tar.gz && ./oneinstack/install.sh --nginx_option 1 --apache --apache_mpm_option 1 --apache_mode_option 1 --php_option 9 --phpcache_option 1 --php_extensions fileinfo,redis,swoole --phpmyadmin --db_option 5 --dbinstallmethod 1 --dbrootpwd $MYSQL_NEW_ROOT_PASSWORD --redis --memcached
95 |
96 | # Step 2: Modify php.ini
97 | sed -i '/disable_functions/s/exec,//' /usr/local/php/etc/php.ini
98 | sed -i '/disable_functions/s/stream_socket_server,//' /usr/local/php/etc/php.ini
99 | service php-fpm restart
100 |
101 | # Step 3: Install GMP extension
102 | cd /opt/oneinstack/src || exit
103 | tar xzf php-7.4.33.tar.gz
104 | cd php-7.4.33/ext/gmp || exit
105 | apt install libgmp-dev -y
106 | /usr/local/php/bin/phpize
107 | ./configure --with-php-config=/usr/local/php/bin/php-config
108 | make && make install
109 | echo 'extension=gmp.so' > /usr/local/php/etc/php.d/gmp.ini
110 | service php-fpm restart
111 | echo "GMP extension installation is complete."
112 |
113 | # Step 4: Configure MySQL
114 | cd /opt/oneinstack
115 | sed -i 's/bind-address = 0.0.0.0/bind-address = 127.0.0.1/' /etc/my.cnf
116 | systemctl restart mysql
117 |
118 | # Step 5: Setup .htaccess authentication
119 | HTPASSWD_DIR="/usr/local/apache"
120 | HTPASSWD_FILE="$HTPASSWD_DIR/.htpasswd"
121 | PROTECTED_DIR="/data/wwwroot/default"
122 |
123 | if [ ! -d $HTPASSWD_DIR ]; then
124 | mkdir -p $HTPASSWD_DIR
125 | fi
126 |
127 | /usr/local/apache/bin/htpasswd -cb $HTPASSWD_FILE $HTACCESS_USERNAME $HTACCESS_PASSWORD
128 | echo "AuthType Basic
129 | AuthName \"Restricted Access\"
130 | AuthUserFile $HTPASSWD_FILE
131 | Require valid-user" > $PROTECTED_DIR/.htaccess
132 | service httpd restart
133 |
134 | # Step 6: Configure Redis
135 | sed -i "s/^# requirepass foobared/requirepass $REDIS_PASSWORD/" /usr/local/redis/etc/redis.conf
136 | service redis-server restart
137 |
138 | # Print credentials
139 | echo "MySQL Root Password: $MYSQL_NEW_ROOT_PASSWORD"
140 | echo "Redis Password: $REDIS_PASSWORD"
141 | echo ".htaccess Username: $HTACCESS_USERNAME"
142 | echo ".htaccess Password: $HTACCESS_PASSWORD"
143 |
--------------------------------------------------------------------------------
/docs/oneinstack_setup/run2_domain_and_unzip.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # Immediately exit if any command has a non-zero exit status
4 | set -e
5 |
6 | # Verify /opt/credentials.yml exists
7 | if [ ! -f "/opt/credentials.yml" ]; then
8 | echo "/opt/credentials.yml does not exist."
9 | exit 1
10 | else
11 | # Extract the DOMAIN value from /opt/credentials.yml
12 | domain=$(grep 'DOMAIN:' /opt/credentials.yml | cut -d ' ' -f 2)
13 | if [ -z "$domain" ]; then
14 | echo "DOMAIN value not found in /opt/credentials.yml."
15 | exit 1
16 | fi
17 | fi
18 |
19 |
20 | # Verify /opt/codono_unpack.zip exists
21 | if [ ! -f "/opt/codono_unpack.zip" ]; then
22 | echo "/opt/codono_unpack.zip does not exist."
23 | exit 1
24 | fi
25 |
26 | # Check if unzip is available, if not then install
27 | if ! command -v unzip &> /dev/null; then
28 | echo "unzip is not installed. Installing..."
29 | sudo apt-get update && sudo apt-get install unzip -y
30 | fi
31 |
32 | # Unzip codono_unpack.zip
33 | echo "Unzipping /opt/codono_unpack.zip..."
34 | unzip /opt/codono_unpack.zip -d /data/wwwroot/ || { echo "Failed to unzip file."; exit 1; }
35 |
36 | # Add the domain to /opt/oneinstack/vhost.sh script [ run in subshell]
37 | echo "Adding domain to vhost.sh..."
38 | command_output=$(
39 | /opt/oneinstack/vhost.sh --add < /dev/null; echo "$?")
16 |
17 | # If DB does not exist, create it
18 | if [ "$DB_EXISTS" != "0" ]; then
19 | echo "Database $DB_NAME does not exist. Creating database..."
20 | $MARIADB_BIN -uroot -p"$MYSQL_ROOT_PASSWORD" -e "CREATE DATABASE IF NOT EXISTS $DB_NAME;"
21 | fi
22 |
23 | # Import SQL files into the database
24 | for SQL_FILE in /data/wwwroot/codono_unpack/*.sql; do
25 | echo "Importing $SQL_FILE into $DB_NAME..."
26 | $MARIADB_BIN -uroot -p"$MYSQL_ROOT_PASSWORD" "$DB_NAME" < "$SQL_FILE"
27 | done
28 |
29 | # Update codono_admin table
30 | echo "Updating codono_admin table..."
31 | $MARIADB_BIN -uroot -p"$MYSQL_ROOT_PASSWORD" "$DB_NAME" -e "
32 | UPDATE codono_admin
33 | SET username = '$ADMIN_USER',
34 | password = MD5('$ADMIN_PASS'),
35 | ga = '$TWO_FA_SECRET_KEY'
36 | WHERE id = 1;
37 | "
38 |
39 | echo "Codono Database setup and updates complete. Please visit https://${DOMAIN}/install_check.php and https://${DOMAIN}/"
40 |
--------------------------------------------------------------------------------
/docs/oneinstack_setup/run5_websocket.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # Path to credentials and configuration
4 | CREDENTIALS_FILE="/opt/credentials.yml"
5 | NGINX_CONF_PATH="/usr/local/nginx/conf/vhost"
6 | OTHER_CONFIG_PHP="/data/wwwroot/codebase/other_config.php"
7 | SUPERVISOR_CONF="/etc/supervisor/conf.d/socketbot.conf"
8 |
9 | # Check and install Supervisor if it's not already installed
10 | if ! command -v supervisorctl &> /dev/null; then
11 | echo "Supervisor is not installed. Installing..."
12 | sudo apt-get update && sudo apt-get install -y supervisor
13 | else
14 | echo "Supervisor is already installed."
15 | fi
16 |
17 | # Extract the domain name from credentials.yml
18 | DOMAIN=$(grep 'DOMAIN:' ${CREDENTIALS_FILE} | cut -d ' ' -f 2)
19 | if [ -z "$DOMAIN" ]; then
20 | echo "Domain not found in ${CREDENTIALS_FILE}. Exiting..."
21 | exit 1
22 | fi
23 |
24 | # Configure Supervisor to keep the socket bot running
25 | echo "Configuring Supervisor for socket bot..."
26 | cat > ${SUPERVISOR_CONF} << EOF
27 | [program:socketbot]
28 | directory=/data/wwwroot/codebase
29 | command=/usr/local/php/bin/php socketbot.php start
30 | autostart=true
31 | autorestart=true
32 | stderr_logfile=/var/log/supervisor/socketbot.err.log
33 | stdout_logfile=/var/log/supervisor/socketbot.out.log
34 | EOF
35 |
36 | # Update other_config.php with the new domain for WebSocket
37 | sed -i "s|const SOCKET_WS_URL =.*|const SOCKET_WS_URL = \"wss://${DOMAIN}/wsocket\";|" ${OTHER_CONFIG_PHP}
38 |
39 | # Add/update the Nginx configuration for WebSocket forwarding
40 | NGINX_CONF="${NGINX_CONF_PATH}/${DOMAIN}.conf"
41 | if grep -q "~/wsocket(.*)\$" "${NGINX_CONF}"; then
42 | echo "WebSocket configuration already exists in ${NGINX_CONF}"
43 | else
44 | echo "Adding WebSocket configuration to ${NGINX_CONF}"
45 | sed -i "/server {/a location ~/wsocket(.*)\$ {\n proxy_set_header X-Real-IP \$remote_addr;\n proxy_set_header X-Forwarded-For \$remote_addr;\n proxy_set_header Host \$host;\n proxy_pass http://127.0.0.1:7272;\n}" "${NGINX_CONF}"
46 | fi
47 |
48 | # Reload Nginx to apply changes
49 | echo "Reloading Nginx..."
50 | nginx -s reload
51 |
52 | # Reload Supervisor to apply changes
53 | echo "Reloading Supervisor..."
54 | supervisorctl reload
55 | echo "Starting socketbot..."
56 | supervisorctl start socketbot
57 |
58 | # Add sudoers file for www user
59 | NEW_SUDOERS_FILE="/etc/sudoers.d/www_sudoers"
60 | echo "www ALL=(ALL) NOPASSWD: /usr/bin/supervisorctl restart all" > ${NEW_SUDOERS_FILE}
61 | chmod 440 ${NEW_SUDOERS_FILE}
62 | visudo -c -f ${NEW_SUDOERS_FILE}
63 | if [ $? -ne 0 ]; then
64 | echo "Failed to validate the sudoers file, removing..."
65 | rm ${NEW_SUDOERS_FILE}
66 | exit 1
67 | else
68 | echo "Sudoers file for www user has been updated and validated."
69 | fi
70 |
71 | echo "Socket Setup complete. WebSocket and Supervisor are configured."
72 |
--------------------------------------------------------------------------------
/docs/oneinstack_setup/run6_cron_setup.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Define the path to the credentials file for codono
3 | CREDENTIALS_FILE="/opt/credentials.yml"
4 |
5 | # Check if credentials file exists
6 | if [ ! -f "$CREDENTIALS_FILE" ]; then
7 | echo "Credentials file does not exist: $CREDENTIALS_FILE"
8 | exit 1
9 | fi
10 |
11 | # Extract the DOMAIN value from the credentials file
12 | DOMAIN=$(awk '/DOMAIN:/ {print $2}' "$CREDENTIALS_FILE")
13 | PHP_PATH='/usr/local/php/bin/php';
14 | CRON_KEY=$(grep 'CRON_KEY:' /opt/credentials.yml | cut -d ' ' -f 2)
15 |
16 | # Check if DOMAIN was found
17 | if [ -z "$DOMAIN" ]; then
18 | echo "DOMAIN not found in the credentials file."
19 | exit 1
20 | fi
21 |
22 | # Define groups of cron jobs
23 | declare -A CRON_JOB_GROUPS
24 | CRON_JOB_GROUPS[1]="0" # BTC Deposit
25 | CRON_JOB_GROUPS[2]="1" # CryptoApis Deposit
26 | CRON_JOB_GROUPS[3]="2 3" # Substrate Deposit
27 | CRON_JOB_GROUPS[4]="4 5" # Blockgum Deposit and Withdrawal ID
28 | CRON_JOB_GROUPS[5]="6 7" # Cryptonote
29 | CRON_JOB_GROUPS[6]="11 12" # Coinpayments
30 |
31 | # Define the user interface
32 | echo "We will add some mandatory crons automatically for Emails, Charts, Tron, etc."
33 | echo "Select cron jobs to enable: "
34 | echo "1) BTC Deposit"
35 | echo "2) CryptoApis Deposit"
36 | echo "3) Substrate"
37 | echo "4) Blockgum"
38 | echo "5) Cryptonote"
39 | echo "6) Coinpayments"
40 |
41 | read -p "Enter numbers separated by spaces (e.g., 1 2 3): " selection
42 |
43 | # Define the original path
44 | INDEX_PATH="/data/wwwroot/${DOMAIN}"
45 |
46 | # Define the cron jobs
47 | CRON_JOBS=(
48 | "* * * * * cd ${INDEX_PATH} && ${PHP_PATH} index.php Coin/deposit_btctype/securecode/${CRON_KEY}/ > /dev/null"
49 | "* * * * * cd ${INDEX_PATH} && ${PHP_PATH} index.php Coin/deposit_cryptoapis/securecode/${CRON_KEY}/ > /dev/null"
50 | "* * * * * cd ${INDEX_PATH} && ${PHP_PATH} index.php Coin/substrate_deposit/securecode/${CRON_KEY}/ > /dev/null"
51 | "*/5 * * * * cd ${INDEX_PATH} && ${PHP_PATH} index.php Coin/getWithdrawalIdSubstrate/securecode/${CRON_KEY}/ > /dev/null"
52 | "* * * * * cd ${INDEX_PATH} && ${PHP_PATH} index.php Coin/blockgum_deposit/securecode/${CRON_KEY}/ > /dev/null"
53 | "*/5 * * * * cd ${INDEX_PATH} && ${PHP_PATH} index.php Coin/getWithdrawalIdBlockgum/securecode/${CRON_KEY}/ > /dev/null"
54 | "* * * * * cd ${INDEX_PATH} && ${PHP_PATH} index.php Coin/wallet_cryptonote_deposit/securecode/${CRON_KEY}/ > /dev/null"
55 | "* * * * * cd ${INDEX_PATH} && ${PHP_PATH} index.php Coin/wallet_cryptonote2_deposit/securecode/${CRON_KEY}/ > /dev/null"
56 | "*/5 * * * * cd ${INDEX_PATH} && ${PHP_PATH} index.php Coin/wallet_blockio_deposit/securecode/${CRON_KEY}/ > /dev/null"
57 | "*/5 * * * * cd ${INDEX_PATH} && ${PHP_PATH} index.php Coin/wallet_blockio_withdraw/securecode/${CRON_KEY}/ > /dev/null"
58 | "* * * * * cd ${INDEX_PATH} && ${PHP_PATH} index.php Coin/esmart_deposit/securecode/${CRON_KEY}/chain/chainNameHere > /dev/null"
59 | "*/5 * * * * cd ${INDEX_PATH} && ${PHP_PATH} index.php Coin/wallet_coinpay_deposit/securecode/${CRON_KEY}/ > /dev/null"
60 | "*/5 * * * * cd ${INDEX_PATH} && ${PHP_PATH} index.php Coin/wallet_coinpay_withdraw/securecode/${CRON_KEY}/ > /dev/null"
61 | )
62 |
63 | # Mandatory cron jobs (always added)
64 | MANDATORY_CRON_JOBS=(
65 | "* * * * * cd ${INDEX_PATH} && ${PHP_PATH} index.php Tron/cronDeposits/securecode/${CRON_KEY}/ > /dev/null"
66 | "* * * * * cd ${INDEX_PATH} && ${PHP_PATH} index.php Xtrade/cronMe/securecode/${CRON_KEY}/ > /dev/null"
67 | "* * * * * cd ${INDEX_PATH} && ${PHP_PATH} index.php Xtrade/otcTrade/securecode/${CRON_KEY}/ > /dev/null"
68 | "* * * * * cd ${INDEX_PATH} && ${PHP_PATH} index.php Selfengine/CreateOrderbook/securecode/${CRON_KEY}/ > /dev/null"
69 | "0 9 * * * cd ${INDEX_PATH} && ${PHP_PATH} index.php Selfengine/cleanUp/securecode/${CRON_KEY}/ > /dev/null"
70 | "0 9 * * * cd ${INDEX_PATH} && ${PHP_PATH} index.php Queue/checkStaking/securecode/${CRON_KEY}/ > /dev/null"
71 | "* * * * * cd ${INDEX_PATH} && ${PHP_PATH} index.php Queue/BinanceUpdate/securecode/${CRON_KEY}/ > /dev/null"
72 | "* * * * * cd ${INDEX_PATH} && ${PHP_PATH} index.php Queue/ExchangeBinanceUpdate/securecode/${CRON_KEY}/ > /dev/null"
73 | "* * * * * cd ${INDEX_PATH} && ${PHP_PATH} index.php Queue/cmcUpdate/securecode/${CRON_KEY}/ > /dev/null"
74 | "* * * * * cd ${INDEX_PATH} && ${PHP_PATH} index.php Queue/cmcUpdateRate/securecode/${CRON_KEY}/ > /dev/null"
75 | "* * * * * cd ${INDEX_PATH} && ${PHP_PATH} index.php Queue/send_notifications/securecode/${CRON_KEY}/ > /dev/null"
76 | "*/10 * * * * cd ${INDEX_PATH} && ${PHP_PATH} index.php Queue/genInternalCharts/securecode/${CRON_KEY}/ > /dev/null"
77 | )
78 |
79 | # Start with mandatory cron jobs
80 | CRON_JOBS_TO_ADD=("${MANDATORY_CRON_JOBS[@]}")
81 |
82 | VALID_SELECTION=0
83 | for i in $selection; do
84 | if ! [[ "$i" =~ ^[1-6]+$ ]]; then
85 | echo "Invalid selection: $i. Please enter valid numbers (e.g., 1 2 3)."
86 | exit 1
87 | fi
88 |
89 | # Get the corresponding group of cron jobs for the selection
90 | if [[ -n ${CRON_JOB_GROUPS[$i]} ]]; then
91 | for index in ${CRON_JOB_GROUPS[$i]}; do
92 | CRON_JOBS_TO_ADD+=("${CRON_JOBS[$index]}")
93 | VALID_SELECTION=1
94 | done
95 | else
96 | echo "Selection $i is out of range."
97 | exit 1
98 | fi
99 | done
100 |
101 | if [ "$VALID_SELECTION" -eq 0 ]; then
102 | echo "No valid selections made."
103 | exit 1
104 | fi
105 |
106 | # Backup current crontab
107 | crontab -u www -l > mycron.backup 2>/dev/null
108 |
109 | CRON_TMP_FILE=$(mktemp)
110 | echo "Temporary file created at: $CRON_TMP_FILE"
111 |
112 | # Populate the temp file with existing crons excluding old installations
113 | crontab -u www -l 2>/dev/null | grep -v "${INDEX_PATH}" > "$CRON_TMP_FILE"
114 |
115 | # Add new cron jobs to the temporary file
116 | for job in "${CRON_JOBS_TO_ADD[@]}"; do
117 | echo "$job" >> "$CRON_TMP_FILE"
118 | done
119 |
120 | # Install the new cron jobs
121 | crontab -u www "$CRON_TMP_FILE"
122 | rm "$CRON_TMP_FILE"
123 |
124 | # Reload the cron service to apply changes
125 | if command -v systemctl &> /dev/null; then
126 | echo "Reloading cron service using systemctl..."
127 | systemctl reload cron
128 | elif command -v service &> /dev/null; then
129 | echo "Reloading cron service using service command..."
130 | service cron reload
131 | else
132 | echo "Cron service will automatically detect the changes. No manual reload required."
133 | fi
134 |
135 | echo "Cron jobs have been updated and reloaded. You can always check crons using the command: crontab -l -u www"
136 |
--------------------------------------------------------------------------------
/docs/oneinstack_setup/run7_show_admin_login.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # Define the path to the credentials file
4 | CREDENTIALS_FILE="/opt/credentials.yml"
5 |
6 | # Check if qrencode is installed and install it if it's not
7 | if ! command -v qrencode &> /dev/null; then
8 | echo "'qrencode' is not installed. Attempting to install..."
9 | sudo apt-get update && sudo apt-get install -y qrencode
10 | if [ $? -ne 0 ]; then
11 | echo "Failed to install 'qrencode'. Please install it manually."
12 | exit 1
13 | fi
14 | fi
15 |
16 | # Read values from the credentials file
17 | TWO_FA_SECRET_KEY=$(awk '/TWO_FA_SECRET_KEY:/ {print $2}' "$CREDENTIALS_FILE")
18 | DOMAIN=$(awk '/DOMAIN:/ {print $2}' "$CREDENTIALS_FILE")
19 | ADMIN_KEY=$(awk '/ADMIN_KEY:/ {print $2}' "$CREDENTIALS_FILE")
20 | ADMIN_USER=$(awk '/ADMIN_USER:/ {print $2}' "$CREDENTIALS_FILE")
21 | ADMIN_PASS=$(awk '/ADMIN_PASS:/ {print $2}' "$CREDENTIALS_FILE")
22 |
23 | # Check if necessary values were found
24 | if [ -z "$TWO_FA_SECRET_KEY" ] || [ -z "$DOMAIN" ] || [ -z "$ADMIN_KEY" ] || [ -z "$ADMIN_USER" ] || [ -z "$ADMIN_PASS" ]; then
25 | echo "Required information is missing from credentials file."
26 | exit 1
27 | fi
28 |
29 | # Generate QR code for 2FA secret
30 | echo "Generating QR code for the 2FA secret key..."
31 | qrencode -t UTF8 "otpauth://totp/${DOMAIN}:Admin?secret=${TWO_FA_SECRET_KEY}&issuer=${DOMAIN}"
32 |
33 | # Print Admin login URL and credentials
34 | echo "Admin Login URL: https://${DOMAIN}/Admin/Login/index/securecode/${ADMIN_KEY}"
35 | echo "Admin User: $ADMIN_USER"
36 | echo "Admin Password: $ADMIN_PASS"
37 |
38 | # Instruction for scanning the QR code
39 | echo "Scan the above QR code using Authy or another 2FA app to add ${DOMAIN} Admin 2FA."
40 |
--------------------------------------------------------------------------------
/docs/php-dex-decentalized-exchange.md:
--------------------------------------------------------------------------------
1 |
2 | ## Codno Dex Module [PHP DEX SCRIPT](https://codono.com)
3 |
4 | ### Step 1: Create Ethereum Account
5 |
6 | Create a fresh Ethereum account using Metamask and grab its private key.
7 |
8 | ### Step 2: Add Tokens
9 |
10 | Add the tokens you want to sell (ERC20/BEP20) to the Ethereum account address created in Step 1. The system supports selling only one token using this tool.
11 |
12 | ### Step 3: Add Gas
13 |
14 | Add some gas amount to the Ethereum account.
15 |
16 | ### Step 4: Dex Configuration
17 |
18 | Go to `Admin -> Trade -> Dex Config`
19 |
20 | ### Step 5: Information Filling
21 |
22 | - Default Coin: ETH (Select Main Coin for Dex)
23 | - Default Network: Ropsten (Select Network type for Dex)
24 | - Main Address: 0x2f7f81a71f455156fdd9bcb289621a3537e630b9 (Main address of chain generated in Step 1)
25 | - Private Key: Private Key for Main address generated in Step 1 (Not shown for security)
26 | - Token Name: Token which you sent to main address (Example: MY ABC Token)
27 | - Token Symbol: abc (Symbol of token, lowercase)
28 | - Token Decimals: Decimals on token (example: 8)
29 | - Contract Address: Contract address of token to be sold (example: 0x5fa128ea1eebb38895cc2d5246888f6b062f30b6)
30 | - Token Minimum: Minimum token to be sold in each buy (example: 1.00000000)
31 | - Token Maximum: Maximum Amount of token user can buy (example: 100000.00000000)
32 |
33 | ### Step 6: Create Coin and Token
34 |
35 | Go to `Admin -> Trade -> Dex -> Dex Coins` to add or edit a coin/token.
36 |
37 | - Status: Enabled (Coin status)
38 | - Is Default In Spend: NA (Select only one coin as default status, either ETH or BNB)
39 | - Is Token?: Token (Only One main coin)
40 | - Name Of Coin: DAI (Name of coin)
41 | - Symbol Of Coin: dai (Symbol in small letters, e.g., usdt)
42 | - Image: Click Add Picture (80px*80px)
43 | - Contract Address: 0xad6d458402f60fd3bd25163575031acdce07538d (Contract Address of token, Empty in case of main coin)
44 | - Decimals: 18 (Only One main coin)
45 | - Price: 0.01010000 (Price of your token)
46 | - Min Buy Quantity: 0.01000000 (Minimum Buy Quantity)
47 | - Max Buy Quantity: 10000.00000000
48 |
49 | ### Optional Cron for Missing Deposit Detection
50 |
51 | This cron will detect deposits:
52 | ```
53 | yoursite/Dex/cronCoinDeposits/securecode/cronkey
54 |
55 | ```
56 |
57 | ### Optional Cron for Missing ERC20/BEP20 Deposit Detection
58 |
59 | This cron will detect ERC20/BEP20 deposits:
60 | ```
61 | yoursite/Dex/cronTokenDeposits/securecode/cronkey
62 |
63 | ```
64 |
65 |
66 | ### Optional Cron for Handling Abandoned Deposits
67 |
68 | This cron sends purchases which were made but didn't get tokens back, sending them tokens for the buy:
69 | ```
70 | yoursite.com/Dex/abandonedDeposits/securecode/cronkey
71 |
72 | ```
73 |
74 |
--------------------------------------------------------------------------------
/docs/security-tips.md:
--------------------------------------------------------------------------------
1 | # Securing your Codono Exchange Project
2 |
3 | Securing your Codono exchange project is crucial to protect your users' data, financial assets, and maintain the integrity of the platform. Here are lots of security tips to consider for your project:
4 |
5 | 1. **Keep Software Updated**: Regularly update Codono, PHP, and all installed libraries to the latest stable versions. Apply security patches as soon as they are released.
6 |
7 | 2. **Secure Hosting Environment**: Choose a reliable and secure hosting provider that offers regular backups, firewall protection, and DDoS mitigation.
8 |
9 | 3. **Use HTTPS**: Enable HTTPS with a valid SSL certificate to encrypt data transmitted between users and the server.
10 |
11 | 4. **Strong Password Policies**: Enforce strong password policies for user accounts, including minimum length, complexity, and password expiration.
12 |
13 | 5. **Two-Factor Authentication (2FA)**: Implement 2FA for user logins to add an extra layer of security to user accounts.
14 |
15 | 6. **SQL Injection Prevention**: Use prepared statements and parameterized queries to prevent SQL injection attacks.
16 |
17 | 7. **Input Validation**: Validate all user input to prevent malicious data from being processed.
18 |
19 | 8. **Cross-Site Scripting (XSS) Protection**: Use output escaping and encoding to prevent XSS attacks.
20 |
21 | 9. **Cross-Site Request Forgery (CSRF) Protection**: Implement CSRF tokens to prevent CSRF attacks.
22 |
23 | 10. **Rate Limiting**: Implement rate limiting for API requests to prevent abuse and DoS attacks.
24 |
25 | 11. **Secure File Uploads**: Validate file uploads to prevent malicious files from being uploaded to the server.
26 |
27 | 12. **Secure Session Management**: Use secure session management techniques, such as HttpOnly and Secure flags for cookies.
28 |
29 | 13. **Access Controls**: Implement proper access controls to restrict users from accessing unauthorized resources.
30 |
31 | 14. **Secure Socket Layer (SSL) Pinning**: Implement SSL pinning to ensure communication occurs only with trusted servers.
32 |
33 | 15. **Secure APIs**: Authenticate and authorize API requests to prevent unauthorized access to sensitive data.
34 |
35 | 16. **Disable Directory Listing**: Disable directory listing on the webserver to prevent sensitive files from being exposed.
36 |
37 | 17. **Error Handling**: Avoid showing detailed error messages to end-users, and log errors securely for debugging.
38 |
39 | 18. **Data Encryption**: Encrypt sensitive data, such as user passwords and API keys, stored in the database.
40 |
41 | 19. **Captcha**: Implement CAPTCHA or reCAPTCHA to prevent automated bots from performing actions.
42 |
43 | 20. **User Activity Logging**: Log user activity and review logs regularly for any suspicious activities.
44 |
45 | 21. **Third-Party Libraries**: Use well-known and trusted libraries. Review the source code for vulnerabilities if using lesser-known libraries.
46 |
47 | 22. **Remove Unused Functionality**: Disable or remove any unused features or modules from the system.
48 |
49 | 23. **Security Testing**: Conduct regular security audits, penetration testing, and code reviews to identify and fix vulnerabilities.
50 |
51 | 24. **Backup and Recovery**: Regularly back up the database and files and have a disaster recovery plan in place.
52 |
53 | 25. **Secure File Permissions**: Set appropriate file and directory permissions to prevent unauthorized access.
54 |
55 | 26. **Harden PHP Configuration**: Adjust PHP settings to improve security, such as disabling dangerous functions and limiting resource usage.
56 |
57 | 27. **HTTPS Header Security**: Implement security-related HTTP headers like Content Security Policy (CSP), HTTP Strict Transport Security (HSTS), etc.
58 |
59 | 28. **Secure OAuth Consent Screen**: Ensure proper OAuth consent screen configuration to prevent phishing attacks.
60 |
61 | 29. **Third-Party Integration Security**: Vet third-party integrations for security practices and potential vulnerabilities.
62 |
63 | 30. **Regular Security Training**: Educate your development and support teams about the latest security best practices and common threats.
64 |
65 | Remember that security is an ongoing process, and it requires vigilance and continuous improvement. Regularly monitor security advisories and take proactive measures to protect your exchange platform from emerging threats.
66 |
--------------------------------------------------------------------------------
/docs/shuftipro-setup-requirements.md:
--------------------------------------------------------------------------------
1 | #[Crypto Exchange Script](https://codono.com)
2 | In case of Firewall or Cloudflare
3 | Allow following IPS
4 |
5 | # Whitelist the following IPs to receive a callback.
6 | ```
7 | IPv4 : 85.10.199.216
8 | IPv6 : 2a01:4f8:a0:53ad::2
9 | IPv4 : 78.46.100.11
10 | IPv6 : 2a01:4f8:120:9365::2
11 | ```
12 |
13 |
14 | # New IPs to whitelist:
15 |
16 | ```
17 | IP1: IPV4=>65.108.103.45
18 | IPV6=> 2a01:4f9:6b:1a8d::2
19 | IP2: IPV4=>142.132.144.101
20 | IPV6=> 2a01:4f8:261:164e::2
21 | ```
22 |
23 | # Cloudflare Rule
24 |
25 | ```
26 | (ip.src eq 85.10.199.216) or (ip.src eq 2a01:4f8:a0:53ad::2) or (ip.src eq 78.46.100.11) or (ip.src eq 2a01:4f8:120:9365::2) or (ip.src eq 65.108.103.45) or (ip.src eq 2a01:4f9:6b:1a8d::2) or (ip.src eq 142.132.144.101) or (ip.src eq 2a01:4f8:261:164e::2)
27 | ```
28 |
--------------------------------------------------------------------------------
/docs/substrate-node-solution.md:
--------------------------------------------------------------------------------
1 | # Welcome to Substrate Solution by Codono.com!
2 |
3 | Substrate repository contains two sub-folders. Block listener and Wallet Engine.
4 |
5 | Block Listener is responsible for checking new blocks on the respective blockchain and adding it to the mongoDB database.
6 |
7 | Wallet Engine is responsible for making transactions.
8 |
9 | # Local Setup
10 |
11 | Simply clone the repository using **git clone** or download the code as zip.
12 |
13 | There is an **env.example** file in root directory. Copy and rename it to **.env**. And change the values accordingly.
14 |
15 | Perform **npm install** in both sub-folders.
16 |
17 | If you are facing some errors while executing **npm install**, try changing npm version to the **16.10.0** using **nvm**.
18 |
19 | ### Starting Block Listener & MongoDB & Wallet Engine
20 |
21 | First make sure you have **yarn** and **nvm** installed on your system.
22 |
23 | Run **pm2 start** in root directory.
24 |
25 | If you are facing errors with any process. You can start them manually.
26 |
27 | Manual commands are for:
28 | ## First run for NPM installation , and Building package
29 | Must run and it should build following directories ./wallet-engine/node_modules ,./block-listener/node_modules ,./block-listener/build
30 | **npm run start-init**
31 |
32 | ### Starting MongoDB Manually
33 |
34 | **npm run start-mongodb**
35 |
36 | ### Starting Block Listener Manually
37 |
38 | **npm run start-block**
39 |
40 | ### Starting Wallet Engine
41 |
42 | **npm run start-wallet**
43 |
44 | Note: If you still facing error while starting Wallet engine. Try using Node version **16.10.0** using **nvm** and re-execute the above command.
45 |
46 | # Encrypting and Decrypting values
47 |
48 | You will have to encrypt values such as **xprv**. In the root directory, execute **npm run encrypt example_value**.
49 |
50 | Note: Replace **example_value** with your real value.
51 |
52 | For example: **npm run encrypt E502xi0Q87HE502xi0Q87HE502xi0Q87H**
53 |
54 | # Transactions are getting failed
55 |
56 | If transfers are getting failed then make sure the account, to which payment is being made to, must have at least **0.1 WND** to be **eligible** to receive payments.
57 |
58 | # Ports
59 |
60 | **MongoDB service** uses port **22546** & **Wallet Engine** uses port **22547**.
61 |
--------------------------------------------------------------------------------
/docs/things-to-avoid.md:
--------------------------------------------------------------------------------
1 | When setting up and running a crypto exchange using the Codono source code, it's essential to consider specific security measures to ensure the safety of users' funds and data. Here are the top 10 things to avoid for a crypto exchange built on the Codono platform:
2 |
3 | 1. **Avoid Using Weak or Default Passwords**: Ensure that all user passwords, admin credentials, and API keys are strong and not set to default values.
4 |
5 | 2. **Avoid Storing Private Keys on the Server**: Private keys for users' crypto wallets should never be stored on the server. Use hardware wallets or other secure methods for key management.
6 |
7 | 3. **Avoid Using Insecure APIs**: Carefully vet and secure all APIs used for external integrations, such as price feeds and payment gateways, to prevent potential vulnerabilities.
8 |
9 | 4. **Avoid Ignoring Cold Storage**: Implement a cold storage solution for storing a significant portion of users' crypto assets offline to prevent hacking attempts.
10 |
11 | 5. **Avoid Overlooking KYC and AML Compliance**: Implement robust Know Your Customer (KYC) and Anti-Money Laundering (AML) procedures to prevent fraud and illegal activities on the exchange.
12 |
13 | 6. **Avoid Insufficient Security Audits**: Regularly conduct security audits, penetration tests, and code reviews to identify and fix vulnerabilities in the exchange.
14 |
15 | 7. **Avoid Neglecting Server Security**: Secure the server environment with firewalls, intrusion detection systems, and regular security updates to prevent unauthorized access.
16 |
17 | 8. **Avoid Allowing Weak or No Two-Factor Authentication**: Enable two-factor authentication (2FA) for all user accounts to add an extra layer of security.
18 |
19 | 9. **Avoid Exposing Sensitive Data**: Ensure that sensitive data, such as transaction details and user balances, is not exposed to unauthorized users.
20 |
21 | 10. **Avoid Delaying Security Updates**: Promptly apply security patches and updates to the Codono source code and all related libraries to address any known vulnerabilities.
22 |
23 | By avoiding these pitfalls and taking a proactive approach to security, you can enhance the safety of your crypto exchange and build trust among users, ultimately contributing to the success of your platform.
24 |
--------------------------------------------------------------------------------
/docs/trc20-setup.md:
--------------------------------------------------------------------------------
1 | #Tron Code is In Built in [Codono Ultra](https://codono.com/product/ultra).
2 |
3 | It does not require any additional Coin node .
4 |
5 | Setup instructions for [cryptocurrency exchange script](https://codono.com/).
6 |
7 | Generating Main Tron account where all user deposits will Move to.
8 |
9 | You can generate Main account externally or by running following url
10 | ```
11 | yoursite.com/Tron/makeOneAccount/securecode/cronkey
12 | ```
13 | It would give you following type of information
14 |
15 | This informationation on refresh will vanish , it does not get saved anywhere.If you plan to use this account as Main account ,Save this information some where safe, print it and keep safe
16 | ```
17 | Array
18 | (
19 | [private_key] => xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
20 | [public_key] => 0442281c4a2fb2e58f57bbb42f8d2b0ac00252aee341fdae45f05748d4fc2e2e83e8bb8e872da8157b7258cd09aa0c35d404d568bce1430398ef7e88eb6e6674b8
21 | [address_hex] => 41f8cbbde4e0433333f2ea1bbedf0647447a5fa9f8
22 | [address_base58] => TYeieronBA8hbbUpW7fekUqjdUQdmR78oX
23 | )
24 | ```
25 | This is just a tool to generate unique Tron address along with its private keys, You can use this account or generate somewhere else and save it in tron config in admin area, This informationation on refresh will vanish , it does not get saved anywhere.
26 |
27 | Now goto -> Admin-> Coin-> Find trx or Add new [If not exists]
28 | ```
29 | symbol:trx
30 | parent symbol:trx
31 | frontend title:Tron [Trc20]
32 | Coin Type:Tron Network [Trc20]
33 | Token of :none
34 | Wallet Server IP : [Keep Empty]
35 | Wallet Server Port : [Keep Empty]
36 | Keep Empty: [Keep Empty]
37 | Server Username:[Keep Empty]
38 | Wallet Server Password: [private_key generated from above step
39 | Main Account: [address_base58 value from above step]
40 | Block Explorer:https://tronscan.org/#/transaction/
41 | Decimal:6
42 | ```
43 |
44 | Adding TRC20 [Example of USDT https://tronscan.io/#/token20/TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t]
45 | ```
46 | symbol:tusdt [see here its unique key for symbol]
47 | parent symbol:usdt [this is main coin symbol where it falls into]
48 | frontend title:USDT [Trc20]
49 | Coin Type:Tron Network [Trc20]
50 | Token of :trx
51 | Wallet Server IP : [Keep Empty]
52 | Wallet Server Port : [Keep Empty]
53 | Keep Empty: [Keep Empty]
54 | Server Username:TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t [contract address ]
55 | Wallet Server Password: [private_key generated from above step
56 | Main Account: [address_base58 value from above step]
57 | Block Explorer:https://tronscan.org/#/transaction/
58 | Decimal:6
59 | ```
60 |
61 |
62 | Deposit cron: Run every min
63 | ```
64 | https://yoursite.com/Tron/cronDeposits/securecode/cronkey
65 | ```
66 |
67 | Moving Token to main account [Example USDT]
68 | ```
69 | https://yoursite.com/Tron/moveTokenToMain/securecode/cronkey/token/usdt
70 | ```
71 |
72 | Moving Tron to main account [Example USDT]
73 | ```
74 | https://yoursite.com/Tron/moveTronToMain/securecode/cronkey/
75 | ```
76 |
77 |
78 |
79 | Saving ABI file [ For each token]
80 |
81 | Goto Token code page on tronscan
82 |
83 | Example
84 | ```
85 | https://tronscan.io/#/token20/TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t/code
86 | ```
87 | Copy Contract ABI
88 |
89 |
90 | and save in following location -> Public/ABI
91 |
92 | File name example [Capital name]
93 |
94 | USDT.abi
95 | UNI.abi
96 |
--------------------------------------------------------------------------------
/docs/tron_setup.md:
--------------------------------------------------------------------------------
1 | ## Tron Code in Codono Ultra
2 |
3 | Tron Code is built into Codono Ultra and does not require any additional Coin node.
4 |
5 | ### Setup Instructions
6 |
7 | #### Generating Main Tron Account
8 |
9 | You can generate the Main Tron account externally or by running the following URL:
10 |
11 | ```
12 | yoursite.com/Tron/makeOneAccount/securecode/cronkey
13 |
14 | ```
15 |
16 | It will provide you with the following information. Save this information securely if you plan to use this account as the Main account:
17 |
18 | ```
19 | Array
20 | (
21 | [private_key] => 6c25cc8ba4da6f75************************
22 | [public_key] => 0442281c4a2fb2e58f57bbb42f8d2b0ac00252aee341fdae45f05748d4fc2e2e83e8bb8e872da8157b7258cd09aa0c35d404d568bce1430398ef7e88eb6e6674b8
23 | [address_hex] => 41f8cbbde4e0433333f2ea1bbedf0647447a5fa9f8
24 | [address_base58] => TYeieronBA8hbbUpW7fekUqjdUQdmR78oX
25 | )
26 | ```
27 |
28 |
29 | Please note that this information will vanish on refresh, as it is not saved anywhere. If you plan to use this account as the Main account, save this information somewhere safe, print it, and keep it secure.
30 |
31 | Now go to `Admin -> Coin -> Find trx` or add a new one if it doesn't exist.
32 |
33 | - Symbol: trx
34 | - Parent Symbol: trx
35 | - Frontend Title: Tron [Trc20]
36 | - Coin Type: Tron Network [Trc20]
37 | - Token of: none
38 | - Wallet Server IP: [Keep Empty]
39 | - Wallet Server Port: [Keep Empty]
40 | - Server Username: [Keep Empty]
41 | - Wallet Server Password: [private_key generated from above step]
42 | - Main Account: [address_base58 value from above step]
43 | - Block Explorer: [Tronscan Transaction Explorer](https://tronscan.org/#/transaction/)
44 | - Decimal: 6
45 |
46 | #### Adding TRC20 Tokens
47 |
48 | For example, let's add USDT: [Tronscan USDT Token](https://tronscan.io/#/token20/TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t)
49 |
50 | - Symbol: tusdt [unique key for symbol]
51 | - Parent Symbol: usdt [main coin symbol]
52 | - Frontend Title: USDT [Trc20]
53 | - Coin Type: Tron Network [Trc20]
54 | - Token of: trx
55 | - Wallet Server IP: [Keep Empty]
56 | - Wallet Server Port: [Keep Empty]
57 | - Server Username: TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t [contract address]
58 | - Wallet Server Password: [private_key generated from above step]
59 | - Main Account: [address_base58 value from above step]
60 | - Block Explorer: [Tronscan Transaction Explorer](https://tronscan.org/#/transaction/)
61 | - Decimal: 6
62 |
63 | #### Deposit Cron: Run Every Minute
64 |
65 | ```
66 | yoursite.com/Tron/cronDeposits/securecode/cronkey
67 |
68 | ```
69 |
70 | #### Moving Token to Main Account (Example: USDT)
71 |
72 | ```
73 | yoursite.com/Tron/moveTokenToMain/securecode/cronkey/token/usdt
74 |
75 | ```
76 |
77 |
78 | #### Moving Tron to Main Account (Example: USDT)
79 |
80 | ```
81 | yoursite.com/Tron/moveTronToMain/securecode/cronkey/
82 |
83 | ```
84 |
85 |
86 |
87 | #### Saving ABI File (For Each Token)
88 |
89 | 1. Go to the token code page on Tronscan, e.g. [Tronscan Token Code](https://tronscan.io/#/token20/TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t/code)
90 | 2. Copy the Contract ABI
91 | 3. Save it in the following location: `Public/ABI`
92 |
93 | Example file names (capitalized):
94 |
95 | - USDT.abi
96 | - UNI.abi
97 |
98 |
--------------------------------------------------------------------------------
/docs/trx-trc20-withdrawal.md:
--------------------------------------------------------------------------------
1 | # TRX and TRC20 Tokens Withdrawal Processing Guide for Codono
2 |
3 | This guide outlines the steps required to process withdrawals using TRX and its TRC20 tokens in the Codono cryptocurrency exchange platform. Follow these steps to ensure a smooth withdrawal process.
4 |
5 | ## Step 1: Coin Configuration Check
6 |
7 | - **Configuration Check**: Navigate to **Admin/Config/coin** and ensure that TRX and its TRC20 tokens are configured correctly with the main address set up properly.
8 |
9 | ## Step 2: Verify Main Address Balance
10 |
11 | 1. **Note Main Address**: Record or copy the main address for TRX or the TRC20 token you are processing.
12 | 2. **Explorer Check**: Use a blockchain explorer like [Tronscan](https://tronscan.org) to verify the main address has sufficient balance for the withdrawal.
13 | 3. **Gas Funds**: Confirm the main address has enough TRX to cover gas fees for the transaction.
14 |
15 | ## Step 3: Balance Top-Up (If Required)
16 |
17 | If the main address does not have enough balance, use the following URL to transfer TRX or TRC20 tokens to the main address:
18 |
19 | **Move TRX or TRC20 Tokens to Main Address**
20 |
21 | ```
22 | http://exchange.local/Tron/MoveAsset/securecode/cronkey/
23 |
24 | ```
25 |
26 | - **URL Replacement**: Replace `exchange.local` with your exchange's actual URL.
27 | - **Process Execution**: Follow the instructions provided on the screen to complete the transfer of TRX or TRC20 tokens to the main address.
28 |
29 | ## Step 4: Reconfirmation
30 |
31 | - **Block Explorer Check**: After topping up the main address, use [Tronscan](https://tronscan.org) to recheck the main address balance to confirm the updated balance accurately reflects the transferred amount.
32 |
33 | ## Step 5: Processing Withdrawals
34 |
35 | 1. **Crypto Withdrawal Page**: Go to the Crypto withdrawal page in the Codono admin panel.
36 | 2. **Initiate Payment**: Click the `pay now` button for the withdrawal request you intend to process.
37 | 3. **Transaction ID**: Allow up to few seconds for the transaction ID to appear in the admin panel, which is crucial for tracking and confirmation.
38 |
39 | ## Notes
40 | - **Caution**: Never click 'Pay now' twice. Always verify on [Tronscan](https://tronscan.org) whether the funds were sent. Allow a cooling-off period of 2 minutes before making a second attempt.
41 | - Ensure the main address for TRX and any TRC20 tokens are correctly set up and funded to avoid withdrawal delays.
42 | - Regularly check gas prices on the TRON network to ensure sufficient TRX is allocated for transaction fees, especially during periods of network congestion.
43 |
--------------------------------------------------------------------------------
/docs/xrp-setup-crypto-exchange.md:
--------------------------------------------------------------------------------
1 | ---
2 |
3 | ## Setting Up XRP with Codono
4 |
5 | XRP integration with Codono doesn't require any additional Coin node.
6 |
7 | ### Setup Instructions
8 |
9 | 1. **Generating XRP Account**
10 |
11 | Generate an XRP account where all user deposits will be automatically deposited using their `dest_tag`. You can generate the main account externally or by visiting [bithomp.com/paperwallet](https://bithomp.com/paperwallet/). Copy the secret and address and save them in a secure location.
12 |
13 | > **Note**: There are various offline and safe methods to generate Ripple addresses and keys. We recommend using them.
14 |
15 | 2. **Configure Coin in Admin Area**
16 |
17 | Navigate to `Admin -> Coin` and either find XRP or add a new one if it doesn't exist.
18 |
19 | - Symbol: `xrp`
20 | - Parent Symbol: `xrp` (or empty)
21 | - Frontend Title: Ripple [XRP Network]
22 | - Coin Type: XRP Chain
23 | - Token of: none
24 | - Wallet Server IP: Keep Empty
25 | - Wallet Server Port: Keep Empty
26 | - Server Username: Keep Empty
27 | - Wallet Server Password: Secret generated from above step
28 | - Main Account: Address value from above step
29 | - Block Explorer: [xrpcharts.ripple.com/#/transactions/](https://xrpcharts.ripple.com/#/transactions/)
30 | - Decimal: 6
31 |
32 | 3. **Deposit Cron**
33 |
34 | Set up a cron job to run every minute for deposit detection.
35 |
36 | ```
37 | Yoursite/Coin/xrpdeposit/securecode/cronkey
38 | ```
39 |
40 | ---
41 |
--------------------------------------------------------------------------------
/features/leaderboard.md:
--------------------------------------------------------------------------------
1 | ## Leaderboard Feature
2 |
3 | The Leaderboard is a dynamic feature designed for Codono to enhance user engagement and foster a competitive spirit among the users of our platform. It prominently displays the rankings of top performers in two major categories:
4 |
5 |
6 | ### Top Referrers
7 | - **Overview**: This section of the Leaderboard showcases the users who have successfully referred the highest number of new users to the platform.
8 | - **Benefits**: Encourages existing users to participate actively in our referral program by providing visibility and recognition for their efforts. This can lead to increased user acquisition and growth.
9 |
10 | ### Top Earners
11 | - **Overview**: This segment highlights the users who have earned the most in terms of trading profits, rewards, and other income sources available on the platform.
12 | - **Benefits**: Motivates users to actively trade and participate in platform activities by showcasing the financial successes of the top earners.
13 |
14 | ### Key Features
15 | - **Real-Time Updates**: The Leaderboard is updated in real-time to reflect the most current standings, ensuring that users always have up-to-date information.
16 | - **User-Friendly Interface**: Designed with user experience in mind, the Leaderboard is easy to navigate and visually appealing, making it accessible to all users.
17 | - **Transparency**: Provides transparency in user rankings and achievements, helping to build trust and integrity within the community.
18 |
19 | ### Goals
20 | - **Enhance User Engagement**: By recognizing and rewarding top performers, we aim to boost user activity and engagement on the platform.
21 | - **Promote Healthy Competition**: The Leaderboard encourages a competitive yet fair environment where users are motivated to excel.
22 |
23 | This feature is part of our ongoing commitment to providing an engaging and rewarding experience for all our users.
24 |
--------------------------------------------------------------------------------
/install_check.php:
--------------------------------------------------------------------------------
1 | =');
15 | const DB_HOST="127.0.0.1";
16 | const DB_USER="root";
17 | const DB_PWD="";
18 | const DB_NAME="codono";
19 | const PHP_PATH="php";
20 | $mysqli = @new mysqli(DB_HOST, DB_USER, DB_PWD, DB_NAME);
21 | $os_found=PHP_OS;
22 | if($os_found=='WINNT'){
23 | $found_php_path=str_replace('ext/', 'php.exe', ini_get('extension_dir'));
24 | }else if ($os_found=='linux'){
25 | $found_php_path = exec("which php");
26 | }else{
27 | $found_php_path= "Please google php path for $os_found";
28 | }
29 | /* check connection */
30 | if (!$mysqli->connect_errno) {
31 | $mysqli_version=mysqli_get_server_info($mysqli);
32 | }else{
33 | $mysqli_version="Connection Failed, Please check pure_config.php";
34 | }
35 |
36 | $phppath_result=strpos(exec(PHP_PATH." -v"),'Copyright');
37 | if ($phppath_result !== false) {
38 | $phppath_result =true;
39 | }
40 |
41 | $phpPath = version_compare($phpVersion, '7.3.0', '>=');
42 |
43 | // Directory permissions
44 | $bootstrapDirWriteable = is_writable('Upload');
45 | $storageDirWriteable = is_writeable('Runtime');
46 | $envWriteable = is_writeable('pure_config.php');
47 | // Extension
48 | $redisExtension =extension_loaded('redis');
49 | $opensslExtension = extension_loaded('openssl');
50 | $pdoMysqlExtension = extension_loaded('pdo_mysql');
51 | $mbstringExtension = extension_loaded('mbstring');
52 | $curlExtension = extension_loaded('curl');
53 |
54 | $tokenizerExtension = extension_loaded('tokenizer');
55 | $xmlExtension = extension_loaded('xml');
56 | $fileinfoExtension = extension_loaded('fileinfo');
57 | $ctypeExtension = extension_loaded('ctype');
58 | $jsonExtension = extension_loaded('json');
59 | $bcmathExtension = extension_loaded('bcmath');
60 | $zipExtension = extension_loaded('zip');
61 | $gdExtension = extension_loaded('gd');
62 | $allow_url_fopen = ini_get('allow_url_fopen');
63 | $iconvExtension = extension_loaded('iconv');
64 | $libsodium=extension_loaded('iconv');
65 | $exec=function_exists('exec');
66 | $stream_socket_server=function_exists('stream_socket_server');
67 | $gmpExtension = extension_loaded('gmp');
68 | //$mcypt=function_exists('mcrypt_create_iv');
69 | $extensionRows = [
70 | 'exec'=>$exec,
71 | 'openssl' => $opensslExtension,
72 | 'redis' => $redisExtension,
73 | 'pdo_mysql' => $pdoMysqlExtension,
74 | 'mbstring' => $mbstringExtension,
75 | 'curl' => $curlExtension,
76 | 'tokenizer' => $tokenizerExtension,
77 | 'xml' => $xmlExtension,
78 | 'fileinfo' => $fileinfoExtension,
79 | 'ctype' => $ctypeExtension,
80 | 'json' => $jsonExtension,
81 | 'bcmath' => $bcmathExtension,
82 | 'zip' => $zipExtension,
83 | 'GD' => $gdExtension,
84 | 'allow_url_fopen'=>$allow_url_fopen,
85 | 'iconv'=>$iconvExtension,
86 | 'libsodium'=>$libsodium,
87 | 'stream_socket_server'=>$stream_socket_server,
88 | // 'mcrypt'=>$mcrypt,
89 | 'gmp [Required For Tron Network]' => $gmpExtension
90 | ];
91 | $isCross = $phpVersionCould && $storageDirWriteable && $bootstrapDirWriteable && $envWriteable;
92 | if ($isCross) {
93 | foreach ($extensionRows as $extensionRow) {
94 | $isCross = $isCross && $extensionRow;
95 | }
96 | }
97 | ?>
98 |
99 |
100 |
101 |
102 |
104 |
105 |
106 | Codono Environment Check
107 |
108 |
109 |
110 |
111 |
112 |
Codono Environment Check
113 |
114 |
115 |
116 |
PHP version detection(Required version:=7.4)
117 |
118 |
119 |
120 |
121 |
122 |
123 |
PHP Path in Pure Config [Found: ]
124 |
125 |
126 |
127 |
128 |
129 |
130 |
MySQL connection
131 |
132 |
133 |
134 | Recommended MariaDB
135 |
136 |
137 |
Directory permission writable
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
PHP extension detection
151 | $row) { ?>
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 | You can continue installation
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
--------------------------------------------------------------------------------
/manage/README.md:
--------------------------------------------------------------------------------
1 | # Cryptocurrency Platform Management
2 |
3 | This repository contains the documentation for various modules of a cryptocurrency management platform. Each document provides detailed instructions on configuring and managing different features within the platform.
4 |
5 | ## Modules Documentation
6 |
7 | - [**Airdrop.md**](airdrop.md)
8 | Learn how to set up and distribute cryptocurrency airdrops to your platform's users, incentivizing participation and engagement.
9 |
10 | - [**Coins.md**](coins.md)
11 | Comprehensive guide on how to add and manage different cryptocurrencies on your exchange platform.
12 |
13 | - [**Competition.md**](competition.md)
14 | Detailed instructions on creating and managing trading competitions that drive user activity and increase trading volume.
15 |
16 | - [**Faucet.md**](faucet.md)
17 | Configuration steps for a crypto faucet, which dispenses small amounts of cryptocurrency, encouraging users to interact with the platform regularly.
18 |
19 | - [**Launchpad.md**](launchpad.md)
20 | Guidelines for setting up a launchpad for new token offerings, allowing users to invest in initial coin offerings (ICO) and token sales.
21 |
22 | - [**Market.md**](market.md)
23 | Instructions for managing market pairs, providing insights into setting up trading pairs and managing market dynamics.
24 |
25 | - [**Mining.md**](mining.md)
26 | A detailed manual on setting up mining operations, enabling users to mine cryptocurrency directly through the platform.
27 |
28 | - [**Staking.md**](staking.md)
29 | Steps to configure staking options for users, allowing them to earn rewards by holding and supporting the network of a particular cryptocurrency.
30 |
31 | Each document is structured to provide clarity and ease of use, ensuring smooth setup and management of your cryptocurrency platform's features.
32 |
--------------------------------------------------------------------------------
/manage/airdrop.md:
--------------------------------------------------------------------------------
1 | ## Airdrop Manager
2 |
3 | ### Overview
4 | This form is for managing and creating new airdrop events where users holding a specific currency receive rewards.
5 |
6 | ### Form Fields
7 |
8 | - **AirDrop Title**:
9 | - Type: `Text Input`
10 | - Description: The name of the airdrop event.
11 | - Placeholder: `Any language`
12 |
13 | - **Holding currency**:
14 | - Type: `Dropdown Selection`
15 | - Description: The currency users must hold to be eligible for the airdrop.
16 | - Options: `[ARBIUSDT, USDT, BTC, etc.]`
17 |
18 | - **Reward currency**:
19 | - Type: `Dropdown Selection`
20 | - Description: The currency that will be distributed as a reward.
21 | - Options: `[DOGE, ADA, ETH, etc.]`
22 |
23 | - **Quantity**:
24 | - Type: `Text Input`
25 | - Description: The total amount of the reward currency to be distributed.
26 | - Placeholder: `Total Airdrop of reward currency`
27 |
28 | - **Airdrop Introduction**:
29 | - Type: `Textarea`
30 | - Description: A brief description or instructions about the airdrop.
31 | - Placeholder: `100k Doge to be distributed...`
32 |
33 | - **Sort**:
34 | - Type: `Text Input`
35 | - Description: The order in which the airdrop appears in lists.
36 | - Placeholder: `Integer`
37 |
38 | - **Promo**:
39 | - Type: `Image Upload`
40 | - Description: Image representing the airdrop promotion.
41 |
42 | - **Featured**:
43 | - Type: `Dropdown Selection`
44 | - Description: Indicates if the airdrop is featured prominently.
45 | - Options: `[No, Yes]`
46 |
47 | - **Active**:
48 | - Type: `Dropdown Selection`
49 | - Description: Indicates if the airdrop is currently active.
50 | - Options: `[No, Yes]`
51 |
52 | - **add time**:
53 | - Type: `Datetime Input`
54 | - Description: The time when the airdrop was added.
55 | - Placeholder: `Default: Current Time`
56 |
57 | - **Edit time**:
58 | - Type: `Datetime Input`
59 | - Description: The time when the airdrop was last edited.
60 | - Placeholder: `Default: Current Time`
61 |
62 | ### Actions
63 | - **Submit**: Saves the airdrop configuration.
64 | - **Back**: Returns to the previous page without saving changes.
65 |
66 | Please note to provide correct values for all the dropdowns and maintain the system totals to avoid discrepancies.
67 |
--------------------------------------------------------------------------------
/manage/coins.md:
--------------------------------------------------------------------------------
1 | # Adding a New Coin to Codono Exchange
2 |
3 | ## Overview
4 |
5 | This guide explains how to add a new cryptocurrency to your Codono exchange platform. The "Add Coin" form allows for the integration of various coin types, including native cryptocurrencies and tokens from different blockchain networks such as TRC20, and Blockgum EVM Wallets[ERC20, BEP20, FTM20, EVM20 etc].
6 |
7 | Refer to our specific tutorials for [TRC20](https://github.com/CodonoTeam/cryptocurrency-exchange-script/blob/main/docs/trc20-setup.md), and [Blockgum setup](https://github.com/CodonoTeam/cryptocurrency-exchange-script/blob/main/docs/blockgum-integration.md) for detailed steps on configuring each coin type.
8 |
9 | ## Form Fields and Instructions
10 |
11 | ### Basic Information
12 |
13 | - **Unique Symbol**: Enter the abbreviated symbol of the coin. Only use 3-6 lowercase alphabetical characters.
14 | - **Parent Symbol**: For tokens belonging to a parent chain, enter the symbol of the primary cryptocurrency (e.g., `bnb` for BEP20 tokens).
15 | - **Frontend Title**: The name displayed on the frontend (e.g., Bitcoin Cash).
16 |
17 | ### Coin Properties
18 |
19 | - **Coin Type**: Select the category that best describes your coin. This could be an ICO coin, a fiat coin, or associated with a particular blockchain network.
20 | - **Token Type**: Specify if your asset is a token and its standard, such as ERC20 or BEP20.
21 |
22 | ### Network Settings
23 |
24 | - **Public RPC URL**: Input the public RPC URL if required by the coin type for blockchain interactions.
25 |
26 | ### Wallet Configuration
27 |
28 | (These fields are typically not required for ICO coins)
29 |
30 | - **Wallet Server IP/Port/Username/Password**: Provide the connection details to the wallet server if applicable.
31 | - **Main Address**: For offline coins or main wallets handling multiple user transactions.
32 |
33 | ### Trading Parameters
34 |
35 | - **Block Explorer**: URL to a block explorer supporting the coin for transaction verification.
36 | - **Decimal Places**: Number of decimal places that the coin can be divided into.
37 |
38 | ### Fee Structure
39 |
40 | - **List Ratio**: The percentage fee applied to coin listings.
41 | - **Deposits**: Toggle to enable or disable deposits.
42 | - **Network Confirmations**: The number of confirmations needed for network validation.
43 |
44 | ### Withdrawal Controls
45 |
46 | - **Fees Coin**: The currency used for withdrawal fees.
47 | - **Withdrawal Fee % / Flat Fee**: Define the percentage or flat rate for withdrawal fees.
48 | - **Fee Userid**: User ID that receives the fees.
49 | - **Min/Max Withdrawal Amount**: Set thresholds for withdrawal amounts.
50 | - **Withdrawal Status**: Enable or disable withdrawals.
51 |
52 | ### Detailed Information
53 |
54 | - **Details**: Additional information about the coin.
55 | - **Download Wallet**: Where users can download the coin's wallet.
56 | - **Source Download**: Location of the coin's source code.
57 | - **Official Link / Forums**: Official resources for user reference.
58 | - **Developers**: Names or teams of developers.
59 | - **Core Algorithm**: The coin's underlying algorithm.
60 |
61 | ### Technical Specifications
62 |
63 | - **Release Date**: Launch date of the coin.
64 | - **Proof Method**: Consensus mechanism used.
65 | - **Total Issued**: The total number of coins issued.
66 | - **Stock**: How much is currently in circulation.
67 | - **Difficulty Adjustment**: Details on how the coin adjusts its mining difficulty.
68 | - **Block Award**: Block mining reward.
69 | - **Key Features**: Notable functionalities.
70 | - **Shortcomings**: Any current limitations or issues.
71 |
72 | After filling out all the necessary fields, click "Submit" to add the coin to the exchange.
73 | For step-by-step instructions on configuring each type of coin, refer to the respective documentation within the `docs` directory of this repository.
74 |
75 |
--------------------------------------------------------------------------------
/manage/competition.md:
--------------------------------------------------------------------------------
1 | ## Voting Competition Form
2 |
3 | ### Overview
4 | This form is used to create a voting competition between two coins. The community can vote for their preferred coin. The winner at the end of the voting period gets listed on the exchange.
5 |
6 | ### Form Fields
7 |
8 | - **Coin1 name**:
9 | - Type: `Text Input`
10 | - Description: The symbol for the first coin competing in the voting (e.g., BTC).
11 | - Placeholder: `Symbol [e.g., BTC, LTC, XRP]`
12 |
13 | - **Coin2 name**:
14 | - Type: `Text Input`
15 | - Description: The symbol for the second coin competing in the voting (e.g., ETH).
16 | - Placeholder: `Symbol [e.g., ETH, BCH, ADA]`
17 |
18 | - **Virtual Support Votes**:
19 | - Type: `Integer Input`
20 | - Description: Initial number of votes in support of Coin1.
21 |
22 | - **Virtual Against Votes**:
23 | - Type: `Integer Input`
24 | - Description: Initial number of votes against Coin1, potentially in support of Coin2.
25 |
26 | - **Coin 1 Image**:
27 | - Type: `Image Upload`
28 | - Description: Upload an image representing Coin1.
29 |
30 | - **Coin 2 Image**:
31 | - Type: `Image Upload`
32 | - Description: Upload an image representing Coin2.
33 |
34 | - **Competition currency**:
35 | - Type: `Dropdown Selection`
36 | - Options: `[ARBIUSDT, USDT, BTC, etc.]`
37 | - Description: The currency used for deducting votes.
38 |
39 | - **Featured**:
40 | - Type: `Checkbox`
41 | - Description: Check if the competition should be featured on the homepage.
42 |
43 | - **Start time**:
44 | - Type: `Datetime Input`
45 | - Description: The start date and time for the competition.
46 |
47 | - **End time**:
48 | - Type: `Datetime Input`
49 | - Description: The end date and time for the competition when votes will be counted and the winner decided.
50 |
51 | - **Price**:
52 | - Type: `Integer Input`
53 | - Description: The price per vote, if applicable.
54 |
55 | - **Active**:
56 | - Type: `Checkbox`
57 | - Description: Check if the competition is currently active.
58 |
59 | ### Actions
60 | - **Submit**: Saves the competition configuration.
61 | - **Back**: Returns to the previous page without saving changes.
62 |
63 | Ensure to provide detailed instructions for image uploads and other input validations to maintain data integrity.
64 |
--------------------------------------------------------------------------------
/manage/faucet.md:
--------------------------------------------------------------------------------
1 | ## Faucet Management Manual
2 |
3 | ### Description
4 |
5 | This interface is designed to manage a cryptocurrency faucet system. A faucet is a feature on a platform that allows users to receive small amounts of cryptocurrency at certain time intervals. This form is used to create or edit the conditions and parameters under which users can claim from the faucet.
6 |
7 | ### Fields and Usage
8 |
9 | - `Faucet name`:
10 | The unique identifier for the faucet. For example, "Faucet every 10th Hour".
11 |
12 | - `Faucet currency`:
13 | The cryptocurrency that users will receive from the faucet. Select from the dropdown menu.
14 |
15 | - `Sort`:
16 | Determines the display order of the faucet. Faucets with lower sort values appear first.
17 |
18 | - `Total Times`:
19 | The total number of times the faucet can be claimed.
20 |
21 | - `Consumed`:
22 | Shows how many times the faucet has already been claimed.
23 |
24 | - `Faucet price`:
25 | The amount of cryptocurrency each user will receive per claim.
26 |
27 | - `Limit Per User`:
28 | The maximum number of claims a single user can make on this faucet.
29 |
30 | - `Start Date`:
31 | The beginning date and time from which the faucet is available to users.
32 |
33 | - `End Date`:
34 | The date and time when the faucet will no longer be available.
35 |
36 | - `Faucet period`:
37 | The interval time in hours that must pass before the faucet can be claimed again by the same user.
38 |
39 | - `Status`:
40 | Indicates whether the faucet is currently enabled or disabled.
41 |
42 | ### Form Submission
43 |
44 | Ensure all fields are filled out according to the desired specifications for the faucet. Once completed, click the `Submit` button to save the changes or `Back` to return to the previous page without saving.
45 |
--------------------------------------------------------------------------------
/manage/launchpad.md:
--------------------------------------------------------------------------------
1 | # Add/Edit ICO Details
2 |
3 | Use this form to configure the settings for an ICO/IEO/Lab/Launchpad on the Codono platform.
4 |
5 | ## Configuration Fields
6 |
7 | ### Basic ICO Information
8 |
9 | - **ICO Name**: The name given to the ICO event (e.g., "Electronium Launch").
10 | - **ICO Currency**: Select the currency of the ICO from the dropdown menu (e.g., "Electronium").
11 | - **Price Currency**: The currency in which the ICO price is denominated (e.g., "USD").
12 | - **ICO Price**: Set the price per unit for the ICO (e.g., "0.00100000 USD per ETN").
13 |
14 | ### Payment Options
15 |
16 | - **Payment Coins**: Choose which cryptocurrencies can be used to purchase in the ICO by checking the corresponding boxes.
17 |
18 | ### Visual Elements
19 |
20 | - **ICO Image**: Upload an image to visually represent the ICO. Recommended size is 837x628 pixels.
21 |
22 | ### Listing Preferences
23 |
24 | - **Show on Homepage**: Choose whether to feature the ICO on the homepage.
25 | - **Staff Pick**: Highlight the ICO as a staff pick to increase visibility.
26 | - **Sort**: Position the ICO in lists; a higher value places it more forward in the list.
27 |
28 | ### Social and Informational Links
29 |
30 | - **Video Link**: Provide a link to a video related to the ICO (e.g., YouTube).
31 | - **ICOBench Name**: The ICO's name on ICOBench for reference.
32 | - **Social Media**: URLs for the ICO's Facebook, Twitter, and Telegram accounts.
33 |
34 | ### Ownership and Financials
35 |
36 | - **Token Owner**: The user ID of the ICO owner.
37 | - **Site Commission**: The commission percentage the site will take from the ICO.
38 | - **Total Supply**: The total number of tokens available in the ICO.
39 | - **Amount Subscribed**: The current number of tokens that have been subscribed.
40 | - **ICO Limit**: The maximum number of tokens one person can buy.
41 |
42 | ### Timing and Restrictions
43 |
44 | - **Start Date**: The starting date and time for the ICO.
45 | - **ICO Period**: The duration of the ICO in days.
46 | - **Unfreeze Time**: Time until the purchased tokens are unfrozen, in hours.
47 | - **Minimum Single**: The minimum amount that can be purchased in a single transaction.
48 | - **Max Buy Largest**: The maximum amount a single person can purchase.
49 |
50 | ### Bonuses
51 |
52 | - **Bonus Currency**: The currency in which bonuses are paid out.
53 | - **Bonus 1st Referrer**: Bonus percentage for the first-tier referrer.
54 | - **Bonuses 2nd Tier**: Bonus percentage for the second-tier.
55 | - **Bonus 3rd Tier**: Bonus percentage for the third-tier.
56 |
57 | ### Additional Information
58 |
59 | - **Instructions**: Detailed instructions or information regarding the ICO.
60 | - **Status**: Toggle between enabling or disabling the ICO.
61 |
62 | Ensure all fields are completed accurately before submitting. Once ready, click the "Submit" button to update the ICO details, or "Back" to cancel.
63 |
64 |
--------------------------------------------------------------------------------
/manage/market.md:
--------------------------------------------------------------------------------
1 | # Market Add/Edit
2 |
3 | Market form allows administrators to configure and manage market pairs within the Codono exchange platform. Each field and its usage is detailed below:
4 |
5 | ## Market Configuration
6 |
7 | ### General Settings
8 |
9 | - **Market Name**: The identifier for the trading pair, cannot be modified , But auto generated.
10 | - **Owned Trading**: Select the quote currency for the trading pair from the dropdown.
11 | - `USDT`: Tether
12 | - `BTC`: Bitcoin
13 | - `ETH`: Ethereum
14 | - `TRY`: Turkish Lira
15 | - `EUR`: Euro
16 |
17 | ### Fee Configuration
18 |
19 | - **Fees User**: The user ID designated to receive collected fees from market transactions. Input `0` for no fee collection.
20 | - **Decimal Places**: Define the number of decimal places allowed for the trading pair.
21 | - **BUY fee%**: Percentage fee applied to each buy transaction.
22 | - **Selling fees%**: Percentage fee applied to each sell transaction.
23 |
24 | ### Price Range
25 |
26 | - **Min Buy Price**: The minimum allowable price for buy orders.
27 | - **Max Buy Price**: The maximum allowable price for buy orders.
28 | - **Min Sale Price**: The minimum allowable price for sell orders.
29 | - **Max Sale Price**: The maximum allowable price for sell orders.
30 |
31 | ### Transaction Limits
32 |
33 | - **Min Trx Amt**: The minimum allowable amount per transaction.
34 | - **Single Max Trx Amt**: The maximum allowable amount for a single transaction.
35 |
36 | ### Referral Bonuses
37 |
38 | - **1st Tier Refer Bonus%**: Referral bonus percentage for the first tier.
39 | - **2nd Tier Refer Bonus%**: Referral bonus percentage for the second tier.
40 | - **3rd Tier Refer Bonus%**: Referral bonus percentage for the third tier.
41 | - **Refer Bonus[Buyers]**: Enable or disable referral bonuses for buyers.
42 | - **Refer Bonus[Sellers]**: Enable or disable referral bonuses for sellers.
43 |
44 | ### Market Data Source
45 |
46 | - **Websocket/Ajax**: Determines how the order book and trade logs are updated.
47 | - `Ajax [No Websocket]`: Updates the order book using AJAX calls.
48 | - `SelfEngine Websocket`: Uses the SelfEngine websocket for live updates.
49 | - `Huobi Websocket`: Uses the Huobi websocket service for live updates.
50 | - `Other [Currently not available]`: Reserved for future use.
51 |
52 | ### External Integration
53 |
54 | - **External Pair**: The identifier of the pair if using an external source, such as `ethusdt` for ETH/USD on Huobi.
55 | - **Market External Price**: Enable or disable the use of external price sources like Binance for price updates.
56 | - **Liquidity**: Choose the source of liquidity for the order book.
57 | - **External Orderbook Markup**: Adds a markup percentage to the external order book prices.
58 | - **Cross Ordering From Binance**: Enable or disable cross-ordering with Binance.
59 | - **Generate Fake orders**: Enable or disable the generation of fake orders for simulation or testing purposes.
60 |
61 | ### TradingView Charts
62 |
63 | - **Charts from TradingView**: Toggle the display of external charts from TradingView.
64 | - **Charts Symbol from TradingView**: The symbol identifier used for TradingView charts, like `BINANCE:BTCUSDT`.
65 |
66 | ### Self-Engine Orderbook Configuration
67 |
68 | - **SelfEngine Orderbook Buy Price**: The price to be used for generating the buy side of the order book.
69 | - **SelfEngine Orderbook Sell Price**: The price to be used for generating the sell side of the order book.
70 | - **SelfEngine Orderbook Max Qty**: Maximum quantity for the SelfEngine generated order book.
71 |
72 | ### Market Statistics (Autogenerated)
73 |
74 | These fields are typically auto-populated with market data and generally do not require manual input.
75 |
76 | - **Last Price**: The last traded price in the market.
77 | - **Buy Price**: The current buy price in the market.
78 | - **Sell Price**: The current sell price in the market.
79 | - **Min Price**: The minimum price in the last 24 hours.
80 | - **Max Price**: The maximum price in the last 24 hours.
81 | - **24 Hr Vol**: The total trading volume in the last 24 hours.
82 | - **Change %**: The percentage price change in the last 24 hours.
83 |
84 | ### Trading Time Configuration
85 |
86 | - **Start Trading Time**: Define the start time for trading.
87 | - **End Trading Time**: Define the end time for trading.
88 |
89 | ### Market Operations
90 |
91 | - **Open trading**: Toggle to enable or disable open trading for this pair.
92 | - **Status**: Set the status of the market pair to `Enabled` or `Disabled`.
93 |
94 | ### Form Submission
95 |
96 | - **Submit Button**: Click to save changes.
97 | - **Back Button**: Click to return to the previous page without saving changes.
98 |
99 |
--------------------------------------------------------------------------------
/manage/mining.md:
--------------------------------------------------------------------------------
1 | # Mining Machine Edit/Add
2 |
3 | Configure the settings for mining machines that users can rent.
4 |
5 | ## Form Fields
6 |
7 | - **ID**: (Read-only) The system-generated identifier for the mining machine.
8 | - **Mine Title**: Enter a name for the mining machine, which will be displayed to users.
9 | - **Image**: Upload an image to represent the mining machine. Recommended dimensions are 80px by 80px.
10 |
11 | ### Coin Settings
12 | - **Purchase Coin**: Select the coin users will use to purchase or rent the mining machine.
13 | - **Price**: Set the cost in the purchase coin for buying or renting the mining machine.
14 | - **Release Charge Coin**: Choose the coin that will be charged as a fee upon earnings release.
15 | - **Charge Amount on release**: Set the fixed charge amount that will be deducted from the earnings in the specified coin.
16 |
17 | ### Earnings and Periods
18 | - **Reward Coin**: Specify the coin in which users will receive their mining rewards.
19 | - **Profit**: Enter the daily profit amount that will be paid out in the reward coin.
20 | - **Days**: Define the rental period for the mining machine in days.
21 |
22 | ### Inventory and Limits
23 | - **Total machines**: Indicate the total number of mining machines available.
24 | - **Inventory**: Specify how many mining machines are currently available for users to rent.
25 | - **User Buy Limit**: Set a limit on the number of machines a single user can rent.
26 |
27 | ### Additional Settings
28 | - **Power Hash**: Input the hash power of the mining machine. This is typically used for marketing purposes and may be displayed as GH/s or TH/s.
29 | - **Sort**: A numeric value determining the display order of the mining machines; higher values will be listed first.
30 | - **Popular**: Select whether this mining machine should be marked as 'Popular', which could influence its visibility on the platform.
31 |
32 | ### Status
33 | - **Status**: Choose 'Active' to make the mining machine available for users, or 'Inactive' to remove it from the listing.
34 |
35 | After all the details are filled in, click "Submit" to save the changes or "Back" to cancel.
36 |
37 |
--------------------------------------------------------------------------------
/manage/staking.md:
--------------------------------------------------------------------------------
1 | # Staking Plans Configuration
2 |
3 | This section allows you to create and manage staking plans, enabling users to earn interest on their held cryptocurrency.
4 |
5 | ## Form Fields
6 |
7 | - **ID**: (Automatically filled by the system, not editable) Unique identifier for the staking plan.
8 | - **Staking Title**: A descriptive title for the staking plan, used for marketing purposes.
9 |
10 | ### Coin Selection
11 | - **Coin**: Choose which coin the staking plan will apply to from the dropdown list.
12 |
13 | ### Staking Periods and Rewards
14 | - **Period & Percentage**: Define the staking periods and their respective interest percentages. Check the box for each period you wish to offer and fill in the associated percentage.
15 |
16 | ### Penalties
17 | - **Penalty Coin**: If applicable, select the coin in which penalties will be charged for early withdrawal.
18 | - **Penalty Amount**: The fixed amount charged as a penalty for early withdrawal.
19 |
20 | ### Investment Limits
21 | - **Minvest**: The minimum amount a user can invest in this staking plan.
22 | - **Maxvest**: The maximum amount a user can invest in this staking plan.
23 |
24 | ### Administrative Fields
25 | - **creatorid**: (Typically filled by the system) The ID of the user who created the staking plan.
26 |
27 | ### Conditions for Staking
28 | - **Coin Conditions**: Conditions based on coin name and balance required for a user to participate in staking.
29 | - Enter the required coin name and the minimum balance a user needs to have to be eligible for staking.
30 |
31 | - **Market Conditions**: Set conditions based on market activity, such as the number of buy or sell orders required in a specific market for eligibility.
32 |
33 | ### Status and Withdrawals
34 | - **Status**: The current status of the staking plan (e.g., Approved, Submitted, Rejected, Completed, Upcoming).
35 | - **Allow withdrawal**: Choose whether to allow users to withdraw their staked investment before the end of the staking period.
36 |
37 | After filling out all necessary fields, click the "Submit" button to save the staking plan or "Back" to cancel and return to the previous page.
38 |
39 |
--------------------------------------------------------------------------------
/node-setup/bnb.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | ```markdown
4 | # Become Root
5 | ```bash
6 | sudo su
7 | ```
8 |
9 | # Create GETH User
10 | ```bash
11 | sudo useradd -m geth
12 | ```
13 |
14 | # Switch To The New User's Home
15 | ```bash
16 | cd /home/geth
17 | ```
18 |
19 | # Download The GETH
20 | ```bash
21 | wget https://github.com/bnb-chain/bsc/releases/download/v1.1.11/geth_linux
22 | chmod +x geth_linux
23 | ```
24 |
25 | # Install Unzip
26 | ```bash
27 | apt install unzip
28 | ```
29 |
30 | # Download Mainnet Configs
31 | ```bash
32 | wget https://github.com/bnb-chain/bsc/releases/download/v1.1.11/mainnet.zip
33 | unzip mainnet.zip
34 | ./geth_linux --datadir mainnet init genesis.json
35 | ```
36 |
37 | # Create `start.sh` and `console.sh`
38 | ```bash
39 | echo './geth_linux --config ./config.toml --datadir /home/geth/mainnet --port 5432 --http --http.addr "127.0.0.1" --http.port "7005" --http.api "personal,eth,net,web3" --allow-insecure-unlock --syncmode "snap" --maxpeers "0"' > start.sh
40 | chmod +x start.sh
41 |
42 | echo './geth_linux attach ipc:mainnet/geth.ipc' > console.sh
43 | chmod +x console.sh
44 |
45 | echo './geth_linux --datadir ./mainnet "$@"' > cli.sh
46 | chmod +x cli.sh
47 | ```
48 |
49 | # Setup systemd
50 | ```bash
51 | sudo nano /lib/systemd/system/geth.service
52 | ```
53 |
54 | ```
55 | [Unit]
56 | Description=BSC NoSync Node [Does not connect with network of BNB]
57 |
58 | [Service]
59 | User=geth
60 | Type=simple
61 | WorkingDirectory=/home/geth
62 | ExecStart=/bin/bash /home/geth/start.sh
63 | Restart=on-failure
64 | RestartSec=5
65 |
66 | [Install]
67 | WantedBy=default.target
68 | ```
69 |
70 | After that:
71 |
72 | ```bash
73 | chown -R geth.geth /home/geth/*
74 | systemctl enable geth
75 | systemctl start geth
76 | ```
77 |
78 | # Show logs
79 | ```bash
80 | tail -f /home/geth/mainnet/bsc.log
81 | journalctl -f -u geth
82 | ```
83 |
84 | # Check info of node
85 | ```bash
86 | ./console.sh
87 | ```
88 |
89 | # CLI Usages
90 | ```bash
91 | ./cli.sh account new
92 | ./cli.sh account list
93 | ```
94 |
95 | # Securing Node
96 | ```
97 | Create alpha numeric strings from here [Do not use Special chars Please]
98 | 1. 24 chars long nginx username
99 | 2. 32 chars long nginx password
100 | 3. 32 chars long first account password
101 |
102 | NGINXUSER:DUJvhuHoOcyI3IGMzappo1LTkV1v7FzJ
103 | NGINXPASS:t2h6G3g4YTc7DS93ullowWr7XPP9ZJBZ
104 | MAINACCOUNTPASS:44ufj5MgOmKTH94ZZQ3WOmSoxkU4zqaN
105 | ```
106 |
107 | # Creating First account
108 | ```
109 | ./console.sh
110 |
111 | then type
112 |
113 | personal.newAccount()
114 | It would ask for
115 |
116 | passPhrase:
117 | Repeast Password:
118 |
119 | Your new account is locked with a password. Please give a password. Do not forget this password.
120 | Enter your first account pass
121 |
122 | Password:MAINACCOUNTPASS
123 | Repeat Password:MAINACCOUNTPASS
124 |
125 | Result
126 | Public address of the key: 0xF124634534656355456453665436544365
127 | Path of the secret key file: mainnet/keystore/UTC--2021-08-27T06-46-38.255700718Z--F124634534656355456453665436544365
128 |
129 | - You can share your public address with anyone. Others need it to interact with you.
130 | - You must NEVER share the secret key with anyone! The key controls access to your funds!
131 | - You must BACKUP your key file! Without the key, it's impossible to access account funds!
132 | - You must REMEMBER your password! Without the password, it's impossible to decrypt the key!
133 | ```
134 |
135 | # Cross Checking if password you entered is correct [its must to avoid losing funds]
136 | ```
137 | > personal.unlockAccount("0xF124634534656355456453665436544365")
138 | Unlock account 0xF124634534656355456453665436544365
139 | Passphrase:MAINACCOUNTPASS
140 | true
141 | ```
142 | When it says true, then it means the password is correct.
143 |
144 | Now backup the following file [This is a JSON file]:
145 | ```
146 | mainnet/keystore/UTC--2021-08-27T06-46-38.255700718Z--F124634534656355456453665436544365
147 | ```
148 |
149 | and save your password for the first account somewhere safe.
150 |
151 | # Nginx Security Installation
152 | Installing nginx on Ubuntu 20 ref: https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-ubuntu-20-04
153 |
154 | ```bash
155 | sudo apt update
156 | sudo apt install nginx
157 | systemctl status nginx
158 | ```
159 |
160 | Adjust the firewall to allow only the IP of nginx from your reliable IP.
161 |
162 | ```bash
163 | sudo sh -c "echo -n 'NGINXUSER:' >> /etc/nginx/.htpasswd"
164 | sudo sh -c "openssl passwd -apr1 >> /etc/nginx/.htpasswd"
165 | ```
166 |
167 | Password for nginx = NGINXPASS
168 |
169 | Edit nginx configuration:
170 |
171 | ```bash
172 | sudo nano /etc/nginx/sites-available/default
173 | ```
174 |
175 | Add the following configuration:
176 |
177 | ```
178 | server {
179 | listen 9150;
180 | listen [::]:9150;
181 | auth_basic "No Access";
182 | auth_basic_user_file /etc/nginx/.htpasswd;
183 | location / {
184 | proxy_pass http://localhost:7005/;
185 | proxy_set_header Host $host;
186 | }
187 | }
188 | ```
189 |
190 | Reload nginx:
191 |
192 | ```bash
193 | sudo service nginx reload
194 | ```
195 |
--------------------------------------------------------------------------------
/node-setup/btc.md:
--------------------------------------------------------------------------------
1 | #Gathering Information
2 | ```
3 | NODEIP:IP ADDRESS of your Bitcoin NODE
4 | NODEUSER:Username of your Bitcoin NODE usually root
5 | NODEPWD:Password of your Bitcoin NODE for ssh
6 | ```
7 | #Choosing Information for RPC
8 | ```
9 | RPCUser: Choose RPC Username [Alpha Numeric] atleast 16 chars
10 | RPCPass: Choose RPC Password[Alpha Numeric] Keep strong 32 chars
11 | RPCPort:Choose uncommon port from 1000 to 65000 example 5351
12 | ACCESS_IP: IP address which will access your Bitcoin node [Exchange IP]
13 | ```
14 |
15 | Now login to your NODEIP with ssh root@NODEIP
16 |
17 | ```
18 | cd /opt/
19 | wget https://bitcoin.org/bin/bitcoin-core-22.0/bitcoin-22.0-x86_64-linux-gnu.tar.gz
20 | tar -xvf bitcoin-22.0-x86_64-linux-gnu.tar.gz
21 | sudo install -m 0755 -o root -g root -t /usr/local/bin bitcoin-22.0/bin/*
22 | ```
23 |
24 | Run bitcoind and stop with ctrl+c
25 | ```
26 | bitcoin-cli createwallet "default"
27 |
28 | cd /root/.bitcoin/
29 |
30 | sudo nano bitcoin.conf
31 | ```
32 | and Paste below init [Make sure to replace variables
33 | ```
34 | rpcuser=[RPCUser]
35 | rpcpassword=[RPCPass]
36 | rpcport=RPCPort
37 | rpctimeout=5
38 | rpcallowip=[ACCESS_IP]
39 | rpcbind=0.0.0.0
40 | testnet=0
41 | server=1
42 | prune=550
43 | addresstype=p2sh-segwit
44 | wallet=default
45 | #daemon=1
46 | ```
47 | This now becomes your command
48 | bitcoind -server -rpcbind=0.0.0.0 -rpcport=RPCPort -rpcallowip=ACCESS_IP -rpcuser=RPCUser -rpcpassword=RPCPass -prune=550 -addresstype=p2sh-segwit
49 |
50 | or You can supervisor to run it
51 | ```
52 | sudo apt-get install supervisor
53 | ```
54 | After above use following
55 | ```
56 | cd /etc/supervisor/conf.d/
57 | sudo nano bitcoin.conf
58 | ```
59 | Next enter following information
60 | ```
61 | [program:bitcoin]
62 | command=/usr/local/bin/bitcoind -datadir=/root/.bitcoin -conf=/root/.bitcoin/bitcoin.conf
63 | autostart=true
64 | autorestart=true
65 | stderr_logfile=/var/log/supervisor/bitcoin.err.log
66 | stdout_logfile=/var/log/supervisor/bitcoin.out.log
67 | ```
68 | Now Save it and run following command
69 | ```
70 | supervisorctl reload
71 | ```
72 | To check Log use command
73 | ```
74 | supervisorctl
75 | tail -f bitcoin
76 | ```
77 |
78 | #Testing Connection
79 | ```
80 | curl --data-binary '{"jsonrpc":"1.0","id":"curltext","method":"getblockchaininfo","params":[]}' -H 'content-type:text/plain;' http://RPCUser:RPCPass@127.0.0.1:RPCPort/
81 | ```
82 | If above response comes empty then you can use verbose to debug
83 |
84 | ```
85 | curl --data-binary '{"jsonrpc":"1.0","id":"curltext","method":"getblockchaininfo","params":[]}' -H 'content-type:text/plain;' http://RPCUser:RPCPass@127.0.0.1:RPCPort/ -v
86 | ```
87 |
88 | #creating a wallet
89 | ```
90 | bitcoin-cli createwallet wallet
91 | ```
92 | #Check if wallet is connected
93 | ```
94 | bitcoin-cli getwalletinfo
95 | ```
96 |
97 |
98 |
99 |
--------------------------------------------------------------------------------
/node-setup/btc_prune_node_setup.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # Function to generate random strings
4 | generate_random_string() {
5 | local length=$1
6 | tr -dc 'A-Za-z0-9' "$RPC_FILE"
61 | rpcuser: $RPCUser
62 | rpcpassword: $RPCPass
63 | rpcport: $RPCPort
64 | access_ip: $ACCESS_IP
65 | EOF
66 | fi
67 |
68 | # Check if screen is installed, and install it if not
69 | if ! command -v screen &> /dev/null; then
70 | echo "Screen is not installed. Installing screen..."
71 | sudo apt-get update
72 | sudo apt-get install screen -y
73 | else
74 | echo "Screen is already installed."
75 | fi
76 |
77 | # Check if Bitcoin Core is installed, and install it if not
78 | if ! command -v bitcoind &> /dev/null; then
79 | echo "Bitcoin Core is not installed. Installing Bitcoin Core..."
80 | cd /opt/
81 | wget https://bitcoin.org/bin/bitcoin-core-22.0/bitcoin-22.0-x86_64-linux-gnu.tar.gz
82 | tar -xvf bitcoin-22.0-x86_64-linux-gnu.tar.gz
83 | sudo install -m 0755 -o root -g root -t /usr/local/bin bitcoin-22.0/bin/*
84 | else
85 | echo "Bitcoin Core is already installed."
86 | fi
87 |
88 | # Create default wallet if it doesn't exist
89 | if ! bitcoin-cli listwallets | grep -q "default"; then
90 | echo "Creating default wallet..."
91 | bitcoin-cli createwallet "default"
92 | else
93 | echo "Default wallet already exists."
94 | fi
95 |
96 | # Create and configure bitcoin.conf
97 | echo "Configuring bitcoin.conf..."
98 | cd /root/.bitcoin/
99 | cat < bitcoin.conf
100 | rpcuser=$RPCUser
101 | rpcpassword=$RPCPass
102 | rpcport=$RPCPort
103 | rpctimeout=5
104 | rpcallowip=$ACCESS_IP
105 | rpcbind=0.0.0.0
106 | testnet=0
107 | server=1
108 | prune=550
109 | addresstype=p2sh-segwit
110 | wallet=default
111 | #daemon=1
112 | EOF
113 |
114 | # Start bitcoind in a screen session
115 | echo "Starting bitcoind in a screen session..."
116 | screen -S bitcoin_node -d -m bitcoind -server -rpcbind=0.0.0.0 -rpcport=$RPCPort -rpcallowip=$ACCESS_IP -rpcuser=$RPCUser -rpcpassword=$RPCPass -prune=550 -addresstype=p2sh-segwit
117 |
118 | # Install and configure supervisor if not already configured
119 | if [ ! -f /etc/supervisor/conf.d/bitcoin.conf ]; then
120 | echo "Installing and configuring supervisor..."
121 | sudo apt-get update
122 | sudo apt-get install supervisor -y
123 |
124 | cd /etc/supervisor/conf.d/
125 | cat < bitcoin.conf
126 | [program:bitcoin]
127 | command=/usr/local/bin/bitcoind -datadir=/root/.bitcoin -conf=/root/.bitcoin/bitcoin.conf
128 | autostart=true
129 | autorestart=true
130 | stderr_logfile=/var/log/supervisor/bitcoin.err.log
131 | stdout_logfile=/var/log/supervisor/bitcoin.out.log
132 | EOF
133 |
134 | # Reload supervisor
135 | echo "Reloading supervisor..."
136 | supervisorctl reload
137 | else
138 | echo "Supervisor configuration already exists."
139 | fi
140 |
141 | # Testing Connection
142 | echo "Testing connection..."
143 | curl --data-binary '{"jsonrpc":"1.0","id":"curltext","method":"getblockchaininfo","params":[]}' -H 'content-type:text/plain;' http://$RPCUser:$RPCPass@127.0.0.1:$RPCPort/
144 |
145 | # Creating a wallet if it doesn't exist
146 | if ! bitcoin-cli listwallets | grep -q "my_wallet"; then
147 | echo "Creating a wallet..."
148 | bitcoin-cli createwallet "my_wallet"
149 | else
150 | echo "Wallet 'my_wallet' already exists."
151 | fi
152 |
153 | # Check if wallet is connected
154 | echo "Checking wallet connection..."
155 | bitcoin-cli getwalletinfo
156 |
157 | echo "Bitcoin node setup complete! You can resume the screen session with 'screen -r bitcoin_node'. also credentials are stored in /opt/btc_rpc.yml save them some where safe and delete the file."
158 |
--------------------------------------------------------------------------------
/node-setup/dogecoin_prune_node_setup.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # Function to generate random strings
4 | generate_random_string() {
5 | local length=$1
6 | tr -dc 'A-Za-z0-9' "$RPC_FILE"
61 | rpcuser: $RPCUser
62 | rpcpassword: $RPCPass
63 | rpcport: $RPCPort
64 | access_ip: $ACCESS_IP
65 | EOF
66 | fi
67 |
68 | # Check if screen is installed, and install it if not
69 | if ! command -v screen &> /dev/null; then
70 | echo "Screen is not installed. Installing screen..."
71 | sudo apt-get update
72 | sudo apt-get install screen -y
73 | else
74 | echo "Screen is already installed."
75 | fi
76 |
77 | # Check if Dogecoin Core is installed, and install it if not
78 | if ! command -v dogecoind &> /dev/null; then
79 | echo "Dogecoin Core is not installed. Installing Dogecoin Core..."
80 | cd /opt/
81 | wget https://github.com/dogecoin/dogecoin/releases/download/v1.14.9/dogecoin-1.14.9-x86_64-linux-gnu.tar.gz
82 | tar -xvf dogecoin-1.14.9-x86_64-linux-gnu.tar.gz
83 | sudo install -m 0755 -o root -g root -t /usr/local/bin dogecoin-1.14.9/bin/*
84 | else
85 | echo "Dogecoin Core is already installed."
86 | fi
87 |
88 | # Create default wallet if it doesn't exist
89 | if ! dogecoin-cli listwallets | grep -q "default"; then
90 | echo "Creating default wallet..."
91 | dogecoin-cli createwallet "default"
92 | else
93 | echo "Default wallet already exists."
94 | fi
95 |
96 | # Create and configure dogecoin.conf
97 | echo "Configuring dogecoin.conf..."
98 | cd /root/.dogecoin/
99 | cat < dogecoin.conf
100 | rpcuser=$RPCUser
101 | rpcpassword=$RPCPass
102 | rpcport=$RPCPort
103 | rpctimeout=5
104 | rpcallowip=$ACCESS_IP
105 | rpcbind=0.0.0.0
106 | testnet=0
107 | server=1
108 | prune=550
109 | addresstype=p2sh-segwit
110 | wallet=default
111 | #daemon=1
112 | EOF
113 |
114 | # Start dogecoind in a screen session
115 | echo "Starting dogecoind in a screen session..."
116 | screen -S dogecoin_node -d -m dogecoind -server -rpcbind=0.0.0.0 -rpcport=$RPCPort -rpcallowip=$ACCESS_IP -rpcuser=$RPCUser -rpcpassword=$RPCPass -prune=550 -addresstype=p2sh-segwit
117 |
118 | # Install and configure supervisor if not already configured
119 | if [ ! -f /etc/supervisor/conf.d/dogecoin.conf ]; then
120 | echo "Installing and configuring supervisor..."
121 | sudo apt-get update
122 | sudo apt-get install supervisor -y
123 |
124 | cd /etc/supervisor/conf.d/
125 | cat < dogecoin.conf
126 | [program:dogecoin]
127 | command=/usr/local/bin/dogecoind -datadir=/root/.dogecoin -conf=/root/.dogecoin/dogecoin.conf
128 | autostart=true
129 | autorestart=true
130 | stderr_logfile=/var/log/supervisor/dogecoin.err.log
131 | stdout_logfile=/var/log/supervisor/dogecoin.out.log
132 | EOF
133 |
134 | # Reload supervisor
135 | echo "Reloading supervisor..."
136 | supervisorctl reload
137 | else
138 | echo "Supervisor configuration already exists."
139 | fi
140 |
141 | # Testing Connection
142 | echo "Testing connection..."
143 | curl --data-binary '{"jsonrpc":"1.0","id":"curltext","method":"getblockchaininfo","params":[]}' -H 'content-type:text/plain;' http://$RPCUser:$RPCPass@127.0.0.1:$RPCPort/
144 |
145 | # Creating a wallet if it doesn't exist
146 | if ! dogecoin-cli listwallets | grep -q "my_wallet"; then
147 | echo "Creating a wallet..."
148 | dogecoin-cli createwallet "my_wallet"
149 | else
150 | echo "Wallet 'my_wallet' already exists."
151 | fi
152 |
153 | # Check if wallet is connected
154 | echo "Checking wallet connection..."
155 | dogecoin-cli getwalletinfo
156 |
157 | echo "Dogecoin node setup complete! You can resume the screen session with 'screen -r dogecoin_node'. Credentials are stored in /opt/doge_rpc.yml. Save them somewhere safe and delete the file if necessary."
158 |
--------------------------------------------------------------------------------
/node-setup/eth.md:
--------------------------------------------------------------------------------
1 | ma# Become Root
2 | ```
3 | sudo su
4 | ```
5 |
6 | # Create GETH User
7 | ```
8 | sudo useradd -m geth
9 | ```
10 |
11 | # Switch To The New User's Home
12 | ```
13 | cd /home/geth
14 | ```
15 |
16 | # Download The GETH
17 | ```
18 |
19 | wget https://gethstore.blob.core.windows.net/builds/geth-linux-amd64-1.10.19-23bee162.tar.gz
20 | tar -xvf geth-linux-amd64-1.10.19-23bee162.tar.gz
21 | mv geth-linux-amd64-1.10.19-23bee162/geth /home/geth/
22 | chmod +x geth
23 | ```
24 |
25 | # Create `start.sh` and `console.sh`
26 | ```
27 | ./geth dumpconfig > config.toml
28 | echo "./geth --config ./config.toml --datadir /home/geth/mainnet --port 5432 --http --http.addr "127.0.0.1" --http.port "7005" --http.api "personal,eth,net,web3" --allow-insecure-unlock" --syncmode "snap" > start.sh
29 | chmod +x start.sh
30 |
31 | echo "./geth attach ipc:/home/geth/mainnet/geth.ipc" > console.sh
32 | chmod +x console.sh
33 |
34 | echo "./geth --datadir /home/geth/mainnet "$@"" > cli.sh
35 | chmod +x cli.sh
36 | ```
37 |
38 | # Additional Layer of security
39 | You can turn off syncing by --maxpeers 0 to start.sh
40 | ```
41 | ./geth --config ./config.toml --datadir /home/geth/mainnet --port 5432 --http --http.addr "127.0.0.1" --http.port "7005" --http.api "personal,eth,net,web3" --allow-insecure-unlock" --syncmode "snap" --maxpeers 0
42 | ```
43 | Also on geth server you can use ufw firewall
44 |
45 | and allow following port 22, 9150
46 | ```
47 | sudo ufw status
48 | ```
49 | Enabling ports
50 | ```
51 | sudo ufw allow 22
52 | sudo ufw allow from 123.456.789.000 to any port 9150
53 | ```
54 |
55 | Here replace your IP which will connect to geth with above IP 123.456.789.000
56 |
57 | #Enabliging ufw [If inactive]
58 | ```
59 | sudo ufw enable
60 | ```
61 |
62 |
63 | # Setup systemd
64 | ```
65 | sudo nano /lib/systemd/system/geth.service
66 | ```
67 |
68 | Then paste the following;
69 |
70 | ```
71 | [Unit]
72 | Description=ETH SNAP Node
73 |
74 | [Service]
75 | User=geth
76 | Type=simple
77 | WorkingDirectory=/home/geth
78 | ExecStart=/bin/bash /home/geth/start.sh
79 | Restart=on-failure
80 | RestartSec=5
81 |
82 | [Install]
83 | WantedBy=default.target
84 | ```
85 |
86 | After that;
87 |
88 | ```
89 | chown -R geth.geth /home/geth/*
90 | systemctl enable geth
91 | systemctl start geth
92 | ```
93 | # Check live logs of geth
94 |
95 | ```
96 | journalctl -f -u geth
97 |
98 | ```
99 |
100 | # Check info of node
101 | ```
102 | ./console.sh
103 | ```
104 | # CLI Usages
105 |
106 | ```
107 |
108 | ./cli.sh account new
109 | ./cli.sh account list
110 |
111 | ```
112 | # Securing Node
113 | ```
114 | Create alpha numeric strings from here [Do not use Special chars Please]
115 | 1. 24 chars long nginx username
116 | 2. 32 chars long nginx password
117 | 3. 32 chars long first account password
118 |
119 | nginx user:DUJvhuHoOcyI3IGMzappo1LTkV1v7FzJ
120 | nginx Pass:t2h6G3g4YTc7DS93ullowWr7XPP9ZJBZ
121 | first account pass:44ufj5MgOmKTH94ZZQ3WOmSoxkU4zqaN
122 | ```
123 | # Creating First account
124 | ```
125 | ./cli.sh account new
126 |
127 | Or
128 |
129 | ./console.sh
130 |
131 | then type
132 |
133 | personal.newAccount()
134 | passPhrase:
135 | Repeast Password:
136 | prompt will ask
137 | Your new account is locked with a password. Please give a password. Do not forget this password.
138 | Enter your first account pass
139 | Password:44ufj5MgOmKTH94ZZQ3WOmSoxkU4zqaN
140 | Repeat Password:44ufj5MgOmKTH94ZZQ3WOmSoxkU4zqaN
141 |
142 | Result
143 | Public address of the key: 0xF124634534656355456453665436544365
144 | Path of the secret key file: mainnet/keystore/UTC--2021-08-27T06-46-38.255700718Z--F124634534656355456453665436544365
145 |
146 | - You can share your public address with anyone. Others need it to interact with you.
147 | - You must NEVER share the secret key with anyone! The key controls access to your funds!
148 | - You must BACKUP your key file! Without the key, it's impossible to access account funds!
149 | - You must REMEMBER your password! Without the password, it's impossible to decrypt the key!
150 | ```
151 | Cross Checking if password you entered is correct [its must to avoid loosing funds]
152 |
153 | > personal.unlockAccount("0xF124634534656355456453665436544365")
154 | Unlock account 0xF124634534656355456453665436544365
155 | Passphrase:44ufj5MgOmKTH94ZZQ3WOmSoxkU4zqaN
156 | true
157 |
158 | When it says true then it means password is correct .
159 |
160 | @todo
161 | Now backup following file [This is a json file ]
162 |
163 | mainnet/keystore/UTC--2021-08-27T06-46-38.255700718Z--F124634534656355456453665436544365
164 |
165 | and save your password for first account somewhere same.
166 |
167 | # Nginx Security Installation
168 | ```
169 | Installing nginx on Ubuntu 20 ref: https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-ubuntu-20-04
170 | sudo apt update
171 | sudo apt install nginx
172 | systemctl status nginx
173 |
174 | @todo adjust firewall to allow ip of nginx from only your reliable ip
175 |
176 | sudo sh -c "echo -n 'DUJvhuHoOcyI3IGMzappo1LTkV1v7FzJ:' >> /etc/nginx/.htpasswd"
177 |
178 |
179 | sudo sh -c "openssl passwd -apr1 >> /etc/nginx/.htpasswd"
180 |
181 | password for nginx=t2h6G3g4YTc7DS93ullowWr7XPP9ZJBZ
182 |
183 |
184 | sudo nano /etc/nginx/sites-available/default
185 |
186 |
187 | server {
188 | listen 9150;
189 | listen [::]:9150;
190 | # ADDED THESE TWO LINES FOR AUTHENTICATION
191 | auth_basic "No Access";
192 | auth_basic_user_file /etc/nginx/.htpasswd;
193 | #server_name example.com;
194 | location / {
195 | proxy_pass http://localhost:7005/;
196 | proxy_set_header Host $host;
197 | }
198 | }
199 | ```
200 |
201 | #Run 2 more commands to check if everything is good.
202 | ```
203 | sudo service nginx reload
204 | sudo service nginx status
205 | ```
206 |
--------------------------------------------------------------------------------
/node-setup/klay.md:
--------------------------------------------------------------------------------
1 | # Become Root
2 | ```
3 | sudo su
4 | ```
5 |
6 | # Create GETH User
7 | ```
8 | sudo useradd -m geth
9 | ```
10 |
11 | # Switch To The New User's Home
12 | ```
13 | cd /home/geth
14 | ```
15 |
16 | # Download The Ken CLi
17 | ```
18 | wget https://packages.klaytn.net/klaytn/v1.9.0/ken-v1.9.0-0-linux-amd64.tar.gz
19 | tar -xvf ken-v1.9.0-0-linux-amd64.tar.gz
20 | chmod +x ken
21 | ```
22 | # Create config.toml
23 | ```
24 | ./ken dumpconfig >config.toml
25 | ```
26 |
27 | # Create `start.sh` and `console.sh`
28 | ```
29 | echo "./ken --config ./config.toml --datadir /home/geth/mainnet --port 5432 --rpc --rpcaddr 127.0.0.1 --rpcport 7005 --rpcapi personal,eth,net,web3 --syncmode snap --nodiscover
30 | > start.sh
31 | chmod +x start.sh
32 |
33 | ```
34 |
35 | # Setup systemd
36 | ```
37 | sudo nano /lib/systemd/system/geth.service
38 | ```
39 |
40 | Then paste the following;
41 |
42 | ```
43 | [Unit]
44 | Description=BSC NoSync Node [Does not connect with network of BNB]
45 |
46 | [Service]
47 | User=geth
48 | Type=simple
49 | WorkingDirectory=/home/geth
50 | ExecStart=/bin/bash /home/geth/start.sh
51 | Restart=on-failure
52 | RestartSec=5
53 |
54 | [Install]
55 | WantedBy=default.target
56 | ```
57 |
58 | After that;
59 |
60 | ```
61 | chown -R geth.geth /home/geth/*
62 | systemctl enable geth
63 | systemctl start geth
64 | ```
65 |
66 | # Show logs
67 | ```
68 | tail -f /home/geth/mainnet/bsc.log
69 | journalctl -f -u geth
70 | ```
71 |
72 | # Securing Node
73 | ```
74 | Create alpha numeric strings from here [Do not use Special chars Please]
75 | 1. 24 chars long nginx username
76 | 2. 32 chars long nginx password
77 | 3. 32 chars long first account password
78 |
79 | NGINXUSER:DUJvhuHoOcyI3IGMzappo1LTkV1v7FzJ
80 | NGINXPASS:t2h6G3g4YTc7DS93ullowWr7XPP9ZJBZ
81 | MAINACCOUNTPASS:44ufj5MgOmKTH94ZZQ3WOmSoxkU4zqaN
82 | ```
83 | # Creating First account
84 | ```
85 |
86 | ./ken --datadir ./mainnet account new
87 |
88 | It would ask for
89 |
90 | passPhrase:
91 | Repeast Password:
92 |
93 |
94 | Your new account is locked with a password. Please give a password. Do not forget this password.
95 | Enter your first account pass
96 |
97 | Password:MAINACCOUNTPASS
98 | Repeat Password:MAINACCOUNTPASS
99 |
100 | Result
101 | Public address of the key: 0xF124634534656355456453665436544365
102 | Path of the secret key file: mainnet/keystore/UTC--2021-08-27T06-46-38.255700718Z--F124634534656355456453665436544365
103 |
104 | - You can share your public address with anyone. Others need it to interact with you.
105 | - You must NEVER share the secret key with anyone! The key controls access to your funds!
106 | - You must BACKUP your key file! Without the key, it's impossible to access account funds!
107 | - You must REMEMBER your password! Without the password, it's impossible to decrypt the key!
108 | ```
109 | Cross Checking if password you entered is correct [its must to avoid loosing funds]
110 | ```
111 | > personal.unlockAccount("0xF124634534656355456453665436544365")
112 | Unlock account 0xF124634534656355456453665436544365
113 | Passphrase:MAINACCOUNTPASS
114 | true
115 | ```
116 | When it says true then it means password is correct .
117 |
118 | Now backup following file [This is a json file ]
119 |
120 | mainnet/keystore/UTC--2021-08-27T06-46-38.255700718Z--F124634534656355456453665436544365
121 |
122 | and save your password for first account somewhere same.
123 |
124 |
125 | # Nginx Security Installation
126 | ```
127 | sudo apt update
128 | sudo apt install nginx
129 | systemctl status nginx
130 | ```
131 | @todo adjust firewall to allow ip of nginx from only your reliable ip
132 | ```
133 | sudo sh -c "echo -n 'NGINXUSER:' >> /etc/nginx/.htpasswd"
134 |
135 |
136 | sudo sh -c "openssl passwd -apr1 >> /etc/nginx/.htpasswd"
137 | ```
138 | password for nginx=NGINXPASS
139 | ```
140 | #sudo rm /etc/nginx/sites-available/default
141 | sudo nano /etc/nginx/sites-available/default
142 |
143 |
144 | server {
145 | listen 9150;
146 | listen [::]:9150;
147 | # ADDED THESE TWO LINES FOR AUTHENTICATION
148 | auth_basic "No Access";
149 | auth_basic_user_file /etc/nginx/.htpasswd;
150 | #server_name example.com;
151 | location / {
152 | proxy_pass http://localhost:7005/;
153 | proxy_set_header Host $host;
154 | }
155 | }
156 | ```
157 |
158 |
159 |
160 | sudo service nginx reload
161 |
--------------------------------------------------------------------------------
/node-setup/ltc_prune_node.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # Function to generate random strings
4 | generate_random_string() {
5 | local length=$1
6 | tr -dc 'A-Za-z0-9' "$RPC_FILE"
61 | rpcuser: $RPCUser
62 | rpcpassword: $RPCPass
63 | rpcport: $RPCPort
64 | access_ip: $ACCESS_IP
65 | EOF
66 | fi
67 |
68 | # Check if screen is installed, and install it if not
69 | if ! command -v screen &> /dev/null; then
70 | echo "Screen is not installed. Installing screen..."
71 | sudo apt-get update
72 | sudo apt-get install screen -y
73 | else
74 | echo "Screen is already installed."
75 | fi
76 |
77 | # Check if Litecoin Core is installed, and install it if not
78 | if ! command -v litecoind &> /dev/null; then
79 | echo "Litecoin Core is not installed. Installing Litecoin Core..."
80 | cd /opt/
81 | wget https://download.litecoin.org/litecoin-0.21.4/linux/litecoin-0.21.4-x86_64-linux-gnu.tar.gz
82 | tar -xvf litecoin-0.21.4-x86_64-linux-gnu.tar.gz
83 | sudo install -m 0755 -o root -g root -t /usr/local/bin litecoin-0.21.4/bin/*
84 | else
85 | echo "Litecoin Core is already installed."
86 | fi
87 |
88 | # Create default wallet if it doesn't exist
89 | if ! litecoin-cli listwallets | grep -q "default"; then
90 | echo "Creating default wallet..."
91 | litecoin-cli createwallet "default"
92 | else
93 | echo "Default wallet already exists."
94 | fi
95 |
96 | # Create and configure litecoin.conf
97 | echo "Configuring litecoin.conf..."
98 | cd /root/.litecoin/
99 | cat < litecoin.conf
100 | rpcuser=$RPCUser
101 | rpcpassword=$RPCPass
102 | rpcport=$RPCPort
103 | rpctimeout=5
104 | rpcallowip=$ACCESS_IP
105 | rpcbind=0.0.0.0
106 | testnet=0
107 | server=1
108 | prune=550
109 | addresstype=p2sh-segwit
110 | wallet=default
111 | #daemon=1
112 | EOF
113 |
114 | # Start litecoind in a screen session
115 | echo "Starting litecoind in a screen session..."
116 | screen -S litecoin_node -d -m litecoind -server -rpcbind=0.0.0.0 -rpcport=$RPCPort -rpcallowip=$ACCESS_IP -rpcuser=$RPCUser -rpcpassword=$RPCPass -prune=550 -addresstype=p2sh-segwit
117 |
118 | # Install and configure supervisor if not already configured
119 | if [ ! -f /etc/supervisor/conf.d/litecoin.conf ]; then
120 | echo "Installing and configuring supervisor..."
121 | sudo apt-get update
122 | sudo apt-get install supervisor -y
123 |
124 | cd /etc/supervisor/conf.d/
125 | cat < litecoin.conf
126 | [program:litecoin]
127 | command=/usr/local/bin/litecoind -datadir=/root/.litecoin -conf=/root/.litecoin/litecoin.conf
128 | autostart=true
129 | autorestart=true
130 | stderr_logfile=/var/log/supervisor/litecoin.err.log
131 | stdout_logfile=/var/log/supervisor/litecoin.out.log
132 | EOF
133 |
134 | # Reload supervisor
135 | echo "Reloading supervisor..."
136 | supervisorctl reload
137 | else
138 | echo "Supervisor configuration already exists."
139 | fi
140 |
141 | # Testing Connection
142 | echo "Testing connection..."
143 | curl --data-binary '{"jsonrpc":"1.0","id":"curltext","method":"getblockchaininfo","params":[]}' -H 'content-type:text/plain;' http://$RPCUser:$RPCPass@127.0.0.1:$RPCPort/
144 |
145 | # Creating a wallet if it doesn't exist
146 | if ! litecoin-cli listwallets | grep -q "my_wallet"; then
147 | echo "Creating a wallet..."
148 | litecoin-cli createwallet "my_wallet"
149 | else
150 | echo "Wallet 'my_wallet' already exists."
151 | fi
152 |
153 | # Check if wallet is connected
154 | echo "Checking wallet connection..."
155 | litecoin-cli getwalletinfo
156 |
157 | echo "Litecoin node setup complete! You can resume the screen session with 'screen -r litecoin_node'. Credentials are stored in /opt/ltc_rpc.yml. Save them somewhere safe and delete the file if necessary."
158 |
--------------------------------------------------------------------------------
/node-setup/polkadot-substrate.md:
--------------------------------------------------------------------------------
1 |
2 | #PolkaDot Virtual RPC API [Custom Code]
3 | - Automatic Address creation using HDKEY
4 | - Deposit Detection
5 | - Address Withdrawal
6 | - Deposit movement to main address
7 | - Complete Exchange Solution with flawless flow built using various technologies.
8 | - Telegram @ ctoninja
9 |
--------------------------------------------------------------------------------
/node-setup/readme.md:
--------------------------------------------------------------------------------
1 | # Codono Bitcoin Prune Node Setup Script
2 |
3 | This script automates the setup of a Bitcoin prune node. It checks for existing configurations, installs necessary software, and sets up the node with resume protection using `screen`.
4 |
5 | ## Features
6 | - **Resume-Supported**: Can be run multiple times without overwriting existing configurations.
7 | - **RPC Configuration**: Generates and saves RPC credentials in `/opt/btc_rpc.yml`.
8 | - **Screen Session**: Runs the Bitcoin node in a `screen` session for resume protection.
9 | - **Supervisor Setup**: Configures `supervisor` to manage the Bitcoin node service.
10 | - **Wallet Creation**: Creates a default wallet and an additional wallet named `my_wallet`.
11 |
12 | ## Instructions to Use the Script
13 |
14 | ### Prerequisites
15 | - **Root Access**: This script requires root privileges to install software and configure system settings.
16 | - **Internet Access**: The script downloads Bitcoin Core and other dependencies.
17 |
18 | ### Steps
19 |
20 | 1. **Save the Script**:
21 | - Download the script to your server. For example, save it as `setup_bitcoin_node.sh`.
22 |
23 | ```
24 | cd /opt/ && curl -sSL https://raw.githubusercontent.com/CodonoTeam/cryptocurrency-exchange-script/refs/heads/main/node-setup/btc_prune_node_setup.sh -o setup_bitcoin_node.sh
25 | ```
26 |
27 | 2. **Make the Script Executable**:
28 | ```bash
29 | chmod +x setup_bitcoin_node.sh
30 |
31 | Run the Script with Root Privileges:
32 |
33 | ```bash
34 | sudo ./setup_bitcoin_node.sh
35 | ```
36 | ### What the Script Does
37 | - **Welcome Message**: Provides an overview of what the script will do.
38 | - **User Confirmation**: Asks for user confirmation before proceeding.
39 | - **Check for Existing RPC Configuration**: Reuses existing RPC information from /opt/btc_rpc.yml if it exists.
40 | - **Install Necessary Software**: Installs screen and Bitcoin Core if they are not already installed.
41 | - **Configure Bitcoin Core**: Sets up bitcoin.conf with random RPC credentials and a specified port.
42 | - **Start Bitcoin Node**: Runs the Bitcoin node in a screen session for resume protection.
43 | - **Supervisor Configuration**: Sets up supervisor to manage the Bitcoin node service.
44 | - **Wallet Creation**: Creates a default wallet and an additional wallet named my_wallet.
45 | - **Connection Test**: Tests the connection to the Bitcoin node.**
46 | ### Notes
47 | - **Existing Configurations**: The script checks for existing configurations and reuses them to avoid overwriting.
48 | - **Screen Session**: The Bitcoin node runs in a screen session. You can resume the session with screen -r bitcoin_node.
49 | - **Supervisor**: The script configures supervisor to manage the Bitcoin node service, ensuring it restarts automatically if it crashes.
50 | - **Wallets**: The script creates a default wallet and an additional wallet named my_wallet if they do not already exist.
51 | - **Resume-Supported**: The script is designed to be run multiple times without overwriting existing configurations or reinstalling software.
52 | - **Review Script**: Always review and understand the script before running it, especially when running with root privileges.
53 |
54 | ### Troubleshooting
55 | - **Screen Session**: If the script stops unexpectedly, you can resume the session with screen -r bitcoin_node.
56 | - **Logs**: Check the supervisor logs for any issues:
57 |
58 | ```bash
59 | supervisorctl tail -f bitcoin
60 | ```
61 |
62 | ### Connection Issues
63 | Use the curl command provided in the script to test the connection to the Bitcoin node.
64 |
65 | ### Support
66 | For any issues or further assistance, please contact **https://t.me/@ctoninja**
67 | Thank you for using the Codono Bitcoin Prune Node Setup Script!
68 |
--------------------------------------------------------------------------------
/scrape/bscscan-etherscan-scraping.md:
--------------------------------------------------------------------------------
1 | # Web Scraping BscScan Token Information Using Web Scraper Chrome Extension
2 |
3 | In this tutorial, we will guide you through the process of scraping token information from BscScan using the Web Scraper Chrome extension. This will allow you to extract details such as token names, symbols, contract addresses, and decimals into a CSV file.
4 |
5 | ## Step 1: Install the Web Scraper Chrome Extension
6 |
7 | 1. Open Google Chrome and go to the [Web Scraper extension page](https://chromewebstore.google.com/detail/web-scraper/jnhgnonknehpejjnehehllkliplmbmhn?hl=en).
8 | 2. Click on the "Add to Chrome" button.
9 | 3. Confirm the installation by clicking "Add extension".
10 |
11 | ## Step 2: Navigate to BscScan Tokens Page
12 |
13 | 1. Open a new tab in Chrome and go to [BscScan Tokens](https://bscscan.com/tokens).
14 |
15 | ## Step 3: Activate Developer Tools
16 |
17 | 1. Right-click anywhere on the BscScan Tokens page.
18 | 2. Select "Inspect" to open Developer Tools.
19 | 3. Click on the "Web Scraper" tab in the Developer Tools menu.
20 |
21 | ## Step 4: Create a New Sitemap
22 |
23 | 1. In the Web Scraper tab, click on "Create new sitemap".
24 | 2. Choose "Import sitemap".
25 | 3. Paste the following JSON into the Import Sitemap dialog:
26 |
27 | ```json
28 | {
29 | "_id": "tokens",
30 | "startUrl": ["https://bscscan.com/tokens"],
31 | "selectors": [
32 | {
33 | "id": "name",
34 | "parentSelectors": ["wrapper_for_name_symbol"],
35 | "type": "SelectorText",
36 | "selector": "div.hash-tag",
37 | "multiple": false,
38 | "regex": ""
39 | },
40 | {
41 | "id": "symbol",
42 | "parentSelectors": ["wrapper_for_name_symbol"],
43 | "type": "SelectorText",
44 | "selector": "span.text-muted",
45 | "multiple": false,
46 | "regex": ""
47 | },
48 | {
49 | "id": "wrapper_for_name_symbol",
50 | "parentSelectors": ["_root"],
51 | "type": "SelectorElement",
52 | "selector": "tbody tr",
53 | "multiple": true
54 | },
55 | {
56 | "id": "link",
57 | "parentSelectors": ["_root"],
58 | "type": "SelectorLink",
59 | "selector": "a.gap-1",
60 | "multiple": true,
61 | "linkType": "linkFromHref"
62 | },
63 | {
64 | "id": "decimals",
65 | "parentSelectors": ["link"],
66 | "type": "SelectorText",
67 | "selector": ".text-cap b",
68 | "multiple": false,
69 | "regex": ""
70 | },
71 | {
72 | "id": "contract",
73 | "parentSelectors": ["link"],
74 | "type": "SelectorText",
75 | "selector": "a.text-truncate.d-block",
76 | "multiple": false,
77 | "regex": ""
78 | },
79 | {
80 | "id": "img",
81 | "parentSelectors": ["link"],
82 | "type": "SelectorImage",
83 | "selector": "img.js-token-avatar",
84 | "multiple": false
85 | }
86 | ]
87 | }
88 | ```
89 |
90 | 4. Click "Import Sitemap".
91 |
92 | ## Step 5: Scrape the Token Information
93 |
94 | 1. In the Web Scraper tab, select the newly created "Sitemap Tokens".
95 | 2. Click on "Scrape".
96 | 3. Wait for the scraping process to complete. This may take a few minutes depending on the number of tokens.
97 |
98 | ## Step 6: Export the Data
99 |
100 | 1. Once the scraping is complete, click on the "Export data" button.
101 | 2. Choose the format "CSV".
102 | 3. The CSV file with the scraped token information will be downloaded to your computer.
103 |
104 | ## Conclusion
105 |
106 | You have successfully scraped token information from BscScan using the Web Scraper Chrome extension and exported it to a CSV file. You can now use this data for further analysis or integration into your projects.
107 |
--------------------------------------------------------------------------------
/scrape/bscscan-tokens.csv:
--------------------------------------------------------------------------------
1 | decimals,contract,img-src,symbol,title
2 | "18","0x6E88056E8376AE7709496BA64D37FA2F8015CE3E","/token/images/dexe_32.png?=v124","DEXE","Dexe"
3 | "6","0x8b1f4432f943c465a973fedc6d7aa50fc96f1f65","/token/images/axelar_32.png","AXL","Axelar"
4 | "6","0xd944f1d1e9d5f9bb90b62f9d45e447d989580782","/token/images/miota_32.png?=v1","IOTA","MIOTAC"
5 | "18","0xd17479997F34dd9156Deef8F95A52D81D265be9c","/token/images/usdd-tron_32.png","USDD","Decentralized USD"
6 | "18","0x26433c8127d9b4e9b71eaa15111df99ea2eeb2f8","/token/images/decentraland_32.png","MANA","Decentraland"
7 | "18","0xb3ed0a426155b79b898849803e3b36552f7ed507","/token/images/pendle_32.png","PENDLE","Pendle"
8 | "18","0x045c4324039dA91c52C55DF5D785385Aab073DcF","/token/images/conflux_32.png","bCFX","BSC Conflux"
9 | "18","0x56b6fb708fc5732dec1afc8d8556423a2edccbd6","/token/images/eos_32.png","EOS","Binance-Peg EOS Token"
10 | "18","0x16939ef78684453bfdfb47825f8a5f714f12623a","/token/images/tezos_32.png","XTZ","Binance-Peg Tezos Token"
11 | "18","0x33d08d8c7a168333a85285a68c0042b39fc3741d","/token/images/aioznetwork_32.png","AIOZ","AIOZ Network"
12 | "18","0xb7f8cd00c5a06c0537e2abff0b58033d02e5e094","/token/images/paxos_32.png","PAX","Binance-Peg Paxos Standard"
13 | "18","0x0ef2e7602add1733bfdb17ac3094d0421b502ca3","/token/images/ecash_32.png","XEC","Binance-Peg eCash Token"
14 | "18","0xbf7c81fff98bbe61b40ed186e4afd6ddd01337fe","/token/images/elrond_32.png?v=2","EGLD","Binance-Peg Elrond Token"
15 | "18","0x715d400f88c167884bbcc41c5fea407ed4d2f8a0","/token/images/axieinfinity_32.png","AXS","Binance-Peg Axie Infinity Shard Token"
16 | "18","0x1f1c90aeb2fd13ea972f0a71e35c0753848e3db0","/token/images/cheel_32.png?v=2","CHEEL","CHEELEE"
17 | "18","0x352Cb5E19b12FC216548a2677bD0fce83BaE434B","/token/images/bittorrent_32.png","BTT","BitTorrent"
18 | "18","0xc943c5320b9c18c153d1e2d12cc3074bebfb31a2","/token/images/onflow_32.png","FLOW","Binance-Peg FLOW Token"
19 | "9","0xfb5b838b6cfeedc2873ab27866079ac55363d37e","/token/images/floki_32.png","FLOKI","FLOKI"
20 | "18","0x031b41e504677879370e9dbcf937283a8691fa7f","/token/images/fetch_32.png","FET","Fetch"
21 | "18","0x8595f9da7b868b1822194faed312235e43007b49","/token/images/bittorrent_32.png","BTT","Binance-Peg BitTorrent Token"
22 | "18","0x6fdcdfef7c496407ccb0cec90f9c5aaa1cc8d888","/token/images/vechain_32.png","VET","VeChain"
23 | "18","0x5f0da599bb2cccfcf6fdfd7d81743b6020864350","/token/images/makerdao_32.png","MKR","Binance-Peg Maker"
24 | "18","0xa050ffb3eeb8200eeb7f61ce34ff644420fd3522","/token/images/arbitrum_32.png?=v34","Arbitrum","ARB"
25 | "18","0xad29abb318791d579433d831ed122afeaf29dcfe","/token/images/ftm_32.png?=v2","FTM","Fantom"
26 | "18","0x43c934a845205f0b514417d757d7235b8f53f1b9","/token/images/stellar_32.png","XLM","Stellar"
27 | "18","0x0d8ce2a99bb6e3b7db580ed848240e4a0f9ae153","/token/images/filecoin_32.png","FIL","Binance-Peg Filecoin"
28 | "18","0x0eb3a705fc54725037cc9e008bdede697f62f335","/token/images/cosmos_32.png","ATOM","Binance-Peg Cosmos Token"
29 | "18","0x7130d2a12b9bcbfae4f2634d864a1ee1ce3ead9c","/token/images/btcb_32.png","BTCB","Binance-Peg BTCB Token"
30 | "18","0x25d887ce7a35172c62febfd67a1856f20faebb00","/token/images/pepe_32.png?v=2","PEPE","Pepe"
31 | "18","0x3d6545b08693dae087e957cb1180ee38b9e3c25e","/token/images/ethclassic_32.png?v=1","ETC","Binance-Peg Ethereum Classic"
32 | "18","0xbf5140a22578168fd562dccf235e5d43a02ce9b1","/token/images/uniswap_32.png","UNI","Binance-Peg Uniswap"
33 | "18","0x1af3f329e8be154074d8769d1ffa4ee058b1dbc3","/token/images/dai_32.png","DAI","Binance-Peg Dai Token"
34 | "18","0x4338665cbb7b2485a8855a139b75d5e34ab0db94","/token/images/litecoin_32.png","LTC","Binance-Peg Litecoin Token"
35 | "18","0xcc42724c6683b7e57334c4e856f4c9965ed682bd","/token/images/polygonmatic_new_32.png","MATIC","Matic Token"
36 | "18","0x1fa4a73a3f0133f0025378af00236f3abdee5d63","/token/images/near_32.png","NEAR","Binance-Peg NEAR Protocol"
37 | "18","0x8ff795a6f4d97e7887c79bea79aba5cc76444adf","/token/images/bitcoincash_32.png","BCH","Binance-Peg Bitcoin Cash Token"
38 | "18","0xf8a0bf9cf54bb92f17374d9e9a321e6a111a51bd","/token/images/chainlink_32.png?v=2","LINK","Binance-Peg ChainLink Token"
39 | "18","0x7083609fce4d1d8dc0c979aab8c869ea2c873402","/token/images/polkadot_32.png","DOT","Binance-Peg Polkadot Token"
40 | "6","0xce7de646e7208a4ef112cb6ed5038fa6cc6b12e3","/token/images/tronnetwork_32.png","TRX","TRON"
41 | "18","0x1ce0c2827e2ef14d5c4f29a091d735a204794041","/token/images/avax_32.png","AVAX","Binance-Peg Avalanche Token"
42 | "18","0x2859e4544c4bb03966803b044a93563bd2d0dd4d","/token/images/shibatoken_32.png","SHIB","Binance-Peg SHIBA INU Token"
43 | "18","0x3ee2200efb3400fabb9aacf31297cbdd1d435d47","/token/images/cardano_32.png","ADA","Binance-Peg Cardano Token"
44 | "8","0xba2ae424d960c26247dd6c32edc70b295c744c43","/token/images/dogecoin_32.png","DOGE","Binance-Peg Dogecoin Token"
45 | "9","0x76A797A59Ba2C17726896976B7B3747BfD1d220f","/token/images/toncoin_32.png","TONCOIN","Wrapped TON Coin"
46 | "18","0x1d2f0da169ceb9fc7b3144628db156f3f6c60dbe","/token/images/xrp_32.png","XRP","Binance-Peg XRP Token"
47 | "18","0x8965349fb649a33a30cbfda057d8ec2c48abe2a2","/token/images/usdcgno_32.png","anyUSDC","USDC"
48 | "18","0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d","/token/images/centre-usdc_28.png","USDC","Binance-Peg USD Coin"
49 | "18","0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c","/token/images/bnbchain2_32.png","WBNB","Wrapped BNB"
50 | "18","0x55d398326f99059ff775485246999027b3197955","/token/images/busdt_32.png","BSC-USD","Binance-Peg BSC-USD"
51 | "18","0x2170ed0880ac9a755fd29b2688956bd959f933f8","/token/images/ether_32.png","ETH","Binance-Peg Ethereum Token"
52 |
--------------------------------------------------------------------------------
/tools/admin_change.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # Paths
4 | CONFIG_FILE="/data/wwwroot/codebase/pure_config.php"
5 | OUTPUT_FILE="/data/wwwroot/codebase/date_admin.changed"
6 |
7 | # Read DB_NAME, DB_USER, DB_PWD, and ADMIN_KEY from pure_config.php
8 | DB_NAME=$(grep -oP "(?<=const DB_NAME = ')[^']+" "$CONFIG_FILE")
9 | DB_USER=$(grep -oP "(?<=const DB_USER = ')[^']+" "$CONFIG_FILE")
10 | DB_PWD=$(grep -oP "(?<=const DB_PWD = ')[^']+" "$CONFIG_FILE")
11 | ADMIN_KEY=$(grep -oP "(?<=const ADMIN_KEY = ')[^']+" "$CONFIG_FILE")
12 |
13 | # Generate new admin username, password, and ADMIN_KEY
14 | NEW_ADMIN_USERNAME="adm_$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 12 | head -n 1)"
15 | NEW_ADMIN_PASSWORD=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 38 | head -n 1)
16 | NEW_ADMIN_PASSWORD_HASH=$(echo -n "$NEW_ADMIN_PASSWORD" | md5sum | awk '{print $1}')
17 | NEW_ADMIN_KEY="ADM_$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 37 | head -n 1)"
18 |
19 | # Update database with new admin username and password
20 | mysql -u "$DB_USER" -p"$DB_PWD" -e "USE $DB_NAME; UPDATE codono_admin SET username='$NEW_ADMIN_USERNAME', password='$NEW_ADMIN_PASSWORD_HASH';"
21 |
22 | # Update ADMIN_KEY in the configuration file
23 | sed -i "s/const ADMIN_KEY = '[^']*'/const ADMIN_KEY = '$NEW_ADMIN_KEY'/" "$CONFIG_FILE"
24 |
25 | # Log changes to date_admin.changed
26 | echo "Admin Username: $NEW_ADMIN_USERNAME" >> "$OUTPUT_FILE"
27 | echo "Admin Password (hashed): $NEW_ADMIN_PASSWORD_HASH" >> "$OUTPUT_FILE"
28 | echo "Admin Password (plain): $NEW_ADMIN_PASSWORD" >> "$OUTPUT_FILE"
29 | echo "ADMIN_KEY: $NEW_ADMIN_KEY" >> "$OUTPUT_FILE"
30 |
31 | echo "Changes applied and saved in $OUTPUT_FILE."
32 |
--------------------------------------------------------------------------------