Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ prof/
.venv/
.mypy_cache/
__pycache__/
.idea/
.vscode/
Comment on lines +11 to +12
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For folders specific to your own environment, please use .git/info/exclude instead.

decred/setup.py
.pytest_cache
.coverage
*.c
Expand Down
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,19 @@ The [`tinywallet`](./tinywallet) package contains a wallet based on the
Each package may be installed from the [Python Package Index](https://pypi.org/)
using the [`pip`](https://pip.pypa.io/) command as usual.

## Requirements

To run tinydecred on your machine you will need to set up the following.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't "run tinydecred". You can run tinywallet, or use the decred package.


- pip install websocket_client
- pip install blake256
- pip install base58
- pip install PyNaCl
- pip install appdirs
Comment on lines +17 to +23
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You shouldn't install this way. Regular users should just pip install decred.

For tinywallet, you can poetry install and then poetry run tinywallet, but you'll need the fix from #198.


Set up and run dcrd. Ensure your rpcusername and rpcpassword is set in your dcrd config file.
Installation guide can be found [`here`](https://docs.decred.org/wallets/cli/dcrd-setup/).
Comment on lines +25 to +26
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dcrd is completely optional, and it's integration is very shallow right now. I wouldn't say much about dcrd yet.


## Status

[![Check and test both packages](https://github.com/decred/tinydecred/workflows/Check%20and%20test%20both%20packages/badge.svg)](https://github.com/decred/tinydecred/actions)
Expand All @@ -28,6 +41,7 @@ using the [`pip`](https://pip.pypa.io/) command as usual.
[![GitHub contributors](https://img.shields.io/github/contributors/decred/tinydecred)](https://github.com/decred/tinydecred/graphs/contributors)
[![GitHub](https://img.shields.io/github/license/decred/tinydecred)](./LICENSE)


## Roadmap

In no particular order:
Expand Down
6 changes: 3 additions & 3 deletions decred/decred/crypto/crypto.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
from blake256.blake256 import blake_hash
import nacl.secret

from decred import DecredError
from decred.util import encode
from decred.util.encode import ByteArray, unblobCheck
from decred.decred import DecredError
from decred.decred.util import encode
from decred.decred.util.encode import ByteArray, unblobCheck
Comment on lines -16 to +18
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't do this. Typically this would indicate that you are importing the package in a way that it wasn't intended. How are you using the package that requires this change?

Copy link
Author

@ReevesAk ReevesAk Jun 13, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I run tinywallet, without this change I was getting an importerror(unknown location), so I figured since it is absolute import, this would help. The only other fix I could figure out was the insertion of my projectpath using sys.path.insert().
This was what I used to make tinywallet run on my machine, I would be glad if you can proffer a better way.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you using the CLI command poetry run tinywallet to run tinywallet?

Copy link
Member

@buck54321 buck54321 Jun 13, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You'll need to pip install poetry and poetry install in the tinywallet directory first.

Sorry this stuff isn't better documented already.

Copy link
Author

@ReevesAk ReevesAk Jun 21, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have implemented your suggestions, and I still got the error I dropped on tinydecred room..
what version of python are you using?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you referring to the IDE error?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it's actually not IDE related.

Copy link
Member

@JoeGruffins JoeGruffins Jun 23, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neither buck nor I are seeing this, and we use different flavors of linux I believe. I'm not great with poetry, but It looks like the virtual environment it uses isn't being set up properly on your end.


from . import rando
from .secp256k1.curve import PrivateKey, PublicKey, curve as Curve
Expand Down
4 changes: 2 additions & 2 deletions decred/decred/crypto/mnemonic.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
PGP-based mnemonic seed generation.
"""

from decred import DecredError
from decred.util.encode import ByteArray
from decred.decred import DecredError
from decred.decred.util.encode import ByteArray

from .crypto import sha256ChecksumByte

Expand Down
4 changes: 2 additions & 2 deletions decred/decred/crypto/rando.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

import os

from decred import DecredError
from decred.util.encode import ByteArray
from decred.decred import DecredError
from decred.decred.util.encode import ByteArray


KEY_SIZE = 32
Expand Down
6 changes: 3 additions & 3 deletions decred/decred/crypto/secp256k1/curve.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
where x = x1/z1^2 and y = y1/z1^3.
"""

from decred import DecredError
from decred.crypto.rando import generateSeed
from decred.util.encode import ByteArray
from decred.decred import DecredError
from decred.decred.crypto.rando import generateSeed
from decred.decred.util.encode import ByteArray

from .field import BytePoints, FieldVal

Expand Down
2 changes: 1 addition & 1 deletion decred/decred/crypto/secp256k1/field.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from base64 import b64decode
from zlib import decompress as zdecompress

from decred.util.encode import ByteArray
from decred.decred.util.encode import ByteArray

from .bytepoints import secp256k1BytePoints

Expand Down
12 changes: 6 additions & 6 deletions decred/decred/dcr/account.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
See LICENSE for details
"""

from decred import DecredError
from decred.crypto import crypto, opcode
from decred.dcr import addrlib
from decred.dcr.txscript import DefaultRelayFeePerKb
from decred.util import encode, helpers
from decred.util.encode import BuildyBytes, ByteArray, unblobCheck
from decred.decred import DecredError
from decred.decred.crypto import crypto, opcode
from decred.decred.dcr import addrlib
from decred.decred.dcr.txscript import DefaultRelayFeePerKb
from decred.decred.util import encode, helpers
from decred.decred.util.encode import BuildyBytes, ByteArray, unblobCheck

from . import nets, txscript
from .vsp import VotingServiceProvider
Expand Down
10 changes: 5 additions & 5 deletions decred/decred/dcr/addrlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

from base58 import b58encode

from decred import DecredError
from decred.crypto.crypto import (
from decred.decred import DecredError
from decred.decred.crypto.crypto import (
RIPEMD160_SIZE,
PKFCompressed,
PKFUncompressed,
Expand All @@ -21,9 +21,9 @@
checksum,
hash160,
)
from decred.crypto.secp256k1.curve import curve as Secp256k1
from decred.dcr import nets
from decred.util.encode import BuildyBytes, ByteArray, decodeBlob, unblobCheck
from decred.decred.crypto.secp256k1.curve import curve as Secp256k1
from decred.decred.dcr import nets
from decred.decred.util.encode import BuildyBytes, ByteArray, decodeBlob, unblobCheck


class Address:
Expand Down
8 changes: 4 additions & 4 deletions decred/decred/dcr/blockchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

import time

from decred.dcr import addrlib, rpc
from decred.dcr.wire.msgblock import BlockHeader
from decred.util import database, helpers
from decred.util.encode import ByteArray
from decred.decred.dcr import addrlib, rpc
from decred.decred.dcr.wire.msgblock import BlockHeader
from decred.decred.util import database, helpers
from decred.decred.util.encode import ByteArray


log = helpers.getLogger("blockchain")
Expand Down
12 changes: 6 additions & 6 deletions decred/decred/dcr/dcrdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
import time
from urllib.parse import urlencode, urljoin, urlsplit, urlunsplit

from decred import DecredError
from decred.crypto import crypto
from decred.dcr import addrlib
from decred.util import database, tinyhttp, ws
from decred.util.encode import ByteArray
from decred.util.helpers import formatTraceback, getLogger, makeWebsocketURL
from decred.decred import DecredError
from decred.decred.crypto import crypto
from decred.decred.dcr import addrlib
from decred.decred.util import database, tinyhttp, ws
from decred.decred.util.encode import ByteArray
from decred.decred.util.helpers import formatTraceback, getLogger, makeWebsocketURL

from . import account, agenda, txscript
from .wire import msgblock, msgtx, wire
Expand Down
2 changes: 1 addition & 1 deletion decred/decred/dcr/nets/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
See LICENSE for details
"""

from decred import DecredError
from decred.decred import DecredError

from . import mainnet, simnet, testnet

Expand Down
2 changes: 1 addition & 1 deletion decred/decred/dcr/nets/mainnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
https://github.com/decred/dcrd/blob/master/chaincfg/mainnetparams.go
"""

from decred.dcr import constants as C
from decred.decred.dcr import constants as C


Name = "mainnet"
Expand Down
10 changes: 5 additions & 5 deletions decred/decred/dcr/rpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
import ssl
import types

from decred import DecredError
from decred.crypto.opcode import OP_SSRTX
from decred.util import tinyhttp, ws
from decred.util.encode import ByteArray
from decred.util.helpers import getLogger, makeWebsocketURL
from decred.decred import DecredError
from decred.decred.crypto.opcode import OP_SSRTX
from decred.decred.util import tinyhttp, ws
from decred.decred.util.encode import ByteArray
from decred.decred.util.helpers import getLogger, makeWebsocketURL

from . import agenda, txscript
from .wire.msgblock import BlockHeader
Expand Down
12 changes: 6 additions & 6 deletions decred/decred/dcr/txscript.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
import bisect
import math

from decred import DecredError
from decred.crypto import crypto, opcode
from decred.crypto.secp256k1.curve import curve as Curve
from decred.dcr import addrlib
from decred.util import helpers
from decred.util.encode import ByteArray
from decred.decred import DecredError
from decred.decred.crypto import crypto, opcode
from decred.decred.crypto.secp256k1.curve import curve as Curve
from decred.decred.dcr import addrlib
from decred.decred.util import helpers
from decred.decred.util.encode import ByteArray

from .wire import msgtx, wire

Expand Down
8 changes: 4 additions & 4 deletions decred/decred/dcr/vsp.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
import time
from urllib.parse import urlsplit, urlunsplit

from decred import DecredError
from decred.dcr import addrlib
from decred.util import encode, tinyhttp
from decred.util.encode import ByteArray, unblobCheck
from decred.decred import DecredError
from decred.decred.dcr import addrlib
from decred.decred.util import encode, tinyhttp
from decred.decred.util.encode import ByteArray, unblobCheck

from . import constants, nets, txscript

Expand Down
4 changes: 2 additions & 2 deletions decred/decred/dcr/wire/msgblock.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
Based on dcrd MsgBlock.
"""

from decred.crypto import crypto
from decred.util.encode import ByteArray
from decred.decred.crypto import crypto
from decred.decred.util.encode import ByteArray


# chainhash.HashSize in Go
Expand Down
2 changes: 1 addition & 1 deletion decred/decred/dcr/wire/msgping.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Based on dcrd MsgPing.
"""

from decred.util.encode import ByteArray
from decred.decred.util.encode import ByteArray


CmdPing = "ping"
Expand Down
2 changes: 1 addition & 1 deletion decred/decred/dcr/wire/msgpong.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Based on dcrd MsgPing.
"""

from decred.util.encode import ByteArray
from decred.decred.util.encode import ByteArray


CmdPong = "pong"
Expand Down
8 changes: 4 additions & 4 deletions decred/decred/dcr/wire/msgtx.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
Based on dcrd MsgTx.
"""

from decred import DecredError
from decred.crypto.crypto import hashH
from decred.dcr import txscript
from decred.util.encode import ByteArray
from decred.decred import DecredError
from decred.decred.crypto.crypto import hashH
from decred.decred.dcr import txscript
from decred.decred.util.encode import ByteArray

from . import wire

Expand Down
2 changes: 1 addition & 1 deletion decred/decred/dcr/wire/msgverack.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Based on dcrd MsgVerAck.
"""

from decred.util.encode import ByteArray
from decred.decred.util.encode import ByteArray


CmdVerAck = "verack"
Expand Down
6 changes: 3 additions & 3 deletions decred/decred/dcr/wire/msgversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

import time

from decred import DecredError
from decred.dcr.wire import netaddress, wire
from decred.util.encode import ByteArray
from decred.decred import DecredError
from decred.decred.dcr.wire import netaddress, wire
from decred.decred.util.encode import ByteArray


# MaxUserAgentLen is the maximum allowed length for the user agent field in a
Expand Down
4 changes: 2 additions & 2 deletions decred/decred/dcr/wire/netaddress.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
import socket
import time

from decred import DecredError
from decred.util.encode import ByteArray
from decred.decred import DecredError
from decred.decred.util.encode import ByteArray


MaxNetAddressPayload = 30
Expand Down
4 changes: 2 additions & 2 deletions decred/decred/dcr/wire/wire.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
Constants and common routines from the dcrd wire package.
"""

from decred import DecredError
from decred.util.encode import ByteArray
from decred.decred import DecredError
from decred.decred.util.encode import ByteArray


# fmt: off
Expand Down
4 changes: 2 additions & 2 deletions decred/decred/util/chains.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
See LICENSE for details
"""

from decred import DecredError
from decred.dcr import account as dcracct, nets as dcrnets
from decred.decred import DecredError
from decred.decred.dcr import account as dcracct, nets as dcrnets


class BipIDs:
Expand Down
2 changes: 1 addition & 1 deletion decred/decred/util/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import sqlite3
import threading

from decred import DecredError
from decred.decred import DecredError


TRUE = bytearray([1])
Expand Down
2 changes: 1 addition & 1 deletion decred/decred/util/encode.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import struct

from decred import DecredError
from decred.decred import DecredError


NONE = "None".encode()
Expand Down
2 changes: 1 addition & 1 deletion decred/decred/util/tinyhttp.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from urllib.parse import urlencode
import urllib.request as urlrequest

from decred import DecredError
from decred.decred import DecredError

from .helpers import formatTraceback

Expand Down
6 changes: 3 additions & 3 deletions decred/decred/wallet/accounts.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
mostly be through the AccountManager.
"""

from decred import DecredError
from decred.crypto import crypto
from decred.util import chains, encode, helpers
from decred.decred import DecredError
from decred.decred.crypto import crypto
from decred.decred.util import chains, encode, helpers


EXTERNAL_BRANCH = 0
Expand Down
12 changes: 6 additions & 6 deletions decred/decred/wallet/wallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@

from pathlib import Path

from decred import DecredError
from decred.crypto import crypto, mnemonic, rando
from decred.dcr import nets
from decred.dcr.dcrdata import DcrdataBlockchain
from decred.util import chains, database, encode, helpers
from decred.util.helpers import mkdir
from decred.decred import DecredError
from decred.decred.crypto import crypto, mnemonic, rando
from decred.decred.dcr import nets
from decred.decred.dcr.dcrdata import DcrdataBlockchain
from decred.decred.util import chains, database, encode, helpers
from decred.decred.util.helpers import mkdir

from . import accounts

Expand Down
Loading