cardano-foundation / cardano-wallet

HTTP server & command-line for managing UTxOs and HD wallets in Cardano.
Apache License 2.0
766 stars 214 forks source link

Shelley api are not avaliable #1813

Closed lijianl closed 4 years ago

lijianl commented 4 years ago

I am using wallet V1 from cardano-sl and migrating my wallet data to cardano-wallet; and blocked by some problem.. hope you can give some hit.

P1: I started a cardano-node on byron mainnet. and the log show like these

[stage-no:cardano.node.ChainDB:Notice:37] [2020-06-28 07:26:53.72 UTC] Chain extended, new tip: (Point 4356306, 7653b7dd79ac5693)
[stage-no:cardano.node.ChainDB:Notice:37] [2020-06-28 07:27:11.68 UTC] Chain extended, new tip: (Point 4356307, a133a360c6514317)
[stage-no:cardano.node.ChainDB:Notice:37] [2020-06-28 07:27:33.55 UTC] Chain extended, new tip: (Point 4356308, 12305f898795ef85)
....

are these normal log? the information is so little to make sure whether the node is ready..

# here are cmd to build cardano-node
git clone https://github.com/input-output-hk/cardano-node.git
cd cardano-node
nix-build -A scripts.mainnet.node -o mainnet-node-local && ./mainnet-node-local

P2: I built my wallet cardano-wallet from sources with cmd below, get from cardano-wallet-install

https://github.com/input-output-hk/cardano-wallet.git
nix-build -A cardano-wallet-byron
cardano-wallet serve --node-socket ~/cardano-node/state-node-mainnet/node.socket --mainnet --database /tmp/mainnet

I noticed that an error "ntp client experienced error Network.Socket.ByteString.sendManyTo: does not exist (Network is unreachable) when sending packet" in the log..., what is the meaning of this log...

and my cardano-wallet only support BYRON (RANDOM) API from "https://input-output-hk.github.io/cardano-wallet/api/edge/#tag/Network". also why the BYRON-API can accessed only by localhost(127.0.0.1) not IP.....

i want to know whether my wallet support Shelley ERA On the 8th of June 2020...

P3. after I retore my wallet data to cardano-wallet,does 'cardano-sl' v1 wallet still work avaliable?

lijianl commented 4 years ago

pass problem localhost

rvl commented 4 years ago

Hi @lijianl

P1. "Chain extended, new tip" - these mean that cardano-node is operating normally. Use the cardano-wallet /network/information endpoint to get sync state in terms of epoch and slot numbers.

P2. "ntp client experienced error" - the wallet runs NTP queries to check if your system clock is accurate. Your firewall/network configuration might be blocking NTP. If your system clock is accurate then these errors are not a problem.

P2. The API can be accessed only by localhost. This is the default for security reasons. Use cardano-wallet serve --listen-address 0.0.0.0 to change it.

P2. https://input-output-hk.github.io/cardano-wallet/api/edge/ - this is the shelley ara API.

P3. After I restore my wallet data to cardano-wallet, does 'cardano-sl' v1 wallet still work?

Yes, you should see the same balance and transactions in both - for now. But in the future only cardano-wallet will work.

lijianl commented 4 years ago

are there any difference between SHELLY wallet and BYRON wallet in link https://input-output-hk.github.io/cardano-wallet/api/edge/ ??

these two wallets are all supported by Shelley

lijianl commented 4 years ago

my passphrase of cardano-sl wallet is too short to restore into cardano-walllet, could you help for this ?


post http://localhost:8091/v2/byron-wallets/    
{
"code": "bad_request",
 "message": "Error in $.passphrase: passphrase is too short: expected at least 10 characters"
} ```
rvl commented 4 years ago

The main difference between SHELLY wallet and BYRON wallet in the API is in how new addresses are generated. See https://github.com/input-output-hk/cardano-wallet/wiki/About-Address-Derivation for a good explanation.

After restoring the byron wallet, you can transfer your ada from the byron wallet into a new shelley wallet.

Use a different, longer passphrase with cardano-wallet. This passphrase is "only" for encrypting the wallet keys locally. The mnemonic_sentence is the wallet key. Use exactly the same mnemonic as in cardano-sl.

lijianl commented 4 years ago

So as your words, I can only use /v2/byron-wallets/ before the 8th of June 2020. and on the 8th of June 2020, I should rebuild my cardano-node and cardano-wallet to support Shelley and change API to /v2/wallets/?

lijianl commented 4 years ago

I make a list of steps:

Before: the 8th of June 2020.

  1. build cardano-node and cardano-wallet to support byron-wallet
  2. create a new walletId on cardano-wallet and transfer ADA from cardano-sl to the new walledId.
  3. change cardano-sl api to byron-api in link https://input-output-hk.github.io/cardano-wallet/api/edge/#tag/Byron-Wallets

After: the 8th of June 2020.

  1. rebuild cardano-node and cardano-wallet to support shelley
  2. create a new walletId on shelley and transfer ADA from byron to the new walletId
  3. change api from v2/byron-wallets to /v2/wallets/ in link https://input-output-hk.github.io/cardano-wallet/api/edge

any problems up above the step ????

rvl commented 4 years ago

For now -

  1. Use cardano-wallet-byron and cardano-node with byron mainnet.
  2. Restore your existing wallet mnemonic with POST /v2/byron-wallets. Check that the balance is correct. There is no need to make any transactions yet.
  3. Adjust your application to use the v2 cardano-wallet API.

Later - cardano-sl will stop working with mainnet. If you have already adapted to the v2 cardano-wallet API, it will be fine.

lijianl commented 4 years ago

I get the changes for now.....

also I noticed there is not an API to validate an address before a transaction. anyways to validate an address in advance???

hope The SHELLEY ERA comes smoothly on the 8th of June 2020

rvl commented 4 years ago

@lijianl You can use the estimate fee endpoint to test that an address is encoded well, and matches the network (i.e. mainnet/testnet). But this is not foolproof - use caution.

I believe @neville-freeman has contacted you by e-mail about the shelley hard fork.

willcbanks commented 4 years ago

is there a list somewhere of what these Notices and Errors mean? I am getting: ChainDB:Notice:26 what does it mean?

KtorZ commented 4 years ago

This is a question for https://github.com/input-output-hk/cardano-node I am afraid.