Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A few fixes and two rewrites for clarity. #76

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

roschler
Copy link

No description provided.

roschler added 4 commits May 26, 2018 20:22
The tutorial did  not instruct the user on how to add a section to their Truffle configuration file that describes the Ganache network.  This version has those instructions.  Also instead of using "local" for the deployment command, this version uses "development" as the network mnemonic since that is the default label used in Truffle's documentation on the Truffle configuration file.
Completed document wide replacement of the "local" network designation with "development".
The original document used lowercase "basil" in the "zos init" command.  This led to the generated "zos.json" having a lowercase "basil" for the "name" field, which didn't match the tutorial.
Copy link
Contributor

@fiiiu fiiiu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@roschler Many thanks for the fixes! Please see the suggested changes :)

@@ -91,7 +91,7 @@ Now, to get the niceties that ZeppelinOS provides, let's install the `zos` comma

```sh
npm install zos
zos init basil 0.0.1
zos init Basil 0.0.1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are using all lowercase for app names, please see https://docs.zeppelinos.org/docs/setup.html where my-app is used.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, see latest commit.

@@ -128,16 +128,32 @@ Let's start a local ethereum network:
ganache-cli --deterministic
```

This will print 10 accounts. Copy the address of the first one, and then back into the initial terminal, export it as the `OWNER` because it will be useful for us later:
This will print 10 accounts. Copy the address of the first one and then go back to the terminal window that you used to launch the Ganache client. Export the address you just copied to an environment variable named `OWNER`. You will need easy access to that address as you complete this tutorial:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This phrase could indeed be improved, but please note that the "going back" is not to the terminal running the Ganache client, but the other, where the initial commands were run, and is at this point free to run the next steps.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. Changed text to tell the user to go back to the terminal window that they used to create the Basil project.


If you don't, use your favorite editor to add an entry to the `networks` section like the one shown above. If your `truffle.js` file is empty except for a couple of comment lines, just replace the entire contents of that file with that shown above. Now Truffle knows where to find the Ganache client.

Next, we deploy our app to Ganache:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should actually be covered by the zos init command, which generates a suitable truffle config file. We would like to keep these details hidden from the users where possible, so as to avoid cluttering the guides with non-zos content.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed that section. zos init generates a truffle-config.js file with the port set at 9545 for Ganache in the networks section.


```sh
zos push --from $OWNER --network local
zos push --from $OWNER --network development
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The truffle config file generated by zos init uses local for the network name.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed all instance of development back to `local.

@@ -146,15 +162,15 @@ of your project in that specific network, including contract logic and instance

## Contract logic and upgradeable instances

Notice how the file `zos.local.json` lists a series of "contracts" and "proxies". The first are the logic contracts for a specific contract name, while the second are the actual contract instances that our users will interact with in the blockchain.
Notice how the file `zos.development.json` lists a series of "contracts" and "proxies". The first are the logic contracts for a specific contract name, while the second are the actual contract instances that our users will interact with in the blockchain.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See above.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed all instances of development back to local.


```sh
zos create Basil --from $OWNER --network local --init --args $OWNER
zos create Basil --from $OWNER --network development --init --args $OWNER
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See above, and several instances following.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed all instances of development back to local.

```

Notice the `--deploy-stdlib` option we've used. What this does is inject a version of the standard lib in our development network. Since we're working on a local blockchain, ZeppelinOS's contracts don't exist. This handy option solves that problem for us quite conveniently ^^
Notice the `--deploy-stdlib` option we've used. What this does is inject a version of the standard lib into our development network. Since we're working on a local blockchain, the smart contracts that make up the ZeppelinOS library don't exist there. This handy option solves that problem for us quite nicely.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like most changes here but why "conveniently" -> "nicely"?

Also, the "^^" is supposed to be an emoticon :)

roschler and others added 7 commits June 13, 2018 22:10
Note: This is an interim commit.  I have asked a Solidity professional to go through the tutorial on a fresh machine.  Once I get their review of this new revision I will do a final commit of this document.

Included in this version:

- The tutorial is now completely stand-alone including setup and installation of: `truffle`, `ganache-cli`, the necessary auxiliary packages, and the contents of the initial `truffle.js` file.  The user does not have to have anything but a working Linux station with the usual tools.
- It fixes the most significant problem with the tutorial.  The original version told the user immediately after the `zos push` command to assign the output address of that to the BASIL_ADDRESS environment variable.  These instructions should have been after the tutorial asks the user to do the `zos create` command since that command outputs the the Basil proxy address.  The `zos push` command outputs the `app` package address.  This resulted in the the `setToken()` call to fail at the end of the tutorial with a `revert` exception.
- Numerous enhancements of various sections of the tutorial to include additional explanations and file snapshots.
- Many rewrites of the some of the text to improve clarity and specificity.
- Renamed the BASIL_ADDRESS and TOKEN_ADDRESS environment variables to BASIL_PROXY_ADDRESS and TOKEN_PROXY_ADDRESS since that is what they actually contain.
Added a small note that tells the user that the addresses found in this tutorial document are only samples and will not match what they see on their system monitor as the execute the commands in this tutorial.
Closed off a backward quoted text element that was missing.
Replaced the hard coded address in one of the address export statements with a substitution label.  Enhanced and cleaned up the text involving the exporting of the mintable token and the `setToken()` command.
Removed the section on creating a truffle.js file since `zos init` creates one.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants