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

Challenges following the tutorial #143

Open
lucasmoten opened this issue Jun 26, 2021 · 1 comment
Open

Challenges following the tutorial #143

lucasmoten opened this issue Jun 26, 2021 · 1 comment

Comments

@lucasmoten
Copy link
Contributor

I'm attempting to set this up in a virtual machine following the tutorial. My VM is allocated ample storage and memory and running Ubuntu 20.04.2 LTS as the underlying operating system. The PPA repository for installing Bitcoin no longer seems to work, so I went ahead and installed Bitcoin from https://bitcoincore.org/bin/bitcoin-core-0.21.1/bitcoin-0.21.1-x86_64-linux-gnu.tar.gz, checking sha256 and signatures.

After installing Elements and setting up work environment, the following commands fail as there is no wallet, as one is not created by default.

Give them a few seconds to start up and then check they are running:

e1-cli getwalletinfo
e2-cli getwalletinfo

To get past this, I simply create wallets for both

e1-cli createwallet ""
e2-cli createwallet ""

And also for bitcoin

b-cli createwallet ""

Advancing forward in the tutorial to the next page, Using Elements to perform basic operations. From the tutorial the expectation is for the wallets to show 21 million bitcoin due to anyone can spend. But the balance is 0. With no balance on regtest, I can't proceed with sending to addresses generated by elements due to Insufficient funds.

So then since this is regtest, I do this to get 5000 coins available, and more in the immature balance

b-cli -generate 200

This doesn't help get access to initialfreecoins but may be viable to use for pegin

Simplify. Attempting just the standalone

The same is true if I take bitcoin out of the equation. Using just the standalone blockchain guidance found here: https://elementsproject.org/elements-code-tutorial/blockchain

# Args
STANDALONEARGS=("-validatepegin=0" "-defaultpeggedassetname=newasset" "-initialfreecoins=100000000000000" "-initialreissuancetokens=200000000")

# Startup 
e1-dae ${STANDALONEARGS[@]}

# Have to create wallet before viewing it
e1-cli createwallet ""

# Has zero balance, but shows asset name as `newasset` as anticipated
e1-cli getwalletinfo

# Look at transaction in first block from startup initialfreecoins
tx1=`e1-cli getblock $(e1-cli getblockhash 0) | jq -r .tx[1]`
e1-cli decoderawtransaction `e1-cli getrawtransaction $tx1`

I can see the 1,000,000 newasset created in vout, as well as the 2 for reissuance.

How can I claim the coins to the wallet to test with?

@lucasmoten
Copy link
Contributor Author

Follow up with how to get past the wallet issues

At the time of this writing, when following the tutorial, it's important to check out the tag elements-0.18.1.12 as running off of master will not create the wallet at startup and this is the main problem I was running into.

In addition, to follow most of the guide, will need to manually make the change to the elements2.conf file as was done after the tag was created, setting the chain at the top of the file to use chain=elementsregtest which will override the default using liquid.
https://github.com/ElementsProject/elements/blob/master/contrib/assets_tutorial/elements2.conf

Thanks to @wintercooled for helping identify the cause being tied to version.

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

No branches or pull requests

1 participant