Coder Social home page Coder Social logo

accept-bitcoin's People

Contributors

bryant1410 avatar dcohenb avatar insanity54 avatar sagivo 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  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

accept-bitcoin's Issues

Error when trying sample script

1Hey there,
i get the following error when i try one of the sample scripts:

hello 2MwoZu4iHWBbUFUY7ECNdadRjzzcGVeFiBY
/home/jay/workspace/btc-accept/node_modules/accept-bitcoin/lib/key.js:34
        network: this.settings.network === 'live' ? bitcore.networks.livenet : bitcore.networks.testnet
                                                                                               ^
TypeError: Cannot read property 'testnet' of undefined
    at new Key (/home/jay/workspace/btc-accept/node_modules/accept-bitcoin/lib/key.js:34:96)
    at Main.generateAddress (/home/jay/workspace/btc-accept/node_modules/accept-bitcoin/lib/index.js:58:15)
    at Main.generateAddress (/home/jay/workspace/btc-accept/node_modules/accept-bitcoin/lib/index.js:4:61)
    at Object.<anonymous> (/home/jay/workspace/btc-accept/index.js:4:18)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.runMain (module.js:604:10)

`
This happens with every sample.

Thanks in Advance

TypeError: Cannot read property 'testnet' of undefined

I'm running the example, simple.js (I renamed it btctest.js) and getting this error:

chris@chris-laptop:~/scripts/vanman-HQ$ node btctest.js 
hello mu3F27qcViM4udXFFiGrjEa7nmNmzS8ocf

/home/chris/scripts/vanman-HQ/node_modules/accept-bitcoin/lib/key.js:34
tings.network === 'live' ? bitcore.networks.livenet : bitcore.networks.testnet
                                                                      ^
TypeError: Cannot read property 'testnet' of undefined
    at new Key (/home/chris/scripts/vanman-HQ/node_modules/accept-bitcoin/lib/key.js:34:96)
    at Main.generateAddress (/home/chris/scripts/vanman-HQ/node_modules/accept-bitcoin   /lib/index.js:60:15)
    at Main.generateAddress (/home/chris/scripts/vanman-HQ/node_modules/accept-bitcoin/lib/index.js:4:61)
    at Object.<anonymous> (/home/chris/scripts/vanman-HQ/btctest.js:6:10)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)

Is there anything I could be doing wrong?

version notes:

accept-bitcoin v0.0.9
node v0.10.25

TypeError: Unspecified operation for type undefined for add

Does anyone have an example of a working environment they can share? What I need is version numbers for modules.

my latest attempt using bitcore 0.1.41 which got around #2 is having a new problem:

chris@chris-laptop:~/scripts/vanman-HQ$ node payToAddres.js 
hello 1JSG6YdLGVq6nY6Q3vpVxVxZ3aAE7oJK1U

/home/chris/scripts/vanman-HQ/node_modules/accept-bitcoin/node_modules/bitcore/node_modules/bignum/index.js:96
            throw new TypeError('Unspecified operation for type '
                  ^
TypeError: Unspecified operation for type undefined for add
    at BigNum.(anonymous function) [as add] (/home/chris/scripts/vanman-HQ/node_modules/accept-bitcoin/node_modules/bitcore/node_modules/bignum/index.js:96:19)
    at Object.base58.decode (/home/chris/scripts/vanman-HQ/node_modules/accept-bitcoin/node_modules/bitcore/lib/Base58.js:50:23)
    at Object.base58Check.decode (/home/chris/scripts/vanman-HQ/node_modules/accept-bitcoin/node_modules/bitcore/lib/Base58.js:87:22)
    at PrivateKey.encodings.base58.converters.binary (/home/chris/scripts/vanman-HQ/node_modules/accept-bitcoin/node_modules/bitcore/util/EncodedData.js:106:23)
    at PrivateKey.EncodedData.as (/home/chris/scripts/vanman-HQ/node_modules/accept-bitcoin/node_modules/bitcore/util/EncodedData.js:40:36)
    at PrivateKey.EncodedData.encoding (/home/chris/scripts/vanman-HQ/node_modules/accept-bitcoin/node_modules/bitcore/util/EncodedData.js:25:22)
    at PrivateKey.EncodedData.doAsBinary (/home/chris/scripts/vanman-HQ/node_modules/accept-bitcoin/node_modules/bitcore/util/EncodedData.js:71:8)
    at PrivateKey.validate (/home/chris/scripts/vanman-HQ/node_modules/accept-bitcoin/node_modules/bitcore/lib/PrivateKey.js:17:8)
    at WalletKey.fromObj (/home/chris/scripts/vanman-HQ/node_modules/accept-bitcoin/node_modules/bitcore/lib/WalletKey.js:43:10)
    at new Key (/home/chris/scripts/vanman-HQ/node_modules/accept-bitcoin/lib/key.js:37:17)

npm install -s does not work

No entry created in package.json!
LOG:
gyp ERR! configure error
gyp ERR! stack Error: gyp failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:336:16)
gyp ERR! stack at emitTwo (events.js:125:13)
gyp ERR! stack at ChildProcess.emit (events.js:213:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Darwin 15.6.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/Juan/Documents/neat-tuck/bitcoin/node_modules/zmq
gyp ERR! node -v v8.6.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm WARN [email protected] No description
npm WARN [email protected] No repository field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/Juan/.npm/_logs/2018-03-13T11_08_57_720Z-debug.log

Question: Recover from boot and waiting for too many keys?

I'm wondering once the application is restarted how can i still listen events for the payments that are still not finished?

Using the example from the help file:

key = ac.generateAddress({alertWhenHasBalance: true});
console.log("Hello buyer! please pay to: " + key.address());
key.on('hasBalance', function(amount){
  console.log("thanks for paying me " + amount); //do stuff
  key.transferBalanceToMyAccount(function(err, d){
    if (d.status === 'success') console.log("Cool, the bitcoins are in my private account!");
  });
});

And assuming a new key is generated when i run

key = ac.generateAddress({alertWhenHasBalance: true});

Once the application restarts how am i supposed to retrieve the addresses that still didn't receive any BTC and wait for them to be paid?

Also let's say a bunch of users never pay and the application is never restarted and i end up with a whole lot of "keys" waiting for "hashBalance" how would that impact the performance of the application?

Thank You for this amazing library!

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.