To successfully execute these examples you'll need to configure some environment variables. To do so:
Rename the ".env.template" file located at the root of this folder to ".env"
Uncomment, and assign your Sepolia testnet endpoint to the RPC_PROVIDER_URL variable in the ".env" file
Uncomment, and assign your Sepolia websocket testnet endpoint to the WS_PROVIDER_URL variable in the ".env" file
Uncomment, and assign your account address to the ACCOUNT_ADDRESS variable in the ".env" file (make sure to have a few ETH in it)
Uncomment, and assign your starknet public key to the PUBLIC_KEY variable in the ".env" file
Uncomment, and assign your private key to the PRIVATE_KEY variable in the ".env" file
The variables used vary from example to example, you'll see the required ones on each main.go file, usually after a // Load variables from '.env' file comment.
To run an example:
Make sure you are in the chosen example directory
Execute go run FILE_NAME.go to run it
Some FAQ answered by these examples
How to deploy an account? How to send a DEPLOY_ACCOUNT_TXN?
R: See deployAccount
How to use my existing account importing my account address, and public and private keys?
R: See deployContractUDC, lines 47 and 61.
How to declare a Cairo contract? How to send a DECLARE_TXN?
R: See simpleDeclare.