GithubHelp home page GithubHelp logo

fuel-smart-contract's Introduction

Fuel Beta-5 Ağında Kontrat Deploy Etme

Bilgi

Fuel ağı çok güçlü bir şekilde geliyor ve son dönemlerde developerlar çok ciddi airdroplar kazanıyor.

Hetzner üzerinden bir sunucu açtım(2gb-4gb-80gb), belki codespace üzerindende yapılabilir.

İşlemler uzun ve ne yazık ki yorucu yapmak isterseniz buyrun

Bu yollara Ruesandora hocam sayesinde girdim. Kendisini https://x.com/Ruesandora0 bu hesaptan takip edebilirsiniz.

Başlayalım

# Sunucu güncelleme ile başlayalım, ikinci komutta y diyip devam edebilirsiniz
sudo apt update && sudo apt upgrade -y
sudo apt-get install git-all
sudo apt-get install curl

# Rust yükleyelim, ilk komutta 1 e basıp devam edelim
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source "$HOME/.cargo/env"
cd $home && rm -rf .fuel && rm -rf .forc && rm -rf .fuelup && rm -rf fuel-project

# Alttaki komutu girince y ile devam edelim lütfen
curl --proto '=https' --tlsv1.2 -sSf https://install.fuel.network/fuelup-init.sh | sh

# Fuelup kurmamız gerekiyor
git clone https://github.com/FuelLabs/fuelup
cd fuelup

# Cargo yükleyip, sonrasında fuelup için devam edeceğiz.
apt install cargo
cargo run --release

# Devam ediyoruz. 
fuelup self update
fuelup toolchain install beta-5
fuelup default beta-5
fuelup --version

# Yukarıdaki komutlarda hata ile karşılaşırsanız, aşağıdaki komutu deneyip o şekilde yeniden yukarıdaki 4 fuelup komutunu girin.
export PATH="${HOME}/.fuelup/bin:${PATH}"

# Kontrat işlemlerine geçelim
mkdir fuel-project
cd fuel-project
forc new counter-contract

# Aşağıdaki komutu girip, içerisindekileri silelim
nano counter-contract/src/main.sw

# Yukarıdaki dosyanın içerisinde aşağıdaki komutu olduğu gibi girelim ve CTRL X+Y enter ile çıkalım o ekrandan
contract;
 
storage {
    counter: u64 = 0,
}
 
abi Counter {
    #[storage(read, write)]
    fn increment();
 
    #[storage(read)]
    fn count() -> u64;
}
 
impl Counter for Contract {
    #[storage(read)]
    fn count() -> u64 {
        storage.counter.read()
    }
 
    #[storage(read, write)]
    fn increment() {
        let incremented = storage.counter.read() + 1;
        storage.counter.write(incremented);
    }
}

# Kontrat sekmesine ilerliyoruz
cd counter-contract
forc build

# Cüzdanımızı ekliyoruz
forc-wallet import
forc wallet account new
forc wallet accounts

# Cüzdanınıza [Faucet](https://faucet-beta-5.fuel.network/) alın
# Ve kontrat deploy edin
forc deploy --testnet

# Bir süre sonra https://fuellabs.github.io/block-explorer-v2/beta-5/#/ buradan cüzdan adresinizle kontrol edebilirsiniz.

fuel-smart-contract's People

Contributors

webraizo30 avatar geocmsk avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.