Code Monkey home page Code Monkey logo

eospixels's Introduction

EOS Pixels - Paint pixels, earn tokens!

The first collaborative artwork on blockchain.

The first collaborative artwork on blockchain.

Setup

Go to contracts folder:

cd contracts

Install project dependencies:

yarn

Local EOS test network extra steps

Run nodeos in docker:

# cd to path-to-repo/contracts frist
yarn nodeos:docker

# alias cleos
alias cleos='docker exec -it eosio /opt/eosio/bin/cleos -u http://0.0.0.0:8888 --wallet-url http://0.0.0.0:8888'

Initialize wallet if not already

cleos wallet create
# Remember to save the password
cleos wallet import --private-key 5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3

Create EOS token if not already

Create eosio.token account:

cleos create account eosio eosio.token EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV

Deploy eosio.token contract:

cleos set contract eosio.token contracts/eosio.token -p eosio.token@active

Create EOS token:

cleos push action eosio.token create '[ "eosio", "1000000000.0000 EOS"]' -p eosio.token

Compile & Deploy

Note: For Kylin Testnet or Jungle Testnet, you need to create the contract account on the corresponding website first, and then you also need to buy some ram using faucet supply tokens.

Copy the .env.template to .env and add your private key there and edit your contract name and network node infomations.

Kylin Testnet example configuration:

EOS_CONTRACT_NAME=myeospixels1
CONTRACT_PRIVATE_KEY=5......
EOS_NETWORK_PROTOCOL=https
EOS_NETWORK_HOST=api-kylin.eosasia.one
EOS_NETWORK_PORT=443
EOS_NETWORK_CHAINID=5fff1dae8dc8e2fc4d5b23b2c7665c97f9e9d8edf2b6485a86ba311c25639191

Compile and deploy contracts:

# Local EOS test network
yarn start:docker

# yarn start

Scripts

Tip: for local eos testnet, you won't get error detail from api respond, use docker logs --tail 10 -f eosio to trace the chain logs.

Clear docker data:

# stop and remove container
docker stop eosio

# remove data
yarn clear:docker

Update contract (recompile and deploy):

# Local EOS test network
yarn update-contract:docker

# yarn update-contract

Create new canvas after current canvas is done:

yarn @end

Create new canvas automatically:

yarn @autoend

Withdraw using tester account:

yarn @withdraw '0.0010 EOS'

Inspecting the contract's tables:

yarn dump-tables

eospixels's People

Contributors

dfguo avatar lychees avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.