Tezos is available as a dedicated node only
Chainstack offers Tezos as dedicated nodes only. You can request a dedicated node through the contact form.- The contract can be funded in any amount of tez by anyone on the network.
- 1 tez at a time can be withdrawn from the funded contract by anyone on the network.
Prerequisites
- Get a Tezos node endpoint.
- LIGO to create and test the contract.
- Tezos client to originate the contract and to interact with the contract through the CLI.
- Temple wallet to interact with the contract through a web app.
Overview
To get from zero to a deployed contract on Ghostnet, do the following:- Get a Tezos node endpoint.
- Fund your developer Tezos account through a faucet.
- With LIGO, create the contract.
- With the Tezos client, compile and originate the contract through your Tezos node.
- With the Tezos client, fund the contract.
- Fund your user Tezos account through a faucet and your Temple wallet.
- With Temple wallet, interact with the contract.
Install LIGO
See LIGO: Installation.Install and configure the Tezos client
To install the client, see Installing binaries. Once installed, configure the client to the the node:Generate an account
Run:Fund your account with testnet tez
- Go to the faucet.
- In fund any address, paste your generated address.
- Click Request 6001 tz.
Create the contract
Create a simple fund contract in the PascaLIGO syntax with two entrypoints:Deposit
— any account on the network can deposit any amount of tez in the contract.Withdraw
— any account on the network can withdraw 1 tez at a time from the contract.
simplefund.ligo
:
Test the contract
Before compiling the contract, you can test it using the LIGO CLI. Deposit 10 tez:Compile the contract
Compile the contract and save the compiled code in a.tz
file:
Originate the contract
Originate the contract using your account, initiate the contract with 0 tez, and provide the origination fee with--burn-cap
:
Originated contracts
.
Example:
Interact with the contract using the Tezos client
You can now fund the contract using the Tezos client. Get the contract parameter for the deposit function to pass to the Tezos client. Get the parameter forDeposit
:
Get a Temple wallet account with test tez
You need an account in the Temple wallet with some test tez to execute operations on Ghostnet.- Install the Temple wallet.
- Go to the faucet.
- Connect with your Temple wallet.
- Once connected, click Request 6001 tz.
Interact with the contract using the Temple wallet
- Navigate to the BCD explorer.
- Click Ghostnet.
- In the search field, provide your originated contract address.
- On the contract page, click Interact.
- Click withdraw > Execute > Temple - Tezos Wallet.
- Click Confirm. This will connect your account from the Temple wallet with the contract and withdraw 1 tez to the account.