on master help sign in
Updated claz guide per request
b15104aDavid Kerschner
tutorials/arvo/claz.md+15−19
@@ -4,25 +4,21 @@ weight = 4
4template = "doc.html"
4template = "doc.html"
5+++
5+++
6
6
7−This document outlines some advanced techniques for interacting with Azimuth contracts from Urbit itself. It's strongly discouraged to do this unless you're very confident as Azimuth transactions will cost Etherium to complete. However, until you upload a signed transaction to the block chain no transaction will take place so it's safe to explore these tools. It will also be very helpful to have at least a rudimentary understanding of Hoon in order to read and modify parts of the code.
7+This document outlines some advanced techniques for interacting with Azimuth contracts from Urbit itself. It's strongly discouraged to do this unless you're very confident as Azimuth transactions are permanent and will cost ETH to complete. However, until you upload a signed transaction to the block chain no transaction will take place so it's safe to explore these tools. It will also be very helpful to have at least a rudimentary understanding of Hoon in order to read and modify parts of the code.
8
8
9First you will want to boot a fakezod. You can do this with your live running ship but at this time this will need you to modify the code so it's best to do this on a ship you can make mistakes on. If you don't know how to boot a fakezod see this guide for instructions.
9First you will want to boot a fakezod. You can do this with your live running ship but at this time this will need you to modify the code so it's best to do this on a ship you can make mistakes on. If you don't know how to boot a fakezod see this guide for instructions.
10
10
11Be sure to have mounted your home desk so you can easily edit files on it.
11Be sure to have mounted your home desk so you can easily edit files on it.
12−The first edit that will probably need to be made is in [`app/claz.hoon`](https://github.com/urbit/urbit/blob/master/pkg/arvo/app/claz.hoon#L14). The listed url will need to be changed to
12+The first edit that will probably need to be made is in [`app/claz.hoon`](https://github.com/urbit/urbit/blob/master/pkg/arvo/app/claz.hoon#L14). The listed url will need to be changed to a valid Etherium endpoint. infura.io provides an Etherium API that you can use.
13
13
14−https://mainnet.infura.io/v3/2599df54929b47099bda360958d75aaf
15−
16−or another valid endpoint.
17−
18−The second change that will potentially be needed is to modify the [gas limit](https://github.com/urbit/urbit/blob/master/pkg/arvo/app/claz.hoon#L179). This number here is the maximum number of gas units that will be used. In future this will be configurable but for now you may need to change this manually. For a guide to what to set it to you can use the [constants in bridge](https://github.com/urbit/bridge/blob/master/src/lib/constants.js#L23) as a guide based on what action you are going to be preforming. You will need at least the maximum gas units multiplied by the gwei you're going to set later in your etherium account as it may cost that much though is likely to be far less.
14+The second change that may potentially be needed is to modify the [gas limit](https://github.com/urbit/urbit/blob/master/pkg/arvo/app/claz.hoon#L179). This number here is the maximum number of gas units that will be used. In future this will be configurable but for now you may need to change this manually. For a guide to what to set it to you can use the [constants in bridge](https://github.com/urbit/bridge/blob/master/src/lib/constants.js#L23) as a guide based on what action you are going to be preforming. The maximum cost of your transaction will be the maximum gas units multiplied by the gwei you're going to set later. You'll need at least this much in your account.
19
15
20Once you have made these changes be sure to run `|commit %home` to get them into your ship.
16Once you have made these changes be sure to run `|commit %home` to get them into your ship.
21
17
22Next run `|start %claz` after which you'll be able to generate transactions.
18Next run `|start %claz` after which you'll be able to generate transactions.
23
19
24```
20```
25−:claz [%generate %/transaction/eth-txs %mainnet author %single %spawn ~ship to]
21+:claz [%generate %/spawn/eth-txs %mainnet author %single %spawn ~ship to]
26```
22```
27
23
28Here we have an example of generating a transaction to spawn a ship. Something to note is that for this to be successful you'll need to actually have the right to spawn the ship in question. Let's break down the command.
24Here we have an example of generating a transaction to spawn a ship. Something to note is that for this to be successful you'll need to actually have the right to spawn the ship in question. Let's break down the command.
@@ -30,9 +26,9 @@ Here we have an example of generating a transaction to spawn a ship. Something t
30
26
31`%generate` is how all commands to `claz` are going to start.
27`%generate` is how all commands to `claz` are going to start.
32
28
33−`%/transaction/eth-txs` is simply the path for the output file
29+`%/spawn/eth-txs` is simply the path for the output file
34
30
35−`%mainnet` specifies which network this is going to sent out on.
31+`%mainnet` specifies which network this is going to sent out on. Other options are possible including the test net `%ropsten`.
36
32
37`author` here is an etherium address that is issuing the transaction. It will need to be written in `@ux` notation, e.g. `0x3b17.d097.d9dd.711e.4ef8.517a.bbf1.8b2b.a643.81fe`.
33`author` here is an etherium address that is issuing the transaction. It will need to be written in `@ux` notation, e.g. `0x3b17.d097.d9dd.711e.4ef8.517a.bbf1.8b2b.a643.81fe`.
38
34
@@ -42,12 +38,12 @@ Here we have an example of generating a transaction to spawn a ship. Something t
42
38
43`~ship` will be the ship to be spawned.
39`~ship` will be the ship to be spawned.
44
40
45−`to` is the etherium address to spawn the ship to.
41+`to` is the Etherium address to spawn the ship to.
46
42
47You will want to read `sur/claz.hoon` which you can find [here](https://github.com/urbit/urbit/blob/master/pkg/arvo/sur/claz.hoon).
43You will want to read `sur/claz.hoon` which you can find [here](https://github.com/urbit/urbit/blob/master/pkg/arvo/sur/claz.hoon).
48This will contain more details about the various kinds of transactions you can perform particularly `++call`
44This will contain more details about the various kinds of transactions you can perform particularly `++call`
49
45
50−After running this command you should find a csv file at the specified path. You can examine this file to learn how they are constructed but it's not important for this guide.
46+After running this command you should find a csv file at the specified path. You can examine this file to learn how they are constructed. You are able to modify the nonces, gas limit and price without changing the function of the transaction but it's not important for this guide.
51
47
52This file can now be signed and uploaded. At this point, you can transfer this file to an airgapped machine which has your keys if you want. If you choose to do that you will need to download the urbit binary as well as the most recent pill file or a copy of the fakezod pier you have already booted.
48This file can now be signed and uploaded. At this point, you can transfer this file to an airgapped machine which has your keys if you want. If you choose to do that you will need to download the urbit binary as well as the most recent pill file or a copy of the fakezod pier you have already booted.
53
49
@@ -56,21 +52,21 @@ For this guide, we'll continue on the same ship.
56Run `|start %eth-sender` and then you can use it to sign the transaction file.
52Run `|start %eth-sender` and then you can use it to sign the transaction file.
57
53
58```
54```
59−:eth-sender [%sign %/transaction-signed/txt %/transaction/eth-txs %/mykey/txt ~[80]]
55+:eth-sender [%sign %/spawn-signed/txt %/spawn/eth-txs %/mykey/txt ~[40 80]]
60```
56```
61
57
62Let's again break this down.
58Let's again break this down.
63
59
64−`%sign` is the action we are going to perform here.
60+`%sign` is the action we are going to perform here. `eth-sender` can also be used to submit batches of transactions to the network in various ways, but details on that are outside of the scope of this guide.
65
61
66−`%/transaction-signed/txt` is the path to the output file.
62+`%/spawn-signed/txt` is the path to the output file.
67
63
68−`%/transaction/eth-txs` is the path to the transaction file we generated earlier. It will need to be accessible so don't forget to `|comit %home` if you moved it to a different pier.
64+`%/spawn/eth-txs` is the path to the transaction file we generated earlier. It will need to be accessible so don't forget to `|comit %home` if you moved it to a different pier.
69
65
70−`%/mykey/txt` is the path to your private key file. This file is most likely the reason you will want to use an airgapped machine so that your private key never touches a networked computer. Opsec is left to the reader.
66+`%/mykey/txt` is the path to your private key file. It should contain your private key beginning with 0x and followed by a hex string with no dots where capital letters are fine. This file is most likely the reason you will want to use an airgapped machine so that your private key never touches a networked computer. Opsec is left to the reader.
71
67
72−`~[80]` is a list of possible gwei costs a signed transaction file will be created for each one. Here we just specify 80 gwei. You may need to adjust this based on current etherium network traffic and average gas costs.
68+`~[40 80]` is a list of possible gwei costs a signed transaction file will be created for each one. Here we just specify 40 and 80 gwei. You may need to use the higher value based on current Etherium network traffic and average gas costs.
73
69
74Now you should have a directory in your pier that contains one file for each of the specified gwei costs.
70Now you should have a directory in your pier that contains one file for each of the specified gwei costs.
75
71
76−To actually transmit the transaction, paste the contents of one of these files into https://etherscan.io/pushTx or whatever other transmission system you would like to use. **This is the action that will actually cost you etherium. Only do this step if you want to actually perform the action.**
72+To actually transmit the transaction, paste the contents of one of these files into https://etherscan.io/pushTx or whatever other transmission system you would like to use. **This is the action that will actually cost you ETH and perform the transaction on the network. Only do this step if you want to actually perform the action.**