Skip to content

Commit c371c6c

Browse files
committed
eth intro: check-ins and final quiz
1 parent 63d00aa commit c371c6c

File tree

13 files changed

+152
-154
lines changed

13 files changed

+152
-154
lines changed

pages/lessons/fundamentals/wolovim-part-1.mdx

Lines changed: 17 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,6 @@ icons:
1515

1616
So, you’ve heard about this [Ethereum](https://ethereum.org/) thing and are ready to venture down the rabbit hole? This post will quickly cover some blockchain basics, then get you interacting with a simulated Ethereum node – reading block data, checking account balances, and sending transactions. Along the way, we’ll highlight the differences between traditional ways of building apps and this new decentralized paradigm.
1717

18-
<SideDrawer buttonText="Warm-up Questions" title="TODO">
19-
<Question question="eth-intro-1/1-intro/Q1" />
20-
<Question question="eth-intro-1/1-intro/Q2" />
21-
<Question question="eth-intro-1/1-intro/Q3" />
22-
<Question question="eth-intro-1/1-intro/Q4" />
23-
<Question question="eth-intro-1/1-intro/Q5" />
24-
</SideDrawer>
25-
<br/>
26-
2718
### **(Soft) prerequisites**
2819

2920
This post aspires to be accessible to a wide range of developers. Python tools will be involved, but they are just a vehicle for the ideas – no problem if you are not a Python developer. I will, however, be making just a few assumptions about what you already know, so we can quickly move on the Ethereum-specific bits.
@@ -35,7 +26,7 @@ Assumptions:
3526
- Python version 3.7 or greater is installed on your machine (use of a [virtual environment](https://realpython.com/effective-python-environment/#virtual-environments) is strongly encouraged), and
3627
- you’ve used `pip`, Python’s package installer.
3728

38-
Again, if any of these are untrue, or you don’t plan to reproduce the code in this article, you can likely still follow along just fine.
29+
Again, if any of these are untrue, or you don’t plan to reproduce the code in this article, just follow along conceptually.
3930

4031
### **Blockchains, briefly**
4132

@@ -46,7 +37,6 @@ There are many ways to describe Ethereum, but at its heart is a blockchain. Bloc
4637
"number": 1234567,
4738
"hash": "0xabc123...",
4839
"parentHash": "0xdef456...",
49-
"miner": "0xa1b2c3...",
5040
...,
5141
"transactions": [...]
5242
}
@@ -76,11 +66,11 @@ Python developers that want to interact with Ethereum are likely to reach for *
7666
**Note:** “Ethereum node” and “Ethereum client” are often used interchangeably. In either case, it refers to the software that a participant in the Ethereum network runs. This software can read block data, receive updates when new blocks are added to the chain, broadcast new transactions, and more.
7767
</Callout>
7868

79-
Ethereum clients can be configured to be reachable by [IPC](https://en.wikipedia.org/wiki/Inter-process_communication), HTTP, or Websockets. web3.py refers to these connection options as **providers**. You’ll want to choose one of the three providers to configure so that web3.py knows how to communicate with your node.
69+
Ethereum clients can be configured to be reachable by IPC, HTTP, or Websockets. web3.py refers to these connection options as **providers**. You’ll want to choose one of the three providers to configure so that web3.py knows how to communicate with your node.
8070

8171
![https://cdn-images-1.medium.com/max/1600/1*OrElsXOF45w-AgBuezCqjQ.png](https://cdn-images-1.medium.com/max/1600/1*OrElsXOF45w-AgBuezCqjQ.png)
8272

83-
Configure the Ethereum node and web3.py to communicate via the same protocol, e.g., IPC in this diagram.
73+
The Ethereum node and web3.py need to be configured to communicate via the same protocol, e.g., IPC in this diagram.
8474

8575
Once web3.py is properly configured, you can begin to interact with the blockchain. Here’s a couple of web3.py usage examples as a preview of what’s to come:
8676

@@ -92,12 +82,13 @@ w3.eth.get_block('latest')
9282
w3.eth.send_transaction({'from': ..., 'to': ..., 'value': ...})
9383
```
9484

95-
<SideDrawer buttonText="Check-in 1" title="TODO">
96-
<Question question="eth-intro-1/1-intro/Q1" />
97-
<Question question="eth-intro-1/1-intro/Q2" />
98-
<Question question="eth-intro-1/1-intro/Q3" />
99-
<Question question="eth-intro-1/1-intro/Q4" />
100-
<Question question="eth-intro-1/1-intro/Q5" />
85+
<SideDrawer buttonText="Did you get all that?" title="Comprehension Check">
86+
<Question question="eth-intro-1/2-checkin/Q1" />
87+
<Question question="eth-intro-1/2-checkin/Q2" />
88+
<Question question="eth-intro-1/2-checkin/Q3" />
89+
<Question question="eth-intro-1/2-checkin/Q4" />
90+
<Question question="eth-intro-1/2-checkin/Q5" />
91+
<Question question="eth-intro-1/2-checkin/Q6" />
10192
</SideDrawer>
10293
<br/>
10394

@@ -200,12 +191,12 @@ In [4]: w3 = Web3(Web3.EthereumTesterProvider())
200191

201192
Before we move on, does all that make sense? Test yourself:
202193

203-
<SideDrawer buttonText="Check-in 2" title="TODO">
204-
<Question question="eth-intro-1/1-intro/Q1" />
205-
<Question question="eth-intro-1/1-intro/Q2" />
206-
<Question question="eth-intro-1/1-intro/Q3" />
207-
<Question question="eth-intro-1/1-intro/Q4" />
208-
<Question question="eth-intro-1/1-intro/Q5" />
194+
<SideDrawer buttonText="Keeping up? Test yourself." title="Comprehension Check">
195+
<Question question="eth-intro-1/3-checkin/Q1" />
196+
<Question question="eth-intro-1/3-checkin/Q2" />
197+
<Question question="eth-intro-1/3-checkin/Q3" />
198+
<Question question="eth-intro-1/3-checkin/Q4" />
199+
<Question question="eth-intro-1/3-checkin/Q5" />
209200
</SideDrawer>
210201
<br/>
211202

@@ -268,7 +259,7 @@ Out[9]: AttributeDict({
268259

269260
A lot of information gets returned about a block, but just a couple things to point out here:
270261

271-
1. The block number is zero — no matter how long ago you configured the tester provider. Unlike the real Ethereum network, which mines a new block roughly every 15 seconds, this simulation will wait until you give it some work to do.
262+
1. The block number is zero — no matter how long ago you configured the tester provider. Unlike the real Ethereum network, which includes a new block every 13 seconds, this simulation will wait until you give it some work to do.
272263
2. `transactions` is an empty list, for the same reason: we haven’t done anything yet. This first block is an **empty block**, just to kick off the chain.
273264
3. Notice that the `parentHash` is just a bunch of empty bytes. This signifies that it's the first block in the chain, also known as the **genesis** **block**.
274265

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
{
2-
"question": "TODO",
2+
"question": "What is a blockchain?",
33
"options": [
44
{
5-
"answer": "True"
5+
"answer": "A fast food restaurant concept"
66
},
77
{
8-
"answer": "False",
8+
"answer": "A data structure that is a linked list of blocks",
99
"correct": true
10+
},
11+
{
12+
"answer": "A type of cryptocurrency"
1013
}
1114
]
1215
}

utils/questions/eth-intro-1/2-checkin/Q2.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
{
2-
"question": "TODO",
2+
"question": "What is in a block?",
33
"options": [
44
{
5-
"answer": "True"
5+
"answer": "The email address of the block creator"
66
},
77
{
8-
"answer": "False",
8+
"answer": "Data about the transactions in that block",
9+
"correct": true
10+
},
11+
{
12+
"answer": "A reference to the previous block",
913
"correct": true
1014
}
1115
]
Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
{
2-
"question": "TODO",
2+
"question": "What is novel about blockchains?",
33
"options": [
44
{
5-
"answer": "True"
5+
"answer": "They can be governed without a central authority.",
6+
"correct": true
67
},
78
{
8-
"answer": "False",
9-
"correct": true
9+
"answer": "They store data more efficiently than a database."
10+
},
11+
{
12+
"answer": "Transaction throughput is unrivaled."
1013
}
1114
]
1215
}
Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
{
2-
"question": "TODO",
2+
"question": "What happens when you send a transaction?",
33
"options": [
44
{
5-
"answer": "True"
5+
"answer": "Somewhere, a banker sneezes."
66
},
77
{
8-
"answer": "False",
8+
"answer": "The transaction is pending until it gets included in a block.",
99
"correct": true
10+
},
11+
{
12+
"answer": "The master node includes the transaction in the next block in the order it was received."
1013
}
1114
]
1215
}
Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
11
{
2-
"question": "TODO",
2+
"question": "The native currency of Ethereum is called:",
33
"options": [
44
{
5-
"answer": "True"
5+
"answer": "Ethereum"
66
},
77
{
8-
"answer": "False",
8+
"answer": "Bitcoin"
9+
},
10+
{
11+
"answer": "ether",
912
"correct": true
13+
},
14+
{
15+
"answer": "frogcoin"
1016
}
1117
]
1218
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"question": "How can you communicate with an Ethereum node?",
3+
"options": [
4+
{
5+
"answer": "Configure a provider within a tool like web3.py or ethers.js",
6+
"correct": true
7+
},
8+
{
9+
"answer": "Use a Ouija board and hope for the best"
10+
},
11+
{
12+
"answer": "Email your local node admin"
13+
}
14+
]
15+
}

utils/questions/eth-intro-1/3-checkin/Q1.json

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
{
2-
"question": "TODO",
2+
"question": "How many decimal points are accounted for with ether?",
33
"options": [
44
{
5-
"answer": "True"
5+
"answer": "3"
66
},
77
{
8-
"answer": "False",
8+
"answer": "9"
9+
},
10+
{
11+
"answer": "12"
12+
},
13+
{
14+
"answer": "18",
915
"correct": true
1016
}
1117
]
Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
{
2-
"question": "TODO",
2+
"question": "While developing your application,you should:",
33
"options": [
44
{
5-
"answer": "True"
5+
"answer": "connect to a local test network for quicker development cycles",
6+
"correct": true
67
},
78
{
8-
"answer": "False",
9-
"correct": true
9+
"answer": "connect to Ethereum mainnet and spend real ether until you get it right"
10+
},
11+
{
12+
"answer": "take out loans to buy NFTs"
1013
}
1114
]
1215
}

utils/questions/eth-intro-1/3-checkin/Q3.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
{
2-
"question": "TODO",
2+
"question": "A local test network provides you with:",
33
"options": [
44
{
5-
"answer": "True"
5+
"answer": "deployed sample smart contracts"
66
},
77
{
8-
"answer": "False",
8+
"answer": "accounts populated with test ether",
9+
"correct": true
10+
},
11+
{
12+
"answer": "transactions instantly included in new block",
913
"correct": true
1014
}
1115
]

0 commit comments

Comments
 (0)