Coder Social home page Coder Social logo

askmish / sawtooth-simplewallet Goto Github PK

View Code? Open in Web Editor NEW
66.0 12.0 66.0 154 KB

A simple sawtooth "simplewallet" transaction family (processor + client)

License: Apache License 2.0

CMake 0.98% Shell 1.97% C++ 11.22% Python 22.54% Java 7.50% JavaScript 16.04% CSS 1.08% Dockerfile 10.30% Rust 12.95% Go 8.72% Handlebars 6.70%
simplewallet sawtooth wallet-account hyperledger-sawtooth processor-client transaction-family

sawtooth-simplewallet's People

Contributors

arsulegai avatar askmish avatar danintel avatar dependabot[bot] avatar jakepanter avatar manojgop avatar prp20 avatar ram-srini avatar rranjan3 avatar shonjs avatar sofiter avatar varalakshmika avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sawtooth-simplewallet's Issues

Login not working on js client UI

When clicking the login button after giving the username, in the js client UI, it doesn't go to the home page.
Refreshes and stays on the same page.
(Browser - firefox 63.0.3)

Loops on the go processor

When we transfer money to an account that doesn't have balance the processor goes into a loop. I've tried to change the error handling to

return &processor.InvalidTransactionError{Msg: "Didn't find the wallet key associated with user key " + self.getUserTo()}

But still i get a loop, any ideas?

Upgrade simplewallet to use Sawtooth 1.1

The changes are needed to the docker-compose .yaml files to use the 1.1 containers (instead of 1.0) and to add a devmode-engine-rust container.

The diffs should be very similar to the changes I made to cookiejar. Here's the diffs:
danintel/sawtooth-cookiejar@9f0b69c

The sawtooth-validator command line needs this new argument: --bind consensus:tcp://eth0:5050

The repository needs updating from 1.0 to "bumper" (1.1) and adding [arch=amd64] Something like:
"deb [arch=amd64] http://repo.sawtooth.me/ubuntu/bumper/stable xenial universe"

The dev-mode engine addition to the .yaml files should be something like:

+  devmode-engine:
+    image: hyperledger/sawtooth-devmode-engine-rust:1.1
+    ports:
+      - '5050:5050'
+    container_name: sawtooth-devmode-engine-rust-default
+    depends_on:
+      - validator
+    entrypoint: devmode-engine-rust --connect tcp://validator:5050

Add instructions to run jsclient

Some basic instructions for running jsclient would be helpful.
I didn't find anything in README.md or the jsclient files.

Even better would be a container with jsclient and any processor (Python or C++).

simplewallet-processor container exists without any error

simplewallet-processor container exists without any error

here's the log of docker container:

-- The CXX compiler identification is GNU 5.4.0
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for C++ include pthread.h
-- Looking for C++ include pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Configuring done
-- Generating done
-- Build files have been written to: /project/simplewallet/cxxprocessor/build
Scanning dependencies of target simplewallet-tp
[ 50%] Building CXX object CMakeFiles/simplewallet-tp.dir/simplewallet-tp.cpp.o
[100%] Linking CXX executable bin/simplewallet-tp
[100%] Built target simplewallet-tp
-- Configuring done
-- Generating done
-- Build files have been written to: /project/simplewallet/cxxprocessor/build
[100%] Built target simplewallet-tp

Cannot create protobuf/protobuf_bundle.json: Directory nonexistent npm ERR! code ELIFECYCLE npm ERR! errno 2

Things I have done :

Installed latest Node(8.11.3)& npm version.
Started JavaScript essential thing using docker-compose up (used javascript .yaml file).

Things giving error:

Want to setup Javascript transaction processor so moved to dir jsprocessor.

Trying to install all node modules using $ npm install, but giving error shown in image. I think it is relate to node js.

Reinstalled Node & NPM, Externally installed npm module that producing error but no effect.

What am I doing wrong?
nder

Transfer 0 error

I tried the following command "simplewallet transfer 0 <user 1> <user 2>" and there was something like an infinite loop. This was the error that was displayed.

simplewallet-processor | SimpleWalletApplicator::Apply
simplewallet-processor | Got: transfer and 0
simplewallet-processor | Got beneficiary: 023e1bde5961655a5c3a51daab5e5820556fadd722932d7dd3eee38ecbc0ab2f94
simplewallet-processor | 124360 [0x7faca6499780] DEBUG simplewallet null - SimpleWalletApplicator::doTransfer Key: 020ec936c18ed8d96272e8c62f5269db1122656ca0e9a894d37c8005a5a7c632f5 Address: 7e26646cb200282575bc2638258e663febd8ffcf543f0690bd2dc8da494d4bd2e6bac3
simplewallet-processor | 124361 [0x7faca6499780] DEBUG simplewallet null - SimpleWalletApplicator::doTransfer Beneficiary Key: 023e1bde5961655a5c3a51daab5e5820556fadd722932d7dd3eee38ecbc0ab2f94 Address: 7e2664e728c0be707e30c78292c546be8be02442d70e6e0597c5e2b0ec77505b221589
simplewallet-processor | 124363 [0x7faca1de9700] DEBUG sawtooth.MessageDispatcher null - ReceiveMessage MessageType: 8
simplewallet-processor | 124364 [0x7faca6499780] ERROR sawtooth.TransactionProcessor null - applicator->Apply unknown error
simplewallet-processor | 124365 [0x7faca1de9700] DEBUG sawtooth.MessageDispatcher null - ReceiveMessage MessageType: 5

unable to get chain head from block store

This is the error i am facing i have done native installation. I am hitting the Javascript application
The validator has no genesis block, and so cannot be queried. Wait for genesis to be completed and resubmit. If you are running the validator, ensure it was set up properly.

Error on building yaml file

Some days ago the code was functioning well, but recently I get this error on compiling the simplewallet-build-tp.py file:

curl: (6) Could not resolve host: p80.pool.sks-keyservers.net
gpg: no valid OpenPGP data found.

The command '/bin/sh -c apt-get update && apt-get install -y -q curl gnupg && curl -sSL 'http://p80.pool.sks-keyservers.net/pks/lookup?op=get&search=0x8AA7AF1F1091A5FD' | apt-key add - && echo 'deb [arch=amd64] http://repo.sawtooth.me/ubuntu/chime/stable bionic universe' >> /etc/apt/sources.list && apt-get update' returned a non-zero code: 2
ERROR: Service 'simplewallet-client' failed to build : Build failed

It will die if i transfer to user(who he dont run simplewallet deposit first)(bug)

This is my step:

  1. sawtooth keygen a
  2. sawtooth keygen b
  3. simplewallet deposit 100 a
  4. simplewallet transfer 25 a b

(just not deposit any value to b)

And then,the docker logs will scroll a lot of info cyclically,the info like this:


simplewallet-processor    | Got: transfer and 25
simplewallet-processor    | Got beneficiary: 03605ad5fbb2c9106e71dddb5e1492aaffbf29358cd41b8c02bd061869c873a940
simplewallet-processor    | 479056 [0x7fee26c74780] DEBUG simplewallet null - SimpleWalletApplicator::doTransfer Key: 022116461963790d88e315c0fc81e3f8f2ae74aac5eff42fb888edb69405d34df4 Address: 7e266467df98ca12dc7b4d797a3c13e07718e2066b353a50f73072c4c2f7d3a4fdaaa1
simplewallet-processor    | 479056 [0x7fee26c74780] DEBUG simplewallet null - SimpleWalletApplicator::doTransfer Beneficiary Key: 03605ad5fbb2c9106e71dddb5e1492aaffbf29358cd41b8c02bd061869c873a940 Address: 7e26649edfba4e018ac9c59a0462e8d8565ec4b1db295597da83b7d9819705d090bbe8
simplewallet-processor    | 479057 [0x7fee225c4700] DEBUG sawtooth.MessageDispatcher null - ReceiveMessage MessageType: 8
simplewallet-processor    | 479058 [0x7fee225c4700] DEBUG sawtooth.MessageDispatcher null - ReceiveMessage MessageType: 8
simplewallet-processor    | 479058 [0x7fee26c74780] ERROR sawtooth.TransactionProcessor null - applicator->Apply unknown error

And if i exec the command simplewallet balance b it will display 404 Not Found.
Like this:

simplewallet balance y
[12:01:14 INFO    connectionpool] Starting new HTTP connection (1): rest-api
[12:01:14 DEBUG   connectionpool] "GET /state/7e26649edfba4e018ac9c59a0462e8d8565ec4b1db295597da83b7d9819705d090bbe8 HTTP/1.1" 404 134
Error: Error 404: Not Found

I think its solution is:
If i try transfer it will check first if this user had balance(it just can be 0).
Another i think it can initialize user 's balance to 0 if i 'keygen'

Thank you~

Wallet with Javascript SDK running a PBFT consensus

Dear! I have installed your repository and also watched your video. I need simulate currency transactions using the PBFT algorithm and the Javascript SDK. This is for an academic thesis, but I am finding serious problems since I am not used with docker and containers. Would be possible any help related to your repo?

Transfer to new client not working

Hey,
I've set up 3 clients for an instance, client A, client B, client C. If the client A did some transaction deposited 10000 and transfer 1000 to client C which doesn't have any transactions, the balance for client C shown as undefined.
If client B have made a few transactions and the balance for client B is 1000 then if client A transfer it is credited to client B account.

Issue in running docker-compose.yaml

Hi,
When I give the following command:
docker-compose -f docker-compose.yaml up
I get this error:

validator is up-to-date
sawtooth-simplewallet_settings-tp_1 is up-to-date
simplewallet-processor is up-to-date
rest-api is up-to-date
Recreating simplewallet-client ... error

ERROR: for simplewallet-client  Cannot start service simplewallet-client: failed to create endpoint simplewallet-client on network sawtooth-simplewallet_default: Windows does not support host IP addresses in NAT settings

ERROR: for simplewallet-client  Cannot start service simplewallet-client: failed to create endpoint simplewallet-client on network sawtooth-simplewallet_default: Windows does not support host IP addresses in NAT settings
ERROR: Encountered errors while bringing up the project.

Please help. What should I do?

List transactions

Nice work guys, but is there any way i can list the transactions for a wallet? thanks

simplewallet balance jack, Not working with the following error.

root@d533a2567fd4:/project/simplewallet/pyclient# simplewallet balance jack #Displays the balance left in Jack's account
[19:48:16 INFO connectionpool] Starting new HTTP connection (1): rest-api
[19:48:16 DEBUG connectionpool] "GET /state/7e266409c158f073860c0938ce27c3eea1354b73d3313da10e46c6a828eac674bef285 HTTP/1.1" 404 134
Traceback (most recent call last):
File "/project/simplewallet/pyclient/wallet/simplewallet_client.py", line 148, in _send_to_restapi
result.status_code, result.reason))
Exception: Error 404: Not Found

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/project/simplewallet/pyclient/wallet/simplewallet_cli.py", line 257, in main_wrapper
main()
File "/project/simplewallet/pyclient/wallet/simplewallet_cli.py", line 243, in main
do_balance(args)
File "/project/simplewallet/pyclient/wallet/simplewallet_cli.py", line 208, in do_balance
data = client.balance()
File "/project/simplewallet/pyclient/wallet/simplewallet_client.py", line 117, in balance
"state/{}".format(self._address))
File "/project/simplewallet/pyclient/wallet/simplewallet_client.py", line 155, in _send_to_restapi
raise Exception(err)
Exception: Error 404: Not Found

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.