skycoin / services Goto Github PK
View Code? Open in Web Editor NEWIncubator repo for various services
Incubator repo for various services
If you paste in an address, the UI should remove leading or trailing spaces. Currently it does not. This will make cutting and pasting easier.
Beautiful soup was mentioned as a parser, but this is geared towards html
The hardware wallet project is split in 3 repos:
Each one of them contain its copy of the protobuf files under a protob directory.
It is worth considering creating a github repo for these files only and use git submodule to have our repos point to it.
That is how they organised it in trezor project
https://godoc.org/github.com/skycoin/skycoin/src/cipher
Port the following functions
There must be tests
Then do test scripts that generate an input/output pair in golang at random and tests what the hardware outputs for the input pair.
Add pending transactions list to coin api address balance request
to look like that
{
"status": "Ok",
"code": 200,
"result": {
"address": "19h48jGe744JGaqh8UYDgjUtfYrMusq7SL",
"balance": 9997000,
"utxo": [
{
"amount": 10000000,
"tx_hash": "89c92d078286c043ef8c2bf3955b1998600520d2dbd140bc6772215f9929bc54",
"confirmations": 101,
"height": 515453
}
],
"pending_utxo": [
{
"amount": 9997000,
"tx_hash": "d54b8f6f6eaad826923f8ccfb12929e3078b5f59cff937fe2dbf4617d31e1021",
"confirmations": 0,
"height": 0
}
]
}
}
The requirement is to produce a file containing all the visible public keys, account numbers and balances for a given coin up to a given block. It should be a command line tool written in go.
Parameters it should accept include:
All errors and warnings should be written to stderr or appended to a log file. Errors should halt execution with detailed log output including block number, and full transaction details.
Output format will be further clarified, but for ease of manipulation (e.g. to sort and remove to p X) suggest simple CSV:
account number, public key, balance, number of transactions.
Presumably, for any account which has not done a transaction, the public key will be blank.
Number of transactions is nice to have to help reconciliation & testing., not mandatory.
This is the contract for TRX on the main net:
Contract TokenName Symbol Decimals Official Site
#1: 0xf230b790e05390fc8295f4d3f60332c93bed42e2 Tronix TRX 6 -
Optimisations:
The tools main file should be in the root of the project so that it works with "go install"
The work should be committed to a dir below services, e.g. "eth-balance-extractor"
This task is in progress by Sigma.
btcd is listed as a dependency for dep in this file:
https://github.com/skycoin/services/blob/master/coin-api/Gopkg.toml#L32
However when performing dep ensure
I get the following error:
Warning: the following project(s) have [[constraint]] stanzas in Gopkg.toml:
✗ github.com/btcsuite/btcd
However, these projects are not direct dependencies of the current project:
they are not imported in any .go files, nor are they in the 'required' list in
Gopkg.toml. Dep only applies [[constraint]] rules to direct dependencies, so
these rules will have no effect.
Either import/require packages from these projects so that they become direct
dependencies, or convert each [[constraint]] to an [[override]] to enforce rules
on these projects, if they happen to be transitive dependencies.
After looking at the go files I realized that btcd is not a dependency to any of the go files. I would like to know if this is actually intended in some way.
So I made that Pull Request #102 which won't pass the CI test.
It only contains changes to the Gopkg.toml, so with the right settings the CoinApi project compiles now. But the CI will get my PR rejected.
The way the CI is working with this project is right?, there is only one CI performing the same checks for every project inside this repository?.
There are 3 lines which must be removed:
Current Inventory....
You can check the current....
Each time you select ....
See comments at the end of:
#45
This function is not compatible with https://github.com/skycoin/skycoin/tree/v0.20.4/src in the version 0.20.4. There is not such function NewGui
and I cannot find any other struct that is compatible with the ClientApi interface.
The factory test mode should:
Move the exchange API to the services repo/folder
Have an -org
option that will gather the data for all repos in the organization over the specific time period
Would it be useful to add a README.MD to scanner with:
Add methods for
I use start script from deploy-coin package to start skycoin node with following command
./start -config config.txt -master true
And it starts successfully, but if I send SIGINT for gracefull shutdown and that start it again if fails with following output
abs path: /home/stgleb/workspace/skycoin/node3/src/gui/static
runtime.Caller= /home/stgleb/go/src/github.com/skycoin/services/deploy-coin/cmd/start/config.go
Filepath Directory= src/gui/static
Filepath Absolute Directory= /home/stgleb/workspace/skycoin/node3/src/gui/static
Working Directory= /home/stgleb/workspace/skycoin/node3
Runtime Filename= /home/stgleb/go/src/github.com/skycoin/services/deploy-coin/cmd/start/config.go
Runtime Directory= /home/stgleb/go/src/github.com/skycoin/services/deploy-coin/cmd/start
ResolveResourceDirectory: static resource dir= /home/stgleb/workspace/skycoin/node3/src/gui/static
[skycoin.visor:DEBUG] Creating new visor
[skycoin.visor:DEBUG] Visor is master
[skycoin.visor:INFO] Loading blockchain
[skycoin.wallet:INFO] Loaded wallet from .skycoin/wallets/2018_02_23_7713.wlt
[skycoin.pex:INFO] Pex.Run started
[skycoin.daemon:INFO] daemon.Pool listening on port 20101
[skycoin.gnet:INFO] Listening for connections on :20101...
[skycoin.visor:DEBUG] Create genesis block
[skycoin.daemon:INFO] Connect to trusted peers
[skycoin.daemon:DEBUG] Trying to connect to 127.0.0.1:20000
[skycoin.daemon:DEBUG] Trying to connect to 127.0.0.1:20001
[skycoin.gnet:DEBUG] Making TCP Connection to 127.0.0.1:20000
[skycoin.daemon:DEBUG] Trying to connect to 127.0.0.1:20002
[skycoin.daemon:DEBUG] Trying to connect to 127.0.0.1:20100
[skycoin.daemon:INFO] Connected to peer: 127.0.0.1:20000 (outgoing)
[skycoin.daemon:INFO] 127.0.0.1:20000 verified for version 2
[skycoin.daemon:DEBUG] Sending introduction message to 127.0.0.1:20000, mirror:560802697
[skycoin.gnet:DEBUG] Making TCP Connection to 127.0.0.1:20001
[skycoin.daemon:DEBUG] Successfully requested blocks from 127.0.0.1:20000
[skycoin.gnet:DEBUG] Making TCP Connection to 127.0.0.1:20002
[skycoin.pex:DEBUG] Reset retry times of 127.0.0.1:20000
[skycoin.daemon:DEBUG] Failed to connect to 127.0.0.1:20002 with error: dial tcp 127.0.0.1:20002: getsockopt: connection refused
[skycoin.pex:DEBUG] Increase retry times of 127.0.0.1:20002: 1
[skycoin.visor:INFO] Genesis block signature=fc56e7931bce2e37c6fbc483ad8ce32a093ac228f18c1d2af0d1676d505748b973bd0fb2da2608ae72f6b5848534566fc411ba21d2b96f9318d6c80bbdaaa46201
[skycoin.daemon:DEBUG] Failed to connect to 127.0.0.1:20001 with error: dial tcp 127.0.0.1:20001: getsockopt: connection refused
[skycoin.pex:DEBUG] Increase retry times of 127.0.0.1:20001: 1
[skycoin.gnet:DEBUG] Making TCP Connection to 127.0.0.1:20100
[skycoin.daemon:INFO] 127.0.0.1:20100 verified for version 2
[skycoin.pex:DEBUG] Reset retry times of 127.0.0.1:20100
[skycoin.visor:INFO] Removed 0 invalid txns from pool
[skycoin.visor:INFO] Blockchain parser start
[skycoin.historydb:INFO] History db reset
[skycoin.daemon:CRITICAL] Added new block 1
[skycoin.daemon:INFO] Connected to peer: 127.0.0.1:20100 (outgoing)
[skycoin.daemon:DEBUG] Sending introduction message to 127.0.0.1:20100, mirror:560802697
[skycoin.daemon:DEBUG] Successfully requested blocks from 127.0.0.1:20100
[skycoin.daemon:INFO] 127.0.0.1:20100 disconnected because: read data failed: read tcp 127.0.0.1:56920->127.0.0.1:20100: read: connection reset by peer
[skycoin.gnet:DEBUG] connection 127.0.0.1:20100 closed
[skycoin.visor:WARNING] bc.VerifySingleTxnAllConstraints failed for txn ae61b001461c0ab77169186905d65af442f36db2686ffe1044269475a5a839df: Transaction violates hard constraint: unspent output of db8af0383bdeae4c847bdad3834977a2fac25f95b2073e8af51ab30c4e8d0fdc does not exist
[skycoin.daemon:ERROR] daemon.Visor.InjectTransaction error: Transaction violates hard constraint: unspent output of db8af0383bdeae4c847bdad3834977a2fac25f95b2073e8af51ab30c4e8d0fdc does not exist
[skycoin.daemon:ERROR] Visor request func failed: Transaction violates hard constraint: unspent output of db8af0383bdeae4c847bdad3834977a2fac25f95b2073e8af51ab30c4e8d0fdc does not exist
[skycoin.main:ERROR] failed to run transaction to distribute coin volume - Transaction violates hard constraint: unspent output of db8af0383bdeae4c847bdad3834977a2fac25f95b2073e8af51ab30c4e8d0fdc does not exist
[skycoin.main:ERROR] failed to start node -Transaction violates hard constraint: unspent output of db8af0383bdeae4c847bdad3834977a2fac25f95b2073e8af51ab30c4e8d0fdc does not exist
[skycoin.main:INFO] Shutting down...
[skycoin.gnet:DEBUG] connection 127.0.0.1:20000 closed
[skycoin.gnet:INFO] Connection pool closed
[skycoin.pex:INFO] Shutting down pex
[skycoin.pex:INFO] Save peerlist
[skycoin.pex:INFO] Pex.Run stopped
[skycoin.pex:INFO] Pex shutdown
[skycoin.visor:INFO] Blockchain parser closed
[skycoin.daemon:INFO] Visor closed
[skycoin.daemon:INFO] Daemon closed
[skycoin.visor:INFO] DB and BlockchainParser closed
[skycoin.main:INFO] closing log file
[skycoin.main:INFO] Goodbye
It can be fixed if I delete data.db that contains blockchain. I think this is a problem, this is related to deploy-coin or skycoin node?
main.go has this import:
import(
"github.com/services/scanner/handler"
"github.com/services/scanner/config"
)
This should really be:
"github.com/skycoin/services/scanner/handler"
"github.com/skycoin/services/scanner/config"
Currently, the mobile and desktop wallet support both 12 and 24-word seed phrases while the hardware wallet supports only 12. 24 words should eventually be enabled on the hardware wallet also.
If you enter a skycoin address, it gives you a bitcoin address.
Then if you go back to the home page, enter the skycoin address again, it says "please generate a btc address first" or similar. It should show the status.
The teller-json daemon will expose an HTTP API for:
The two buy methods for binding a SKY address are:
The daemon will continually watch bound BTC/ETH addresses and watch for deposits, and then execute purchases and deposit SKY to the user's address.
More requirements for the daemon:
Stage 1
skycoin address:
time:
Stage 2 (deposit address)
btc address:
Stage 3 (transaction detected event, but not executed)
time:
btc tx id:
Stage 4
Buying the coins from c2cx
Stage 5
Wait for the BTC TX confirmation
Stage 6
Withdrawal and track withdrawal if its from our OTC wallet and not C2CX
Teller-json will use a JSON-flatfile database for storage. Here's an overview of the filenames and their contents:
db/bound/[sky address].json
Created: when /api/bind is called for the first time with [sky address]
.
Appended: successive calls to /api/bind with a [sky address]
. Appends to dropoffs
field.
{
"address": "...sky address...",
"dropoffs": [
{
address: "...dropoff address...",
type: "...dropoff currency..."
},
{
address: "...dropoff address...",
type: "...dropoff currency..."
}
]
}
db/status/[sky address].json
Created: when /api/bind is called.
Appended: successive calls to /api/bind with a [sky address]
.
[
{
"seq": ...dropoff sequence number...,
"updated_at": ...unix time...,
"status": ...dropoff status...
}
]
status
:
waiting_deposit
waiting_send
waiting_confirm
done
Karls json teller, currently in his repo here: https://github.com/skycoin-karl/teller#frontend
Exposes two sets of API, one for the OTC used by customers, and one for the admin panel (used by US).
Each of these APIs will need to run on different ports to allow the proxy to block the admin API from being called externally.
See also: https://docs.google.com/spreadsheets/d/1CnDPnV8NKj6d81EoHRMscWBXJl6VJOdMoiM58orXpNY/edit?usp=sharing
OLD OTC UI (header and footer removed)
Write a script that gets all merged github PRs for a repo between two dates, including link, title, author, and also get all closed issues for a repo between two dates including link and title. should write the information to stdout.
End date is not required. If -end
is missing, get all PRs/issues from -start
.
Put this in a new folder github-metrics/
.
Exchange API, only needs to store latest copy of order book in ram. deprecate redis
Add option for disabling redis usage for order book storage.
Then disable it by default.
After the device had been through a failed bootloader check, if the user infortunately push abort button, the flash memory is locked and we cannot wipe it anymore.
Tryed
st-flash -erase
openocd -f interface/stlink-v2.cfg -f target/stm32f2x.cfg flash erase
The hardware devices displays a "Storage failure detected" message when the device is plugged in.
Using debugger it appeared svc_flash_lock() returns a status where FLASH_SR_PGPERR flag is raised.
git log HEAD at the time the error was noticed: dedf49c
Preface: The "wallet API" is a multi-token API. It has one interface that exports a few functions. Then there are multiple implementations of the interface for individual coins:
Issue:
For bitcoin create multiple implementations of the interface
so we have a list of
One implementation for bitcoin uses the "scanning wallet" (but has to connect to a bctd node)
one uses blockchain.info api, etc
The command line tool can call the json http request directly, on the running server
The "wallet api" only needs to support bitcoin and skycoin for now (two coins) and one or two implementation for bitcoin (scanning wallet and querying blockchain.info)
Is showing the wrong price. It is neither the manual price or the exchange price. It should be the current price as set in the admin panel or from exchange.
Add spent_by field that contains hash of transaction that has spent current transaction.
Create a folder called coin-api
This is a command line application.
https://godoc.org/github.com/skycoin/skycoin/src/cip
We will define an interface that implements 5 functions for each coin
For generating addreses, see
For Bitcoin
Only implement
The can come back and focus on
For Skycoin, implement all of the above, using the golang CLI command.
Later we may want to implement "Watch Address" functionality, which allows us to add an address as a "watch address" and get events (deposits) to that address.
Each coin will have one or more implementations of the interface
There will be a CLI with a command for
There will be a JSON HTTP api that includes
applications will be able to use the multi-coin server from an HTTP JSON API
we may have a command line interface (CLI) for doing operations against the coin api server (will jus call the JSON HTTP API)
The coin API server will have a golang api, that can be imported and allow applications in golang to generate public keys, private keys and addresses for each supported coin, from a deterministic seed (supported for Bitcoin and Skycoin in the cipher library).
There will be a web-interface, showing which scanning wallet implementations have be instantiated.
The web-interface will also show the connection status of instantiated interfaces (is the coin-api server connected to the skycoin node? is the coin api-server successfully connected to a BCTD node, etc).
Note:
Architecture Choices
a web front end to support testing the wallet. Only one function, to show price and buy skycoin.
Very simple web interface (e.g. using react)
Check out what the api needs, and allow this to be entered. e.g. it may require you paste in your skycoin address, and it may then show you a BTC address (like OTC).
Rename Scanning Wallet to bitcoin-scanning-wallet
Suggested scenario:
1- the PC sends a message with a [address signature message] inputs:
skycoin-cli deviceCheckMessageSignature --address=zC8GAQGABfwk7vtTxVoRG7iMperHNuyYPs --message="Hello World!" --signature=GTL6dapi5RLnvsYUQvW9khdn6jhNAF87Jdjm4mYHE9nLhYLtsY8QX6YV5avi9ZjVtycjc7Dw8ExZB6K6cBmTNR6TS
2- the device computes the address that issued the given signature for the given message and sends it back to the PC:
address that issued the signature is: #2EU3JbveHdkxW6z5tdhbbB2kRAWvXC2pLzw
3- the device's screen displays "Signature success" if the address matches the given address "Wrong signature" otherwise
4- the PC has to check the address matching on his side as well
Using this endpoint: https://explorer.skycoin.net/api/pendingTxs
If an unconfirmed txn is in the array for more than 1 minute, send an alert
This service can be run in a cron job
The API response is documented here:
https://github.com/skycoin/skycoin/blob/develop/src/api/README.md#get-unconfirmed-transactions
The txid field can be used to identify the transaction.
failed get organisation. err: Get https://api.github.com/orgs/skycoin/repos: could not refresh installation id 0's token: received non 2xx response status "404 Not Found" when fetching https://api.github.com/installations/0/access_tokens
Add the possibility to use a passpharse protection on top of pin code protection.
the passphrase may be used later to encrypt wallet's memory
Document how to use it
Create a new tool address-parser
,
given a list of addresses from a file, or a single address on the command line
Use
https://github.com/openvenues/gopostal
to parse each address
1> Create a folder called load-testing
put documentation in .md in the folder
You will create a command line utility that
Print on the command line each event, status, etc
Also,
2> Use the cipher library to generate skycoin addresses from seed
https://godoc.org/github.com/skycoin/skycoin/src/cipher
func GenerateDeterministicKeyPairs(seed []byte, n int) []SecKey
^ generate addresses from seed, input string
type Address
func AddressFromSecKey(secKey SecKey) Address
^ generate a skycoin address from a seed
3> Create a command line utility that connects to a skycoin node
4>
3>
Also add a command line parameter "-cleanup" that generates n addresses from seed and does a transaction to send all of the coins in any of the N addresses, to the first address generated by the seed.
Later enhancements (TBD)
1> Create a folder transaction-policy-testing
2> Create a command line script, see
runs on command line
takes in a -seed="wallet seed" parameter-
connects to a running skycoin node (locally)
-- see github.com/skycoin/skycoin for instructions to run
generates first skycoin address generated by the wallet seed and prints it
checks that there are coins in the first address generated from the wallet seed
prints the balance and unspent outputs for the wallet address
3>
The command line utility will
We will try different "policies" and then record how long and how many blocks, that ten sequential transactions takes
We are testing different "transaction policies" or implementations of the Skycoin send function.
The transactions we are testing will be constructed with different policies, based upon the "policy" chosen on the command line
The transaction struct is in github.com/skycoin/skycoin /src/coin
There are examples of send function being used in the skycoin repo under /src/cli under send function
4> Write a blog post in github.com/skycoin/skycoin.net, documenting the process of
Look at this file as an example
https://github.com/SolarBankers/SunCoin/blob/master/cmd/suncoin/suncoin.go
Create a new folder called create-coin (or find a better name)
Create a script in a subfolder that outputs a new coin (genesis block, masternode, etc) and outputs all the parameters as json or to a json file
Create a second script in a sub-folder that launches a node for the coin by taking in the json parameters
WARNING: Make sure the default port number for the test net coins is different than the port number for Skycoin
1> Create a folder create-coin
2> Create a script that outputs a json configuration for a new coin
The script should print two JSON sections on the command line
There should be an option to save the information to a file on disc (optional)
3> Create a script that takes in the json configuration (from the command line or from a file on disc) and runs a node for that coin
4> Use the script to create a testnet coin, then run one master node and four node instances (possible in separate docker containers) and run the transaction testing script to verify that the testnet coin works
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.