Skip to content

Instantly share code, notes, and snippets.

@cookie-ag
Last active November 8, 2018 15:30
Show Gist options
  • Select an option

  • Save cookie-ag/b58615d49c0f92cddd26b8eda6053ab9 to your computer and use it in GitHub Desktop.

Select an option

Save cookie-ag/b58615d49c0f92cddd26b8eda6053ab9 to your computer and use it in GitHub Desktop.

Revisions

  1. Gautam Anand revised this gist Nov 8, 2018. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions 02-nodeos.txt
    Original file line number Diff line number Diff line change
    @@ -6,7 +6,7 @@ docker pull eosio/eos-dev

    (b) Start the container from the image
    -> OSX
    sudo docker run --rm --name eosio -d -p 8888:8888 -p 9876:9876 -v /tmp/work:/work -v /tmp/eosio/data:/mnt/dev/data -v /tmp/eosio/config:/mnt/dev/config eosio/eos-dev /bin/bash -c "nodeos -e -p eosio --plugin eosio::wallet_api_plugin --plugin eosio::wallet_plugin --plugin eosio::producer_plugin --plugin eosio::history_plugin --plugin eosio::chain_api_plugin --plugin eosio::history_api_plugin --plugin eosio::http_plugin -d /mnt/dev/data --config-dir /mnt/dev/config --http-server-address=0.0.0.0:8888 --access-control-allow-origin=* --contracts-console"
    sudo docker run --rm --name nodeos -d -p 8888:8888 -p 9876:9876 -v /tmp/work:/work -v /tmp/eosio/data:/mnt/dev/data -v /tmp/eosio/config:/mnt/dev/config eosio/eos-dev /bin/bash -c "nodeos -e -p eosio --plugin eosio::wallet_api_plugin --plugin eosio::wallet_plugin --plugin eosio::producer_plugin --plugin eosio::history_plugin --plugin eosio::chain_api_plugin --plugin eosio::history_api_plugin --plugin eosio::http_plugin -d /mnt/dev/data --config-dir /mnt/dev/config --http-server-address=0.0.0.0:8888 --access-control-allow-origin=* --contracts-console"

    -> WIN 10
    docker network create eosdev
    @@ -19,5 +19,5 @@ sudo docker logs --tail 10 eosio
    http://localhost:8888/v1/chain/get_info

    (e) Stop/Start container
    docker stop eosio
    docker start eosio
    docker stop nodeos
    docker start nodeos
  2. Gautam Anand revised this gist Nov 8, 2018. 1 changed file with 5 additions and 0 deletions.
    5 changes: 5 additions & 0 deletions 02-nodeos.txt
    Original file line number Diff line number Diff line change
    @@ -5,8 +5,13 @@ the core EOSIO daemon that can be configured with plugins to run a node. Example
    docker pull eosio/eos-dev

    (b) Start the container from the image
    -> OSX
    sudo docker run --rm --name eosio -d -p 8888:8888 -p 9876:9876 -v /tmp/work:/work -v /tmp/eosio/data:/mnt/dev/data -v /tmp/eosio/config:/mnt/dev/config eosio/eos-dev /bin/bash -c "nodeos -e -p eosio --plugin eosio::wallet_api_plugin --plugin eosio::wallet_plugin --plugin eosio::producer_plugin --plugin eosio::history_plugin --plugin eosio::chain_api_plugin --plugin eosio::history_api_plugin --plugin eosio::http_plugin -d /mnt/dev/data --config-dir /mnt/dev/config --http-server-address=0.0.0.0:8888 --access-control-allow-origin=* --contracts-console"

    -> WIN 10
    docker network create eosdev
    docker run --name nodeos -d -p 8888:8888 --network eosdev -v C:\eosio\work:/work -v C:\eosio\data:/mnt/dev/data -v C:\eosio\config:/mnt/dev/config eosio/eos-dev /bin/bash -c "nodeos -e -p eosio --plugin eosio::producer_plugin --plugin eosio::history_plugin --plugin eosio::chain_api_plugin --plugin eosio::history_api_plugin --plugin eosio::http_plugin -d /mnt/dev/data --config-dir /mnt/dev/config --http-server-address=0.0.0.0:8888 --access-control-allow-origin=* --contracts-console --http-validate-host=false"

    (c) See if this image is working
    sudo docker logs --tail 10 eosio

  3. Gautam Anand revised this gist Jun 9, 2018. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions 04-smartcontracts.txt
    Original file line number Diff line number Diff line change
    @@ -18,3 +18,6 @@ eosiocpp -o ${contract}.wast ${contract}.cpp

    (e) Create abi file from hpp
    eosiocpp -g ${contract}.abi ${contract}.hpp

    (f) set contract to the block chain
    cleos set contract $CURRENCY ${contract}.wast ${contract}.abi
  4. Gautam Anand revised this gist Jun 9, 2018. 1 changed file with 9 additions and 2 deletions.
    11 changes: 9 additions & 2 deletions 04-smartcontracts.txt
    Original file line number Diff line number Diff line change
    @@ -6,8 +6,15 @@ Before anything go through the communication doc: https://developers.eos.io/eosi
    alias eosiocpp='docker exec eosio eosiocpp'

    (b) Create a new contract from template
    eosiocpp -n g1contract
    eosiocpp -n ${contract}

    (c) Access this new contract file
    docker exec -it $CONTAINERID /bin/bash
    cd tmp/g1contract
    cd ${contract}
    -> This is the place where we have our smart contract hpp and cpp file.

    (d) Create wast/wasm from cpp
    eosiocpp -o ${contract}.wast ${contract}.cpp

    (e) Create abi file from hpp
    eosiocpp -g ${contract}.abi ${contract}.hpp
  5. Gautam Anand revised this gist Jun 9, 2018. 1 changed file with 5 additions and 1 deletion.
    6 changes: 5 additions & 1 deletion 04-smartcontracts.txt
    Original file line number Diff line number Diff line change
    @@ -6,4 +6,8 @@ Before anything go through the communication doc: https://developers.eos.io/eosi
    alias eosiocpp='docker exec eosio eosiocpp'

    (b) Create a new contract from template
    eosiocpp -n g1contract
    eosiocpp -n g1contract

    (c) Access this new contract file
    docker exec -it $CONTAINERID /bin/bash
    cd tmp/g1contract
  6. Gautam Anand revised this gist Jun 9, 2018. 2 changed files with 13 additions and 13 deletions.
    21 changes: 9 additions & 12 deletions 03-cleos.txt
    Original file line number Diff line number Diff line change
    @@ -4,38 +4,35 @@ cleos is a command line tool that interfaces with the REST API exposed by nodeos
    (a) Create a alias so as cleos is available from terminal
    alias cleos='docker exec eosio /opt/eosio/bin/cleos --wallet-url http://localhost:8888'

    (b) Create Local Wallet
    cleos create wallet

    (c) Create Key
    (b) Create Key
    cleos create key

    (d) Create Wallet/List all wallets
    (c) Create Wallet/List all wallets
    cleos wallet create
    cleos wallet list

    (e) Open a wallet
    (d) Open a wallet
    cleos wallet open

    (f) Unlock a wallet (Assuming you opened a default)
    (e) Unlock a wallet (Assuming you opened a default)
    cleos wallet unlock --password XXXXXXXmypassword

    (g) Relate private keys inside your wallet and your wallet is unlocked
    (f) Relate private keys inside your wallet and your wallet is unlocked
    cleos wallet import myprivatekeyXXXXX

    (h) Create Account (First time user should be eosio)
    (g) Create Account (First time user should be eosio)
    cleos create account eosio $ACCOUNTNAME EOSXXXPublicKey EOSXXXPublicKey
    # This is very useful when creating accounts. Always use eosio as the creator for local development.

    (i) Get block/account/code or abi info
    (h) Get block/account/code or abi info
    cleos get info
    cleos get account eosio
    cleos get code eosio.token

    (j) Get table for specific contract
    (i) Get table for specific contract
    cleos get table eosio.token eosio accounts

    (h) Get table for specific contract
    (j) Get table for specific contract
    cleos get currency balance eosio.token eosio SYMBOL


    5 changes: 4 additions & 1 deletion 04-smartcontracts.txt
    Original file line number Diff line number Diff line change
    @@ -3,4 +3,7 @@ Before anything go through the communication doc: https://developers.eos.io/eosi
    # We need to setup a tool call eosiocpp

    (a) Create a alias so as eosiocpp is available from terminal
    alias eosiocpp='docker exec eosio eosiocpp'
    alias eosiocpp='docker exec eosio eosiocpp'

    (b) Create a new contract from template
    eosiocpp -n g1contract
  7. Gautam Anand revised this gist Jun 9, 2018. 2 changed files with 10 additions and 1 deletion.
    5 changes: 4 additions & 1 deletion 01-docker101.txt
    Original file line number Diff line number Diff line change
    @@ -4,5 +4,8 @@ docker image ls
    (b) Show containers
    docker container ls

    (c) Access docker bash for a container
    docker exec -it $CONTAINERID /bin/bash

    (c) More
    https://www.digitalocean.com/community/tutorials/naming-docker-containers-3-tips-for-beginners
    https://www.digitalocean.com/community/tutorials/naming-docker-containers-3-tips-for-beginners
    6 changes: 6 additions & 0 deletions 04-smartcontracts.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    Before anything go through the communication doc: https://developers.eos.io/eosio-cpp/docs/communication-model

    # We need to setup a tool call eosiocpp

    (a) Create a alias so as eosiocpp is available from terminal
    alias eosiocpp='docker exec eosio eosiocpp'
  8. Gautam Anand revised this gist Jun 9, 2018. 1 changed file with 14 additions and 1 deletion.
    15 changes: 14 additions & 1 deletion 03-cleos.txt
    Original file line number Diff line number Diff line change
    @@ -23,7 +23,20 @@ cleos wallet unlock --password XXXXXXXmypassword
    (g) Relate private keys inside your wallet and your wallet is unlocked
    cleos wallet import myprivatekeyXXXXX

    (g) Create Account (First time user should be eosio)
    (h) Create Account (First time user should be eosio)
    cleos create account eosio $ACCOUNTNAME EOSXXXPublicKey EOSXXXPublicKey
    # This is very useful when creating accounts. Always use eosio as the creator for local development.

    (i) Get block/account/code or abi info
    cleos get info
    cleos get account eosio
    cleos get code eosio.token

    (j) Get table for specific contract
    cleos get table eosio.token eosio accounts

    (h) Get table for specific contract
    cleos get currency balance eosio.token eosio SYMBOL



  9. Gautam Anand revised this gist Jun 9, 2018. 1 changed file with 6 additions and 3 deletions.
    9 changes: 6 additions & 3 deletions 03-cleos.txt
    Original file line number Diff line number Diff line change
    @@ -10,8 +10,9 @@ cleos create wallet
    (c) Create Key
    cleos create key

    (d) Create Wallet
    (d) Create Wallet/List all wallets
    cleos wallet create
    cleos wallet list

    (e) Open a wallet
    cleos wallet open
    @@ -22,5 +23,7 @@ cleos wallet unlock --password XXXXXXXmypassword
    (g) Relate private keys inside your wallet and your wallet is unlocked
    cleos wallet import myprivatekeyXXXXX

    (g) Create Account
    cleos create account creator mytestaccount EOSXXXPublicKey
    (g) Create Account (First time user should be eosio)
    cleos create account eosio $ACCOUNTNAME EOSXXXPublicKey EOSXXXPublicKey
    # This is very useful when creating accounts. Always use eosio as the creator for local development.

  10. Gautam Anand revised this gist Jun 9, 2018. 1 changed file with 14 additions and 2 deletions.
    16 changes: 14 additions & 2 deletions 03-cleos.txt
    Original file line number Diff line number Diff line change
    @@ -10,5 +10,17 @@ cleos create wallet
    (c) Create Key
    cleos create key

    (d) Create Account
    cleos create account creator "MYNAME" OwnerKey EOSXXXXXXXXXXX
    (d) Create Wallet
    cleos wallet create

    (e) Open a wallet
    cleos wallet open

    (f) Unlock a wallet (Assuming you opened a default)
    cleos wallet unlock --password XXXXXXXmypassword

    (g) Relate private keys inside your wallet and your wallet is unlocked
    cleos wallet import myprivatekeyXXXXX

    (g) Create Account
    cleos create account creator mytestaccount EOSXXXPublicKey
  11. Gautam Anand revised this gist Jun 9, 2018. 3 changed files with 25 additions and 3 deletions.
    8 changes: 8 additions & 0 deletions 01-docker101.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    (a) Show images
    docker image ls

    (b) Show containers
    docker container ls

    (c) More
    https://www.digitalocean.com/community/tutorials/naming-docker-containers-3-tips-for-beginners
    6 changes: 6 additions & 0 deletions nodeos.txt → 02-nodeos.txt
    Original file line number Diff line number Diff line change
    @@ -10,3 +10,9 @@ sudo docker run --rm --name eosio -d -p 8888:8888 -p 9876:9876 -v /tmp/work:/wor
    (c) See if this image is working
    sudo docker logs --tail 10 eosio

    (d) Got to the web-browser
    http://localhost:8888/v1/chain/get_info

    (e) Stop/Start container
    docker stop eosio
    docker start eosio
    14 changes: 11 additions & 3 deletions cleos.txt → 03-cleos.txt
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,14 @@
    # Check API: http://localhost:8888/v1/chain/get_info

    #Cleos
    cleos is a command line tool that interfaces with the REST API exposed by nodeos. In order to use cleos you will need to have the end point (IP address and port number) to a nodeos instance and also configure cleos to load the 'eosio::chain_api_plugin'. cleos contains documentation for all of its commands

    alias cleos='docker exec eosio /opt/eosio/bin/cleos --wallet-url http://localhost:8888'
    (a) Create a alias so as cleos is available from terminal
    alias cleos='docker exec eosio /opt/eosio/bin/cleos --wallet-url http://localhost:8888'

    (b) Create Local Wallet
    cleos create wallet

    (c) Create Key
    cleos create key

    (d) Create Account
    cleos create account creator "MYNAME" OwnerKey EOSXXXXXXXXXXX
  12. Gautam Anand revised this gist Jun 9, 2018. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions nodeos.txt
    Original file line number Diff line number Diff line change
    @@ -1,9 +1,12 @@
    #Nodeos
    the core EOSIO daemon that can be configured with plugins to run a node. Example uses are block production, dedicated API endpoints, and local development.

    (a) Download IMAGE for Development
    docker pull eosio/eos-dev

    (b) Start the container from the image
    sudo docker run --rm --name eosio -d -p 8888:8888 -p 9876:9876 -v /tmp/work:/work -v /tmp/eosio/data:/mnt/dev/data -v /tmp/eosio/config:/mnt/dev/config eosio/eos-dev /bin/bash -c "nodeos -e -p eosio --plugin eosio::wallet_api_plugin --plugin eosio::wallet_plugin --plugin eosio::producer_plugin --plugin eosio::history_plugin --plugin eosio::chain_api_plugin --plugin eosio::history_api_plugin --plugin eosio::http_plugin -d /mnt/dev/data --config-dir /mnt/dev/config --http-server-address=0.0.0.0:8888 --access-control-allow-origin=* --contracts-console"

    (c) See if this image is working
    sudo docker logs --tail 10 eosio

  13. Gautam Anand revised this gist Jun 9, 2018. 1 changed file with 6 additions and 0 deletions.
    6 changes: 6 additions & 0 deletions cleos.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    # Check API: http://localhost:8888/v1/chain/get_info

    #Cleos
    cleos is a command line tool that interfaces with the REST API exposed by nodeos. In order to use cleos you will need to have the end point (IP address and port number) to a nodeos instance and also configure cleos to load the 'eosio::chain_api_plugin'. cleos contains documentation for all of its commands

    alias cleos='docker exec eosio /opt/eosio/bin/cleos --wallet-url http://localhost:8888'
  14. Gautam Anand renamed this gist Jun 9, 2018. 1 changed file with 1 addition and 7 deletions.
    8 changes: 1 addition & 7 deletions instructions.txt → nodeos.txt
    Original file line number Diff line number Diff line change
    @@ -1,15 +1,9 @@
    #Nodeos
    the core EOSIO daemon that can be configured with plugins to run a node. Example uses are block production, dedicated API endpoints, and local development.

    docker pull eosio/eos-dev

    sudo docker run --rm --name eosio -d -p 8888:8888 -p 9876:9876 -v /tmp/work:/work -v /tmp/eosio/data:/mnt/dev/data -v /tmp/eosio/config:/mnt/dev/config eosio/eos-dev /bin/bash -c "nodeos -e -p eosio --plugin eosio::wallet_api_plugin --plugin eosio::wallet_plugin --plugin eosio::producer_plugin --plugin eosio::history_plugin --plugin eosio::chain_api_plugin --plugin eosio::history_api_plugin --plugin eosio::http_plugin -d /mnt/dev/data --config-dir /mnt/dev/config --http-server-address=0.0.0.0:8888 --access-control-allow-origin=* --contracts-console"

    sudo docker logs --tail 10 eosio

    # Check API: http://localhost:8888/v1/chain/get_info

    #Cleos
    cleos is a command line tool that interfaces with the REST API exposed by nodeos. In order to use cleos you will need to have the end point (IP address and port number) to a nodeos instance and also configure cleos to load the 'eosio::chain_api_plugin'. cleos contains documentation for all of its commands

    alias cleos='docker exec eosio /opt/eosio/bin/cleos --wallet-url http://localhost:8888'

  15. Gautam Anand created this gist Jun 9, 2018.
    15 changes: 15 additions & 0 deletions instructions.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    #Nodeos

    docker pull eosio/eos-dev

    sudo docker run --rm --name eosio -d -p 8888:8888 -p 9876:9876 -v /tmp/work:/work -v /tmp/eosio/data:/mnt/dev/data -v /tmp/eosio/config:/mnt/dev/config eosio/eos-dev /bin/bash -c "nodeos -e -p eosio --plugin eosio::wallet_api_plugin --plugin eosio::wallet_plugin --plugin eosio::producer_plugin --plugin eosio::history_plugin --plugin eosio::chain_api_plugin --plugin eosio::history_api_plugin --plugin eosio::http_plugin -d /mnt/dev/data --config-dir /mnt/dev/config --http-server-address=0.0.0.0:8888 --access-control-allow-origin=* --contracts-console"

    sudo docker logs --tail 10 eosio

    # Check API: http://localhost:8888/v1/chain/get_info

    #Cleos
    cleos is a command line tool that interfaces with the REST API exposed by nodeos. In order to use cleos you will need to have the end point (IP address and port number) to a nodeos instance and also configure cleos to load the 'eosio::chain_api_plugin'. cleos contains documentation for all of its commands

    alias cleos='docker exec eosio /opt/eosio/bin/cleos --wallet-url http://localhost:8888'