Giter Site home page Giter Site logo

tatumio / tatum-kms Goto Github PK

View Code? Open in Web Editor NEW
187.0 18.0 58.0 3.16 MB

Unbreakable secure KMS (key management system) integrated to Tatum blockchain infrastructure

License: MIT License

JavaScript 14.69% TypeScript 84.08% Dockerfile 1.23%
wallet-store daemon-mode mnemonic keymanagment blockchain cryptocurrency

tatum-kms's People

Contributors

aanandmishra1804 avatar alexloiko avatar chrto avatar evgeniabogranskaya avatar hathoriel avatar isra67 avatar jdckl avatar jeydev310 avatar npwork avatar oliverjantar avatar pedrodbaptista avatar rachitgod avatar samtatum avatar samuelbartels20 avatar samuelsramko avatar smrecz avatar tokayer avatar zolanvar 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tatum-kms's Issues

Failed at the [email protected] install script.

I am running macOS Big Sur version 11.5.2 with an intel processor.

Doing the following:

docker run --rm -ti ubuntu:22.04 bash;

inside the Docker container I run:

apt-get update && apt-get install git curl;
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash;
. ~/.nvm/nvm.sh;
nvm install 16.9.0;
nvm use 16.9.0;
npm i -g npm@6;
npm i -g @tatumio/tatum-kms;

The install fails. Here is the end of the output:

> [email protected] install /root/.nvm/versions/node/v16.9.0/lib/node_modules/@tatumio/tatum-kms/node_modules/iso-constants
> node build.js > index.browser.js

sh: 1: cannot create index.browser.js: Permission denied
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.3.2 (node_modules/@tatumio/tatum-kms/node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! [email protected] install: `node build.js > index.browser.js`
npm ERR! Exit status 2
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!     /root/.npm/_logs/2022-11-28T20_32_23_278Z-debug.log

What should I do to make this work?

FR: password change

if I use a lot of wallets, it would be practical to change the storage master password over time.

Got 'Request failed with status code 401' when starting KMS daemon using docker

I got the error log Request failed with status code 401 when starting KMS daemon using docker even I got success with generatemanagedwallet and export command. I used testnet API that is exported in the .env file:

# My .env file with testnet API  key 
TATUM_API_KEY="t-6531...d2fe2-cf57...be3b"
TATUM_KMS_PASSWORD=x12fcv2322
  • Success with generatemanagedwallet
docker run -it --env-file ./.env -v ./volume:/root/.tatumrc tatumio/tatum-kms generatemanagedwallet DOGE --testnet

output:

{
  "signatureId": "7c4623f7-0ac3-41b3-acf2-18d97c7abf8c",
  "xpub": "tpubDFJuM3n5NrpA1or4XxjaaPDkUpfnJGwt9upBoFyeSN78C5rtsYqNV8yBQZrLjimpiXeb6X7WkEVaLFtUtSCxJtB2wAURuftTjSQkcHfetGv"
}
  • Success with export
docker run -it --env-file ./.env -v ./volume:/root/.tatumrc tatumio/tatum-kms export --testnet

output:

{
  "7c4623f7-0ac3-41b3-acf2-18d97c7abf8c": {
    "mnemonic": "cable front twice < ... >",
    "xpub": "tpubDFJuM3n5NrpA1or4XxjaaPDkUpfnJGwt9upBoFyeSN78C5rtsYqNV8yBQZrLjimpiXeb6X7WkEVaLFtUtSCxJtB2wAURuftTjSQkcHfetGv",
    "chain": "DOGE",
    "testnet": true
  }
}
  • Failed with KMS daemon
docker run -it --env-file ./.env -v ./volume:/root/.tatumrc tatumio/tatum-kms daemon --testnet --period=20 --chain=DOGE

Logs:

2023-10-25T05:56:27.494Z - Getting pending transaction from DOGE for wallets 7c4623f7-0ac3-41b3-acf2-18d97c7abf8c.
2023-10-25T05:56:28.182Z - Error received from API /v3/kms/pending/DOGE - {"signatureIds":["7c4623f7-0ac3-41b3-acf2-18d97c7abf8c"]}: Error: Request failed with status code 401

Why did I get this error in KMS daemon log even I used the same API key in the KMS commands.

Error: Request failed with status code 401

Because the command generatemanagedwallet got success then I think the API key is a correct one.

KMS in React Native

Thats a simple question, can i use tatum-kms in react native/expo ? there are another packages that i have to install?

Error: Malformed UTF-8 data

Error: Malformed UTF-8 data
    at Object.stringify (/usr/src/app/node_modules/crypto-js/core.js:523:24)
    at WordArray.init.toString (/usr/src/app/node_modules/crypto-js/core.js:278:38)
    at getManagedWallets (/usr/src/app/dist/management.js:47:67)
    at Timeout._onTimeout (/usr/src/app/dist/signatures.js:281:68)

both docker KMS image (docker pull tatumio/tatum-kms) and
npm installed (GitHub master branch) KMS have the same error,
when running in daemon mode after calling the generatemanagedwallet BSC method to add a managed wallet address

Installing Tatum

I'm getting this error upon installation.
My Environment Versions:
node: '14.15.4',
npm: '6.14.10',
image

export wallets always export default path (ignore path parameter)

I found a problem in "exportWallets" method. the method has 3 parameters but the second parameter (_path1) never used.
on the other hand when it called from index.ts, just two parameter passed to it, so the third parameter will be "null" all the time and the default path will be export all the time.
https://github.com/tatumio/tatum-kms/blob/388096517464d9dedc9aa8285b3724fae02a2ddc/src/index.ts#L145
https://github.com/tatumio/tatum-kms/blob/388096517464d9dedc9aa8285b3724fae02a2ddc/src/management.ts#L81

break wallets limit.

in kms there is 25_000 wallets limit.

can we break it by chunk wallets?

here is my code.

import _, { chunk } from 'lodash'

const wallets = getManagedWallets(pwd, supportedChain, testnet, path)
const chunkedWallets:string[][] = chunk(wallets, KMS_CONSTANTS.SIGNATURE_IDS);
let i = 1;
for (const wallets of chunkedWallets) {
  console.log(`chunk ${i++}`)
  transactions.push(...(await getPendingTransactions(axios, supportedChain, wallets)))
}

Split daemon and processSignatures

Would be nice (specially for testing) to be able to run kms ad-hoc and not as a daemon.
Just moving the code within the setInterval out of there and make it reachable by another command line option.

Cheers

Cannot send USDT on Ethereum

https://api.tatum.io/v3/ethereum/transaction (on sepolia)
{
"to": "0x74Ac3CC70cD05b6f16A4FB545B64Ec07F8B10183",
"currency": "USDT",
"amount": "0.77",
"signatureId": "1dbfa637-71d7-4480-ac56-9c8445360648",
"index": 0
}

response:
{
"signatureId": "6369d9decb7180cadae7bc53"
}

webhook:
{"signatureId":"6369d9decb7180cadae7bc53","txId":"0xec56b4a5708413d08ac12acf8063c323a200ea56b3a9ce672256bc851aa9e397","subscriptionType":"KMS_COMPLETED_TX"}

https://sepolia.etherscan.io/tx/0xec56b4a5708413d08ac12acf8063c323a200ea56b3a9ce672256bc851aa9e397
does not transfer USDT by calling transfer() on USDT ERC20 contract (as Metamask does)

Please advise.

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.