tatumio / tatum-kms Goto Github PK
View Code? Open in Web Editor NEWUnbreakable secure KMS (key management system) integrated to Tatum blockchain infrastructure
License: MIT License
Unbreakable secure KMS (key management system) integrated to Tatum blockchain infrastructure
License: MIT License
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?
if I use a lot of wallets, it would be practical to change the storage master password over time.
it is possible to turn on a daemon with a bad password. a bad password is only detected by not being able to sign transactions.
Add log levels configurable on the fly - syslog / log level
Counters - req/minute, others - improved monitoring
It seems that only npm 6 is supported. Please add support for npm 7 too.
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
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"
}
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
}
}
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.
I am looking for PHP alternative for Tatum KMS.
I need create fromPrivateKey variable via PHP.
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
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
Should be Currency.BTC but is Currency.LTC
Line 369 in d7d00e8
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
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)))
}
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
I have a subscribed api key on region us-west1, when I'm trying to run tatum-kms daemon --api-key=XXXXXXX --chain=MATIC it is getting transactions on https://api-eu1.tatum.io/v3/kms/pending/MATIC?signatures=XXXXXX. Is there a way to change TATUM_API_URL using command line?
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.