Git Product home page Git Product logo

electrum's Introduction

Electrum - Lightweight Bitcoin client

Licence: MIT Licence
Author: Thomas Voegtlin
Language: Python (>= 3.6)
Homepage: https://electrum.org/
Build Status Test coverage statistics Help translate Electrum online

Getting started

(If you've come here looking to simply run Electrum, you may download it here.)

Electrum itself is pure Python, and so are most of the required dependencies, but not everything. The following sections describe how to run from source, but here is a TL;DR:

sudo apt-get install libsecp256k1-0
python3 -m pip install --user .[gui,crypto]

Not pure-python dependencies

If you want to use the Qt interface, install the Qt dependencies:

sudo apt-get install python3-pyqt5

For elliptic curve operations, libsecp256k1 is a required dependency:

sudo apt-get install libsecp256k1-0

Alternatively, when running from a cloned repository, a script is provided to build libsecp256k1 yourself:

sudo apt-get install automake libtool
./contrib/make_libsecp256k1.sh

Due to the need for fast symmetric ciphers, either one of pycryptodomex or cryptography is required. Install from your package manager (or from pip):

sudo apt-get install python3-cryptography

If you would like hardware wallet support, see this.

Running from tar.gz

If you downloaded the official package (tar.gz), you can run Electrum from its root directory without installing it on your system; all the pure python dependencies are included in the 'packages' directory. To run Electrum from its root directory, just do:

./run_electrum

You can also install Electrum on your system, by running this command:

sudo apt-get install python3-setuptools python3-pip
python3 -m pip install --user .

This will download and install the Python dependencies used by Electrum instead of using the 'packages' directory. It will also place an executable named electrum in ~/.local/bin, so make sure that is on your PATH variable.

Development version (git clone)

Check out the code from GitHub:

git clone git://github.com/spesmilo/electrum.git
cd electrum
git submodule update --init

Run install (this should install dependencies):

python3 -m pip install --user -e .

Create translations (optional):

sudo apt-get install python-requests gettext
./contrib/pull_locale

Finally, to start Electrum:

./run_electrum

Creating Binaries

Linux (tarball)

See contrib/build-linux/sdist/README.md.

Linux (AppImage)

See contrib/build-linux/appimage/README.md.

Mac OS X / macOS

See contrib/osx/README.md.

Windows

See contrib/build-wine/README.md.

Android

See contrib/android/Readme.md.

electrum's People

Contributors

akshayaurora avatar bauerj avatar chrisglass avatar dabura667 avatar danielsocials avatar dydysy avatar ecdsa avatar echterago avatar fluffypony avatar genjix avatar huazhouwang avatar jeremyrand avatar jimboman77 avatar liuzjalex avatar matejcik avatar mergify[bot] avatar neocogent avatar peterqin18 avatar quincysx avatar romanz avatar shuailiwang avatar sombernight avatar somebodyli avatar taimanhui avatar toxeus avatar wozz avatar xiaoliangcc avatar xmjasmine avatar ysangkok avatar zoe-wls avatar

Stargazers

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

Watchers

 avatar  avatar

electrum's Issues

nodejs无法调用onekey-connnet

在node中使用onekey-connet和trezor-connet,示例代码如下:

import TrezorConnect from 'trezor-connect';
// import TrezorConnect from '@onekeyhq/connect';

(async () => {
    await TrezorConnect.init({
            connectSrc: 'https://localhost:8088/',
            lazyLoad: true, // this param will prevent iframe injection until TrezorConnect.method will be called
            manifest: {
                email: '[email protected]',
                appUrl: 'http://your.application.com',
            },
            webusb: false
        });

    let res = await TrezorConnect.ethereumGetAddress({
        path: "m/44'/60'/0'/0/0"
    });
    console.log(res);

})();

在使用不同版本的包的时候输出不同。

当使用@onekeyhq/8.1.25-extended时,输出

{
  success: false,
  payload: { error: 'window is not defined', code: undefined }
}

可见onekey-connet必须在浏览器中使用。

当使用trezor-connect/8.1.25时,输出

(node:70314) UnhandledPromiseRejectionWarning: Error: This version of trezor-connect is not suitable to work without browser. Use trezor-connect@extended package instead
    at Object.TypedError (/Users/hyg/Programme/yarntest/node_modules/trezor-connect/lib/constants/errors.js:103:10)
    at empty (/Users/hyg/Programme/yarntest/node_modules/trezor-connect/lib/env/node/index.js:13:27)
    at Object.init (/Users/hyg/Programme/yarntest/node_modules/trezor-connect/lib/index.js:38:27)
    at /Users/hyg/Programme/yarntest/onekey.ts:5:25
    at step (/Users/hyg/Programme/yarntest/onekey.ts:33:23)
    at Object.next (/Users/hyg/Programme/yarntest/onekey.ts:14:53)
    at /Users/hyg/Programme/yarntest/onekey.ts:8:71
    at new Promise (<anonymous>)
    at __awaiter (/Users/hyg/Programme/yarntest/onekey.ts:4:12)
    at /Users/hyg/Programme/yarntest/onekey.ts:4:2
(Use `node --trace-warnings ...` to show where the warning was created)
(node:70314) 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:70314) [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

该版本提示

Error: This version of trezor-connect is not suitable to work without browser. Use trezor-connect@extended package instead

说明要用extended包。

当使用trezor-connect/8.1.25-extended时,输出

{
  id: 1,
  success: false,
  payload: { error: 'Transport is missing', code: 'Transport_Missing' }
}

我手边没有trezor,所以无法验证能成功,但显然该报错说明确实其实现逻辑与onekey-connet不同。

根据trezor.js的说明,可以被Nodejs集成,而这部分代码被合并到了trezor-connect中。
此外,直接在nodejs中调用trezor-connet的项目也有cardano-hw-cli

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.