Skip to content

Instantly share code, notes, and snippets.

@tigran-gruv
Last active August 30, 2019 12:55
Show Gist options
  • Save tigran-gruv/1898432738acb91a8dd6bd96ec9d7d65 to your computer and use it in GitHub Desktop.
Save tigran-gruv/1898432738acb91a8dd6bd96ec9d7d65 to your computer and use it in GitHub Desktop.

Local

Package installation

https://developers.eos.io/eosio-home/docs/setting-up-your-environment
https://developers.eos.io/eosio-home/docs/installing-the-contract-development-toolkit

Run local node

keosd &
nodeos -e -p eosio --plugin eosio::producer_plugin --plugin eosio::chain_api_plugin --plugin eosio::http_plugin --plugin eosio::history_plugin --plugin eosio::history_api_plugin --access-control-allow-origin='*' --contracts-console --http-validate-host=false --verbose-http-errors >> nodeos.log 2>&1 &

Wallet creation

cleos wallet create -n cognaize --to-console
cleos wallet open -n cognaize
cleos wallet unlock -n cognaize
cleos wallet list

Create account

cleos wallet create_key
cleos create account eosio accountname YOUR_PUBLIC_KEY

Build

eosio-cpp -I include -o phonebook.wasm src/contract.cpp -contract phonebook --abigen

Deploy to Jungle testnet

  1. Create keys with cleos create key --to-console
  2. Go to https://api.monitor.jungletestnet.io
  3. Create an account
  4. Request tokens from Faucet
  5. Buy ram with this command
    cleos --url https://jungle2.cryptolions.io system buyram demoaccount demoaccount "100 EOS" -p demoaccount@active
  6. Deploy smart contract with command
    cleos --url https://jungle2.cryptolions.io set contract demoaccount CONTRACT_DIR_PATH phonebook.wasm --abi phonebook.abi -p demoaccout@active
  7. Call some action, for example
    cleos --url https://jungle2.cryptolions.io push action demoaccount addperson '["Isaac Newton", "(884) 981-3901"]' -p demoaccount@active

Some useful commands

cleos -u http://jungle.cryptolions.io:8888 get account accountname
cleos -u http://jungle.cryptolions.io:8888 get currency balance eosio.token accountname EOS

cleos --url https://jungle2.cryptolions.io get abi demoaccount5
cleos --url https://jungle2.cryptolions.io get table demoaccount5 demoaccount5 person

Some links

https://eos.io
https://developers.eos.io/eosio-home/docs/10-big-picture
https://developers.eos.io/eosio-cleos/reference
https://github.com/EOSIO
https://github.com/EOSIO/eosio.contracts
https://github.com/EOSIO/eosjs
https://developers.eos.io/eosio-cpp/docs/naming-conventions
https://eosio.stackexchange.com/
https://twitter.com/block_one_
https://twitter.com/bytemaster7
https://medium.com/@bytemaster

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment