How to create cardano light wallet? - cardano

I am trying to create light wallet of cardano. these are steps I followed but not able to create it. It create only full node wallet.
METHOD 1
first I run full node
cardano-node run \
--topology /root/cardano-node/mainnet-topology.json \
--database-path /root/cardano-node/db/ \
--socket-path /root/cardano-node/node.socket \
--host-addr 127.0.0.1 \
--port 1225 \
--config /root/cardano-node/mainnet-config.json
then connected with node using cardano wallet
cardano-wallet serve \
--port 8090 \
--mainnet \
--database /root/cardano-node/db \
--node-socket /root/cardano-node/node.socket
then create wallet using cardano-wallet wallet create from-recovery-phrase mytwallet
but this generates only full node wallet. please correct me if i am doing something wrong.
METHOD 2
by using blockfrost api and IOHK github cardano-wallet binaries I able to connect with blockfrost but not able to create light wallet.
IOHK - https://input-output-hk.github.io/cardano-wallet/user-guide/cli
cardano-wallet serve --light --blockfrost-token-file /root/blockfrost-mainnet.key --mainnet --port 8090
cardano-wallet wallet create from-recovery-phrase mytwallet
after this I got error something like this
cardano-wallet.main:Info:4] [2022-05-02 14:58:20.48 UTC] Wallet
backend server listening on http://127.0.0.1:8090/
[cardano-wallet.api-server:Info:32] [2022-05-02 14:58:53.29 UTC]
[RequestId 0] [POST] /v2/wallets
[cardano-wallet.wallet-engine:Notice:38] [2022-05-02 14:58:53.50 UTC]
68d07b25: Reward balance worker has exited. Prelude.undefined
CallStack (from HasCallStack): error, called at
libraries/base/GHC/Err.hs:79:14 in base:GHC.Err undefined, called at
src/Cardano/Wallet/Shelley/Network/Blockfrost.hs:222:26 in
cardano-wallet-2022.4.27-8yWedlbE4ve5DTbU3euDG0:Cardano.Wallet.Shelley.Network.Blockfrost
[cardano-wallet.wallet-engine:Notice:34] [2022-05-02 14:58:53.57 UTC]
Worker has exited: Action has finished
[cardano-wallet.network:Info:47] [2022-05-02 14:58:53.79 UTC] Update
watcher with tip: 92708059<-[ee0df56e-59937200#7196414]. Callback
start. [cardano-wallet.network:Info:47] [2022-05-02 14:58:53.79 UTC]
Update watcher with tip: 92708059<-[ee0df56e-59937200#7196414].
Callback exception: Prelude.undefined CallStack (from HasCallStack):
error, called at libraries/base/GHC/Err.hs:79:14 in base:GHC.Err
undefined, called at
src/Cardano/Wallet/Shelley/Network/Blockfrost.hs:215:39 in
cardano-wallet-2022.4.27-8yWedlbE4ve5DTbU3euDG0:Cardano.Wallet.Shelley.Network.Blockfrost. [cardano-wallet.wallet-engine:Error:47] [2022-05-02 14:58:53.79 UTC]
68d07b25: Processing the pending local tx submission pool: exception:
Prelude.undefined CallStack (from HasCallStack): error, called at
libraries/base/GHC/Err.hs:79:14 in base:GHC.Err undefined, called at
src/Cardano/Wallet/Shelley/Network/Blockfrost.hs:215:39 in
cardano-wallet-2022.4.27-8yWedlbE4ve5DTbU3euDG0:Cardano.Wallet.Shelley.Network.Blockfrost
[cardano-wallet.network:Info:42] [2022-05-02 14:58:53.79 UTC] Update
watcher with tip: 92708059<-[ee0df56e-59937200#7196414]. Callback
start. [cardano-wallet.wallet-engine:Error:42] [2022-05-02 14:58:53.79
UTC] 68d07b25: Processing the pending local tx submission pool:
exception: Prelude.undefined CallStack (from HasCallStack): error,
called at libraries/base/GHC/Err.hs:79:14 in base:GHC.Err undefined,
called at src/Cardano/Wallet/Shelley/Network/Blockfrost.hs:215:39 in
cardano-wallet-2022.4.27-8yWedlbE4ve5DTbU3euDG0:Cardano.Wallet.Shelley.Network.Blockfrost
[cardano-wallet.network:Info:42] [2022-05-02 14:58:53.79 UTC] Update
watcher with tip: 92708059<-[ee0df56e-59937200#7196414]. Callback
exception: Prelude.undefined CallStack (from HasCallStack): error,
called at libraries/base/GHC/Err.hs:79:14 in base:GHC.Err undefined,
called at src/Cardano/Wallet/Shelley/Network/Blockfrost.hs:215:39 in
cardano-wallet-2022.4.27-8yWedlbE4ve5DTbU3euDG0:Cardano.Wallet.Shelley.Network.Blockfrost. [cardano-wallet.network:Info:40] [2022-05-02 14:58:53.80 UTC] Update
watcher with tip: 92708059<-[ee0df56e-59937200#7196414]. Callback
start. [cardano-wallet.network:Info:40] [2022-05-02 14:58:53.96 UTC]
Update watcher with tip: 92708059<-[ee0df56e-59937200#7196414].
Callback exception: BlockfrostException (ClientError
BlockfrostNotFound).
after entering recovery phrase and password i got this error
I am trying to create light wallet that does not sync every time with node.
thank you for support.

My apologies for the error you see in the --light mode. Its just not ready to be used yet, we're working on it.

Related

Airflow : Job <job-id> was killed before it finished (likely due to running out of memory)

I have a linear DAG with two tasks - first task's truthy/falsy value decide if second task would be executed. I am using ShortCircuitOperator for first task so that if needed second task can be bypassed. Following is my DAG code :-
DAG_VERSION = "1.0.0"
with DAG(
"sample_dag",
catchup=False,
tags=[DAG_VERSION],
max_active_runs=1,
schedule_interval=None,
default_args=DEFAULT_ARGS,
) as dag:
dag.doc_md = "Sample DAG"
TASK_1 = ShortCircuitOperator(
task_id="task_1",
python_callable=test_script_1,
executor_config=EXECUTOR_CONFIG,
)
TASK_2 = PythonOperator(
task_id="task_2",
python_callable=test_script_2,
executor_config=EXECUTOR_CONFIG,
)
TASK_1 >> TASK_2
However, when I try to run the DAG, then I get following in log for first task when it returns truthy value :-
task_1 logs
Marking task as SUCCESS. dag_id=sample_dag, task_id=task_1, execution_date=20220606T060000, start_date=20220606T070012, end_date=20220606T070014
[2022-06-06, 07:00:17 UTC] State of this instance has been externally set to success. Terminating instance.
[2022-06-06, 07:00:17 UTC] Sending Signals.SIGTERM to GPID 18
[2022-06-06, 07:01:17 UTC] process psutil.Process(pid=18, name='airflow task runner: sample_dag task_1 scheduled__2022-06-06T06:00:00+00:00 7037', status='sleeping', started='07:00:12') did not respond to SIGTERM. Trying SIGKILL
[2022-06-06, 07:01:17 UTC] Process psutil.Process(pid=18, name='airflow task runner: sample_dag task_1 scheduled__2022-06-06T06:00:00+00:00 7037', status='terminated', exitcode=<Negsignal.SIGKILL: -9>, started='07:00:12') (18) terminated with exit code Negsignal.SIGKILL
[2022-06-06, 07:01:17 UTC] Job 7037 was killed before it finished (likely due to running out of memory)
I am using return value of first task in second task. When I try to log xcom value of first task inside second task then I get None, which cause second task to fail. This is my code for access xcom value for first task inside second task :-
def test_script_2(**context: models.xcom) -> List[str]:
task_instance = context["task_instance"]
return_value = task_instance.xcom_pull(task_ids="task_1")
print("logging return value of first task ", return_value)
I am running Airflow 2.2.2 with kubernetes executor.
Is None xcom value due to out of memory issue in first task ? I tried by adding fixed value in first task, but again None was returned in second task with following log :-
task_2 logs
Marking task as SUCCESS. dag_id=sample_dag, task_id=task_2, execution_date=20220606T095611, start_date=20220606T095637, end_date=20220606T095638
[2022-06-06, 09:56:42 UTC] State of this instance has been externally set to success. Terminating instance.
[2022-06-06, 09:56:42 UTC] Sending Signals.SIGTERM to GPID 18
[2022-06-06, 09:57:42 UTC] process psutil.Process(pid=18, name='airflow task runner: sample_dag task_2 manual__2022-06-06T09:56:11.804005+00:00 7051', status='sleeping', started='09:56:37') did not respond to SIGTERM. Trying SIGKILL
[2022-06-06, 09:57:42 UTC] Process psutil.Process(pid=18, name='airflow task runner: sample_dag task_2 manual__2022-06-06T09:56:11.804005+00:00 7051', status='terminated', exitcode=<Negsignal.SIGKILL: -9>, started='09:56:37') (18) terminated with exit code Negsignal.SIGKILL
[2022-06-06, 09:57:42 UTC] Job 7051 was killed before it finished (likely due to running out of memory)
I am unable to find issue in the code. Would appreciate any hint on where I am going wrong and how to get xcom value of first task
Thanks

How do I fix this error when creating a candy machine with metaplex?

I am following this tutorial "https://www.youtube.com/watch?v=4LLx7SMAOag&t=446s" and at 9:28 he tells us to input this
ts-node js/packages/cli/src/candy-machine-cli.ts upload ./assets --env devnet --keypair ~/config/solana/devnet-test.json
His result is an initialized candy machine as shown in the video. Mine is the following:
Beginning the upload for 150 (png+json) pairs
started at: 1634300753134
wallet public key: GLCNNSs9QA1YqxkY6Ptq3pb6UZrkRbwGw7ZUGeJK1CCg
(node:6434) UnhandledPromiseRejectionWarning: Error: failed to get info about
account 63N3bBDCVVzdCaofQAnY5s4kcZodw1evomptDgNQ4feK: FetchError: request to https://api.devnet.solana.com/ failed, reason: connect ENETUNREACH 128.0.113.156:443
at Connection.getAccountInfo (/Users/hectorbardales/Desktop/metaplex/js/node_modules/#solana/web3.js/src/connection.ts:2404:13)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at async Function.fetchIdl
(/Users/hectorbardales/Desktop/metaplex/js/node_modules/#project-serum/anchor/src/program/index.ts:309:25)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:6434) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:6434) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
What do I do to fix this? (I'm running this in visual studio code on a Mac)
Here's what I did for example
ts-node ./js/packages/cli/src/candy-machine-v2-cli.ts upload \
-e devnet \
-k ./js/cm.devnet.json \
-cp ./js/config.json \
-c temp \
./js/assets-pictures
I made sure the path was clear and direct to each file, make sure for -k its path is to the file created when you did your keygen.
If you haven't, perhaps try airdropping 10 SOLs into that wallet address listed above? But do 5 first, then 5 again.
I can't remember what error I got, but I did have issues with that line.
Command for airdropping Sol is simple. Solana Airdrop x (x is your SOL amount).
Idk, worth a shot.
ENETUNREACH is a connection-related error. Even if you are able to browse the web or do other things, the best option is to test again with a new internet connection.

Error while using persistent datasource using mongodb ini hyperledger composer

I am trying to use persistent datasource using mongoDB in hyperledger composer on a UBUNTU droplet
but after starting the rest server and den after issuing a command docker logs -f rest i am getting the following error(i have provided a link to the image)
webuser#ubuntu16:~$ docker logs -f rest
[2018-08-29T12:38:31.278Z] PM2 log: Launching in no daemon mode
[2018-08-29T12:38:31.351Z] PM2 log: Starting execution sequence in -fork mode- for app name:composer-rest-server id:0
[2018-08-29T12:38:31.359Z] PM2 log: App name:composer-rest-server id:0 online
WARNING: NODE_APP_INSTANCE value of '0' did not match any instance config file names.
WARNING: See https://github.com/lorenwest/node-config/wiki/Strict-Mode
Discovering types from business network definition ...
(node:15) DeprecationWarning: current URL string parser is deprecated, and will be removed in a future version. To use the new parser, pass option { useNewUrlParser: true } to MongoClient.connect.
Connection fails: Error: Error trying to ping. Error: Failed to connect before the deadline
It will be retried for the next request.
Exception: Error: Error trying to ping. Error: Failed to connect before the deadline
Error: Error trying to ping. Error: Failed to connect before the deadline
at _checkRuntimeVersions.then.catch (/home/composer/.npm-global/lib/node_modules/composer-rest-server/node_modules/composer-connector-hlfv1/lib/hlfconnection.js:806:34)
at <anonymous>
[2018-08-29T12:38:41.021Z] PM2 log: App [composer-rest-server] with id [0] and pid [15], exited with code [1] via signal [SIGINT]
[2018-08-29T12:38:41.024Z] PM2 log: Starting execution sequence in -fork mode- for app name:composer-rest-server id:0
[2018-08-29T12:38:41.028Z] PM2 log: App name:composer-rest-server id:0 online
WARNING: NODE_APP_INSTANCE value of '0' did not match any instance config file names.
WARNING: See https://github.com/lorenwest/node-config/wiki/Strict-Mode
Discovering types from business network definition ...
(node:40) DeprecationWarning: current URL string parser is deprecated, and will be removed in a future version. To use the new parser, pass option { useNewUrlParser: true } to MongoClient.connect.
Connection fails: Error: Error trying to ping. Error: Failed to connect before the deadline
It will be retried for the next request.
I don't understand what is the problem and what wrong I am doing because I have followed all the steps in the hyperledger composer document with success....
Is it because I am using it on ubuntu droplet....?? anyone help
EDIT
I followed all the steps mentioned in this tutorial
but instead of using google authentication i am using github authentication.
Also i have changed my local host to the ip of my ubuntu droplet in connection.json file and also in this command
sed -e 's/localhost:7051/peer0.org1.example.com:7051/' -e 's/localhost:7053/peer0.org1.example.com:7053/' -e 's/localhost:7054/ca.org1.example.com:7054/' -e 's/localhost:7050/orderer.example.com:7050/' < $HOME/.composer/cards/restadmin#trade-network/connection.json > /tmp/connection.json && cp -p /tmp/connection.json $HOME/.composer/cards/restadmin#trade-network/
bt yet with no success! i get the following error now.....
webuser#ubuntu16:~$ docker logs rest
[2018-08-30T05:03:02.916Z] PM2 log: Launching in no daemon mode
[2018-08-30T05:03:02.989Z] PM2 log: Starting execution sequence in -fork mode- for app name:composer-rest-server id:0
[2018-08-30T05:03:02.997Z] PM2 log: App name:composer-rest-server id:0 online
WARNING: NODE_APP_INSTANCE value of '0' did not match any instance config file names.
WARNING: See https://github.com/lorenwest/node-config/wiki/Strict-Mode
Discovering types from business network definition ...
(node:15) DeprecationWarning: current URL string parser is deprecated, and will be removed in a future version. To use the new parser, pass option { useNewUrlParser: true } to MongoClient.connect.
Discovering the Returning Transactions..
Discovered types from business network definition
Generating schemas for all types in business network definition ...
Generated schemas for all types in business network definition
Adding schemas for all types to Loopback ...
Added schemas for all types to Loopback
SyntaxError: Unexpected string in JSON at position 92
at JSON.parse ()
at Promise.then (/home/composer/.npm-global/lib/node_modules/composer-rest-server/server/server.js:141:34)
at
at process._tickDomainCallback (internal/process/next_tick.js:228:7)
[2018-08-30T05:03:09.942Z] PM2 log: App [composer-rest-server] with id [0] and pid [15], exited with code 1 via signal [SIGINT]
This error Error trying to ping. Error: Failed to connect before the deadline means that the composer-rest-server in the container cannot see/connect to the underlying Fabric at the URLs in the connection.json of the card that you are using to start the REST server.
There are a number of reasons why:
The Fabric is not started
You are using a Business Network Card that has localhost in the URLs of the connection.json, and localhost just re-directs back into the rest container.
Your rest container is started on a different Docker network bridge to your Fabric containers and cannot connect to the Fabric.
Have you followed this tutorial in the Composer documentation? If followed completely it will avoid the 3 problems mentioned above.

How can I proceed run task on API Connect(IBM Bluemix)?

I'm in the tutorial of Bank A.
http://www.ibm.com/support/knowledgecenter/SSMNED_5.0.0/com.ibm.apic.toolkit.doc/tutorial_cli_api_def_working.html%23topic_qdj_dtb_gv?cp=SSMNED_5.0.0&lang=en
In API Designer(the part of IBM API Connect),I clicked the "run" button.
There is error about loading module.
How Can I fix this issue?
Then, I got the following output.
$ apic edit
Express server listening on http://127.0.0.1:9000
Unhandled rejection Error: Service manager failed to start. Please review > /home/sugai/.apiconnect/strong-pm/start.log for details.
at ChildProcess. (/usr/lib/node_modules/apiconnect/node_modules/apiconnect-cli-pm/lib/start/pm.js:122:23)
at ChildProcess.g (events.js:260:16)
at emitTwo (events.js:87:13)
at ChildProcess.emit (events.js:172:7)
at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
at Process.onexit (/usr/lib/node_modules/apiconnect/node_modules/apiconnect-cli-edit/node_modules/apim-ui/node_modules/loopback-workspace/node_modules/loopback/node_modules/continuation-local-storage/node_modules/async-listener/glue.js:188:31)
Reviewed the log file. There is following output.
https://gist.github.com/hokkai7go/ee0d453a60e60e1ab9109a851edae0c4

Derby app created using 'derby new test' not working

I've installed derbyjs using npm install -g derby and then created a test app using derby new test.
Then i started the app using node server.js and I got the following output:
info - socket.io started
Starting cluster with 1 workers in undefined mode
`kill -s SIGUSR2 7161` to force cluster reload
Go to: http://localhost:3000/
info - socket.io started
So I tried to request http://localhost:3000/, but the site does not finish loading and I get the following exception:
TEMPLATE ERROR
Error: Model mutation performed after bundling for clientId: 79f4a9f3-25fc-438d-b9f4-a450dccf9566
at Model.errorOnCommit [as _commit] (/web/derby/test/node_modules/derby/node_modules/racer/lib/bundle/bundle.Model.js:64:9)
at /web/derby/test/node_modules/derby/node_modules/racer/lib/txns/txns.Model.js:120:15
at next (/web/derby/test/node_modules/derby/node_modules/racer/lib/middleware.js:7:26)
at /web/derby/test/node_modules/derby/node_modules/racer/lib/txns/txns.Model.js:107:16
at next (/web/derby/test/node_modules/derby/node_modules/racer/lib/middleware.js:7:26)
at /web/derby/test/node_modules/derby/node_modules/racer/lib/txns/txns.Model.js:101:16
at next (/web/derby/test/node_modules/derby/node_modules/racer/lib/middleware.js:7:26)
at /web/derby/test/node_modules/derby/node_modules/racer/lib/txns/txns.Model.js:92:16
at next (/web/derby/test/node_modules/derby/node_modules/racer/lib/middleware.js:7:26)
at Object.run (/web/derby/test/node_modules/derby/node_modules/racer/lib/middleware.js:10:12)
events.js:68
throw arguments[1]; // Unhandled 'error' event
^
Error: Cannot write after end
at Gzip.write (zlib.js:311:31)
at ServerResponse.res.write (/web/derby/test/node_modules/express/node_modules/connect/lib/middleware/compress.js:82:18)
at Object.View._render (/web/derby/test/node_modules/derby/lib/View.server.js:337:9)
at /web/derby/test/node_modules/derby/lib/View.server.js:276:10
at Array.2 (/web/derby/test/node_modules/derby/lib/View.server.js:300:5)
at Object.Promise.resolve (/web/derby/test/node_modules/derby/node_modules/racer/lib/util/Promise.js:21:19)
at /web/derby/test/node_modules/derby/lib/View.server.js:136:17
at /web/derby/test/node_modules/derby/lib/files.js:224:7
at Object.oncomplete (fs.js:308:15)
at process._makeCallback (node.js:248:20)
I have absolutely no idea how I can get it running... Is it a bug, or am I doing something wrong?
Update
I've created a bug report on the derby repository: https://github.com/codeparty/derby/issues/170