How Tezos Worksfleeting
how tezos works
When you create a keypair, you have to
- activate the account, that means have another person give you your first amount of tezzies,
- reveal the account, that means send an operation of kind reveal signed with your key.
Sending an operation
You have to
- forge the operation, that means create a binary representation of the json description of what you want to have done in the blockchain.
- sign it with you private key
- inject it
Writing a smart contract in smartpy
sp.verify operations are executed during the forge part.
Tezos will answer with the full compiled michelson, as well as a line of code that looks like the sp.verify content
"name": "TezosOperationError", "id": "proto.010-PtGRANAD.michelson_v1.script_rejected", "kind": "temporary", "message": "WrongCondition: ((self.data.owner == sp.sender) | (~ self.data.locked)) & (self.data.balances[sp.sender] >= params.tokens)", "status": 500
To create a test account
- go to https://smartpy.io/ide, bootstrap using a template
- put the code in the editor
- change the admin to a key you own (use a faucet if in a testnet)
- deploy the contract using the document on the right
- use the explorer to mint some data
- play with it