-
Notifications
You must be signed in to change notification settings - Fork 15
Walkthrough for the Edgeware Lockdrop Event
**Note: **The Edgeware Lockdrop begins June 1, 2019 through August 30th, 2019. The following instructions are provided ahead of time in order to provide the best guidance and obtain feedback. We may launch an additional testnet practice tool for this process soon.
There are a few ways to participate in the Edgeware Lockdrop. They will be available on June 1st at https://hicommonwealth.github.io/edgeware-lockdrop-ui/.
Prior to that, we will discuss and show examples for them here.
To give an overview, we begin by using the Rust programming language & the Subkey program to generate a keypair. Once that is done, we use one of two user-friendly methods, or one command-line interface tool to lock and or signal.
Let's first create a mnemonic and keypair using the secure method described below.
A crucial part of the Edgeware Lockdrop is having Edgeware keys to lock or signal with. Therefore, we will first describe how to create an Edgeware keypair in one of two different options:
- The Polkadot UI (User-friendly) **OR **
- Rust and the Subkey Program (Rrquires using a command line interface (CLI)
If using a command line interface (CLI) is not your thing, then you can use the Polkadot UI to generate a keypair. As always, save your keypair file in a secure place.
This process requires the Rust programming language and Cargo, the Rust package manager. Take this time to ensure you have both of these installed, if not, install Rust and Cargo.
Once both Rust and Cargo are installed, complete the following:
- Install
subkey
by running the following command in a shell like Bash or Terminal.
cargo install --force --git https://github.com/paritytech/substrate subkey
- Run
subkey generate
to generate an sr25519 keypair and mnemonic. The following is an example of the output of this command:
✗ subkey generate
Phrase `easy real wisdom valley box century leisure bounce coconut option mushroom cycle` is account:`
Seed: 0xa60afef8639d74d6ba7d98d7638b8d51e3cb0f6e1c4a23549727609a593abf4d
Public key (hex): 0xa469e40f0a073be5b28e2df6e746ce6519260cdd764bc5f6b3fb3aac5cda3c35
Address (SS58): 5FnHAc3WEXdkkiFPciTvWnRNh5VBCaeGP8wdbtBtVM7iA4bL
Store your mnemonic somewhere secure, or you may lose access to your tokens.
We will use the following public address _as an example _ to participate in the Edgeware Lockdrop. (USE THE ONE YOU GENERATE!):
5FnHAc3WEXdkkiFPciTvWnRNh5VBCaeGP8wdbtBtVM7iA4bL
The following options are geared towards less technical users for Options 1 and 2, and more technical users for Option 3.
First, open the Lockdrop interface site (Available June 1) See the following for descriptions of the options available there:
OPTION 1. Use Metamask Online (User-Friendliest) The website supports Metamask and the logic can be verified here. Additionally, for Ledger users, there is Ledger support on Metamask, an example of which can be found here.
OPTION 2. Use MyCrypto Online (User-Friendlier) Click the MyCrypto option will display some instructions for locking or signaling on the Edgeware Lockdrop contract. Additionally, the UI will display the transaction data that you will need to paste into MyCrypto interface. You can check that the calculation of the transaction data here.
If you've opted for one of these two options, you are all set - congratulations! If you've chosen the CLI, the rest of this article is for you.
(Expert) Option 3: Using the Edgeware-Lockdrop CLI The final option you can use is our command line interface. This option should be used if you don't want to participate with a web browser. In order to use this option, you must have access to the hex-encoded private key containing the funds you want to lock or signal from.
For this option, once you have the hex-encoded private keys to your ETH, follow these steps:
Clone the repo with https://github.com/hicommonwealth/edgeware-lockdrop
Install the node_modules
with yarn
Create a file named .env
with the following format:
# ETH config
ETH_PRIVATE_KEY=0xHEXOFPRIVATEKEY
# Node/provider config
INFURA_PATH=v3/INFURA_API_KEY_IF_YOU_WANT_TO_USE_REMOTE_NODE
# Lockdrop config
LOCKDROP_CONTRACT_ADDRESS=0xLOCKDROP
# Edgeware config
EDGEWARE_PUBLIC_ADDRESS=5FnHAc3WEXdkkiFPciTvWnRNh5VBCaeGP8wdbtBtVM7iA4bL
Locking via Command Line Interface
Locking with the CLI is done with the flag -l. In order to lock successfully, you need to specify the following flags:
-l
- lock in the Edgeware Lockdrop
—lockLength <length>
- the integer length of the term to lock: 3, 6, or 12 months
—lockValue <value>
- the integer or decimal amount of value to lock up
(OPTIONAL) —edgeAddress <address>
- the hex or Base58 encoded Edgeware public address (Include an Edgeware address if one is not provided in the .env
file)
(OPTIONAL) —isValidator
- if present, indicates the intent to be a validator
Examples:
-
Locking up 1 ETH for 3 months and indicating intent to validate.
node scripts/lockdrop.js -l --lockValue 1 --lockLength 3 --isValidator
-
Locking up 1 ETH for 3 months with no intent to validate.
node scripts/lockdrop.js -l --lockValue 1 --lockLength 3 --isValidator
-
Locking up 0.025 ETH for 12 months with no intent to validate.
node scripts/lockdrop.js -l --lockValue 0.025 --lockLength 12 --isValidator
Signaling via Command Line Interface
Signaling with the CLI is done with the flag -s
. In order to signal successfully, you need to specify the following flags.
-s <contractAddress>
- signal from any Ethereum address in the Edgeware Lockdrop
-n <nonce>
- the nonce used to create the contract from the private key in the file named .env
(OPTIONAL) —edgeAddress <address>
- the hex or Base58 encoded Edgeware public address (Include an Edgeware address if one is not provided in the .env
file)
Examples:
-
Signaling with the same Ethereum address as corresponds to the local private key hex.
node scripts/lockdrop.js -s 0x2d65a140446894Ef1E71C333ecaA5BD8b5e6D568
-
Signaling with a contract that was created using the local private key hex.
node scripts/lockdrop.js -s 0xc79cb8BEEdA12595Db8Afcfd558931B33d64Cdb1 -n 101
On successful locking or signaling, you should see the transaction hash printed into the shell so that you can check the existence of this transaction on Ethereum block explorers. Additionally, you can use other functions in the CLI to get information about the locks you have now created.
The full CLI option list is:
Options:
-V, --version output the version number
-b, --balance Get the total balance across all locks
-l, --lock Lock ETH with the lockdrop
-s, --signal <contractAddress> Signal a contract balance in the lockdrop
-n, --nonce <nonce> Transaction nonce that created a specific contract address
-u, --unlock <contractAddress> Unlock ETH from a specific lock contract
-r, --remoteUrl <url> The remote URL of an Ethereum node (defaults to localhost:8545)
--unlockAll Unlock all locks from the locally stored Ethereum address
--lockdropContractAddress <addr> The Ethereum address for the target Lockdrop (THIS IS A LOCKDROP CONTRACT)
--allocation Get the allocation for the current set of lockers
--ending Get the remaining time of the lockdrop
--lockLength <length> The desired lock length - (3, 6, or 12)
--lockValue <value> The amount of Ether to lock
--edgeAddress <address> Edgeware ED25519 Base58 encoded address
--isValidator A boolean flag indicating intent to be a validator
--locksForAddress <userAddress> Returns the history of lock contracts for a participant in the lockdrop
-h, --help output usage information