Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

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

Closed
blockone-syncclient opened this issue Nov 28, 2017 · 12 comments
Closed

Comments

@blockone-syncclient
Copy link

blockone-syncclient commented Nov 28, 2017

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
Copy link
Author

➤ Kevin Heifner commented:

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

@blockone-syncclient
Copy link
Author

➤ 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
Copy link
Author

➤ 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
Copy link
Author

blockone-syncclient commented Nov 28, 2017

➤ Thomas B. Cox commented:

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

@thomasbcox thomasbcox assigned thomasbcox and unassigned thomasbcox Nov 28, 2017
@thomasbcox
Copy link
Contributor

thomasbcox commented Nov 28, 2017

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):

  • currency
  • dice
  • exchange
  • infinite
  • proxy
  • simpledb
  • skeleton
  • social
  • storage
  • test_api
  • tic_tac_toe

@thomasbcox
Copy link
Contributor

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
Copy link
Author

➤ 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
Copy link
Author

➤ Dhanesh Valappil commented:

Suggestions:

  1. tic_tac_toe 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
Copy link
Author

➤ Kevin Heifner commented:

#821

@blockone-syncclient
Copy link
Author

➤ 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?

@blockone-syncclient blockone-syncclient changed the title STAT-113 ⁃ Verify all eos/contracts/* work (at least compile) DAWN-113 ⁃ Verify all eos/contracts/* work (at least compile) Jan 15, 2018
@CodyDeeds
Copy link
Contributor

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
Copy link
Contributor

Resolved by #6041

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants