Giter Site home page Giter Site logo

services's Introduction

The load-testing folder has been move to gitlab in https://gitlab.com/skycoin-dev/skycoin-transaction-testing.

The deploy-coin folder has been move to gitlab in https://gitlab.com/skycoin-dev/skycoin-create-new-blockchain.

The address-parser folder has been move to utilities repo in https://github.com/skycoin/utilities/tree/master/address-parser

The github-metrics folder has been move to utilities repo in https://github.com/skycoin/utilities/tree/master/github-metrics

The pending-transactions-monitor folder has been move to utilities repo in https://github.com/skycoin/utilities/tree/master/pending-transactions-monitor

services's People

Contributors

alexey-belous avatar alexsugak avatar briancaine avatar gz-c avatar id523a avatar ivcosla avatar karlmcguire avatar limace11 avatar mihis avatar mikeling avatar mpsido avatar nutmix avatar skudryashov avatar skycoin-karl avatar skycoin-manager avatar stgleb avatar vavilen avatar zsm5j avatar

Stargazers

 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

services's Issues

[Hardware-wallet]: Check signature: how should it work ?

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

Add pending transactions list to coin api

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
			}
		]
	}
}

add readme.md to scanner?

Would it be useful to add a README.MD to scanner with:

  1. any dependencies or prerequisites need to be installed/setup
  2. how to use/test/run?

New Project: Transaction Policy Test

1> Create a folder transaction-policy-testing

2> Create a command line script, see

  • #6

  • 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

  • create a transaction
  • inject the transaction into the network
  • record how many blocks the transaction took
  • record the physical time (log in seconds) between transactions and how long 10 transactions took

We will try different "policies" and then record how long and how many blocks, that ten sequential transactions takes

  • we record the head block (skycoin json API) when we start and print out the block number
  • we create a transaction that spends all of the coins in our wallet address (Generated from the seed value), sending the coins back to the wallet address (we send from address A, to address B)
  • we track the transaction status and wait until the transaction is finished
  • then we get the new balance and repeat, again with another transaction
  • if there are insufficient coinhours to do a transaction, the creation of the transaction may fail and we may have to wait 1 second, then try again and keep trying until it succeeds

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

  • Default Policy. a transaction type that uses the default send method/coin for constructing the transaction (see github.com/skycoin/skycoin /src/gui/ and look for send and the wallet functions, which are in visor
  • a transaction using a send function that sends 0 coinhours to each output (transaction outputs created by transaction). Just set coinhours out to 0 for each transaction output in the transaction
  • a send function that sets the coin hours in each output to 1
  • a send function that sets the coin hours in each output to 2

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

  • programmatically generating a skycoin address
  • checking the balance of a skycoin address
  • creating a skycoin address from a seed
  • creating a transaction
  • checking the status of a transaction

New Project: Load Testing CLI utility

1> Create a folder called load-testing

put documentation in .md in the folder

You will create a command line utility that

  • runs on command line
  • takes in skycoin "seed" on command line to generate skycoin addresses
  • takes in a parameter n for number of addresses to generate from the seed
  • sends coins randomly between addresses in the list of generated address (creates transactions, injects transactions, tracks the status of the transactions, then repeats)
  • has a parameter to configure for time between transactions in seconds

Print on the command line each event, status, etc

Also,

  • make a blog post on github.com/skycoin/skycoin.net or github.com/skycoin/docs
  • document
    -- how to generate skycoin addresses from a seed
    -- how to check skycoin balances programmatic ally
    -- how to sign a transaction
    -- how to check the status of a transaction

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

  • see github.com/skycoin/skycoin/cmd/skycoin for CLI library usage, format
  • see the skycoin CLI in gitbub.com/skycoin /cmd/cli for example of how to get unspent outputs/balance for an address, how to create a transaction and how to track the status of a transaction

4>

  • look at the list of addresses generated
  • find which addresses have balances (unspent outputs)
  • create random transaction sending from an address to 2 other addresses in the list (splitting the coins) (split)
  • also have random transactions that take coins from two addresses and send them to a randomly chosen address (merge)
  • inject the transaction
  • track the status of the transaction and wait for transaction to be completed to create another transaction (in loop, infinitely)
  • have parameter or timer between each transaction (when transaction is attempted and when we attempt to create the next transaction)

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.

coin-api dependencies

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.

json OTC front end bug

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.

New Project: Hardware Wallet

https://godoc.org/github.com/skycoin/skycoin/src/cipher

  • Create a new folder called hardware-wallet for the project files
  • Use the trezor cryptography implementation
  • Create a readme.md explaining installation and how to run

Port the following functions

  • func GenerateDeterministicKeyPairs(seed []byte, n int) []SecKey
  • func ECDH(pub PubKey, sec SecKey) []byte
  • PubKey, PubKeyFromSecKey(seckey SecKey) PubKey
  • AddressFromPubKey(pubKey PubKey) Address
  • func VerifySignature(pubkey PubKey, sig Sig, hash SHA256) error
  • func ChkSig(address Address, hash SHA256, sig Sig) error

There must be tests

  • take list of 10 values /seeds and the private keys they should generate. Verify that the golang and trezor outputs the same values for the 10 inputs. Automated testing.
  • do the same for SHA256
  • do the same for ECDH

Then do test scripts that generate an input/output pair in golang at random and tests what the hardware outputs for the input pair.

  • log all outputs that differ to an error file (including the function tested, the input and the output and what it should be)

Create multiple implementations of the wallet interface

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:

  • generate an address (from seed)
  • check balance (get unspent outputs for an address)
  • get all pending transactions concerning an address or list of addresses (deposits, later deposits and withdrawals)
  • check status of transaction by transaction id
    and wallet API, exposes an HTTP, JSON interface, that can be used by other applications

Issue:
For bitcoin create multiple implementations of the interface
so we have a list of

  • coins, implementations
    and can instantiate an instance of the interface/implementation for a specific coin
    then access the instantiated interfaces through an http json api or via CLI

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)

New Project: Scripts for Creating/Starting up a New Testnet Coin

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 will output one file with the master node private key, the genesis wallet seed, the secret information (and which includes the non-secret information)
  • the script will output another file or section that includes the public information
    -- the genesis blockhash
    -- the port number for the coin
    -- the currency code for the coin (SKY, BZF, SOC, XYML, etc)
    -- the number of coins created in genesis block
    -- the masternode public key
    -- etc

The script should print two JSON sections on the command line

  • the private/secret section
  • the public section

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

json OTC UI: trim

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.

@AlexSugak

media sentiment system

  1. Scrape phrases/words from twitter, telegram and possibly others in the future
  2. manually editable list of twitter hashtags, telegram groups etc.
  3. Manually editable db of phrases, with templates, e.g. "is shit" is bad, "the shit" is good. Possibly template driven.
  4. Look for resources online to do this (e.g. algorithms, databases of phrases)
  5. Provide per day results per coin.
  6. Provide graphs of trends for given time ranges.
  7. no need to go below 1 hour time resolutions.
  8. for twitter, examples are #BTC, #cyrpto #ETC etc.
  9. for telegram, examples are ICOCountdown.
  10. should be written in go.
  11. private repo
  12. english only

Beautiful soup was mentioned as a parser, but this is geared towards html

New Project: Teller-JSON

teller-json

  • create repo/folder called teller-json
  • put documentation in README.md

The teller-json daemon will expose an HTTP API for:

  • binding a SKY address to a BTC address
  • binding a SKY address to a ETH address
  • (possibly binding SKY to other currencies)
  • checking the status of a bound SKY address

The two buy methods for binding a SKY address are:

  • direct: fixed-price purchase from wallet
    • when a deposit event is received, calculate amount based off fixed-price from wallet
  • passthrough: variable-price purchase through exchange
    • when a deposit event is received, send to external api

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:

  • use JSON storage
  • HTTP API respond with JSON

OTC flow/stages with JSON format

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

Storage

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

CI working for every project inside the repository?

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?.

New Project: Muliti-Coin API

Create a folder called coin-api

This is a command line application.

  • it will launch a web-server on local host and expose a JSON HTTP interface
  • will have two executables, a server and a command line RPC
  • will have a simple minimal web front end or dash board

https://godoc.org/github.com/skycoin/skycoin/src/cip

We will define an interface that implements 5 functions for each coin

  • generate address, private keys, pubkeys from deterministic seed
  • check the balance (and get unspent outputs) for an address
  • sign a transaction
  • inject transaction into network
  • check the status of a transaction (tracks transactions by transaction hash)

For generating addreses, see


For Bitcoin

Only implement

  • generating addresses, private keys, secret keys
  • checking balance

The can come back and focus on

  • creating transactions
  • injecting transactions
  • monitoring the status of transactions later

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

  • Bitcoin will have an implementation that uses https://godoc.org/github.com/skycoin/skycoin/src/cipher for address generation and which gets outputs from blockchain.info
  • Bitcoin will have an interface that uses https://godoc.org/github.com/skycoin/skycoin/src/cip for address generation and which gets outputs and address balances from the bitcoin scanning wallet in the services repo (in this repo)
  • Bitcoin may have another implementation that connects to a BCTD node directly (like the scanning wallet does)
  • Skycoin will have one interface implementation that connects to a Skycoin node over the CLI

There will be a CLI with a command for

  • listing the coins supported by the wallet API
  • listing the coins and implementations supported by the API
  • instantiating an instance of a coin interface (an instance of BTC, scanning wallet) on the multi-coin API server

There will be a JSON HTTP api that includes

  • a ping command (just responds to ping, used for checking server status and returning stats)
  • a url that returns a list of the interfaces (coin and type) instantiated on the multi-coin server instance (and the status of the interface, etc whether it is connected to the server and working).
  • a url for checking the balance of an address for a given coin, against a given interface
  • a url for injecting a transaction for a particular coin and interface (with transactions encoded in hex)
  • a url for checking the status of a transaction
  • a url for checking the validity of a transaction for a given coin and interface (optional, may not be needed)

  • 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

  • we can have one server that supports multiple coins (BTC, SKY, etc) with one server and multiple interface instantiations (one for BTC, one for SKY)
  • OR we can create a server that exposes the coin-api, but which requires the coin/interface type specified at startup and only allows one instantiation

Deploy coin start script cannot restart

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?

Tool to gather github metrics

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/.

Hardware wallet support for 24 word seeds

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.

tool to extract public keys and balances from ethereum.

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:

  1. block number. optional. If not supplied, use all available data. If supplied means up to and including this block.
  2. contract address for given token. Required.
  3. filename. If not supplied, output to stdout.

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:

  1. rather than start at block zero and work up, to save time it would be better to start form the block where the contract was created. This should either be a parameter passed in. The user who is running the script could get the block using etherscan.io, looking for the first transaction, and looking up its block (or is a better way?)
  2. initial balance (totalSupply). Because the tool will look for transactions into and out of accounts, it can keep track of balances. The only account(s) it cant do this for are the contracts initial accounts, which are given a balance in the code itself, not via a transaction. Usually, the entire "totalSupply" is allocated to the account of the contract. In this case, we can either extract the "totalSupply" from the contracts "totalSupply()" function, or simply have it as an optional parameter. Given this total supply, and assuming that it is all allocated to the contract account, we can then calculate the balance of the contract account at the required end block. However, it is perfectly acceptable for now to simply show a negative balance for this one (or possibly more) accounts with initial balances allocated via the code (not transaction).

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.

Json OTC front end.

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

OTC react UI.

  1. The UI will present the user with some instructions, a place to enter his skycoin address, and two buttons, "Get BTC Address" and "Check Status).
  2. When the user clicks on get BTC address, a new page will be displayed which shows the generated BTC address, and a QR code they can scan (and the skycoin address at the top for reference). It will have two buttons, "Check Status" and back/home or similar which takes you back to the first page.
  3. if you enter your skycoin address in step 1, and hit check status, or you hit check status from step 2, you will be shown the details of your transaction, e.g time submitted, status, amount received, amount transferred, rate, transaction ids etc. The issue is that although we dont tell the customer, if they do two transfers into the same BTC address, we will do two skycoin transfers, with different rates etc. Ideally we should show all these transactions, but for MVP, if its too hard, we could consider only showing the first, and assuming noone will do this (if they do, it will work, just wont show in the status)
  4. It should check that the teller api server is running, and show "OTC is currently closed".
  5. It should check if the teller api server is "paused" and show "OTC is temporarily not accepting any new transfers, please try again later"
  6. MVP is desktop, but ideally should work on mobile also. Mobile would be more of a simple wizard. Feel free to design the desktop flow to also work with mobile.
  7. The UI header/footer should just be a copy of the current site, with the OTC UI in the middle.

Admin UI.

  1. if Karl can implement a user/pass configured in a json config file on the sever, then the system will need to show a user/pass login and store the session token etc.
  2. Karl, on the server, it should log every login and login attempt, as well as any config change, in an admin audit file.
  3. If Karl doesn't implement login in time, then the admin api should just be open for all (but on the private production network)
  4. The admin UI will have a configuration section (MVP), and a statistics section (P2).
  5. Configuration UI items (button, switch or check box):
    1. pause and resume (pauses processing any transactions, wont accept any new purchases) (MVP)
    2. change manual sky/btc rate (P2, but MVP if possible)
    3. "use static price" vs "use exchange price" (P2?)
    4. enable/disable "dont wait for confirmation for small amounts"
    5. box for entering the "dont confirm if less than" value, currently 0.5 BTC. this value should be saved in the servers startup config file (P2)
    6. Pause a specific transaction (enter btc address or transaction id?) (P2)

OLD OTC UI (header and footer removed)

00_first_page

01_issued_btc_addr

02_btc_status_waiting

change paths to github.com/skycoin/xxx in scanner.

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"

json otc transaction reports.

  1. create A "Transactions" tab on admin panel.
  2. show a filter at the top with "all", "pending", "completed". all is the default.
  3. List the transactions, one per line, with relevant info in columns, including:
    1. time created,
    2. time deposited,
    3. time sky sent,
    4. status,
    5. amount,
    6. rate
    7. sky address
    8. BTC address.
    9. anything else worth showing.
  4. create the corresponding API call with option to specify, all, completed, pending etc.
  5. Note: pending = not completed, so should show any which have error status, manually stopped status, and any other status we add which is not "completed".

Later enhancements (TBD)

  1. paging
  2. date ranges
  3. search by sky address
  4. search by btc address
  5. download results as CSV.
  6. possibly showing less info, so looks ok on mobile, with a link to open a popup with more details.

Exchange API: deprecate redis dependency

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.

exchange api tester app

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).

  1. check how api works
  2. do a wire frame with the fields required and let me know what it looks like so we can discuss.
  3. after discussion, implement.
  4. setup travis auto-deploy script to our test server.

[Hardware-wallet]: flash memory lock

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

[Hardware-wallet] Device flash memory locked

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

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.