├── tx_kasma_2 ├── package.json ├── .env ├── README.md ├── index.js └── index2.js ├── tx_kasma ├── package.json ├── index.js └── README.md ├── Oto restart.md ├── Reboot_start_screens ├── insufficent_fee_hatasi.md ├── port degistirme.md ├── hetzner_tasima.md ├── Otomatik Rollback Scripti.md ├── AirchainsMonitor.md ├── Auto-Restart_hata alindiginda tetiklenir.md ├── AirchainsMonitor.sh ├── AirchainsMonitorRPC.sh ├── 2.station kurma.md ├── README.md ├── Yeni_sunucuya_tasima.md └── Avail_Turing_DA.md /tx_kasma_2/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "send", 3 | "version": "1.0.0", 4 | "main": "index.js", 5 | "scripts": { 6 | "test": "echo \"Error: no test specified\" && exit 1" 7 | }, 8 | "author": "", 9 | "license": "ISC", 10 | "dependencies": { 11 | "dotenv": "^16.4.5", 12 | "ethers": "^5.7.2" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /tx_kasma/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bot", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "", 10 | "license": "ISC", 11 | "dependencies": { 12 | "ethers": "^5.7.2" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /tx_kasma_2/.env: -------------------------------------------------------------------------------- 1 | ETH_RPC_URL =http://IP_BURAYA:8545 2 | 3 | GAS_LIMIT =50000 4 | 5 | PRIVATE_KEY =PRIVATE_KEY_BURAYA 6 | 7 | PKEY2 =İKİNCİ_CÜZDAN_PRIVATE_KEY_BURAYA 8 | 9 | PKEY3 =ÜÇÜNCÜ_CÜZDAN_PRIVATE_KEY_BURAYA 10 | 11 | PKEY4 =DÖDRÜNCÜ_CÜZDAN_PRIVATE_KEY_BURAYA 12 | 13 | ADDRESS_RECEIVER =GÖNDERİLECEK_BAŞKA_CÜZDAN_ADRESI 14 | 15 | MAINADDRESS =ANA_CÜZDAN_ADRESİ 16 | 17 | MAX_WAIT_TIME =12000 18 | # ms türünden 1 sn 1000 ms 19 | 20 | MIN_WAIT_TIME =6000 21 | # ms türünden 1 sn 1000 ms 22 | -------------------------------------------------------------------------------- /Oto restart.md: -------------------------------------------------------------------------------- 1 | Track Restart 2 | 3 | ``` 4 | screen -S restart``` 5 | 6 | ``` 7 | nano stationd_auto_restart.sh``` 8 | 9 | ``` 10 | #!/bin/bash 11 | 12 | # Yeniden başlatma aralığını saniye cinsinden ayarlayın (örneğin, her 60 saniyede bir) 13 | RESTART_INTERVAL=150 14 | 15 | # Sonsuz döngü içinde çalışacak 16 | while true; do 17 | echo "Servis yeniden başlatılıyor..." 18 | # Servisi yeniden başlat 19 | sudo systemctl restart stationd 20 | echo "Servis başarıyla yeniden başlatıldı." 21 | # Belirtilen süre kadar bekleyin 22 | sleep $RESTART_INTERVAL 23 | done 24 | ``` 25 | ``` 26 | chmod +x stationd_auto_restart.sh``` 27 | ``` 28 | ./stationd_auto_restart.sh``` 29 | -------------------------------------------------------------------------------- /Reboot_start_screens: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Ekran oturumlarını yeniden başlat 3 | # Mevcut oturumları kontrol et ve eksik olanları oluştur 4 | 5 | screen -dmS rivalz 6 | screen -S rivalz -X stuff 'rivalz run\n' 7 | 8 | screen -dmS oasis 9 | screen -S oasis -X stuff 'cd oasis && node oasis_terminal.js\n' 10 | 11 | screen -dmS rollback 12 | screen -S rollback -X stuff 'cd rollback && ./check_log_and_fix.sh\n' 13 | 14 | screen -dmS send 15 | screen -S send -X stuff 'cd send && node index.js\n' 16 | 17 | screen -dmS bot 18 | screen -S bot -X stuff 'cd bot && node index.js\n' 19 | 20 | screen -dmS restart 21 | screen -S restart -X stuff 'cd tracks && ./stationd_auto_restart.sh\n' 22 | 23 | screen -dmS air 24 | screen -S air -X stuff 'cd evm-station && sudo journalctl -u stationd.service\n' 25 | 26 | # Yazılımı başlat 27 | cd ubuntu-node/ 28 | sudo bash manager.sh up -------------------------------------------------------------------------------- /insufficent_fee_hatasi.md: -------------------------------------------------------------------------------- 1 | Yeni sürümdeki gas sınırları sebebiyle yetersiz fee hatası alınabiliyor. 2 | Güncelleme gelene kadar bunu uygulayabilirsiniz. 3 | 4 | ![image](https://github.com/neuweltgeld/Airchains_/assets/101174090/c4651e1c-ee88-4a65-8a01-bffaf56035a0) 5 | 6 | ```console 7 | # cüzdanda yeteri kadar amf token olduğuna emin olun 8 | # trackeri durdurun 9 | 10 | systemctl stop stationd 11 | 12 | # submitPod.go dosyasına girin 13 | nano ~/tracks/junction/submitPod.go 14 | 15 | # şu kodu bulup 16 | 17 | gas := utilis.GenerateRandomWithFavour(100, 300, [2]int{120, 250}, 0.7) 18 | 19 | # aşağıdakiyle değiştirin 20 | 21 | gas := utilis.GenerateRandomWithFavour(510, 1000, [2]int{520, 700}, 0.7) 22 | 23 | # ctrl + x ve y ile kaydedip çıkın. 24 | 25 | # tracks klasörüne girin değişiklikleri uygulayın 26 | 27 | cd $HOME/tracks 28 | 29 | go mod tidy 30 | 31 | # trackeri yeniden başlatın 32 | 33 | systemctl restart stationd && sudo journalctl -u stationd -f --no-hostname -o cat 34 | ``` 35 | -------------------------------------------------------------------------------- /port degistirme.md: -------------------------------------------------------------------------------- 1 |

Port Değiştirme İşlemi

2 | Sunucumuza girelim. 3 | 4 | ``` 5 | systemctl stop rolld 6 | 7 | nano ~/.evmosd/config/app.toml 8 | ``` 9 | Aşağıdaki resimde 8545 ve 8546 portlarına herhangi bir sayı verebilirsiniz. Ben 8547 ve 8548 yaptım. 10 | 11 | ![image](https://github.com/ruesandora/Airchains/assets/101149671/588a02d0-f7e3-4c25-ac25-ffff281206eb) 12 | 13 | Ctrl+x y enter yapıp çıkıyoruz. Daha sonra restart atıp logları kontrol edelim. 14 | 15 | ``` 16 | sudo systemctl restart rolld 17 | 18 | sudo journalctl -u rolld -f --no-hostname -o cat 19 | ``` 20 | ![image](https://github.com/ruesandora/Airchains/assets/101149671/64137490-6b3b-4678-ae26-81c90dd1f952) 21 | 22 | Ayrıca bu iki portu açalım. Aşağıdaki portlar sizin kullandığınız porta göre farklı olabilir kendinize göre düzenleyebilirsiniz. 23 | ``` 24 | sudo ufw allow 8547 25 | sudo ufw allow 8548 26 | ``` 27 | Portumuzu değiştirdik ek olarak metamasktan ve tx botundan rpc kısmını yenisine göre düzenlemeliyiz. 28 | 29 | 30 | -------------------------------------------------------------------------------- /tx_kasma/index.js: -------------------------------------------------------------------------------- 1 | const { ethers } = require("ethers"); 2 | const contractABI = [ 3 | { 4 | inputs: [], 5 | name: "set", 6 | outputs: [], 7 | stateMutability: "nonpayable", 8 | type: "function", 9 | }, 10 | { 11 | inputs: [], 12 | name: "get", 13 | outputs: [ 14 | { 15 | internalType: "uint256", 16 | name: "", 17 | type: "uint256", 18 | }, 19 | ], 20 | stateMutability: "view", 21 | type: "function", 22 | constant: true, 23 | }, 24 | ]; 25 | 26 | const contractAddress = "KONTRAT ADRESİ"; 27 | 28 | const bekle = (ms) => new Promise((resolve) => setTimeout(resolve, ms)); 29 | 30 | 31 | async function get() { 32 | const provider = new ethers.providers.JsonRpcProvider("RPC"); 33 | 34 | const private = "PRIVATE KEY"; 35 | 36 | //for sending from account 0 37 | 38 | let senderAccount = new ethers.Wallet(private); 39 | let walletsigner = await senderAccount.connect(provider); 40 | const contract = new ethers.Contract( 41 | contractAddress, 42 | contractABI, 43 | walletsigner 44 | ); 45 | 46 | console.log(`${senderAccount.address} is ready. Please wait`); 47 | let bnonce = 0; 48 | while (true) { 49 | const delay = Math.floor(Math.random() * (5000 - 10000 + 1)) + 2000; 50 | const nonce = await provider.getTransactionCount(senderAccount.address); 51 | console.log(`**************Önceki nonce: ${bnonce} şu an ${nonce} beklenilen sure ${delay}`); 52 | let gasPrice = await provider.getGasPrice(); 53 | console.log(`gas: ${gasPrice}`); 54 | try { 55 | const transaction = await contract.set({ 56 | from: walletsigner.account, 57 | }); 58 | 59 | await transaction.wait(); 60 | 61 | console.log(`Transaction completed: ${transaction}`); 62 | bnonce = nonce; 63 | let storedData = await contract.get(); 64 | console.log(`Stored Data: ${storedData}`); 65 | } catch (error) { 66 | console.log(`HATA: ${error}`); 67 | } 68 | 69 | 70 | 71 | await bekle(delay); 72 | } 73 | } 74 | 75 | get(); 76 | -------------------------------------------------------------------------------- /hetzner_tasima.md: -------------------------------------------------------------------------------- 1 | ### ***Dikkat. Bu işlem risklidir, airchains trackerin silindiğinde geri getirilemediğini bilerek işlem yapın. Sorumluluk size aittir.*** 2 | 3 | ### ***Eğer hetzner kullanıyorsanız ve diskiniz dolduysa snapshot alarak bir üst sunucuya geçebilirsiniz. İşlemlere aşina değilseniz dikkatli olun.*** 4 | 5 | ### ***Servis kurulumlarını yaptıysanız otomatik olarak yeniden başlayacaktır.*** 6 | 7 | ### ***Önemli noktalar*** 8 | 9 | 1. Taşıyacağınız sunucu önceki sunucuyla aynı lokasyonda olmalı 10 | 11 | 2. Snapshot aldıktan sonra! sunucuyu silmeli ve silerken ip4 ve ip6 silmeden tut seçeneğini seçmelisiniz 12 | 13 | ### ***İşlemlere geçelim*** 14 | 15 | + Sunucunuzun karşısındaki 3noktaya tıklayıp take snapshot diyoruz. 16 | 17 | ![image](https://github.com/neuweltgeld/Airchains_/assets/101174090/ce4ba1e0-3dc8-4280-83bb-6c2f14f9f5a7) 18 | 19 | + Bir isim belirleyin ve create & buy tıklayın 20 | 21 | ![image](https://github.com/neuweltgeld/Airchains_/assets/101174090/67ea917f-79a2-4dd1-9c51-f32ea62c254c) 22 | 23 | + Dikkat ! Snapshot işleminin bittiğinden emin olun yoksa her şeyiniz gider. 24 | + %100 olduğunda sonraki adıma geçin. 25 | 26 | ![image](https://github.com/neuweltgeld/Airchains_/assets/101174090/433a646a-ae8e-4d11-9a79-1383a494cb19) 27 | 28 | + Sunucuyu silmeniz gerekli çünkü IP adresleri lazım. Silerken şu seçenekleri seçtiğinize emin olun 29 | 30 | ![image](https://github.com/neuweltgeld/Airchains_/assets/101174090/14ce6610-f5ba-4506-9601-679b760ef392) 31 | 32 | + Sonraki adım snapshotu kullanarak yeni sunucu açmak. 33 | 1. sildiğiniz sunucuyla aynı lokasyonu seçin 34 | 2. snapshot sekmesinden aldığınız yedeği seçin 35 | 3. disk hacmi yüksek sunucuyu seçin 36 | 4. tuttuğunuz ip adresini seçili duruma getirin 37 | 5. create diyerek sunucunun kurulmasını bekleyin 38 | 39 | ![image](https://github.com/neuweltgeld/Airchains_/assets/101174090/92ee4e47-639d-4b30-a086-0862416cceef) 40 | ![image](https://github.com/neuweltgeld/Airchains_/assets/101174090/ba98834c-e96a-460b-8584-1ab9f33c8250) 41 | 42 | + SS ile kurulum biraz zaman alacaktır, bekleyin ve kurulum bittiğinde maile gelen şifre ile yeni sunucuya bağlanın. 43 | + Servis kontrol komutlarıyla düzgün çalışıp çalışmadığını kontrol edebilirsiniz. 44 | + İşlemler bittikten ve sunucunuzun sağlıklı çalıştığını görünce snapshotı silin çünkü saatlik ücreti var. 45 | -------------------------------------------------------------------------------- /Otomatik Rollback Scripti.md: -------------------------------------------------------------------------------- 1 |

İstasyon Otomatik Başlatma

2 | 3 | Airchain loglarının aktığı screen dışında yeni bir screen açıyoruz. 4 | ``` 5 | screen -S rollback 6 | ``` 7 | Bu screen içerisinde yeni bir dosya oluşturuyoruz. 8 | ``` 9 | nano check_log_and_fix.sh 10 | ``` 11 | Dosya içine buradaki scipti kopyalayıp yapıştırıyoruz ve ctrl x+y ile kayıt edip çıkıyoruz. 12 | 13 | ``` 14 | #!/bin/bash 15 | 16 | # Define service name and log search strings 17 | service_name="stationd" 18 | error_patterns=( 19 | "with gas used" 20 | "ERR Error in SubmitPod Transaction Error=" 21 | "Failed to get transaction by hash: not found" 22 | "Switchyard client connection error" 23 | "Failed to Init VRF" 24 | "Failed to Transact Verify pod" 25 | ) 26 | restart_delay=180 # Restart delay in seconds (3 minutes) 27 | 28 | echo "Script started and it will rollback $service_name if needed..." 29 | 30 | while true; do 31 | # Get the last 10 lines of service logs 32 | logs=$(systemctl status "$service_name" --no-pager | tail -n 10) 33 | 34 | # Check for error patterns in the logs 35 | error_found=false 36 | for pattern in "${error_patterns[@]}"; do 37 | if [[ "$logs" =~ $pattern ]]; then 38 | error_found=true 39 | break 40 | fi 41 | done 42 | 43 | # If an error pattern is found, perform rollback and restart 44 | if $error_found; then 45 | echo "Found error in logs, stopping $service_name..." 46 | systemctl stop "$service_name" 47 | cd ~/tracks 48 | 49 | echo "Service $service_name stopped, starting rollback..." 50 | go run cmd/main.go rollback 51 | go run cmd/main.go rollback 52 | go run cmd/main.go rollback 53 | echo "Rollback completed, starting $service_name..." 54 | systemctl start "$service_name" 55 | echo "Service $service_name started" 56 | fi 57 | 58 | # Sleep for the restart delay 59 | sleep "$restart_delay" 60 | done 61 | 62 | ``` 63 | 64 | Daha sonra bu dosyaya izin vermek için 65 | ``` 66 | chmod +x check_log_and_fix.sh 67 | ``` 68 | 69 | İzin verdikden sonra sciptimizi başlatabiliriz. 70 | 71 | ``` 72 | ./check_log_and_fix.sh 73 | ``` 74 | Airchain logları başka bir screende akarken bu açtığımız screen ise onu kontrol ederek benim tespit ettiğim 3 hatada otomatik rollback atacaktır. 75 | 76 | > NOT : Arada veren hatalar için tekrar başlatma yapmıyor. 77 | -------------------------------------------------------------------------------- /tx_kasma_2/README.md: -------------------------------------------------------------------------------- 1 | >Öncelikle bir cüzdan adresine ihtiyacımız var. Cüzdan adresini .env yi düzenlerken kullanacağız 2 |

Node.js ve npm kurulumu

3 | 4 | > Npm ve node.js kurulumunu yapalım 5 | 6 | ``` 7 | # komutları sırasıyla girelim: 8 | screen -S send 9 | 10 | curl -sL https://deb.nodesource.com/setup_20.x -o /tmp/nodesource_setup.sh 11 | sudo bash /tmp/nodesource_setup.sh 12 | sudo apt install nodejs 13 | 14 | curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash 15 | source ~/.bashrc 16 | nvm install v20.10.0 17 | nvm use v20.10.0 18 | npm install -g npm@latest 19 | 20 | ``` 21 | 22 | 23 | > Daha sonra burada yeni bir klasör oluştur. npm ile proje oluştur. hepsini enter ile geçebilirsin. 24 | 25 | ``` 26 | mkdir send 27 | cd send 28 | npm init 29 | 30 | ``` 31 | 32 | > index.js dosyasını oluştur. [Bu repodaki](https://github.com/ruesandora/Airchains/blob/main/tx_kasma_2/index.js) index.js değişiklik yapmadan yapıştır. 33 | 34 | ``` 35 | 36 | nano index.js 37 | 38 | ``` 39 | > .env dosyasını oluştur. [Bu repodaki](https://github.com/ruesandora/Airchains/blob/main/tx_kasma_2/.env) buradaki bilgileri kendine göre düzenle. 40 | 41 | ``` 42 | 43 | nano .env 44 | 45 | ``` 46 | 47 | > Aynısını [package.json](https://github.com/ruesandora/Airchains/blob/main/tx_kasma_2/package.json) için yap 48 | 49 | ``` 50 | 51 | nano package.json 52 | 53 | ``` 54 | 55 | > En son aşağıdakileri çalıştıralım 56 | 57 | ``` 58 | npm install 59 | node index.js 60 | 61 | ``` 62 | 63 | > Sıkıntı çıkmazsa Transefer Başarılı!! -->CÜZDAN BAKİYESİ 64 | 65 | > Buradan sonrası 2 ve daha fazla tx i aynı anda gönderme işlemleri içindir. 66 | 67 | > 2 cüzdandan ana cüzdana transfer işlemi 68 | 69 | ``` 70 | screen -ls 71 | screen -X -S quit 72 | 73 | ``` 74 | 75 | > Metamask üzerinden ikinci, üçüncü, dördüncü cüzdanlara tEVMOS gönderin. 76 | 77 | ``` 78 | nano .env 79 | 80 | ``` 81 | > bu repodaki güncel .env dosyasını kendinize göre düzenleyin. ctrl x+y Enter. Aynı işlemleri index2.js index3.js index4.js için aşağıdaki kodları tekrar ederek yapın. 82 | 83 | ``` 84 | nano index2.js 85 | screen -S tx 86 | node index2.js 87 | 88 | ``` 89 | 90 | > Burada eğer 3 ve 4. tx atmayı da yapacaksanız PKEY3 ve PKEY4 değerlerini .env dosyasına girip, index3.js içinde PKEY2 yazan yeri PKEY3, index4.js içinde PKEY4 yazmalısınız. 91 | 92 | -------------------------------------------------------------------------------- /tx_kasma_2/index.js: -------------------------------------------------------------------------------- 1 | const ethers = require('ethers'); 2 | require('dotenv').config(); 3 | const { 4 | ADDRESS_RECEIVER, 5 | GAS_LIMIT, 6 | PRIVATE_KEY, 7 | ETH_RPC_URL, 8 | MAX_WAIT_TIME, 9 | MIN_WAIT_TIME 10 | } = process.env; 11 | 12 | const provider = new ethers.providers.JsonRpcProvider(ETH_RPC_URL); 13 | const increaseGasBy = 15000000000; 14 | let lastProcessedBlock = null; 15 | 16 | async function getCurrentGasPrice() { 17 | try { 18 | const currentGasPrice = await provider.getGasPrice(); 19 | return (Number(currentGasPrice) + increaseGasBy) + ''; 20 | } catch (err) { 21 | console.error(err); 22 | } 23 | } 24 | 25 | const bot = async () => { 26 | provider.on("block", async (blockNumber) => { 27 | if (lastProcessedBlock === blockNumber) { 28 | return; // Eğer bu bloğu zaten işliyorsak atla 29 | } 30 | lastProcessedBlock = blockNumber; 31 | 32 | console.log("Yeni Tx Oluşturuluyor..."); 33 | const _target = new ethers.Wallet(PRIVATE_KEY); 34 | const target = _target.connect(provider); 35 | const balance = await provider.getBalance(target.address); 36 | const currentGasPrice = await getCurrentGasPrice(); 37 | const balanceinEther = ethers.utils.formatEther(balance); 38 | 39 | if (Number(balanceinEther) > 0 && Number(currentGasPrice) > 0) { 40 | try { 41 | const randomWei = Math.floor(Math.random() * 10) + 1; // 1 ile 10 Wei arasında rastgele bir sayı 42 | await target.sendTransaction({ 43 | to: ADDRESS_RECEIVER, 44 | value: ethers.utils.parseUnits(randomWei.toString(), "wei"), // Rastgele miktar 45 | gasPrice: currentGasPrice.toString(), 46 | gasLimit: GAS_LIMIT.toString() 47 | }); 48 | console.log(`Transfer Başarılı --> Cüzdan bakiyesi: ${ethers.utils.formatEther(await provider.getBalance(target.address))}`); 49 | 50 | const randomDelay = Math.floor(Math.random() * (MAX_WAIT_TIME - MIN_WAIT_TIME)) + Number(MIN_WAIT_TIME); 51 | console.log(`Bekleme süresi: ${randomDelay} ms`); 52 | await new Promise(resolve => setTimeout(resolve, randomDelay)); // Rastgele bekleme süresi 53 | } catch (error) { 54 | console.log(`HATA, TEKRAR DENENİYOR...`); 55 | } 56 | } 57 | }); 58 | }; 59 | 60 | bot(); 61 | -------------------------------------------------------------------------------- /tx_kasma_2/index2.js: -------------------------------------------------------------------------------- 1 | const ethers = require('ethers'); 2 | require('dotenv').config(); 3 | const { 4 | ADDRESS_RECEIVER, 5 | GAS_LIMIT, 6 | PRIVATE_KEY, 7 | ETH_RPC_URL, 8 | MAX_WAIT_TIME, 9 | MIN_WAIT_TIME, 10 | PKEY2, 11 | PKEY3, 12 | PKEY4, 13 | MAINADDRESS 14 | } = process.env; 15 | 16 | const provider = new ethers.providers.JsonRpcProvider(ETH_RPC_URL); 17 | const increaseGasBy = 15000000000; 18 | let lastProcessedBlock = null; 19 | 20 | async function getCurrentGasPrice() { 21 | try { 22 | const currentGasPrice = await provider.getGasPrice(); 23 | return (Number(currentGasPrice) + increaseGasBy) + ''; 24 | } catch (err) { 25 | console.error(err); 26 | } 27 | } 28 | 29 | const bot = async () => { 30 | provider.on("block", async (blockNumber) => { 31 | if (lastProcessedBlock === blockNumber) { 32 | return; // Eğer bu bloğu zaten işliyorsak atla 33 | } 34 | lastProcessedBlock = blockNumber; 35 | 36 | console.log("Yeni Tx Oluşturuluyor..."); 37 | const _target = new ethers.Wallet(PKEY2); // 2. cüzdanın private keyi 38 | const target = _target.connect(provider); 39 | const balance = await provider.getBalance(target.address); 40 | const currentGasPrice = await getCurrentGasPrice(); 41 | const balanceinEther = ethers.utils.formatEther(balance); 42 | 43 | if (Number(balanceinEther) > 0 && Number(currentGasPrice) > 0) { 44 | try { 45 | const randomWei = Math.floor(Math.random() * 10) + 1; // 1 ile 10 Wei arasında rastgele bir sayı 46 | await target.sendTransaction({ 47 | to: MAINADDRESS, 48 | value: ethers.utils.parseUnits(randomWei.toString(), "wei"), // Rastgele miktar 49 | gasPrice: currentGasPrice.toString(), 50 | gasLimit: GAS_LIMIT.toString() 51 | }); 52 | console.log(`Transfer Başarılı --> Cüzdan bakiyesi: ${ethers.utils.formatEther(await provider.getBalance(target.address))}`); 53 | 54 | const randomDelay = Math.floor(Math.random() * (MAX_WAIT_TIME - MIN_WAIT_TIME)) + Number(MIN_WAIT_TIME); 55 | console.log(`Bekleme süresi: ${randomDelay} ms`); 56 | await new Promise(resolve => setTimeout(resolve, randomDelay)); // Rastgele bekleme süresi 57 | } catch (error) { 58 | console.log(`HATA, TEKRAR DENENİYOR...`); 59 | } 60 | } 61 | }); 62 | }; 63 | 64 | bot(); 65 | -------------------------------------------------------------------------------- /tx_kasma/README.md: -------------------------------------------------------------------------------- 1 |

Contract Deployment

2 | 3 | > UYARI : [Remix](https://remix.ethereum.org/) üzerinden bir dosya oluştur. Aşağıdaki kodu yapıştır. 4 | > İlk önce compile et. Sonra Deploy&Run Transactions kısmına gir `Environment` kısmından `Injected Provider-Metamask` seç ve deploy et. 5 | > Aşağıdaki bölümden kontrat adresini not et. 6 | > Deploy ettiğiniz zaman rpc hatası alırsanız 2.tx botunu durdurun sürekli tx attığı için hata veriyor daha sonra sorunsuz şekilde devam edebilirsiniz. 7 | 8 | 9 | ``` 10 | // SPDX-License-Identifier: MIT 11 | pragma solidity ^0.8.4; 12 | 13 | contract SimpleStorage { 14 | uint storedData; 15 | 16 | function set() public { 17 | storedData = storedData + 1; 18 | } 19 | 20 | function get() public view returns (uint) { 21 | return storedData; 22 | } 23 | } 24 | ``` 25 | 26 |

Node.js ve npm kurulumu yapma

27 | 28 | > Npm ve node.js kurulumunu yapalım. 29 | 30 | ``` 31 | # komutları sırasıyla girelim: 32 | curl -sL https://deb.nodesource.com/setup_20.x -o /tmp/nodesource_setup.sh 33 | sudo bash /tmp/nodesource_setup.sh 34 | sudo apt install nodejs 35 | 36 | curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash 37 | source ~/.bashrc 38 | nvm install v20.10.0 39 | nvm use v20.10.0 40 | npm install -g npm@latest 41 | 42 | ``` 43 | 44 | 45 | > Daha sonra burada yeni bir klasör oluştur. npm ile proje oluştur. hepsini enter ile geçebilirsin. 46 | 47 | ``` 48 | mkdir bot 49 | cd bot 50 | npm init 51 | 52 | ``` 53 | 54 | > index.js dosyasını oluştur. Bu repodaki index.js klasorunu düzelterek yapıştır. Şunları düzenle `KONTRAT ADRESİ(26.satır)`, `RPC(32.Satır)`, `PRIVATE_KEY(34.satır)`. Ctrl+X Y sonra Enter ile kaydet. 55 | 56 | ``` 57 | 58 | nano index.js 59 | 60 | ``` 61 | 62 | > Aynısını package.json için yap. Ctrl+K ile hepsini sil. Githubdan package.json kopyala yapıştır. Ctrl+X Y sonra Enter ile kaydet. 63 | 64 | ``` 65 | 66 | nano package.json 67 | 68 | ``` 69 | 70 | > En son aşağıdakileri çalıştıralım 71 | 72 | ``` 73 | npm install 74 | node index.js 75 | 76 | ``` 77 | > Herşey doğru ise Stored Data sürekli aratacak. 78 | 79 |

Screen ile Arkaplanda Çalıştırmaya Devam Etme

80 | 81 | > Ctrl+C ile durduralım. 82 | > Screen indirelim. 83 | 84 | ``` 85 | apt install screen 86 | 87 | ``` 88 | 89 | > Screen oluşturalım. 90 | 91 | ``` 92 | screen -S bot-air 93 | 94 | ``` 95 | 96 | > Tekrar çalıştıralım. 97 | 98 | ``` 99 | node index.js 100 | 101 | ``` 102 | 103 | > Ctrl+A+D ile çıkabilirsiniz. 104 | > Screen içine girmek için; 105 | 106 | ``` 107 | screen -r bot-air 108 | 109 | ``` 110 | -------------------------------------------------------------------------------- /AirchainsMonitor.md: -------------------------------------------------------------------------------- 1 | # AirchainsMonitor 2 | 3 | AirchainsMonitor, Airchains ağ düğümünü izlemek ve bakımını yapmak için tasarlanmış bir Bash betiğidir. Airchains doğrulayıcıları için otomatik hata algılama, RPC uç noktası değiştirme ve sistem bakımı sağlar. 4 | 5 | 6 | ## 2 Farklı versyion? 7 | - `Airchainsmonitor.sh` bu versiyon rpc değiştirmiyor sadece saatlik rollback yapıyor. 8 | - `AirchainsmonitorRPC.sh` bu versiyon saatlik olarak hem rpc değiştiriyor hem de rollback atıyor. 9 | 10 | ## Özellikler 11 | 12 | - Airchains ağının otomatik izlenmesi 13 | - Yaygın hataların tespiti ve ele alınması 14 | - Birden fazla RPC uç noktası arasında dinamik geçiş 15 | - `stationd` servisinin otomatik geri alınması ve yeniden başlatılması 16 | 17 | ## Eklediğim RPC linkleri 18 | - RPC linklerini artık 19 | URL1="https://testnet-files.bonynode.online/airchains/.rpc_combined.json" 20 | URL2="https://api.nodejumper.io/api/v1/airchainstestnet/rpcs" 21 | bu iki linkten çekip en hızlısını kullanacak şekilde ayarladım. 22 | 23 | ## Nereye/Nasıl kurmalıyım? 24 | 25 | - "tracks" klasörünün içine girip çalıştırmanız lazım 26 | - Hali hazırda tx kasmak için elinizde 1 ya da 2 screen vardır onların yanına bir üçüncüsünü (ya da ikincisini) ekleyin yeterli başka bir screen de tekrardan airchain çalıştırmanıza gerek yok. 27 | 28 | ## Oto Kurulum 29 | 30 | ### **Bu kurulum yöntemi link üzerinden script çalıştırdığı için güvenlik riski taşımaktadır. Linkteki dosyanın sizden habersiz değiştirilmesi ile cüzdan bilgileriniz çalınabilir. Güvenip güvenmemek size kalmış.** 31 | 32 | 1. Aşağıdaki komutu yazın direkt çalışacaktır. 33 | ``` 34 | curl -sL1 https://raw.githubusercontent.com/Dwtexe/Airchains-MonitorAddon/main/AirchainsMonitor.sh | bash 35 | ``` 36 | 2. Otomatik rpc değişsin istiyorsanız: 37 | ``` 38 | curl -sL1 https://raw.githubusercontent.com/Dwtexe/Airchains-MonitorAddon/main/AirchainsMonitorRPC.sh | bash 39 | ``` 40 | 41 | 42 | ## Manuel Kurulum 43 | 44 | 1. `AirchainsMonitor.sh` adlı dosyayı repoda bulup açın. 45 | 2. `cd tracks/` yazıp dizine girelim. 46 | 3. `nano AirchainsMonitor.sh` yazarak dosya oluşturalım. 47 | 4. Repodaki `AirchainsMonitor.sh` dosyasını kopyalayayıp yapıştıralım. 48 | ==> 160. satırdan ne kadar sürede bir restart atmasını istediğinizi ayarlayabilirsiniz. (varsayılan olarak saatte 1 kere atıyor) 49 | 5. `CTRL + X` tuşlarına basıp `Y` tuşuna basarak kaydedelim. 50 | 6. `chmod +x AirchainsMonitor.sh` yazarak dosyayı kullanılabilir hale getirelim. 51 | 7. Son yazılan kodu `./AirchainsMonitor.sh` ile çalıştırabilirsiniz. 52 | ``` 53 | ./AirchainsMonitor.sh 54 | ``` 55 | 56 | Betik şunları yapacaktır: 57 | 1. `stationd` servisini durdurma 58 | 2. Geri alma (rollback) işlemi gerçekleştirme 59 | 3. `stationd` servisini yeniden başlatma 60 | 4. Sistem günlüklerini temizleme 61 | 5. Airchains ağını izlemeye başlama 62 | 63 | ## İzleme Süreci 64 | 65 | Betik, Airchains ağını sürekli olarak çeşitli sorunlar için izler, bunlar arasında: 66 | - Başarısız işlemler 67 | - VRF doğrulama hataları 68 | - İstemci bağlantı hataları 69 | - RPC hataları 70 | - Yetersiz fee hataları 71 | 72 | Bir hata tespit edildiğinde, betik şunları yapacaktır: 73 | 1. Bir hata mesajı gösterme 74 | 2. Farklı bir RPC uç noktasına geçiş yapma 75 | 3. Geri alma (rollback) işlemi gerçekleştirme 76 | 4. `stationd` servisini yeniden başlatma 77 | 78 | ## Özelleştirme 79 | 80 | Betiği aşağıdakileri değiştirerek özelleştirebilirsiniz: 81 | 82 | - RPC uç noktaları: `RPC_ENDPOINTS` dizisini tercih ettiğiniz uç noktalarla güncelleyin. 83 | - Hata algılama: Hata kalıpları eklemek veya kaldırmak için `process_log_line` fonksiyonunu değiştirin. 84 | 85 | ## Destek 86 | 87 | Bu betiği faydalı bulursanız, geliştiriciyi desteklemeyi düşünebilirsiniz: 88 | 89 | - Oluşturan: @dwtexe 90 | - Bağış adresi: air1dksx7yskxthlycnhvkvxs8c452f9eus5cxh6t5 91 | 92 | ## Sorumluluk Reddi 93 | 94 | Bu betik olduğu gibi, herhangi bir garanti olmaksızın sağlanmaktadır. Kendi sorumluluğunuzda kullanın ve her zaman düğüm verilerinizin uygun yedeklerini aldığınızdan emin olun. 95 | 96 | ## Lisans 97 | 98 | Bu proje açık kaynaklıdır ve [MIT Lisansı](https://opensource.org/licenses/MIT) altında kullanılabilir. 99 | -------------------------------------------------------------------------------- /Auto-Restart_hata alindiginda tetiklenir.md: -------------------------------------------------------------------------------- 1 | # AirChains | RPC Hatası'nı Düzeltmek için Script 2 | 3 | Bu script, log dosyamızda **"RPC hatası"** ve **"Switchyard client connection error"** hatası aldığımız anda tetiklenerek **rollback** işlemi gerçekleştirecek ve hatanın giderilmesini sağlayacaktır. 4 | 5 | --- 6 | 7 | Bu scripti oluşturmaya başlamadan önce yapılması gereken bazı işlemler var. 8 | --- 9 | **Lütfen okuyun:** 10 | 11 | "stationd" servis dosyasını çalıştırdığımız (yani `sudo journalctl -u stationd -f --no-hostname -o cat` komutu ile logların aktığı) "air" isminde bir screen oturumumuz halihazırda mevcut (node kurulumu esnasında screen'e farklı bir isim verdiyseniz, sonraki adımlarda "air" yerine kendi screen adınızı kullanınız). 12 | 13 | RPC hatasını düzeltmek için çalıştıracağımız scripti ise "autorestart" isminde ayrı bir screen oturumu içerisinde çalıştıracağız. 14 | 15 | Ancak burada şöyle bir problem doğuyor: Logların aktığı "air" isimli screen'in, logları tuttuğu bir log dosyası yok. Dolayısıyla, RPC hatasını düzeltmek için oluşturacağımız script, logları takip edemiyor ve devreye girmesi için, algılaması gereken hata mesajlarını algılayamıyor. Dolayısıyla öncelikle bu sorunu çözmemiz gerekiyor. 16 | 17 | **Bu sorunu gidermek için aşağıdaki adımları izleyeceğiz;** 18 | 19 | Öncelikle logların aktığı screen oturumunu, 'logları kaydedecek şekilde' yeniden oluşturmamız gerekiyor: 20 | 21 | **1- Varolan "air" screeni'ni silelim:** 22 | 23 | *(Servis dosyasını çalıştırdığınız screen ismi farklıysa "air" yerine kendi screen adınızı girmelisiniz)* 24 | 25 | ``` 26 | screen -XS air quit 27 | ``` 28 | --- 29 | **2- Logları kaydedecek şekilde (-L seçeneği ile), "air" isminde yeni bir screen oturumu açalım:** 30 | ``` 31 | screen -S air -L 32 | ``` 33 | --- 34 | **3- -L seçeneği ile açtığımız screen, default olarak screenlog.0 isminde bir dosya oluşturmuş olmalı. (Dosya yolu: /root/screenlog.0)** 35 | 36 | *(Bu dosya, script oluştururken işimize yarayacak)* 37 | 38 | --- 39 | 4- Yeni oluşturduğumuz "air" screen'inden Ctrl a+d ile çıkarak ana dizine gelelim. 40 | 41 | --- 42 | 43 | ### Yukarıdaki adımları tamamladıysak, script dosyasını oluşturmaya başlayabiliriz 44 | --- 45 | 46 | ## 1- Betik Dosyasını Oluşturma: 47 | Betik dosyasını oluşturalım: 48 | ``` 49 | nano /root/restart_stationd.sh 50 | ``` 51 | Aşağıdaki içeriği 'değişiklik yapmadan' olduğu gibi yapıştıralım ve Ctrl x+y ile kaydederek çıkalım: 52 | ``` 53 | #!/bin/bash 54 | 55 | LOG_FILE="/root/screenlog.0" 56 | ERROR_MSGS=("rpc error: code = Unknown desc = rpc error: code = Unknown desc = failed to execute message; message index: 0: rpe error: code = Unavailable desc = incorrect pod number" "rpc error: code = Unknown desc" "Switchyard client connection error") 57 | 58 | echo "Betik başlatılıyor..." 59 | while true; do 60 | echo "Loglar kontrol ediliyor..." 61 | # Logları kontrol et 62 | tail -n 50 $LOG_FILE > /root/temp_log.log # Son 50 satırı geçici bir dosyaya yaz 63 | for ERROR_MSG in "${ERROR_MSGS[@]}"; do 64 | echo "Hata mesajı aranıyor: $ERROR_MSG" 65 | if grep -q "$ERROR_MSG" /root/temp_log.log; then 66 | echo "Hata tespit edildi: $ERROR_MSG" 67 | systemctl stop stationd 68 | cd /root/tracks 69 | /usr/local/go/bin/go run cmd/main.go rollback 70 | systemctl restart stationd 71 | echo "stationd servisi yeniden başlatıldı" 72 | break 73 | fi 74 | done 75 | # 30 saniye bekle 76 | sleep 30 77 | done 78 | ``` 79 | 80 | ## 2- Betik Dosyasına Çalıştırma İzni Verme: 81 | ``` 82 | chmod +x /root/restart_stationd.sh 83 | ``` 84 | 85 | ## 3- Betiği Servis Olarak Ayarlama: 86 | Bir systemd servis dosyası oluşturalım ve betiği bir sistem servisi olarak ayarlayalım. Bu sayede betik sürekli olarak çalışacak ve hatayı algıladığında gerekli işlemleri yapacak. 87 | ``` 88 | sudo nano /etc/systemd/system/restart_stationd.service 89 | ``` 90 | Aşağıdaki içeriği 'değişiklik yapmadan' olduğu gibi yapıştıralım ve Ctrl x+y ile kaydederek çıkalım: 91 | ``` 92 | [Unit] 93 | Description=Restart stationd service on error 94 | After=network.target 95 | 96 | [Service] 97 | User=root 98 | ExecStart=/root/restart_stationd.sh 99 | Restart=always 100 | RestartSec=10 101 | 102 | [Install] 103 | WantedBy=multi-user.target 104 | ``` 105 | 106 | ## 4- Servisi Etkinleştirme ve Başlatma: 107 | Autorestart isminde yeni bir screen oluşturalım: 108 | ``` 109 | screen -S autorestart 110 | ``` 111 | Servis dosyasını etkinleştirip başlatalım: 112 | ``` 113 | sudo systemctl daemon-reload 114 | sudo systemctl enable restart_stationd.service 115 | sudo systemctl start restart_stationd.service 116 | ``` 117 | Bu adımlar sonrasında, restart_stationd servisi logları sürekli olarak izleyecek ve belirtilen hata mesajını algıladığında otomatik olarak gerekli işlemleri yaparak node'unu yeniden başlatacaktır. Bu sayede, hatayı fark etmediğimiz durumlarda bile sistem otomatik olarak kendini toparlayabilecektir. 118 | 119 | --- 120 | 121 | # Script silme: 122 | ``` 123 | sudo systemctl stop restart_stationd.service 124 | sudo systemctl disable restart_stationd.service 125 | ``` 126 | ``` 127 | sudo rm /etc/systemd/system/restart_stationd.service 128 | ``` 129 | ``` 130 | sudo systemctl daemon-reload 131 | ``` 132 | ``` 133 | rm /root/restart_stationd.sh 134 | ``` 135 | -------------------------------------------------------------------------------- /AirchainsMonitor.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Color definitions 4 | declare -A colors=( 5 | ["RED"]='\033[0;31m' 6 | ["GREEN"]='\033[0;32m' 7 | ["YELLOW"]='\033[1;33m' 8 | ["BLUE"]='\033[0;94m' 9 | ["MAGENTA"]='\033[0;35m' 10 | ["CYAN"]='\033[0;36m' 11 | ["WHITE"]='\033[1;37m' 12 | ["NC"]='\033[0m' # No Color 13 | ) 14 | 15 | # Global variable to store the last restart time 16 | LAST_RESTART_TIME=$(date +%s) 17 | 18 | # Function definitions 19 | 20 | cecho() { 21 | local color="${colors[$1]}" 22 | local message="$2" 23 | echo -e "${color}${message}${colors[NC]}" 24 | } 25 | 26 | check_and_install_packages() { 27 | local packages=("figlet" "lolcat") 28 | for package in "${packages[@]}"; do 29 | if ! command -v "$package" &> /dev/null; then 30 | cecho "YELLOW" "Installing $package..." 31 | sudo apt-get update > /dev/null 2>&1 32 | sudo apt-get install -y "$package" > /dev/null 2>&1 33 | cecho "GREEN" "$package installed successfully." 34 | fi 35 | done 36 | } 37 | 38 | display_banner() { 39 | clear 40 | figlet -c "AirchainsMonitor" | lolcat -f 41 | echo 42 | cecho "GREEN" "📡 Monitoring Airchains Network" 43 | cecho "CYAN" "👨‍💻 Created by: @dwtexe" 44 | cecho "BLUE" "💰 Donate: air1dksx7yskxthlycnhvkvxs8c452f9eus5cxh6t5" 45 | echo 46 | cecho "MAGENTA" "🔍 Actively watching for network issues..." 47 | echo 48 | } 49 | 50 | restart_service() { 51 | cecho "YELLOW" "=> Stopping stationd service..." 52 | sudo systemctl stop stationd > /dev/null 2>&1 53 | sudo systemctl restart stationd > /dev/null 2>&1 54 | sudo systemctl daemon-reload 55 | sudo systemctl stop rolld 56 | 57 | sleep 10 58 | sudo systemctl stop stationd > /dev/null 2>&1 59 | while sudo systemctl is-active --quiet stationd; do 60 | sleep 5 61 | done 62 | 63 | cecho "YELLOW" "=> Running rollback commands..." 64 | sleep 10 65 | if go run cmd/main.go rollback && go run cmd/main.go rollback; then 66 | cecho "GREEN" "=> Successfully ran rollback commands" 67 | else 68 | cecho "RED" "Run this script in the tracks/ folder." 69 | exit 1 70 | fi 71 | 72 | sleep 5 73 | cecho "YELLOW" "=> Removing old logs" 74 | sudo journalctl --rotate > /dev/null 2>&1 75 | sudo journalctl --vacuum-time=1s > /dev/null 2>&1 76 | sudo find /var/log/journal -name "*.journal" | xargs sudo rm -rf 77 | sudo systemctl restart systemd-journald > /dev/null 2>&1 78 | sleep 5 79 | 80 | cecho "YELLOW" "=> Restarting stationd service..." 81 | sudo systemctl restart rolld 82 | sudo systemctl daemon-reload 83 | sudo systemctl restart stationd > /dev/null 2>&1 84 | cecho "GREEN" "=> Successfully restarted stationd service" 85 | 86 | # Update the last restart time 87 | LAST_RESTART_TIME=$(date +%s) 88 | } 89 | 90 | process_log_line() { 91 | local line="$1" 92 | 93 | # Check if an hour has passed since the last restart 94 | local current_time=$(date +%s) 95 | if (( current_time - LAST_RESTART_TIME >= 3600 )); then 96 | cecho "YELLOW" "An hour has passed. Restarting service..." 97 | restart_service 98 | fi 99 | 100 | # Filter out unwanted lines 101 | if [[ "$line" =~ stationd\.service:|DBG|"compiling circuit"|"parsed circuit inputs"|"building constraint builder"|"VRF Initiated Successfully"|"Eigen DA Blob KEY:"|"Pod submitted successfully"|"VRF Validated Tx Success"|"Generating proof"|"Pod Verification Tx Success" ]]; then 102 | return 103 | elif [[ "$line" == *"Generating New unverified pods"* ]]; then 104 | echo 105 | cecho "BLUE" "=***=***=***=***=***=***=***=" 106 | echo 107 | fi 108 | 109 | # Simplify error messages 110 | case "$line" in 111 | *"Error="*"account sequence mismatch"*) 112 | local timestamp=$(echo "$line" | awk '{print $1}') 113 | local error_type=$(echo "$line" | sed -n 's/.*ERR Error in \(.*\) Error=.*/\1/p') 114 | local expected=$(echo "$line" | sed -n 's/.*expected \([0-9]*\).*/\1/p') 115 | local got=$(echo "$line" | sed -n 's/.*got \([0-9]*\).*/\1/p') 116 | echo "${timestamp} Error in ${error_type} Error=\"account sequence mismatch, expected ${expected}, got ${got}: incorrect account sequence\"" 117 | ;; 118 | *"Error in InitVRF transaction Error="*"waiting for next block: error while requesting node"*) 119 | local timestamp=$(echo "$line" | awk '{print $1}') 120 | local url=$(echo "$line" | sed -n "s/.*requesting node '\([^']*\)'.*/\1/p") 121 | echo "${timestamp} Error in InitVRF transaction Error=\"waiting for next block: error while requesting node '${url}'\"" 122 | ;; 123 | *"Error in"*"insufficient fees"*) 124 | local timestamp=$(echo "$line" | awk '{print $1}') 125 | local error_type=$(echo "$line" | sed -n 's/.*ERR Error in \(.*\) Error=.*/\1/p') 126 | local fees=$(echo "$line" | sed -n 's/.*insufficient fees; got: \([^;]*\) required: \([^:]*\).*/got: \1 required: \2/p') 127 | echo "${timestamp} Error in ${error_type} Error=\"insufficient fees; ${fees}:\"" 128 | ;; 129 | *"failed to execute message"*) 130 | local timestamp=$(echo "$line" | awk '{print $1}') 131 | echo "${timestamp} Error in SubmitPod Transaction Error=\"rpc error: failed to execute message; invalid request\"" 132 | ;; 133 | *"Error in SubmitPod Transaction"*"error in json rpc client"*) 134 | local timestamp=$(echo "$line" | awk '{print $1}') 135 | echo "${timestamp} Error in SubmitPod Transaction Error=\"error in json rpc client\"" 136 | ;; 137 | *"Error in VerifyPod transaction"*"error in json rpc client"*) 138 | local timestamp=$(echo "$line" | awk '{print $1}') 139 | echo "${timestamp} Error in VerifyPod transaction Error=\"error in json rpc client\"" 140 | ;; 141 | *"request ratelimited"*) 142 | local timestamp=$(echo "$line" | awk '{print $1}') 143 | echo "${timestamp} Error Request rate limited" 144 | ;; 145 | *"Error in ValidateVRF transaction"*) 146 | local timestamp=$(echo "$line" | awk '{print $1}') 147 | echo "${timestamp} Error in ValidateVRF transaction Error=\"error in json rpc client\"" 148 | ;; 149 | *) 150 | echo "$line" 151 | ;; 152 | esac 153 | } 154 | 155 | main() { 156 | clear 157 | cecho "CYAN" "Starting Airchains Monitor..." 158 | 159 | check_and_install_packages 160 | 161 | restart_service 162 | 163 | display_banner 164 | 165 | sudo journalctl -u stationd -f -n 0 --no-hostname -o cat | while read -r line 166 | do 167 | process_log_line "$line" 168 | done 169 | } 170 | 171 | main 172 | -------------------------------------------------------------------------------- /AirchainsMonitorRPC.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Color definitions 4 | declare -A colors=( 5 | ["RED"]='\033[0;31m' 6 | ["GREEN"]='\033[0;32m' 7 | ["YELLOW"]='\033[1;33m' 8 | ["BLUE"]='\033[0;94m' 9 | ["MAGENTA"]='\033[0;35m' 10 | ["CYAN"]='\033[0;36m' 11 | ["WHITE"]='\033[1;37m' 12 | ["NC"]='\033[0m' # No Color 13 | ) 14 | 15 | # URLs of the JSON files 16 | URL1="https://testnet-files.bonynode.online/airchains/.rpc_combined.json" 17 | URL2="https://api.nodejumper.io/api/v1/airchainstestnet/rpcs" 18 | 19 | # Global variable to store the last restart time 20 | LAST_RESTART_TIME=$(date +%s) 21 | 22 | # Function definitions 23 | 24 | cecho() { 25 | local color="${colors[$1]}" 26 | local message="$2" 27 | echo -e "${color}${message}${colors[NC]}" 28 | } 29 | 30 | check_and_install_packages() { 31 | local packages=("figlet" "lolcat" "jq" "curl" "bc") 32 | for package in "${packages[@]}"; do 33 | if ! command -v "$package" &> /dev/null; then 34 | cecho "YELLOW" "Installing $package..." 35 | sudo apt-get update > /dev/null 2>&1 36 | sudo apt-get install -y "$package" > /dev/null 2>&1 37 | cecho "GREEN" "$package installed successfully." 38 | fi 39 | done 40 | } 41 | 42 | display_banner() { 43 | clear 44 | figlet -c "AirchainsMonitor" | lolcat -f 45 | echo 46 | cecho "GREEN" "📡 Monitoring Airchains Network" 47 | cecho "CYAN" "👨‍💻 Created by: @dwtexe" 48 | cecho "BLUE" "💰 Donate: air1dksx7yskxthlycnhvkvxs8c452f9eus5cxh6t5" 49 | echo 50 | cecho "MAGENTA" "🔍 Actively watching for network issues..." 51 | echo 52 | } 53 | 54 | 55 | fetch_and_filter_rpcs() { 56 | # Fetch and combine data from both URLs 57 | combined_ips=$( 58 | (curl -s "$URL1" | jq -r 'to_entries[] | select(.value.tx_index == "on") | .key'; 59 | curl -s "$URL2" | jq -r '.[] | select(.tx_index == true) | .ip') | sort | uniq 60 | ) 61 | 62 | # Process combined and deduplicated IPs 63 | cecho "YELLOW" "Fetching and filtering RPC endpoints..." 64 | declare -A rpc_response_times 65 | while read -r ip; do 66 | # Extract IP and port 67 | ip_addr=$(echo $ip | cut -d':' -f1) 68 | port=$(echo $ip | cut -d':' -f2) 69 | 70 | # Check if SSL is supported (timeout after 5 seconds) 71 | if timeout 5 openssl s_client -connect ${ip_addr}:${port} /dev/null; then 72 | protocol="https" 73 | else 74 | protocol="http" 75 | fi 76 | 77 | # Check if the site is accessible and measure response time 78 | start_time=$(date +%s.%N) 79 | status_code=$(curl -s -o /dev/null -w "%{http_code}" -m 10 ${protocol}://${ip}) 80 | end_time=$(date +%s.%N) 81 | response_time=$(echo "$end_time - $start_time" | bc) 82 | 83 | if [ "$status_code" -ge 200 ] && [ "$status_code" -lt 400 ]; then 84 | rpc_response_times["${protocol}://${ip}"]=$response_time 85 | else 86 | echo 87 | fi 88 | done <<< "$combined_ips" 89 | 90 | # Sort RPC endpoints by response time and get the fastest one 91 | fastest_rpc=$(for rpc in "${!rpc_response_times[@]}"; do 92 | echo "${rpc_response_times[$rpc]} $rpc" 93 | done | sort -n | head -n 1 | cut -d' ' -f2-) 94 | 95 | RPC_ENDPOINTS=("$fastest_rpc") 96 | cecho "GREEN" "Fastest RPC endpoint: ${RPC_ENDPOINTS[0]}" 97 | } 98 | 99 | restart_service() { 100 | cecho "YELLOW" "=> Stopping stationd service..." 101 | sudo systemctl stop stationd > /dev/null 2>&1 102 | sudo systemctl restart stationd > /dev/null 2>&1 103 | sudo systemctl daemon-reload 104 | sudo systemctl stop rolld 105 | 106 | sleep 10 107 | sudo systemctl stop stationd > /dev/null 2>&1 108 | while sudo systemctl is-active --quiet stationd; do 109 | sleep 5 110 | done 111 | 112 | cecho "YELLOW" "=> Running rollback commands..." 113 | sleep 10 114 | if go run cmd/main.go rollback && go run cmd/main.go rollback; then 115 | cecho "GREEN" "=> Successfully ran rollback commands" 116 | else 117 | cecho "RED" "Run this script in the tracks/ folder." 118 | exit 1 119 | fi 120 | 121 | sleep 5 122 | cecho "YELLOW" "=> Removing old logs" 123 | sudo journalctl --rotate > /dev/null 2>&1 124 | sudo journalctl --vacuum-time=1s > /dev/null 2>&1 125 | sudo find /var/log/journal -name "*.journal" | xargs sudo rm -rf 126 | sudo systemctl restart systemd-journald > /dev/null 2>&1 127 | sleep 5 128 | 129 | cecho "YELLOW" "=> Restarting stationd service..." 130 | sudo systemctl restart rolld 131 | sudo systemctl daemon-reload 132 | sudo systemctl restart stationd > /dev/null 2>&1 133 | cecho "GREEN" "=> Successfully restarted stationd service" 134 | 135 | # Update the last restart time 136 | LAST_RESTART_TIME=$(date +%s) 137 | } 138 | 139 | changeRPC() { 140 | fetch_and_filter_rpcs 141 | 142 | local old_rpc_endpoint=$(grep 'JunctionRPC' ~/.tracks/config/sequencer.toml | cut -d'"' -f2) 143 | local new_rpc_endpoint="${RPC_ENDPOINTS[0]}" # Always use the fastest RPC 144 | 145 | sed -i "s|JunctionRPC = \".*\"|JunctionRPC = \"$new_rpc_endpoint\"|" ~/.tracks/config/sequencer.toml 146 | 147 | cecho "GREEN" "=> Successfully updated JunctionRPC from $old_rpc_endpoint to: $new_rpc_endpoint" 148 | 149 | restart_service 150 | 151 | clear 152 | display_banner 153 | } 154 | 155 | process_log_line() { 156 | local line="$1" 157 | 158 | # Check if an hour has passed since the last restart 159 | local current_time=$(date +%s) 160 | if (( current_time - LAST_RESTART_TIME >= 3600 )); then 161 | cecho "YELLOW" "An hour has passed. Restarting service..." 162 | changeRPC 163 | fi 164 | 165 | # Filter out unwanted lines 166 | if [[ "$line" =~ stationd\.service:|DBG|"compiling circuit"|"parsed circuit inputs"|"building constraint builder"|"VRF Initiated Successfully"|"Eigen DA Blob KEY:"|"Pod submitted successfully"|"VRF Validated Tx Success"|"Generating proof"|"Pod Verification Tx Success" ]]; then 167 | return 168 | elif [[ "$line" == *"Generating New unverified pods"* ]]; then 169 | echo 170 | cecho "BLUE" "=***=***=***=***=***=***=***=" 171 | echo 172 | fi 173 | 174 | # Simplify error messages 175 | case "$line" in 176 | *"Error="*"account sequence mismatch"*) 177 | local timestamp=$(echo "$line" | awk '{print $1}') 178 | local error_type=$(echo "$line" | sed -n 's/.*ERR Error in \(.*\) Error=.*/\1/p') 179 | local expected=$(echo "$line" | sed -n 's/.*expected \([0-9]*\).*/\1/p') 180 | local got=$(echo "$line" | sed -n 's/.*got \([0-9]*\).*/\1/p') 181 | echo "${timestamp} Error in ${error_type} Error=\"account sequence mismatch, expected ${expected}, got ${got}: incorrect account sequence\"" 182 | ;; 183 | *"Error in InitVRF transaction Error="*"waiting for next block: error while requesting node"*) 184 | local timestamp=$(echo "$line" | awk '{print $1}') 185 | local url=$(echo "$line" | sed -n "s/.*requesting node '\([^']*\)'.*/\1/p") 186 | echo "${timestamp} Error in InitVRF transaction Error=\"waiting for next block: error while requesting node '${url}'\"" 187 | ;; 188 | *"Error in"*"insufficient fees"*) 189 | local timestamp=$(echo "$line" | awk '{print $1}') 190 | local error_type=$(echo "$line" | sed -n 's/.*ERR Error in \(.*\) Error=.*/\1/p') 191 | local fees=$(echo "$line" | sed -n 's/.*insufficient fees; got: \([^;]*\) required: \([^:]*\).*/got: \1 required: \2/p') 192 | echo "${timestamp} Error in ${error_type} Error=\"insufficient fees; ${fees}:\"" 193 | ;; 194 | *"failed to execute message"*) 195 | local timestamp=$(echo "$line" | awk '{print $1}') 196 | echo "${timestamp} Error in SubmitPod Transaction Error=\"rpc error: failed to execute message; invalid request\"" 197 | ;; 198 | *"Error in SubmitPod Transaction"*"error in json rpc client"*) 199 | local timestamp=$(echo "$line" | awk '{print $1}') 200 | echo "${timestamp} Error in SubmitPod Transaction Error=\"error in json rpc client\"" 201 | ;; 202 | *"Error in VerifyPod transaction"*"error in json rpc client"*) 203 | local timestamp=$(echo "$line" | awk '{print $1}') 204 | echo "${timestamp} Error in VerifyPod transaction Error=\"error in json rpc client\"" 205 | ;; 206 | *"request ratelimited"*) 207 | local timestamp=$(echo "$line" | awk '{print $1}') 208 | echo "${timestamp} Error Request rate limited" 209 | ;; 210 | *"Error in ValidateVRF transaction"*) 211 | local timestamp=$(echo "$line" | awk '{print $1}') 212 | echo "${timestamp} Error in ValidateVRF transaction Error=\"error in json rpc client\"" 213 | ;; 214 | *) 215 | echo "$line" 216 | ;; 217 | esac 218 | } 219 | 220 | main() { 221 | clear 222 | cecho "CYAN" "Starting Airchains Monitor..." 223 | 224 | check_and_install_packages 225 | 226 | changeRPC 227 | 228 | display_banner 229 | 230 | sudo journalctl -u stationd -f -n 0 --no-hostname -o cat | while read -r line 231 | do 232 | process_log_line "$line" 233 | done 234 | } 235 | 236 | main 237 | -------------------------------------------------------------------------------- /2.station kurma.md: -------------------------------------------------------------------------------- 1 |

Airchains

2 | 3 | > UYARI : Her hangi bir hatada puanlarınızın kaybolmaması için kurulum aşamalarında verilen keyleri ve priv keyleri saklayın. 4 | 5 | > Standart güncelleme ve gereksinimleri kuruyoruz. 6 | 7 | # 8 | 9 |

Donanım

10 | 11 | ``` 12 | Minimum: 2 vCPU 4 RAM 13 | Önerilen: 4vCPU 8 RAM 14 | ``` 15 |

Kurulum

16 | 17 | ```console 18 | # güncelleme 19 | apt update && apt upgrade -y 20 | sudo apt install -y curl git jq lz4 build-essential cmake perl automake autoconf libtool wget libssl-dev 21 | 22 | # Go kurulumu 23 | sudo rm -rf /usr/local/go 24 | curl -L https://go.dev/dl/go1.22.3.linux-amd64.tar.gz | sudo tar -xzf - -C /usr/local 25 | echo 'export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin' >> $HOME/.bash_profile 26 | source .bash_profile 27 | ``` 28 | 29 | ```console 30 | # Gerekli repoları çekiyoruz 31 | git clone https://github.com/airchains-network/evm-station.git 32 | git clone https://github.com/airchains-network/tracks.git 33 | ``` 34 | 35 | ```console 36 | # evmos ağımızın kurulumuna başlıyoruz, bu localde çalışan kendi ağımız. 37 | cd evm-station 38 | go mod tidy 39 | ``` 40 | 41 | ```console 42 | # Bu komutla kurulumu tamamlıyoruz. 43 | /bin/bash ./scripts/local-setup.sh 44 | ``` 45 | 46 | > Sistem dosyasının sağlıklı çalışabilmesi için bir env oluşturuyoruz. 47 | 48 | ```console 49 | nano ~/.rollup-env 50 | ``` 51 | 52 | > İçerisine gerekli değişkenleri giriyoruz. 53 | 54 | ```console 55 | # buradaki kod bloğunda değiştirmeniz bir yer yok. 56 | MONIKER="localtestnet" 57 | KEYRING="test" 58 | KEYALGO="eth_secp256k1" 59 | LOGLEVEL="info" 60 | HOMEDIR="$HOME/.evmosd" 61 | TRACE="" 62 | BASEFEE=1000000000 63 | CONFIG=$HOMEDIR/config/config.toml 64 | APP_TOML=$HOMEDIR/config/app.toml 65 | GENESIS=$HOMEDIR/config/genesis.json 66 | TMP_GENESIS=$HOMEDIR/config/tmp_genesis.json 67 | VAL_KEY="mykey" 68 | ``` 69 | 70 | > Servis dosyasını yazıyoruz. User kullanıyorsanız `root` kısmını ona göre değiştirin. 71 | 72 | ```console 73 | # tek komut tüm bloğu copy paste yapabilirsiniz yavrularım 74 | sudo tee /etc/systemd/system/rolld.service > /dev/null << EOF 75 | [Unit] 76 | Description=ZK 77 | After=network.target 78 | 79 | [Service] 80 | User=root 81 | EnvironmentFile=/root/.rollup-env 82 | ExecStart=/root/evm-station/build/station-evm start --metrics "" --log_level info --json-rpc.api eth,txpool,personal,net,debug,web3 --chain-id "stationevm_1234-1" 83 | Restart=always 84 | RestartSec=3 85 | 86 | [Install] 87 | WantedBy=multi-user.target 88 | EOF 89 | ``` 90 | 91 | > Servisleri güncelleyip başlatıyoruz. 92 | 93 | ``` 94 | sudo systemctl daemon-reload 95 | sudo systemctl enable rolld 96 | sudo systemctl start rolld 97 | sudo journalctl -u rolld -f --no-hostname -o cat 98 | ``` 99 | > Logların aktığını görmelisiniz. 100 | 101 | ![image](https://github.com/ruesandora/Airchains/assets/101149671/64137490-6b3b-4678-ae26-81c90dd1f952) 102 | 103 | 104 | # 105 | 106 | # 107 | 108 | > Sonraki aşamalarda rpc lazım olacak, onun ayarını yapalım. 109 | > Önce çalışan nodu durduralım 110 | 111 | ``` 112 | systemctl stop rolld 113 | ``` 114 | 115 | > Sonra app.toml dosyasına gidelim. 116 | > En altta RPC kısmı şu şekilde olacak. 117 | 118 | ``` 119 | nano ~/.evmosd/config/app.toml 120 | ``` 121 | 122 | > Ayarı yaptıktan sonra kaydedip çıkalım ve nodu tekrar başlatalım. 123 | 124 | ``` 125 | systemctl restart rolld 126 | ``` 127 | 128 | ![image](https://github.com/ruesandora/Airchains/assets/101149671/588a02d0-f7e3-4c25-ac25-ffff281206eb) 129 | 130 | 131 | > Böylece cosmos rpclerini public yapmayı öğrendiniz. 132 | 133 | 134 | Bu komut bize private key verecek, saklıyoruz. 135 | ```console 136 | /bin/bash ./scripts/local-keys.sh 137 | ``` 138 | 139 | # 140 | 141 | DA layer olarak eigenlayer kullanacağız. Bunun için key gerekiyor, binary indirip çalışması için izin veriyoruz. 142 | Resmi dökümanda celestia, avail kurulumları da var onlara da bakabilirsiniz. 143 | Mock, yani sahte DA da kullanabilirsiniz (mock ile bir süre puan kazanılmasına izin vereceklermiş) 144 | Şu an testnette sonradan DA değiştirilmiyor, güncellemeyle bunu mümkün kılacaklarını söylediler. 145 | 146 | Benim EigenDA seçme nedenim en kolay Celestia ve Eigen olması (token de bulması kolay), Celestia ezbere biliyoruz - bu sefer Eigen olsun. 147 | 148 | # 149 | 150 | ```console 151 | cd $HOME 152 | wget https://github.com/airchains-network/tracks/releases/download/v0.0.2/eigenlayer 153 | mkdir -p $HOME/go/bin 154 | chmod +x $HOME/eigenlayer 155 | mv $HOME/eigenlayer $HOME/go/bin 156 | ``` 157 | 158 | ```console 159 | # `CUZDANADI` değiştirin ve çıktıda size verilen ECDSA Private Keyi saklayın. 160 | # Ctrl+c ile kapatın enterlayın ve verilen diğer `public hex` kenara not edin lazım olacak. 161 | # Verilen 0x evm adresine her ihtimale karşı 0.5 eth atın holesky ağında. 162 | 163 | eigenlayer operator keys create --key-type ecdsa CUZDANADI 164 | ``` 165 | 166 | > Şimdi track ve station kısmına geçiyoruz. 167 | 168 | ```console 169 | cd $HOME 170 | cd tracks 171 | go mod tidy 172 | ``` 173 | 174 | > tracks klasörü içindeyken aşağıdaki kodu başlatıyoruz. ```PUBLICHEX``` biraz önce aldığımız public key olacak. 175 | 176 | > MONIKER (validatör ismi) değiştirebilirsiniz kafanıza göre. 177 | 178 | ```console 179 | go run cmd/main.go init --daRpc "disperser-holesky.eigenda.xyz" --daKey "PUBLICHEX" --daType "eigen" --moniker "MONIKER" --stationRpc "http://127.0.0.1:8545" --stationAPI "http://127.0.0.1:8545" --stationType "evm" 180 | ``` 181 | 182 | # 183 | 184 | > Çıktı şu şekilde olacak 185 | 186 | ![tg_image_2547108070](https://github.com/ruesandora/Airchains/assets/101149671/463e6802-ab58-4e3b-86d2-8ba8c1c15819) 187 | 188 | # 189 | 190 | > TRACKER CÜZDAN IMPORT (İlk station kurarken yazdığımız cüzdan ismini ve bize verilen kelimeleri girerek aynı cüzdanı import edeceğiz) 191 | 192 | 193 | ```console 194 | go run cmd/main.go keys import --accountName CUZDANISMI --accountPath $HOME/.tracks/junction-accounts/keys --mnemonic 'bize verilen gizli kelimeler' 195 | ``` 196 | 197 | Account imported: airxxxxxxxxxxxxxxxxxxxxxxxxxx şeklinde size ait cüzdan adresini gösteren bir çıktı almanız lazım. 198 | 199 | > Sonra proveri çalıştırıyoruz. 200 | 201 | ```console 202 | go run cmd/main.go prover v1EVM 203 | ``` 204 | 205 | > Şimdi bize node id lazım, bunu da şurdan alıyoruz. 206 | 207 | ```console 208 | # ctrl w ile node id aratabilirsiniz, en aşağı gidip biraz yukarıda 209 | nano ~/.tracks/config/sequencer.toml 210 | ``` 211 | 212 | ![image](https://github.com/ruesandora/Airchains/assets/101149671/8be10bf2-c873-4e97-a40d-2dd148854991) 213 | 214 | # 215 | 216 | > Aşağıdaki kodda 217 | 218 | > `TRACKERCUZDAN` yukarda yazdığınız adı 219 | 220 | > `TRACKERCUZDAN-ADRESI` buna da air cüzdanı 221 | 222 | > `IP` ip adresiniz 223 | 224 | > `NODEID` sequencer.toml dan temin ettiğimiz node id olacak 225 | 226 | 227 | ```console 228 | go run cmd/main.go create-station --accountName TRACKERCUZDAN --accountPath $HOME/.tracks/junction-accounts/keys --jsonRPC "https://junction-testnet-rpc.synergynodes.com/" --info "EVM Track" --tracks TRACKERCUZDAN-ADRESI --bootstrapNode "/ip4/IP/tcp/2300/p2p/NODEID" 229 | ``` 230 | 231 | # 232 | 233 | > Stationu kurduk, şimdi bunu servisle çalıştıralım. 234 | 235 | > Servis çalıştırmak istemeyenler screen açıp tracks klasöründe `go run cmd/main.go start` komutunu çalıştırabilirler. 236 | 237 | ```console 238 | sudo tee /etc/systemd/system/stationd.service > /dev/null << EOF 239 | [Unit] 240 | Description=station track service 241 | After=network-online.target 242 | [Service] 243 | User=root 244 | WorkingDirectory=/root/tracks/ 245 | ExecStart=/usr/local/go/bin/go run cmd/main.go start 246 | Restart=always 247 | RestartSec=3 248 | LimitNOFILE=65535 249 | [Install] 250 | WantedBy=multi-user.target 251 | EOF 252 | ``` 253 | 254 | ```console 255 | sudo systemctl daemon-reload 256 | sudo systemctl enable stationd 257 | sudo systemctl restart stationd 258 | sudo journalctl -u stationd -f --no-hostname -o cat 259 | ``` 260 | 261 |

Kurulum tamam ama?

262 | 263 | Kurulum işlemleri bu kadar. Ama şu an puan kazanmıyorsunuz. 264 | Tracker cüzdanınızın mnemoniclerini leap wallet import edip https://points.airchains.io/ connect diyoruz 265 | Dashboardda stationu ve puanınızı görebilirsiniz. 266 | Henüz tx yapmadığımız için 100 point pending görünecek. Bunun sebebi şu, puan kazanmanız için pod çıkarmanız lazım. 267 | Pod 25txten oluşan bir paket gibi düşünebilirsiniz. Her 25tx 1 pod çıkaracak ve bu işlemlerden 5 puan kazanacaksınız. 268 | İlk kurulumdaki 100 puan, ilk poddan sonra aktif olacak. 269 | 270 | Bunun için de şunu yapıyoruz 271 | İlk başta `bin/bash ./scripts/local-keys.sh` komutuyla bir priv key aldık ve rpc ayarı yapmıştık. 272 | Metamaska bu priv keyi import ediyoruz, ağ ekle kısmında da şu bilgileri girin. 273 | 274 | ``` 275 | rpc http://IP:8545 276 | 277 | id 1234 278 | 279 | ticker tEVMOS 280 | ``` 281 | ![image](https://github.com/neuweltgeld/Airchains_/assets/101174090/578659e5-e1ad-4193-a6bf-b1da38de0a7e) 282 | 283 | 284 | girip okeyliyoruz. 285 | 286 | Ayrıca rpc'ye bağlanabilmek için 8545 numaralı portu açıyoruz o da şu komutla 287 | ``` 288 | sudo ufw allow 8545 289 | ``` 290 | Buradan artık kontrat mı deploy edersiniz, manuel tx mi kasarsınız size kalmış. 291 | 292 | Track işleminde rpc hatası alanlar rollback yapmayı denesinler. Bazen 1 bazen 3 rollback işlemiyle sorun çözülüyor. 293 | Kaç kez rollback yapmak istiyorsanız ``go run cmd/main.go rollback`` komutunu o kadar çalıştırın, her seferinde çıktıyı bekleyin. 294 | 295 | ``` 296 | systemctl stop stationd 297 | cd tracks 298 | go run cmd/main.go rollback 299 | sudo systemctl restart stationd 300 | sudo journalctl -u stationd -f --no-hostname -o cat 301 | ``` 302 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

Airchains

2 | 3 | > UYARI : Her hangi bir hatada puanlarınızın kaybolmaması için kurulum aşamalarında verilen keyleri ve priv keyleri saklayın. 4 | 5 | > Standart güncelleme ve gereksinimleri kuruyoruz. 6 | 7 | # 8 | 9 |

Donanım

10 | 11 | ``` 12 | Minimum: 2 vCPU 4 RAM 13 | Önerilen: 4vCPU 8 RAM 14 | ``` 15 |

Kurulum

16 | 17 | ```console 18 | # güncelleme 19 | apt update && apt upgrade -y 20 | sudo apt install -y curl git jq lz4 build-essential cmake perl automake autoconf libtool wget libssl-dev 21 | 22 | # Go kurulumu 23 | sudo rm -rf /usr/local/go 24 | curl -L https://go.dev/dl/go1.22.3.linux-amd64.tar.gz | sudo tar -xzf - -C /usr/local 25 | echo 'export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin' >> $HOME/.bash_profile 26 | source .bash_profile 27 | ``` 28 | 29 | ```console 30 | # Gerekli repoları çekiyoruz 31 | git clone https://github.com/airchains-network/evm-station.git 32 | git clone https://github.com/airchains-network/tracks.git 33 | ``` 34 | 35 | ```console 36 | # evmos ağımızın kurulumuna başlıyoruz, bu localde çalışan kendi ağımız. 37 | cd evm-station 38 | go mod tidy 39 | ``` 40 | 41 | ```console 42 | # Bu komutla kurulumu tamamlıyoruz. 43 | /bin/bash ./scripts/local-setup.sh 44 | ``` 45 | 46 | > Sistem dosyasının sağlıklı çalışabilmesi için bir env oluşturuyoruz. 47 | 48 | ```console 49 | nano ~/.rollup-env 50 | ``` 51 | 52 | > İçerisine gerekli değişkenleri giriyoruz ardından ctrl+x, y ve enter tuşlarına basarak çıkıyoruz. 53 | 54 | ```console 55 | # buradaki kod bloğunda değiştirmeniz bir yer yok. 56 | MONIKER="localtestnet" 57 | KEYRING="test" 58 | KEYALGO="eth_secp256k1" 59 | LOGLEVEL="info" 60 | HOMEDIR="$HOME/.evmosd" 61 | TRACE="" 62 | BASEFEE=1000000000 63 | CONFIG=$HOMEDIR/config/config.toml 64 | APP_TOML=$HOMEDIR/config/app.toml 65 | GENESIS=$HOMEDIR/config/genesis.json 66 | TMP_GENESIS=$HOMEDIR/config/tmp_genesis.json 67 | VAL_KEY="mykey" 68 | ``` 69 | 70 | > Servis dosyasını yazıyoruz. User kullanıyorsanız `root` kısmını ona göre değiştirin. 71 | 72 | ```console 73 | # tek komut tüm bloğu copy paste yapabilirsiniz yavrularım 74 | sudo tee /etc/systemd/system/rolld.service > /dev/null << EOF 75 | [Unit] 76 | Description=ZK 77 | After=network.target 78 | 79 | [Service] 80 | User=root 81 | EnvironmentFile=/root/.rollup-env 82 | ExecStart=/root/evm-station/build/station-evm start --metrics "" --log_level info --json-rpc.api eth,txpool,personal,net,debug,web3 --chain-id "stationevm_1234-1" 83 | Restart=always 84 | RestartSec=3 85 | 86 | [Install] 87 | WantedBy=multi-user.target 88 | EOF 89 | ``` 90 | 91 | > Servisleri güncelleyip başlatıyoruz. 92 | 93 | ``` 94 | sudo systemctl daemon-reload 95 | sudo systemctl enable rolld 96 | sudo systemctl start rolld 97 | sudo journalctl -u rolld -f --no-hostname -o cat 98 | ``` 99 | > Logların aktığını görmelisiniz, ardından ctrl+c ile logları durduruyoruz. 100 | 101 | ![image](https://github.com/ruesandora/Airchains/assets/101149671/64137490-6b3b-4678-ae26-81c90dd1f952) 102 | 103 | 104 | # 105 | 106 | # 107 | 108 | > Sonraki aşamalarda rpc lazım olacak, onun ayarını yapalım. 109 | > Önce çalışan nodu durduralım 110 | 111 | ``` 112 | systemctl stop rolld 113 | ``` 114 | 115 | > Sonra app.toml dosyasına gidelim. 116 | > En altta RPC kısmı şu şekilde olacak. 117 | 118 | ``` 119 | nano ~/.evmosd/config/app.toml 120 | ``` 121 | ![image](https://github.com/ruesandora/Airchains/assets/101149671/588a02d0-f7e3-4c25-ac25-ffff281206eb) 122 | 123 | > Ayarı yaptıktan sonra ctrl+x, y ve enter ile kaydedip çıkalım ve nodu tekrar başlatalım. 124 | 125 | ``` 126 | systemctl restart rolld 127 | ``` 128 | 129 | 130 | 131 | > Böylece cosmos rpclerini public yapmayı öğrendiniz. 132 | 133 | 134 | Bu komut bize private key verecek, saklıyoruz. 135 | ```console 136 | /bin/bash ./scripts/local-keys.sh 137 | ``` 138 | 139 | # 140 | 141 | DA layer olarak eigenlayer kullanacağız. Bunun için key gerekiyor, binary indirip çalışması için izin veriyoruz. 142 | Resmi dökümanda celestia, avail kurulumları da var onlara da bakabilirsiniz. 143 | Mock, yani sahte DA da kullanabilirsiniz (mock ile bir süre puan kazanılmasına izin vereceklermiş) 144 | Şu an testnette sonradan DA değiştirilmiyor, güncellemeyle bunu mümkün kılacaklarını söylediler. 145 | 146 | Benim EigenDA seçme nedenim en kolay Celestia ve Eigen olması (token de bulması kolay), Celestia ezbere biliyoruz - bu sefer Eigen olsun. 147 | 148 | # 149 | 150 | ```console 151 | cd $HOME 152 | wget https://github.com/airchains-network/tracks/releases/download/v0.0.2/eigenlayer 153 | mkdir -p $HOME/go/bin 154 | chmod +x $HOME/eigenlayer 155 | mv $HOME/eigenlayer $HOME/go/bin 156 | ``` 157 | 158 | ```console 159 | # `CUZDANADI` değiştirin ve çıktıda size verilen ECDSA Private Keyi saklayın. 160 | # Ctrl+c ile kapatın enterlayın ve verilen diğer `public hex` kenara not edin lazım olacak. 161 | # Verilen 0x evm adresine her ihtimale karşı 0.5 eth atın holesky ağında. 162 | 163 | eigenlayer operator keys create --key-type ecdsa CUZDANADI 164 | ``` 165 | 166 | > Şimdi track ve station kısmına geçiyoruz. 167 | 168 | ```console 169 | cd $HOME 170 | cd tracks 171 | go mod tidy 172 | ``` 173 | 174 | > tracks klasörü içindeyken aşağıdaki kodu başlatıyoruz. ```PUBLICHEX``` biraz önce aldığımız public key olacak. 175 | 176 | > MONIKER (validatör ismi) değiştirebilirsiniz kafanıza göre. 177 | 178 | ```console 179 | go run cmd/main.go init --daRpc "disperser-holesky.eigenda.xyz" --daKey "PUBLICHEX" --daType "eigen" --moniker "MONIKER" --stationRpc "http://127.0.0.1:8545" --stationAPI "http://127.0.0.1:8545" --stationType "evm" 180 | ``` 181 | 182 | # 183 | 184 | > Çıktı şu şekilde olacak 185 | 186 | ![tg_image_2547108070](https://github.com/ruesandora/Airchains/assets/101149671/463e6802-ab58-4e3b-86d2-8ba8c1c15819) 187 | 188 | # 189 | 190 | > Şimdi tracker adresi oluşturuyoruz. `TRACKERCUZDAN` değiştirin. 191 | 192 | > Çıktıyı yedek alın, air prefixli cüzdanla [discordda](https://discord.gg/airchains) `switchyard faucet` kanalından token alın. 193 | 194 | ```console 195 | go run cmd/main.go keys junction --accountName TRACKERCUZDAN --accountPath $HOME/.tracks/junction-accounts/keys 196 | ``` 197 | 198 | > Sonra proveri çalıştırıyoruz. 199 | 200 | ```console 201 | go run cmd/main.go prover v1EVM 202 | ``` 203 | 204 | > Şimdi bize node id lazım, bunu da şurdan alıyoruz. 205 | 206 | ```console 207 | # ctrl w ile node id aratabilirsiniz, en aşağı gidip biraz yukarıda 208 | nano ~/.tracks/config/sequencer.toml 209 | ``` 210 | 211 | ![image](https://github.com/ruesandora/Airchains/assets/101149671/8be10bf2-c873-4e97-a40d-2dd148854991) 212 | 213 | # 214 | 215 | > Aşağıdaki kodda 216 | 217 | > `TRACKERCUZDAN` yukarda yazdığınız adı 218 | 219 | > `TRACKERCUZDAN-ADRESI` buna da air cüzdanı 220 | 221 | > `IP` ip adresiniz 222 | 223 | > `NODEID` sequencer.toml dan temin ettiğimiz node id olacak 224 | 225 | 226 | ```console 227 | go run cmd/main.go create-station --accountName TRACKERCUZDAN --accountPath $HOME/.tracks/junction-accounts/keys --jsonRPC "https://junction-testnet-rpc.synergynodes.com/" --info "EVM Track" --tracks TRACKERCUZDAN-ADRESI --bootstrapNode "/ip4/IP/tcp/2300/p2p/NODEID" 228 | ``` 229 | 230 | # 231 | 232 | > Stationu kurduk, şimdi bunu servisle çalıştıralım. 233 | 234 | > Servis çalıştırmak istemeyenler screen açıp tracks klasöründe `go run cmd/main.go start` komutunu çalıştırabilirler. 235 | 236 | ```console 237 | sudo tee /etc/systemd/system/stationd.service > /dev/null << EOF 238 | [Unit] 239 | Description=station track service 240 | After=network-online.target 241 | [Service] 242 | User=root 243 | WorkingDirectory=/root/tracks/ 244 | ExecStart=/usr/local/go/bin/go run cmd/main.go start 245 | Restart=always 246 | RestartSec=3 247 | LimitNOFILE=65535 248 | [Install] 249 | WantedBy=multi-user.target 250 | EOF 251 | ``` 252 | 253 | ```console 254 | screen -S air 255 | sudo systemctl daemon-reload 256 | sudo systemctl enable stationd 257 | sudo systemctl restart stationd 258 | sudo journalctl -u stationd -f --no-hostname -o cat 259 | ``` 260 | 261 |

Kurulum tamam ama?

262 | 263 | Kurulum işlemleri bu kadar. Ama şu an puan kazanmıyorsunuz. 264 | Tracker cüzdanınızın mnemoniclerini leap wallet import edip https://points.airchains.io/ connect diyoruz 265 | Dashboardda stationu ve puanınızı görebilirsiniz. 266 | Henüz tx yapmadığımız için 100 point pending görünecek. Bunun sebebi şu, puan kazanmanız için pod çıkarmanız lazım. 267 | Pod 25txten oluşan bir paket gibi düşünebilirsiniz. Her 25tx 1 pod çıkaracak ve bu işlemlerden 5 puan kazanacaksınız. 268 | İlk kurulumdaki 100 puan, ilk poddan sonra aktif olacak. 269 | 270 | Bunun için de şunu yapıyoruz 271 | İlk başta `bin/bash ./scripts/local-keys.sh` komutuyla bir priv key aldık ve rpc ayarı yapmıştık. 272 | Metamaska bu priv keyi import ediyoruz, ağ ekle kısmında da şu bilgileri girin. 273 | 274 | ``` 275 | rpc http://IP:8545 276 | 277 | id 1234 278 | 279 | ticker tEVMOS 280 | ``` 281 | ![image](https://github.com/neuweltgeld/Airchains_/assets/101174090/578659e5-e1ad-4193-a6bf-b1da38de0a7e) 282 | 283 | 284 | girip okeyliyoruz. 285 | 286 | Ayrıca rpc'ye bağlanabilmek için 8545 numaralı portu açıyoruz o da şu komutla 287 | ``` 288 | sudo ufw allow 8545 289 | ``` 290 | Buradan artık kontrat mı deploy edersiniz, manuel tx mi kasarsınız size kalmış. 291 | 292 | Track işleminde rpc hatası alanlar rollback yapmayı denesinler. Bazen 1 bazen 3 rollback işlemiyle sorun çözülüyor. 293 | Kaç kez rollback yapmak istiyorsanız ``go run cmd/main.go rollback`` komutunu o kadar çalıştırın, her seferinde çıktıyı bekleyin. 294 | 295 | ``` 296 | systemctl stop stationd 297 | cd tracks 298 | go run cmd/main.go rollback 299 | sudo systemctl restart stationd 300 | sudo journalctl -u stationd -f --no-hostname -o cat 301 | ``` 302 | 303 | 304 | Hadi sağlıcakla. 305 | 306 | Ekran Resmi 2024-06-07 14 18 52 307 | 308 | -------------------------------------------------------------------------------- /Yeni_sunucuya_tasima.md: -------------------------------------------------------------------------------- 1 | 2 | # Airchains İstasyon Taşıma 3 | 4 | Bugün sizlere Airchains istasyonumuzu tamamiyle farklı bir sunucuya (Farklı bir IP, farklı bir firma vs.) taşımayı anlatacağım. 5 | 6 | Öncelikle sizlere şunu söyleyeyim; 7 | 8 | Herhangi bir repo/docs bulamadığım için tamamen deneme yanılma yöntemiyle yaptığım bir olaydı ve bugün itibariyle (20.07.2024) 3 gündür sorunsuz şekilde çalışıyor. 9 | 10 | Bunu söylemememin sebebi de gerekli veya gereksiz dosya almış olabilirim ama bence gerekliydi, hiç bir sorun yaşamadım. Aksine ben Armm64 mimarisinden Amd mimarisine geçiş yaptım ve herhangi bir sorun yaşamadım. Aranızda mimari değiştirecek olan da varsa lütfen telegram üzerinden bana (Dtractus) ulaşın, sadece minik farklı bir işlem yapacağız. 11 | 12 | Lütfen taşıma tamamlandı diye ilk sunucunuzu kapatmayın, bırakın 2-3 gün yeni sunucunuzu izleyin. Sorun yok, her şeyiniz harika çalışıyorsa kapatırsınız. Çok fazla sorun yaşayıp pes etmek istersenizde bu sayede uğraşmadan ilk sunucunuzda durdurduğumuz servis dosyalarını tekrar aktif hale getirip, eski haliyle devam edebilirsiniz :) 13 | 14 | Son bir uyarı, sizlere 2. sunucunuzda diye belirtmediğim sürece tüm işlemler 1. sunucuda yapılacak. 2. sunucu olduğunu belirttiğim zaman taşıyacağınız yeni sunucuda işlem yapabilirsiniz. 15 | 16 | Bu kadar ön anlatım yeterli diye düşünüyor, işlemleri anlatmaya geçiyorum; 17 | 18 | 19 | 20 | ## Taşıma aşaması için hazırlık 21 | 22 | Öncelikle diğer sunucuya geçişte sorun yaşamamak için çalışan stationd ve rolld'mizi durdurmamız gerekiyor. 23 | 24 | Aşağıdaki komutla öncelikle rolld'yi, daha sonra stationd'yi durduruyoruz. 25 | 26 | ```bash 27 | sudo systemctl stop rolld && sudo systemctl stop stationd 28 | ``` 29 | Lütfen durduğundan emin olun, çünkü bazılarınızın stationd'si durmuyor. Komutu kullandıktan sonra bitmesini bekleyin, acele etmeye gerek yok. Aşağıdaki komutlarla durup durmadığına bakabilirsiniz; 30 | 31 | Rolld kontrolü için 32 | ```bash 33 | sudo journalctl -u rolld -f --no-hostname -o cat 34 | ``` 35 | 36 | Stationd kontrolü için 37 | ```bash 38 | sudo journalctl -u stationd -f --no-hostname -o cat 39 | ``` 40 | 41 | Durduğundan eminsek birde sunucumuzda yeterli olduğundan emin olalım, çünkü yedekleme işlemi için bize belirli bir alan gerekli. Ortalamaya vurursak 10 GB alan yeterli diye düşünmekteyim. Alan kontrolü için aşağıdaki komutu kullanalım; 42 | 43 | ```bash 44 | df -h 45 | ``` 46 | 47 | Komuttan sonra genelde dev/sda1 sizin alanınızı gösterir. Avail hizasındaki kısım sizlerin boş alanını temsil eder. 48 | 49 | 50 | Yukarıdaki kısımlarıda düzenli okuyup, her şeyi adım adım yerine getirdiysek 2. aşamaya, yani yedekleme aşamasına geçelim. 51 | 52 | ## Yedekleyeceğimiz Dosyaları Hazırlayalım 53 | 54 | Öncelikle sunucumuzun root dizininde olduğumuzdan emin olalım. Bunu kodlada sağlayabiliriz fakat daha sonra kafanız karışmasın, ilerleyen aşamada unutup sorun yaşamayın diye bu kısmı eklemek istedim. Root dizininde olduğumuzdan emin olalım. 55 | 56 | ```bash 57 | cd 58 | ``` 59 | Evet sadece basit iki harf ile nerede olursanız olun root dizinine geçiyorsunuz. 60 | Şimdi kendimize aşağıdaki kod ile dosyalarımızı yedekleyeceğimiz bir klasör oluşturalım; 61 | 62 | ```bash 63 | mkdir -p backup 64 | ``` 65 | Dosyamızı oluşturduk, şimdi içerisine bizim için gerekli (bence gerekli) dosyalarımızı alalım. 66 | 67 | ```bash 68 | cp -r $HOME/evm-station $HOME/backup/ && \ 69 | cp -r $HOME/tracks $HOME/backup/ && \ 70 | cp -r $HOME/.eigenlayer $HOME/backup/ && \ 71 | cp -r $HOME/.evmosd $HOME/backup/ && \ 72 | cp -r $HOME/.tracks $HOME/backup/ && \ 73 | cp -r $HOME/go $HOME/backup/root_go && \ 74 | cp $HOME/.rollup-env $HOME/backup/ 75 | ``` 76 | Bu işlem biraz uzun sürebilir, sakin olun, ekranda akanları izleyebilirsiniz. 77 | 78 | İzleme işlemimiz bittiyse, hadi bu dosyalarımızı sıkıştıralım; 79 | 80 | 81 | ```bash 82 | tar -czvf dtractus_backup.tar.gz -C $HOME/backup . 83 | ``` 84 | Sıkıştırma işlemi de yine dosya boyutuna göre biraz sürebilir, ekranda göreceksiniz zaten. İşlemleri neredeyse yarıladık. 85 | 86 | Diğer sunucumuza geçmeden önce bu dosyamızı indirmek için kendimize minik bir HTTP sunucusu oluşturalım ki upload işlemleri ile vakit kaybetmeyelim. Aşağıdaki kodu direkt çalıştırın, sunucunuzda Python kurulu değilse endişelenmeyin, olmayanlar için bu komutun altına python kurulumunu da yazacağım. 87 | 88 | Aşağıdaki kodla bir HTTP sunucusu açalım; 89 | 90 | ```bash 91 | cd && python3 -m http.server 8000 92 | ``` 93 | 94 | Yukarıdaki kodda hata alıyorsanız muhtemelen sunucunuzda Python kurulu değildir, endişelenmeyin ve aşağıdaki kodu çalıştırarak yükleyin ve yükleme bitince tekrar üstteki komut ile HTTP sunucusunu açın; 95 | 96 | ```bash 97 | sudo apt install python3 python3-pip -y 98 | ``` 99 | 100 | Tebrikler! İlk sunucumuzda işimizi bitirdik. 101 | 102 | ## Yeni Sunucumuzda Hazırlıklarımızı Yapalım 103 | 104 | Evet, ikinci sunucumuzda öncelikle gereksinimlerimizi yükleyelim. 105 | 106 | Sunucumuzu güncelleyelim ; 107 | 108 | ```bash 109 | sudo apt update && sudo apt upgrade -y 110 | ``` 111 | 112 | Sunucumuza gerekli paketlerimizi kuralım; 113 | 114 | 115 | ```bash 116 | sudo apt install -y curl git jq lz4 build-essential cmake perl automake autoconf libtool wget libssl-dev 117 | ``` 118 | 119 | Sunucumuza GO kurulumunu yapalım, eigenlayer binary'sini indirip yerine koyalım; 120 | 121 | ```bash 122 | sudo rm -rf /usr/local/go && \ 123 | curl -L https://go.dev/dl/go1.22.3.linux-amd64.tar.gz | sudo tar -xzf - -C /usr/local && \ 124 | echo 'export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin' >> $HOME/.bash_profile && \ 125 | source $HOME/.bash_profile && \ 126 | wget https://github.com/airchains-network/tracks/releases/download/v0.0.2/eigenlayer && \ 127 | mkdir -p $HOME/go/bin && \ 128 | chmod +x $HOME/eigenlayer && \ 129 | mv $HOME/eigenlayer $HOME/go/bin 130 | ``` 131 | 132 | Go kurulumumuzda hazır, şimdi sıkıştırdığımız dosyayı yeni sunucumuza indirelim. 133 | 134 | Lütfen aşağıdaki kodda ESKİ SUNUCUNUZUN IP'sini (HTTP Sunucusu oluşturduğumuz sunucu ip'si) yazıp, yeni sunucuda kullanın; 135 | 136 | ```bash 137 | wget http://ESKISUNUCUIP:8000/dtractus_backup.tar.gz -O $HOME/dtractus_backup.tar.gz 138 | 139 | ``` 140 | 141 | Evet boşuna upload vesaire işlemiyle uğraşmadan direkt sıkıştırılmış dosyamızı yeni sunucumuza kolaylıkla ve hızlıca indirmiş olduk. Şimdi yeni sunucumuza da bir backup dosyası oluşturalım; 142 | 143 | ```bash 144 | mkdir -p backup 145 | ``` 146 | 147 | Şimdi oluşturduğumuz bu dosyanın içerisine sıkıştırdığımız dosyaları çıkartalım; 148 | 149 | ```bash 150 | tar -xzvf $HOME/dtractus_backup.tar.gz -C $HOME/backup 151 | ``` 152 | 153 | Eveeet. Şimdi geldik dosyalarımızı yerlerine göndermeye. Öncelikle ana dizinimizde olanları yollayalım; 154 | 155 | ```bash 156 | mv $HOME/backup/evm-station $HOME/evm-station && \ 157 | mv $HOME/backup/tracks $HOME/tracks && \ 158 | mv $HOME/backup/.eigenlayer $HOME/.eigenlayer && \ 159 | mv $HOME/backup/.evmosd $HOME/.evmosd && \ 160 | mv $HOME/backup/.tracks $HOME/.tracks && \ 161 | mv $HOME/backup/.rollup-env $HOME/.rollup-env 162 | ``` 163 | 164 | Şimdide go paketlerimizi olması gereken yere gönderelim; 165 | 166 | ```bash 167 | sudo mkdir -p $HOME/go/pkg && sudo cp -r $HOME/backup/root_go/pkg/* $HOME/go/pkg/ 168 | ``` 169 | 170 | Bunlarıda gönderdikten sonra, gerekli olup olmadığını bilmesemde garantiye almak amaçlı ilgili dosyalarda eski sunucu ip'mizi, yeni sunucumuzun ip'si ile değiştirmemiz gerektiğini düşünüyorum. Bunu sizin için en basit hale getirdim. 171 | 172 | Bu komutu dilerseniz önce notepad tarzı bir yerde düzenleyin, daha sonra terminale geçirin. Hata esnasında düzeltilebilir fakat kendinizi yormayın. 173 | 174 | Bize eski sunucu ip'miz ve yeni sunucu ip'miz gerek. Lütfen tırnak işaretlerini kaldırmayın ve aşağıdaki eski_ip_adresi ve yeni_ip_adresi kısımlarını değiştirin! (2 tane sadece) 175 | 176 | ```bash 177 | OLD_IP="eski_ip_adresi" && NEW_IP="yeni_ip_adresi" && find $HOME/.evmosd/config/gentx -type f -name "*.json" -exec sed -i "s/$OLD_IP/$NEW_IP/g" {} + && sed -i "s/$OLD_IP/$NEW_IP/g" $HOME/.evmosd/config/genesis.json && sed -i "s/$OLD_IP/$NEW_IP/g" $HOME/.tracks/config/sequencer.toml 178 | ``` 179 | 180 | Tırnak işaretlerini kaldırmadan sadece üstteki iki yeri değiştirdiyseniz ve komutu kullandıysanız bunu da kolayca halletmiş olduk. Şimdi sıra geldi servis dosyalarını oluşturmaya ve çalıştırmaya; 181 | 182 | Tamamını kopyalayıp terminale yapıştırabilirsiniz fakat root değil farklı bir şey kullanıyorsanız root olan yerleri değiştirin; 183 | 184 | ```bash 185 | sudo tee /etc/systemd/system/rolld.service > /dev/null << EOF 186 | [Unit] 187 | Description=ZK 188 | After=network.target 189 | 190 | [Service] 191 | User=root 192 | EnvironmentFile=/root/.rollup-env 193 | ExecStart=/root/evm-station/build/station-evm start --metrics "" --log_level info --json-rpc.api eth,txpool,personal,net,debug,web3 --chain-id "stationevm_1234-1" 194 | Restart=always 195 | RestartSec=3 196 | 197 | [Install] 198 | WantedBy=multi-user.target 199 | EOF 200 | ``` 201 | 202 | Stationd içinde servis dosyamızı hazır edelim. Aynı şekilde tamamını kopyalayıp terminale yapıştırabilirsiniz fakat root değil farklı bir şey kullanıyorsanız root olan yerleri değiştirin; 203 | 204 | ```bash 205 | sudo tee /etc/systemd/system/stationd.service > /dev/null << EOF 206 | [Unit] 207 | Description=station track service 208 | After=network-online.target 209 | 210 | [Service] 211 | User=root 212 | WorkingDirectory=/root/tracks/ 213 | ExecStart=/usr/local/go/bin/go run /root/tracks/cmd/main.go start 214 | Restart=always 215 | RestartSec=3 216 | LimitNOFILE=65535 217 | 218 | [Install] 219 | WantedBy=multi-user.target 220 | EOF 221 | ``` 222 | 223 | Evet, servis dosyalarımızı da hazırladık, şimdi geldi çalıştırmaya. Öncelikle sadece rolld'yi çalıştıracağız ve bir problem olup olmadığını göreceğiz; 224 | 225 | 226 | ```bash 227 | sudo systemctl daemon-reload && sudo systemctl enable rolld && sudo systemctl start rolld && sudo journalctl -u rolld -f --no-hostname -o cat 228 | ``` 229 | 230 | Bu komut servis dosyalarını yenileyip, rolld'yi aktif edip, çalıştırıp bize logları gösterecek. Kodların çalıştığını gözlemleyin, exit code vermesin. Exit code alırsanız telegramda grupta beni etiketleyerek (dtractus) sorabilirsiniz. 231 | 232 | Her şey başarılı ise artık stationd'mizi de çalıştıralım ; 233 | 234 | ```bash 235 | sudo systemctl enable stationd && sudo systemctl start stationd && sudo journalctl -u stationd -f --no-hostname -o cat 236 | ``` 237 | 238 | Başarıyla stationd'mizi de çalıştırdık. Umuyorum ki hiç bir problem yaşamadan kurulumu tamamladınız ve her şey sorunsuz çalışıyor. 239 | 240 | Herhangi bir yerde sorun yaşamanız halinde lütfen ama lütfen telegramda özelden yazmak yerine gruptan beni etiketleyerek sorunuzu sorun. 241 | -------------------------------------------------------------------------------- /Avail_Turing_DA.md: -------------------------------------------------------------------------------- 1 |

Airchain Create an EVM ZK Rollup for Avail DA

2 | 3 | > WARNING: To ensure that your points are not lost in case of any errors, store the keys and private keys provided during the installation steps. 4 | 5 | > We are installing standard updates and requirements. 6 | 7 | # 8 | 9 |

Hardware

10 | 11 | ``` 12 | Minimum: 2 vCPU 4 RAM 13 | Recommended: 4vCPU 8 RAM 14 | ``` 15 |

Installation

16 | 17 | ```console 18 | # Updating 19 | apt update && apt upgrade -y 20 | sudo apt install -y curl git jq lz4 build-essential cmake perl automake autoconf libtool wget libssl-dev 21 | 22 | # Installing Go 23 | wget https://go.dev/dl/go1.22.0.linux-amd64.tar.gz 24 | sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go1.22.0.linux-amd64.tar.gz 25 | echo 'export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin' >> $HOME/.bash_profile 26 | echo 'export GOROOT=/usr/local/go' >> $HOME/.bash_profile 27 | echo 'export GOPATH=$HOME/go' >> $HOME/.bash_profile 28 | echo 'export GO111MODULE=on' >> $HOME/.bash_profile && . $HOME/.bash_profile 29 | rm -rf go1.22.0.linux-amd64.tar.gz 30 | ``` 31 | 32 | ```console 33 | # Downloading the necessary repositories 34 | git clone https://github.com/airchains-network/evm-station.git 35 | git clone https://github.com/airchains-network/tracks.git 36 | ``` 37 | 38 | ```console 39 | # We are starting the setup of our Evmos network, which is our own network running locally. 40 | cd evm-station 41 | go mod tidy 42 | ``` 43 | 44 | ```console 45 | # We are completing the installation with this command. 46 | /bin/bash ./scripts/local-setup.sh 47 | ``` 48 | 49 | # 50 | 51 | > In the next steps, we will need RPC, let's configure that. 52 | 53 | > The RPC section at the bottom will be as follows. 54 | 55 | ``` 56 | nano ~/.evmosd/config/app.toml 57 | ``` 58 | 59 | ![image](https://github.com/ruesandora/Airchains/assets/101149671/588a02d0-f7e3-4c25-ac25-ffff281206eb) 60 | 61 | 62 | > This way, you have learned how to make Cosmos RPCs public. 63 | 64 | 65 | > We are creating an environment for the system file to function properly. 66 | 67 | ```console 68 | nano ~/.rollup-env 69 | ``` 70 | 71 | > We enter the necessary variables into it. 72 | 73 | ```console 74 | # There is nothing to change ın the code block here. 75 | CHAINID="stationevm_9000-1" 76 | MONIKER="localtestnet" 77 | KEYRING="test" 78 | KEYALGO="eth_secp256k1" 79 | LOGLEVEL="info" 80 | HOMEDIR="$HOME/.evmosd" 81 | TRACE="" 82 | BASEFEE=1000000000 83 | CONFIG=$HOMEDIR/config/config.toml 84 | APP_TOML=$HOMEDIR/config/app.toml 85 | GENESIS=$HOMEDIR/config/genesis.json 86 | TMP_GENESIS=$HOMEDIR/config/tmp_genesis.json 87 | VAL_KEY="mykey" 88 | ``` 89 | 90 | > We are writing the service file. If you are using the User, adjust the `root` part accordingly. 91 | 92 | ```console 93 | # You can copy and paste the entire block with just one command. 94 | sudo tee /etc/systemd/system/rolld.service > /dev/null << EOF 95 | [Unit] 96 | Description=ZK 97 | After=network.target 98 | 99 | [Service] 100 | User=root 101 | EnvironmentFile=/root/.rollup-env 102 | ExecStart=/root/evm-station/build/station-evm start --metrics "" --log_level info --json-rpc.api eth,txpool,personal,net,debug,web3 --chain-id stationevm_9000-1 103 | Restart=always 104 | RestartSec=3 105 | 106 | [Install] 107 | WantedBy=multi-user.target 108 | EOF 109 | ``` 110 | 111 | > We update and start the services. 112 | 113 | ``` 114 | sudo systemctl daemon-reload 115 | sudo systemctl enable rolld 116 | sudo systemctl start rolld 117 | sudo journalctl -u rolld -f --no-hostname -o cat 118 | ``` 119 | > You should see the logs flowing. 120 | 121 | ![image](https://github.com/ruesandora/Airchains/assets/101149671/64137490-6b3b-4678-ae26-81c90dd1f952) 122 | 123 | 124 | # 125 | 126 | 127 | This command will give us a private key, which we should store securely. 128 | ```console 129 | /bin/bash ./scripts/local-keys.sh 130 | ``` 131 | 132 | # 133 | 134 | We will use Avail Turing as the DA layer. 135 | You can also use a mock DA (mock will allow earning points for a period of time). 136 | Currently, on the testnet, the DA cannot be changed later, but they said they will make this possible with an update. 137 | 138 | 139 | # 140 | 141 | ```console 142 | cd $HOME 143 | git clone https://github.com/availproject/availup.git 144 | cd availup 145 | /bin/bash availup.sh --network "turing" --app_id 36 146 | # Close with Ctrl+c, press Enter 147 | ``` 148 | ![image](https://github.com/ahmkah/Airchains/assets/99053148/bbff7a2e-d2a9-42aa-ac23-563e01e37791) 149 | 150 | > We are writing the service file. If you are using the User, adjust the `root` part accordingly. 151 | 152 | ```console 153 | # You can copy and paste the entire block with just one command. 154 | sudo tee /etc/systemd/system/availd.service > /dev/null <<'EOF' 155 | [Unit] 156 | Description=Avail Light Node 157 | After=network.target 158 | StartLimitIntervalSec=0 159 | 160 | [Service] 161 | User=root 162 | Type=simple 163 | Restart=always 164 | RestartSec=120 165 | ExecStart=/root/.avail/turing/bin/avail-light --network turing --app-id 36 --identity /root/.avail/identity/identity.toml 166 | 167 | [Install] 168 | WantedBy=multi-user.target 169 | EOF 170 | ``` 171 | > We update and start the services. 172 | 173 | ``` 174 | systemctl daemon-reload 175 | sudo systemctl enable availd 176 | sudo systemctl start availd 177 | sudo journalctl -u availd -f --no-hostname -o cat 178 | ``` 179 | ![image](https://github.com/ahmkah/Airchains/assets/99053148/364e88b4-d8eb-4e16-a5f9-abcf7c3c8482) 180 | 181 | 182 | 183 | > Inside the file `~/.avail/identity/identity.toml`, you will find the Mnemonics of your Avail wallet. Copy and store these words. 184 | > Close with Ctrl+c, press Enter, and make a note of the other `Avail-Mnemonics` given as they will be needed. 185 | > Add the copied Mnemonics to Polkadot.js or Talisman wallet get your wallet address on the Avail Turing network and receive tokens from the faucet. 186 | 187 | > [Avail-Faucet](https://faucet.avail.tools/) 188 | 189 | 190 | 191 | > We are now moving on to the track and station section. 192 | 193 | ```console 194 | cd $HOME 195 | cd tracks 196 | go mod tidy 197 | ``` 198 | 199 | > When we are inside the `tracks` folder, we start the following code. 200 | > Enter the validator name ``. Do not include <> 201 | > `daKey = `You can obtain your Avail mnemonics with `nano ~/.avail/identity/identity.toml`. Add the copied Mnemonics to Polkadot.js or Talisman wallet, get your wallet address on the Avail Turing network. Do not include <> 202 | 203 | ![image](https://github.com/ahmkah/Airchains/assets/99053148/65b18e53-8084-497f-8efa-51eb9f162d2f) 204 | ```console 205 | avail_secret_uri = 'vessel spirit suggest harvest enjoy sort across tower round gossip topic clown true bottom pudding build zone subway proud forum border taxi gauge donor' 206 | ``` 207 | ```console 208 | go run cmd/main.go init --daRpc "http://127.0.0.1:7000" --daKey "" --daType "avail" --moniker "" --stationRpc "http://127.0.0.1:8545" --stationAPI "http://127.0.0.1:8545" --stationType "evm" 209 | ``` 210 | 211 | # 212 | 213 | > The output will be as follows. 214 | 215 | 216 | # 217 | 218 | > Now we are creating a tracker address. Please replace ``. 219 | 220 | > Take a backup of the output, and receive tokens from the channel with a wallet prefixed with 'air' [discord](https://discord.gg/airchains) `switchyard faucet` . 221 | 222 | ```console 223 | go run cmd/main.go keys junction --accountName --accountPath $HOME/.tracks/junction-accounts/keys 224 | ``` 225 | 226 | > Then we run the prover. 227 | 228 | ```console 229 | go run cmd/main.go prover v1EVM 230 | ``` 231 | 232 | > Now we need the node id, which we obtain from here. 233 | 234 | ```console 235 | # You can search for the node id with Ctrl + W, go to the bottom, and scroll up a bit. 236 | nano ~/.tracks/config/sequencer.toml 237 | ``` 238 | 239 | ![image](https://github.com/ruesandora/Airchains/assets/101149671/8be10bf2-c873-4e97-a40d-2dd148854991) 240 | 241 | # 242 | 243 | > Prepare some preparations for this part and prepare the following command. 244 | > SERVER(VPS) IP `` 245 | > Get `nodeid>` in the `nano ~/.tracks/config/sequencer.toml` file 246 | > Enter the `AIRCHAIN wallet address` you created before `` 247 | > Enter the validator name `` 248 | 249 | 250 | ```console 251 | go run cmd/main.go create-station --accountName --accountPath $HOME/.tracks/junction-accounts/keys --jsonRPC "https://airchains-testnet-rpc.cosmonautstakes.com/" --info "EVM Track" --tracks --bootstrapNode "/ip4//tcp/2300/p2p/" 252 | ``` 253 | 254 | # 255 | 256 | > We have set up the station, now let's run it with a service. 257 | 258 | 259 | 260 | ```console 261 | sudo tee /etc/systemd/system/stationd.service > /dev/null << EOF 262 | [Unit] 263 | Description=station track service 264 | After=network-online.target 265 | [Service] 266 | User=root 267 | WorkingDirectory=/root/tracks/ 268 | ExecStart=/usr/local/go/bin/go run cmd/main.go start 269 | Restart=always 270 | RestartSec=3 271 | LimitNOFILE=65535 272 | [Install] 273 | WantedBy=multi-user.target 274 | EOF 275 | ``` 276 | 277 | ```console 278 | sudo systemctl daemon-reload 279 | sudo systemctl enable stationd 280 | sudo systemctl restart stationd 281 | sudo journalctl -u stationd -f --no-hostname -o cat 282 | ``` 283 | 284 |

Installation complete, right?

285 | 286 | You have completed the installation process. However, currently, you are not earning points. 287 | We recommend importing the mnemonics of your Tracker wallet into the Leap wallet and connecting to https://points.airchains.io/. 288 | You can view your station and points on the dashboard. 289 | Since we haven't made any transactions yet, you will see 100 points pending. The reason for this is that you need to extract a pod to earn points. 290 | You can think of a pod as a package consisting of 25 transactions. Each set of 25 transactions will generate 1 pod, and you will earn 5 points from these transactions. 291 | The initial 100 points from the installation will become active after the first pod. 292 | 293 | For this, we do the following: 294 | Initially, we obtained a private key with the command `bin/bash ./scripts/local-keys.sh` and made RPC settings. 295 | Then we import this private key into Metamask, in the "Add Network" section. 296 | 297 | ``` 298 | rpc: http://IP:8545 299 | 300 | id: 1234 301 | 302 | ticker: eEVMOS 303 | ``` 304 | 305 | We enter and confirm. 306 | 307 | From here on, you can either deploy a contract or manually send transactions; it's up to you. 308 | 309 | For those experiencing RPC errors during the tracking process, they can try to roll back. Sometimes the issue is resolved with 1 rollback, other times it may require 3 rollback operations. Run the command `go run cmd/main.go rollback` as many times as you want to perform a rollback. Wait for the output after each run. 310 | 311 | ``` 312 | systemctl stop stationd 313 | cd tracks 314 | git pull 315 | go run cmd/main.go rollback 316 | sudo systemctl restart stationd 317 | sudo journalctl -u stationd -f --no-hostname -o cat 318 | ``` 319 | 320 | 321 | ![image](https://github.com/ahmkah/Airchains/assets/99053148/cd88d51b-8659-46da-ae78-ef452a6f70f9) 322 | 323 | https://points.airchains.io/ 324 | 325 | --------------------------------------------------------------------------------