Skip to content

A decentralized application (dApp) to enhance trust in agency-client relationships using blockchain. It enables trustless payments via smart contracts, securing funds in escrow until milestones are approved by clients. Stablecoins like USDC are used to ensure stability and ease of use.

Notifications You must be signed in to change notification settings

Tico4Chain-Coders/Trustless-Work

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

87 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nest Logo

Trustless Work

Contents

Installing Rust

Linux, macOS, or Unix-like Systems

If you're using macOS, Linux, or any other Unix-like system, the simplest method to install Rust is by using rustup. Install it with the following command:

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

Windows

On Windows, download and run rustup-init.exe. You can proceed with the default setup by pressing Enter.

You can also follow the official Rust guide here.

Install the wasm32 target.

After installing Rust, add the wasm32-unknown-unknown target:

rustup target add wasm32-unknown-unknown

Install Stellar CLI

There are a few ways to install the latest released version of Stellar CLI.

The toolset installed with Rust allows you to use the cargo command in the terminal to install the Stellar CLI.

Install with cargo from source:

cargo install --locked stellar-cli --features opt

Install with cargo-binstall:

cargo install --locked cargo-binstall
cargo binstall -y stellar-cli

Install with Homebrew (macOS, Linux):

brew install stellar-cli

Configuring the CLI for Testnet

Stellar has a test network called Testnet that you can use to deploy and test your smart contracts. It's a live network, but it's not the same as the Stellar public network. It's a separate network that is used for development and testing, so you can't use it for production apps. But it's a great place to test your contracts before you deploy them to the public network.

To configure your CLI to interact with Testnet, run the following command:

macOS/Linux

stellar network add \
  --global testnet \
  --rpc-url https://soroban-testnet.stellar.org:443 \
  --network-passphrase "Test SDF Network ; September 2015"

Windows (PowerShell)

stellar network add `
  --global testnet `
  --rpc-url https://soroban-testnet.stellar.org:443 `
  --network-passphrase "Test SDF Network ; September 2015"

Note the --global flag. This creates a file in your home folder's ~/.config/soroban/network/testnet.toml with the settings you specified. This means that you can use the --network testnet flag in any Stellar CLI command to use this network from any directory or filepath on your system.

If you want project-specific network configurations, you can omit the --global flag, and the networks will be added to your working directory's .soroban/network folder instead.

Configure an Identity

When you deploy a smart contract to a network, you need to specify an identity that will be used to sign the transactions.

Let's configure an identity called alice. You can use any name you want, but it might be nice to have some named identities that you can use for testing, such as alice, bob, and carol.

stellar keys generate --global alice --network testnet

You can see the public key of alice with:

stellar keys address alice

You can use this link to verify the identity you create for the testnet.

Deploy Project on Testnet

Build contract

Once you have fully set up the contract in your local environment, installed all the necessary tools, and properly configured your user for the testnet, you will be ready to perform the initial deployment to the Testnet and run tests directly on the contract.

The first step is to compile the contract and generate the .wasm file, which can be done using the following command:

stellar contract build

Install contract

Before deploying the contract, you must first install it. This means uploading a version of your code to the Stellar network, which you can later use for deployment.

When you execute the following command with the parameters specific to your local environment, it will return a hash. You will need to save this hash, as it will be required in the next step.

macOS/Linux

stellar contract install \
   --network <network> \
   --source <source_account> \
   --wasm <path_to_wasm_file>

Windows (PowerShell)

stellar contract install `
   --network <network> `
   --source <source_account> `
   --wasm <path_to_wasm_file>

Where:

  • <network> is the name of the network you are working on (e.g., testnet).
  • <source_account> is the account from which the installation will be made (you need to provide your own account).
  • <path_to_wasm_file> is the path to the .wasm file generated when compiling the contract."

Response:

d36cd70c3b9c999e172ecc4648e616d9a49fd5dbbae8c28bef0b90bbb32fc762

Deploy contract

Finally, to deploy the contract, you will need to use the output from the previous command as the input parameter for this command.

Once you execute this command, you will receive another hash, which will be the contract ID. With this ID, you can query platforms such as https://stellar.expert/explorer/testnet and continuously monitor the interactions made with the deployed contract.

macOS/Linux

stellar contract deploy \
   --wasm-hash <wasm_hash> \
   --source <source_account> \
   --network <network>

Windows (PowerShell)

stellar contract deploy `
   --wasm-hash <wasm_hash> `
   --source <source_account> `
   --network <network>

Where:

  • <wasm_hash> is the hash of the .wasm file generated during the contract installation.
  • <source_account> is the account from which the deployment will be made.
  • <network> is the network you are working on (e.g., testnet).

About

A decentralized application (dApp) to enhance trust in agency-client relationships using blockchain. It enables trustless payments via smart contracts, securing funds in escrow until milestones are approved by clients. Stablecoins like USDC are used to ensure stability and ease of use.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages