EOSIO / eos

An open source smart contract platform
https://developers.eos.io/manuals/eos
MIT License
11.27k stars 3.6k forks source link

DAWN-113 ⁃ Verify all eos/contracts/* work (at least compile) #809

Closed blockone-syncclient closed 6 years ago

blockone-syncclient commented 6 years ago

eos/contracts/* has a number of example contracts.

These should be verified that they all work or otherwise removed. If they do not work because of lack of API then we need to access to add required API or document that API is not yet ready.

ACT:

eos/contracts/* all can be loaded into eosd and can process their respective messages.

blockone-syncclient commented 6 years ago

➤ Kevin Heifner commented:

Users will look in eos/contracts/* for examples of how to create contracts.

blockone-syncclient commented 6 years ago

➤ Brian Johnson commented:

(Was just going to put one example, but then ended up looking through all of them)

contracts/storage/storage.hpp's Link struct that has no test code (at least in our repo) and I do not know how eospath and ipfspath could possibly work.

contracts/social/social.cpp which does not have a "void apply() {...}" definition (still has apply_social_post) so can never run, even if it was loaded into eos

contracts/tic_tac_toe could possibly be good examples, but they are not even being compiled to wast, so we have no idea if they even compile, let alone run (same goes for contracts/skeleton)

contracts/dice doesn't compile, has lots of documentation, but does not have "void apply() {...}" definition (it doesn't even match the previous apply function format, it has apply_offer, apply_cancel,...)

[~dan.larimer] [~admin] [~thomas.cox]

blockone-syncclient commented 6 years ago

➤ Kevin Heifner commented:

Please just go through each contract and make sure they build and can be loaded. If they can't be very quickly fixed we need to remove them from github.

blockone-syncclient commented 6 years ago

➤ Thomas B. Cox commented:

Getting helpful input from Jon-Eric Cook (joneric). Shout out to him. https://github.com/joneric

thomasbcox commented 6 years ago

Status of the contracts so far. Contracts that cause errors will be fixed or withdrawn prior to the 12/5 launch (checked means ok, unchecked means failing):

thomasbcox commented 6 years ago

joneric's steps for recreating the error with the 'exchange' contract:

Preconditions:

eosd and eosc have both successfully ran on my MacBook Pro

Objective:

Recreate the error observed when attempting to “./eosc set” the exchange contract located in ~/eos/build/contracts/exchange.

Instructions:

Navigate to ~/eos/build/programs/eosd and delete the folder “data-dir” Open a terminal Navigate to ~/eos/build/programs/eosd

cd ~/eos/build/programs/eosd/

Run the following command:

./eosd

It should exit with an expected error; this initializes the data-dir and the config.ini file.

Navigate to ~/eos/build/programs/eosd/data-dir Replace the “config.ini” file with the one provided (attachment) Navigate to ~/eos/build/programs/eosd

cd ~/eos/build/programs/eosd/

Run the following command:

./eosd

eosd should now be running and producing blocks Open a new terminal and navigate to ~/eos/build/programs/eosc

cd ~/eos/build/programs/eosc/

Create a wallet

./eosc wallet create

Import the wallet of the “inita” account (local testnet only)

./eosc wallet import 5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3

Create the owner keys and save for later use

./eosc create key # owner_key

Create the active keys and save for later use

./eosc create key # active_key

Create the exchange account

./eosc create account inita exchange <owner_public_key> <active_public_key>

Import the active private key of the exchange account

./eosc wallet import <active_private_key>

Set the exchange smart contract onto the locally running eos blockchain

./eosc set contract exchange ../../contracts/exchange/exchange.wast ../../contracts/exchange/exchange.abi

The error should appear in the terminal

blockone-syncclient commented 6 years ago

➤ Thomas B. Cox commented:

[~pravin.bezwada] please verify simply which contracts are working and which are not, and remove non-working contracts from the 12/4 distro. Jon-Eric did a pass (see above).

blockone-syncclient commented 6 years ago

➤ Dhanesh Valappil commented:

Suggestions:

  1. tic_tactoe can be renamed to tictactoe as the system replaces "" to "."

  2. The following smart contracts are incomplete a. dice b. infinite c. social

  3. test_api is not a contract

  4. Replace #include <> to #include "" when includes the contract hpp file

Tested the buildable smart contracts and all looks good

blockone-syncclient commented 6 years ago

➤ Kevin Heifner commented:

https://github.com/EOSIO/eos/issues/821

blockone-syncclient commented 6 years ago

➤ Bezwada Satyapravin commented:

If some contracts don't work or are not ready, should we remove them from git or comment out them from CMakeList.txt?

CodyDeeds commented 6 years ago

I have spent the last few days as a newb trying to get the mentioned broken contracts to work, it has been very discouraging. Removing them altogether until they work is a great idea from personal experience.

brianjohnson5972 commented 6 years ago

Resolved by #6041