mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 02:12:23 +00:00
Merge branch 'dockerShyftBlockApi' into shyftDockerize
* dockerShyftBlockApi: (28 commits) Working Docker Containers reformat code refactored code to minimize lines resolving conflicts need to pop stash tmp code refactor cleaned up code and removed msg type respond back to client with sig fix var names receiving messages from wallet correctly add in additional message sent over tcp add intArrToByteArr function for testing change test keys and test message log out hash of message as hex more work send message back to client rm printlns rm Printlns rm comments and printlns ...
This commit is contained in:
commit
f29117c193
16 changed files with 1524 additions and 971 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
|
@ -55,3 +55,6 @@ shyft-cli/web3/transfer-through-master/build
|
||||||
|
|
||||||
# Remove pg data
|
# Remove pg data
|
||||||
pg-data/*
|
pg-data/*
|
||||||
|
|
||||||
|
# Ignore shyftBlockExplorerApi vendored dependencies used for docker build
|
||||||
|
shyftBlockExplorerApi/vendor/**/.git
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,17 @@
|
||||||
FROM golang:1.10.3-alpine
|
FROM golang:1.10.3-alpine
|
||||||
|
|
||||||
|
RUN apk add --update git make gcc musl-dev linux-headers ca-certificates
|
||||||
|
|
||||||
COPY ./shyftBlockExplorerApi /go/src/github.com/ShyftNetwork/go-empyrean/shyftBlockExplorerApi
|
COPY ./shyftBlockExplorerApi /go/src/github.com/ShyftNetwork/go-empyrean/shyftBlockExplorerApi
|
||||||
# COPY ./vendor /go/src/github.com/ShyftNetwork/go-empyrean/vendor
|
COPY ./wait-for.sh /
|
||||||
COPY ./core /go/src/github.com/ShyftNetwork/go-empyrean/core
|
RUN cat /go/src/github.com/ShyftNetwork/go-empyrean/shyftBlockExplorerApi/vendor/vendor.json
|
||||||
# COPY ./common /go/src/github.com/ShyftNetwork/go-empyrean/common
|
|
||||||
COPY .git /go/src/github.com/ShyftNetwork/go-empyrean/.git
|
|
||||||
|
|
||||||
|
|
||||||
WORKDIR /go/src/github.com/ShyftNetwork/go-empyrean/shyftBlockExplorerApi
|
WORKDIR /go/src/github.com/ShyftNetwork/go-empyrean/shyftBlockExplorerApi
|
||||||
|
|
||||||
RUN apk add --update git make gcc musl-dev linux-headers ca-certificates
|
RUN echo `pwd && ls -a`
|
||||||
RUN go get ./
|
RUN go get -u github.com/kardianos/govendor
|
||||||
|
RUN govendor sync
|
||||||
RUN go build
|
RUN cat /go/src/github.com/ShyftNetwork/go-empyrean/shyftBlockExplorerApi/vendor/vendor.json
|
||||||
|
RUN echo `ls -l /go/src/github.com/ShyftNetwork/go-empyrean/shyftBlockExplorerApi/vendor`
|
||||||
CMD go get github.com/pilu/fresh && fresh
|
CMD go run -v *.go
|
||||||
|
|
||||||
EXPOSE 8080
|
EXPOSE 8080
|
||||||
|
|
|
||||||
57
containers/docker/develop-alpine/shyftApi/wait-for.sh
Executable file
57
containers/docker/develop-alpine/shyftApi/wait-for.sh
Executable file
|
|
@ -0,0 +1,57 @@
|
||||||
|
#!/bin/sh
|
||||||
|
# https://github.com/eficode/wait-for.git
|
||||||
|
log() {
|
||||||
|
echo "[wait-for] [`date +'%Y%m%d%H%M%S'`] $@"
|
||||||
|
}
|
||||||
|
|
||||||
|
usage() {
|
||||||
|
echo "Usage: `basename "$0"` [--timeout=15] <HOST>:<PORT> [<HOST_2>:<PORT_2>]"
|
||||||
|
}
|
||||||
|
|
||||||
|
unknown_arg() {
|
||||||
|
log "[ERROR] unknown argument: '$@'"
|
||||||
|
usage
|
||||||
|
exit 2
|
||||||
|
}
|
||||||
|
|
||||||
|
wait_for() {
|
||||||
|
timeout=$1 && host=$2 && port=$3
|
||||||
|
log "wait '$host':'$port' up to '$timeout'"
|
||||||
|
for i in `seq $timeout` ; do
|
||||||
|
if nc -z "$host" "$port" > /dev/null 2>&1 ; then
|
||||||
|
log "wait finish '$host:$port' [`expr $(date +%s) - $START`] seconds"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
log "wait attempt '${host}:${port}' [$i]"
|
||||||
|
sleep 1
|
||||||
|
done
|
||||||
|
log "[ERROR] wait timeout of '$timeout' on '$host:$port'"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
trap 'kill $(jobs -p) &>/dev/null' EXIT
|
||||||
|
|
||||||
|
START=$(date +%s)
|
||||||
|
timeout=15
|
||||||
|
pids=""
|
||||||
|
for i in $@ ; do
|
||||||
|
case $i in
|
||||||
|
--timeout=*) timeout="${i#*=}" ;;
|
||||||
|
-t=*) timeout="${i#*=}" ;;
|
||||||
|
*:* )
|
||||||
|
wait_for "$timeout" "${i%%:*}" "${i##*:}" &
|
||||||
|
pids="$pids $!"
|
||||||
|
;;
|
||||||
|
*) unknown_arg "$i" ;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
status=0
|
||||||
|
for pid in $pids; do
|
||||||
|
if ! wait $pid ; then
|
||||||
|
status=1
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
log "wait done with status=$status"
|
||||||
|
exit $status
|
||||||
21
containers/docker/develop-alpine/shyftUi/Dockerfile
Normal file
21
containers/docker/develop-alpine/shyftUi/Dockerfile
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
FROM node:8.11.3-alpine
|
||||||
|
|
||||||
|
# set working directory
|
||||||
|
RUN echo `cd usr && ls -a`
|
||||||
|
RUN mkdir -p usr/src/shyftBlockExplorerUI
|
||||||
|
WORKDIR /usr/src/shyftBlockExplorerUI
|
||||||
|
|
||||||
|
# add `/usr/src/app/node_modules/.bin` to $PATH
|
||||||
|
ENV PATH /usr/src/shyftBlockExplorerUI/node_modules/.bin:$PATH
|
||||||
|
|
||||||
|
# install and cache app dependencies
|
||||||
|
COPY ./shyftBlockExplorerUI /usr/src/shyftBlockExplorerUI
|
||||||
|
RUN npm install
|
||||||
|
# RUN npm add react-scripts@1.1.1 -g --silent
|
||||||
|
|
||||||
|
# start app
|
||||||
|
|
||||||
|
EXPOSE 3000
|
||||||
|
|
||||||
|
CMD ["npm", "start"]
|
||||||
|
|
||||||
|
|
@ -25,10 +25,7 @@ import (
|
||||||
"math/big"
|
"math/big"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"database/sql"
|
_ "github.com/lib/pq"
|
||||||
"strconv"
|
|
||||||
"time"
|
|
||||||
|
|
||||||
"github.com/ShyftNetwork/go-empyrean/common"
|
"github.com/ShyftNetwork/go-empyrean/common"
|
||||||
"github.com/ShyftNetwork/go-empyrean/common/hexutil"
|
"github.com/ShyftNetwork/go-empyrean/common/hexutil"
|
||||||
"github.com/ShyftNetwork/go-empyrean/common/math"
|
"github.com/ShyftNetwork/go-empyrean/common/math"
|
||||||
|
|
@ -38,7 +35,9 @@ import (
|
||||||
"github.com/ShyftNetwork/go-empyrean/log"
|
"github.com/ShyftNetwork/go-empyrean/log"
|
||||||
"github.com/ShyftNetwork/go-empyrean/params"
|
"github.com/ShyftNetwork/go-empyrean/params"
|
||||||
"github.com/ShyftNetwork/go-empyrean/rlp"
|
"github.com/ShyftNetwork/go-empyrean/rlp"
|
||||||
_ "github.com/lib/pq"
|
"database/sql"
|
||||||
|
"strconv"
|
||||||
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
//go:generate gencodec -type Genesis -field-override genesisSpecMarshaling -out gen_genesis.go
|
//go:generate gencodec -type Genesis -field-override genesisSpecMarshaling -out gen_genesis.go
|
||||||
|
|
@ -164,7 +163,7 @@ func WriteShyftGen(gen *Genesis, block *types.Block) {
|
||||||
isContract := false
|
isContract := false
|
||||||
data:= ""
|
data:= ""
|
||||||
addr := k.String()
|
addr := k.String()
|
||||||
txCountAccount := v.Nonce + 1
|
accountNonce := v.Nonce +1
|
||||||
i, err := strconv.ParseInt(block.Time().String(), 10, 64)
|
i, err := strconv.ParseInt(block.Time().String(), 10, 64)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
|
|
@ -174,24 +173,22 @@ func WriteShyftGen(gen *Genesis, block *types.Block) {
|
||||||
GENESIS := "GENESIS"
|
GENESIS := "GENESIS"
|
||||||
txHash := strings.Join(Genesis, addr)
|
txHash := strings.Join(Genesis, addr)
|
||||||
|
|
||||||
sqlStatement := `INSERT INTO accounts(addr, balance, txCountAccount) VALUES(($1), ($2), ($3)) RETURNING addr`
|
sqlStatement := `INSERT INTO accounts(addr, balance, accountnonce) VALUES(($1), ($2), ($3)) RETURNING addr`
|
||||||
insertErr := sqldb.QueryRow(sqlStatement, addr, v.Balance.String(), txCountAccount).Scan(&addr)
|
insertErr := sqldb.QueryRow(sqlStatement, addr, v.Balance.String(), accountNonce).Scan(&addr)
|
||||||
if insertErr != nil {
|
if insertErr != nil {
|
||||||
panic(insertErr)
|
panic(insertErr)
|
||||||
}
|
}
|
||||||
|
|
||||||
var retNonce string
|
var retNonce string
|
||||||
sqlGenTxStatement := `INSERT INTO txs(txhash, from_addr, to_addr, blockhash, blockNumber, amount,gasPrice, gas, gasLimit,txFee,nonce,txstatus, iscontract,age, data) VALUES(($1), ($2), ($3), ($4), ($5), ($6), ($7), ($8), ($9), ($10), ($11), ($12), ($13), ($14), ($15)) RETURNING nonce`
|
sqlGenTxStatement := `INSERT INTO txs(txhash, from_addr, to_addr, blockhash, blockNumber, amount,gasPrice, gas, gasLimit,txFee,nonce,txstatus, iscontract,age, data) VALUES(($1), ($2), ($3), ($4), ($5), ($6), ($7), ($8), ($9), ($10), ($11), ($12), ($13), ($14), ($15)) RETURNING nonce`
|
||||||
insertError := sqldb.QueryRow(sqlGenTxStatement, txHash, GENESIS, addr, block.Header().Hash().Hex(), number, v.Balance.String(), gasPrice, gasUsed, gasLimit, txFee, txCountAccount, txStatus, isContract, age, data).Scan(&retNonce)
|
insertError := sqldb.QueryRow(sqlGenTxStatement, txHash, GENESIS, addr, block.Header().Hash().Hex(), number, v.Balance.String(), gasPrice, gasUsed, gasLimit, txFee,accountNonce,txStatus, isContract, age, data).Scan(&retNonce)
|
||||||
if insertError != nil {
|
if insertError != nil {
|
||||||
panic(insertError)
|
panic(insertError)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
log.Info("Found Genesis Block")
|
log.Info("Found Genesis Block")
|
||||||
}
|
}}}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func WriteShyftBlockZero(block *types.Block, gen *Genesis) error {
|
func WriteShyftBlockZero(block *types.Block, gen *Genesis) error {
|
||||||
|
|
||||||
|
|
@ -232,7 +229,6 @@ func WriteShyftBlockZero(block *types.Block, gen *Genesis) error {
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetupGenesisBlock writes or updates the genesis block in db.
|
// SetupGenesisBlock writes or updates the genesis block in db.
|
||||||
// The block that will be used is:
|
// The block that will be used is:
|
||||||
//
|
//
|
||||||
|
|
@ -319,7 +315,6 @@ func (g *Genesis) configOrDefault(ghash common.Hash) *params.ChainConfig {
|
||||||
return params.AllEthashProtocolChanges
|
return params.AllEthashProtocolChanges
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ToBlock creates the genesis block and writes state of a genesis specification
|
// ToBlock creates the genesis block and writes state of a genesis specification
|
||||||
// to the given database (or discards it if nil).
|
// to the given database (or discards it if nil).
|
||||||
func (g *Genesis) ToBlock(db ethdb.Database) *types.Block {
|
func (g *Genesis) ToBlock(db ethdb.Database) *types.Block {
|
||||||
|
|
@ -444,7 +439,6 @@ func DefaultRinkebyGenesisBlock() *Genesis {
|
||||||
Alloc: decodePrealloc(rinkebyAllocData),
|
Alloc: decodePrealloc(rinkebyAllocData),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// DeveloperGenesisBlock returns the 'geth --dev' genesis block. Note, this must
|
// DeveloperGenesisBlock returns the 'geth --dev' genesis block. Note, this must
|
||||||
// be seeded with the
|
// be seeded with the
|
||||||
func DeveloperGenesisBlock(period uint64, faucet common.Address) *Genesis {
|
func DeveloperGenesisBlock(period uint64, faucet common.Address) *Genesis {
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
386
core/shyft_get_utils.go
Normal file
386
core/shyft_get_utils.go
Normal file
|
|
@ -0,0 +1,386 @@
|
||||||
|
package core
|
||||||
|
|
||||||
|
import (
|
||||||
|
"encoding/json"
|
||||||
|
"database/sql"
|
||||||
|
"fmt"
|
||||||
|
"time"
|
||||||
|
)
|
||||||
|
|
||||||
|
///////////
|
||||||
|
// Getters
|
||||||
|
//////////
|
||||||
|
func SGetAllBlocks(sqldb *sql.DB) string {
|
||||||
|
var arr blockRes
|
||||||
|
var blockArr string
|
||||||
|
rows, err := sqldb.Query(`SELECT * FROM blocks`)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println("err")
|
||||||
|
}
|
||||||
|
defer rows.Close()
|
||||||
|
|
||||||
|
for rows.Next() {
|
||||||
|
var hash, coinbase, age, parentHash, uncleHash, difficulty, size, rewards, num string
|
||||||
|
var gasUsed, gasLimit, nonce uint64
|
||||||
|
var txCount, uncleCount int
|
||||||
|
|
||||||
|
err = rows.Scan(
|
||||||
|
&hash, &coinbase, &gasUsed, &gasLimit, &txCount, &uncleCount, &age, &parentHash, &uncleHash, &difficulty, &size, &nonce, &rewards, &num,)
|
||||||
|
|
||||||
|
arr.Blocks = append(arr.Blocks, SBlock{
|
||||||
|
Hash: hash,
|
||||||
|
Coinbase: coinbase,
|
||||||
|
GasUsed: gasUsed,
|
||||||
|
GasLimit: gasLimit,
|
||||||
|
TxCount: txCount,
|
||||||
|
UncleCount: uncleCount,
|
||||||
|
AgeGet: age,
|
||||||
|
ParentHash: parentHash,
|
||||||
|
UncleHash: uncleHash,
|
||||||
|
Difficulty: difficulty,
|
||||||
|
Size: size,
|
||||||
|
Nonce: nonce,
|
||||||
|
Rewards: rewards,
|
||||||
|
Number: num,
|
||||||
|
})
|
||||||
|
|
||||||
|
blocks, _ := json.Marshal(arr.Blocks)
|
||||||
|
blocksFmt := string(blocks)
|
||||||
|
blockArr = blocksFmt
|
||||||
|
}
|
||||||
|
return blockArr
|
||||||
|
}
|
||||||
|
|
||||||
|
//GetBlock queries to send single block info
|
||||||
|
//TODO provide blockHash arg passed from handler.go
|
||||||
|
func SGetBlock(sqldb *sql.DB, blockNumber string) string {
|
||||||
|
sqlStatement := `SELECT * FROM blocks WHERE number=$1;`
|
||||||
|
row := sqldb.QueryRow(sqlStatement, blockNumber)
|
||||||
|
var hash, coinbase, age, parentHash, uncleHash, difficulty, size, rewards, num string
|
||||||
|
var gasUsed, gasLimit, nonce uint64
|
||||||
|
var txCount, uncleCount int
|
||||||
|
|
||||||
|
row.Scan(
|
||||||
|
&hash, &coinbase, &gasUsed, &gasLimit, &txCount, &uncleCount, &age, &parentHash, &uncleHash, &difficulty, &size, &nonce, &rewards, &num,)
|
||||||
|
|
||||||
|
block := SBlock{
|
||||||
|
Hash: hash,
|
||||||
|
Coinbase: coinbase,
|
||||||
|
GasUsed: gasUsed,
|
||||||
|
GasLimit: gasLimit,
|
||||||
|
TxCount: txCount,
|
||||||
|
UncleCount: uncleCount,
|
||||||
|
AgeGet: age,
|
||||||
|
ParentHash: parentHash,
|
||||||
|
UncleHash: uncleHash,
|
||||||
|
Difficulty: difficulty,
|
||||||
|
Size: size,
|
||||||
|
Nonce: nonce,
|
||||||
|
Rewards: rewards,
|
||||||
|
Number: num,
|
||||||
|
}
|
||||||
|
json, _ := json.Marshal(block)
|
||||||
|
return string(json)
|
||||||
|
}
|
||||||
|
|
||||||
|
func SGetRecentBlock(sqldb *sql.DB) string {
|
||||||
|
sqlStatement := `SELECT * FROM blocks WHERE number=(SELECT MAX(number) FROM blocks);`
|
||||||
|
row := sqldb.QueryRow(sqlStatement)
|
||||||
|
var hash, coinbase, age, parentHash, uncleHash, difficulty, size, rewards, num string
|
||||||
|
var gasUsed, gasLimit, nonce uint64
|
||||||
|
var txCount, uncleCount int
|
||||||
|
|
||||||
|
row.Scan(
|
||||||
|
&hash, &coinbase, &gasUsed, &gasLimit, &txCount, &uncleCount, &age, &parentHash, &uncleHash, &difficulty, &size, &nonce, &rewards, &num,)
|
||||||
|
|
||||||
|
block := SBlock{
|
||||||
|
Hash: hash,
|
||||||
|
Coinbase: coinbase,
|
||||||
|
GasUsed: gasUsed,
|
||||||
|
GasLimit: gasLimit,
|
||||||
|
TxCount: txCount,
|
||||||
|
UncleCount: uncleCount,
|
||||||
|
AgeGet: age,
|
||||||
|
ParentHash: parentHash,
|
||||||
|
UncleHash: uncleHash,
|
||||||
|
Difficulty: difficulty,
|
||||||
|
Size: size,
|
||||||
|
Nonce: nonce,
|
||||||
|
Rewards: rewards,
|
||||||
|
Number: num,
|
||||||
|
}
|
||||||
|
json, _ := json.Marshal(block)
|
||||||
|
return string(json)
|
||||||
|
}
|
||||||
|
|
||||||
|
func SGetAllTransactionsFromBlock(sqldb *sql.DB, blockNumber string) string {
|
||||||
|
var arr txRes
|
||||||
|
var txx string
|
||||||
|
sqlStatement := `SELECT * FROM txs WHERE blocknumber=$1`
|
||||||
|
rows, err := sqldb.Query(sqlStatement, blockNumber)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println("err")
|
||||||
|
}
|
||||||
|
defer rows.Close()
|
||||||
|
for rows.Next() {
|
||||||
|
var txhash, to_addr, from_addr, blockhash, blocknumber, amount, status string
|
||||||
|
var gasprice, gas, gasLimit, txfee, nonce uint64
|
||||||
|
var isContract bool
|
||||||
|
var age time.Time
|
||||||
|
var data []byte
|
||||||
|
|
||||||
|
err = rows.Scan(
|
||||||
|
&txhash, &to_addr, &from_addr, &blockhash, &blocknumber, &amount, &gasprice, &gas, &gasLimit, &txfee, &nonce, &status, &isContract, &age, &data,
|
||||||
|
)
|
||||||
|
|
||||||
|
arr.TxEntry = append(arr.TxEntry, ShyftTxEntryPretty{
|
||||||
|
TxHash: txhash,
|
||||||
|
ToGet: to_addr,
|
||||||
|
From: from_addr,
|
||||||
|
BlockHash: blockhash,
|
||||||
|
BlockNumber: blocknumber,
|
||||||
|
Amount: amount,
|
||||||
|
GasPrice: gasprice,
|
||||||
|
Gas: gas,
|
||||||
|
GasLimit: gasLimit,
|
||||||
|
Cost: txfee,
|
||||||
|
Nonce: nonce,
|
||||||
|
Status: status,
|
||||||
|
IsContract: isContract,
|
||||||
|
Age: age,
|
||||||
|
Data: data,
|
||||||
|
})
|
||||||
|
|
||||||
|
tx, _ := json.Marshal(arr.TxEntry)
|
||||||
|
newtx := string(tx)
|
||||||
|
txx = newtx
|
||||||
|
}
|
||||||
|
return txx
|
||||||
|
}
|
||||||
|
|
||||||
|
func SGetAllBlocksMinedByAddress(sqldb *sql.DB, coinbase string) string {
|
||||||
|
var arr blockRes
|
||||||
|
var blockArr string
|
||||||
|
sqlStatement := `SELECT * FROM blocks WHERE coinbase=$1`
|
||||||
|
rows, err := sqldb.Query(sqlStatement, coinbase)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println("err")
|
||||||
|
}
|
||||||
|
defer rows.Close()
|
||||||
|
|
||||||
|
for rows.Next() {
|
||||||
|
var hash, coinbase, age, parentHash, uncleHash, difficulty, size, rewards, num string
|
||||||
|
var gasUsed, gasLimit, nonce uint64
|
||||||
|
var txCount, uncleCount int
|
||||||
|
|
||||||
|
err = rows.Scan(
|
||||||
|
&hash, &coinbase, &gasUsed, &gasLimit, &txCount, &uncleCount, &age, &parentHash, &uncleHash, &difficulty, &size, &nonce, &rewards, &num,)
|
||||||
|
|
||||||
|
arr.Blocks = append(arr.Blocks, SBlock{
|
||||||
|
Hash: hash,
|
||||||
|
Coinbase: coinbase,
|
||||||
|
GasUsed: gasUsed,
|
||||||
|
GasLimit: gasLimit,
|
||||||
|
TxCount: txCount,
|
||||||
|
UncleCount: uncleCount,
|
||||||
|
AgeGet: age,
|
||||||
|
ParentHash: parentHash,
|
||||||
|
UncleHash: uncleHash,
|
||||||
|
Difficulty: difficulty,
|
||||||
|
Size: size,
|
||||||
|
Nonce: nonce,
|
||||||
|
Rewards: rewards,
|
||||||
|
Number: num,
|
||||||
|
})
|
||||||
|
|
||||||
|
blocks, _ := json.Marshal(arr.Blocks)
|
||||||
|
blocksFmt := string(blocks)
|
||||||
|
blockArr = blocksFmt
|
||||||
|
}
|
||||||
|
return blockArr
|
||||||
|
}
|
||||||
|
|
||||||
|
//GetAllTransactions getter fn for API
|
||||||
|
func SGetAllTransactions(sqldb *sql.DB) string {
|
||||||
|
var arr txRes
|
||||||
|
var txx string
|
||||||
|
rows, err := sqldb.Query(`SELECT * FROM txs`)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println("err")
|
||||||
|
}
|
||||||
|
defer rows.Close()
|
||||||
|
for rows.Next() {
|
||||||
|
var txhash, to_addr, from_addr, blockhash, blocknumber, amount, status string
|
||||||
|
var gasprice, gas, gasLimit, txfee, nonce uint64
|
||||||
|
var isContract bool
|
||||||
|
var age time.Time
|
||||||
|
var data []byte
|
||||||
|
|
||||||
|
err = rows.Scan(
|
||||||
|
&txhash, &to_addr, &from_addr, &blockhash, &blocknumber, &amount, &gasprice, &gas, &gasLimit, &txfee, &nonce, &status, &isContract, &age, &data,
|
||||||
|
)
|
||||||
|
|
||||||
|
arr.TxEntry = append(arr.TxEntry, ShyftTxEntryPretty{
|
||||||
|
TxHash: txhash,
|
||||||
|
ToGet: to_addr,
|
||||||
|
From: from_addr,
|
||||||
|
BlockHash: blockhash,
|
||||||
|
BlockNumber: blocknumber,
|
||||||
|
Amount: amount,
|
||||||
|
GasPrice: gasprice,
|
||||||
|
Gas: gas,
|
||||||
|
GasLimit: gasLimit,
|
||||||
|
Cost: txfee,
|
||||||
|
Nonce: nonce,
|
||||||
|
Status: status,
|
||||||
|
IsContract: isContract,
|
||||||
|
Age: age,
|
||||||
|
Data: data,
|
||||||
|
})
|
||||||
|
|
||||||
|
tx, _ := json.Marshal(arr.TxEntry)
|
||||||
|
newtx := string(tx)
|
||||||
|
txx = newtx
|
||||||
|
}
|
||||||
|
return txx
|
||||||
|
}
|
||||||
|
|
||||||
|
//GetTransaction fn returns single tx
|
||||||
|
func SGetTransaction(sqldb *sql.DB, txHash string) string {
|
||||||
|
sqlStatement := `SELECT * FROM txs WHERE txhash=$1;`
|
||||||
|
row := sqldb.QueryRow(sqlStatement, txHash)
|
||||||
|
var txhash, to_addr, from_addr, blockhash, blocknumber, amount, status string
|
||||||
|
var gasprice, gas, gasLimit, txfee, nonce uint64
|
||||||
|
var isContract bool
|
||||||
|
var age time.Time
|
||||||
|
var data []byte
|
||||||
|
|
||||||
|
row.Scan(
|
||||||
|
&txhash, &to_addr, &from_addr, &blockhash, &blocknumber, &amount, &gasprice, &gas, &gasLimit, &txfee, &nonce, &status, &isContract, &age, &data)
|
||||||
|
|
||||||
|
tx := ShyftTxEntryPretty{
|
||||||
|
TxHash: txhash,
|
||||||
|
ToGet: to_addr,
|
||||||
|
From: from_addr,
|
||||||
|
BlockHash: blockhash,
|
||||||
|
BlockNumber: blocknumber,
|
||||||
|
Amount: amount,
|
||||||
|
GasPrice: gasprice,
|
||||||
|
Gas: gas,
|
||||||
|
GasLimit: gasLimit,
|
||||||
|
Cost: txfee,
|
||||||
|
Nonce: nonce,
|
||||||
|
Status: status,
|
||||||
|
IsContract: isContract,
|
||||||
|
Age: age,
|
||||||
|
Data: data,
|
||||||
|
}
|
||||||
|
json, _ := json.Marshal(tx)
|
||||||
|
|
||||||
|
return string(json)
|
||||||
|
}
|
||||||
|
|
||||||
|
func InnerSGetAccount(sqldb *sql.DB, address string) (SAccounts, bool) {
|
||||||
|
sqlStatement := `SELECT * FROM accounts WHERE addr=$1;`
|
||||||
|
var addr, balance, accountNonce string
|
||||||
|
err := sqldb.QueryRow(sqlStatement, address).Scan(&addr, &balance, &accountNonce)
|
||||||
|
if err == sql.ErrNoRows {
|
||||||
|
return SAccounts{}, false
|
||||||
|
} else {
|
||||||
|
account := SAccounts{
|
||||||
|
Addr: addr,
|
||||||
|
Balance: balance,
|
||||||
|
AccountNonce: accountNonce,
|
||||||
|
}
|
||||||
|
return account, true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//GetAccount returns account balances
|
||||||
|
func SGetAccount(sqldb *sql.DB, address string) string {
|
||||||
|
var account, _ = InnerSGetAccount(sqldb, address)
|
||||||
|
json, _ := json.Marshal(account)
|
||||||
|
return string(json)
|
||||||
|
}
|
||||||
|
|
||||||
|
//GetAllAccounts returns all accounts and balances
|
||||||
|
func SGetAllAccounts(sqldb *sql.DB) string {
|
||||||
|
var array accountRes
|
||||||
|
var accountsArr, accountNonce string
|
||||||
|
|
||||||
|
accs, err := sqldb.Query(`
|
||||||
|
SELECT
|
||||||
|
addr,
|
||||||
|
balance,
|
||||||
|
accountNonce
|
||||||
|
FROM accounts`)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
defer accs.Close()
|
||||||
|
|
||||||
|
for accs.Next() {
|
||||||
|
var addr, balance string
|
||||||
|
err = accs.Scan(
|
||||||
|
&addr, &balance, &accountNonce,
|
||||||
|
)
|
||||||
|
|
||||||
|
array.AllAccounts = append(array.AllAccounts, SAccounts{
|
||||||
|
Addr: addr,
|
||||||
|
Balance: balance,
|
||||||
|
AccountNonce: accountNonce,
|
||||||
|
})
|
||||||
|
|
||||||
|
accounts, _ := json.Marshal(array.AllAccounts)
|
||||||
|
accountsFmt := string(accounts)
|
||||||
|
accountsArr = accountsFmt
|
||||||
|
}
|
||||||
|
return accountsArr
|
||||||
|
}
|
||||||
|
|
||||||
|
//GetAccount returns account balances
|
||||||
|
func SGetAccountTxs(sqldb *sql.DB, address string) string {
|
||||||
|
var arr txRes
|
||||||
|
var txx string
|
||||||
|
sqlStatement := `SELECT * FROM txs WHERE to_addr=$1 OR from_addr=$1;`
|
||||||
|
rows, err := sqldb.Query(sqlStatement, address)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println("err", err)
|
||||||
|
}
|
||||||
|
defer rows.Close()
|
||||||
|
for rows.Next() {
|
||||||
|
var txhash, to_addr, from_addr, blockhash, blocknumber, amount, status string
|
||||||
|
var gasprice, gas, gasLimit, txfee, nonce uint64
|
||||||
|
var isContract bool
|
||||||
|
var age time.Time
|
||||||
|
var data []byte
|
||||||
|
|
||||||
|
err = rows.Scan(
|
||||||
|
&txhash, &to_addr, &from_addr, &blockhash, &blocknumber, &amount, &gasprice, &gas, &gasLimit, &txfee, &nonce, &status, &isContract, &age, &data,
|
||||||
|
)
|
||||||
|
|
||||||
|
arr.TxEntry = append(arr.TxEntry, ShyftTxEntryPretty{
|
||||||
|
TxHash: txhash,
|
||||||
|
ToGet: to_addr,
|
||||||
|
From: from_addr,
|
||||||
|
BlockHash: blockhash,
|
||||||
|
BlockNumber: blocknumber,
|
||||||
|
Amount: amount,
|
||||||
|
GasPrice: gasprice,
|
||||||
|
Gas: gas,
|
||||||
|
GasLimit: gasLimit,
|
||||||
|
Cost: txfee,
|
||||||
|
Nonce: nonce,
|
||||||
|
Status: status,
|
||||||
|
IsContract: isContract,
|
||||||
|
Age: age,
|
||||||
|
Data: data,
|
||||||
|
})
|
||||||
|
|
||||||
|
tx, _ := json.Marshal(arr.TxEntry)
|
||||||
|
newtx := string(tx)
|
||||||
|
txx = newtx
|
||||||
|
}
|
||||||
|
return txx
|
||||||
|
}
|
||||||
|
|
@ -37,13 +37,43 @@ services:
|
||||||
environment:
|
environment:
|
||||||
- POSTGRES_USER=postgres
|
- POSTGRES_USER=postgres
|
||||||
- POSGRES_PASSWORD=docker
|
- POSGRES_PASSWORD=docker
|
||||||
# api:
|
shyft_block_api:
|
||||||
# build:
|
build:
|
||||||
# context: $PWD
|
context: $PWD
|
||||||
# dockerfile: containers/docker/develop-alpine/shyftApi/Dockerfile
|
dockerfile: containers/docker/develop-alpine/shyftApi/Dockerfile
|
||||||
|
# volumes:
|
||||||
|
# - ./shyftBlockExplorerApi:/go/src/github.com/ShyftNetwork/go-empyrean/shyftBlockExplorerApi
|
||||||
|
working_dir: /go/src/github.com/ShyftNetwork/go-empyrean/shyftBlockExplorerApi
|
||||||
|
ports:
|
||||||
|
- "8080:8080"
|
||||||
|
depends_on:
|
||||||
|
- pg
|
||||||
|
networks:
|
||||||
|
- shyftnet
|
||||||
|
command: >
|
||||||
|
sh -c '
|
||||||
|
pwd && ls -a && cd vendor/ && ls -a && cat vendor.json && cd ../ &&
|
||||||
|
/wait-for.sh pg:5432 &&
|
||||||
|
DBENV=docker export DBENV &&
|
||||||
|
go run -v *.go'
|
||||||
|
shyft_block_ui:
|
||||||
|
build:
|
||||||
|
context: $PWD
|
||||||
|
dockerfile: containers/docker/develop-alpine/shyftUi/Dockerfile
|
||||||
|
# volumes:
|
||||||
|
# - ./shyftBlockExplorerApi:/go/src/github.com/ShyftNetwork/go-empyrean/shyftBlockExplorerApi
|
||||||
|
ports:
|
||||||
|
- "3000:3000"
|
||||||
|
depends_on:
|
||||||
|
- shyft_block_api
|
||||||
|
networks:
|
||||||
|
- shyftnet
|
||||||
|
# - shyftui
|
||||||
|
# command: sh -c 'bin/sh'
|
||||||
networks:
|
networks:
|
||||||
shyftnet:
|
shyftnet:
|
||||||
driver: bridge
|
driver: bridge
|
||||||
|
# shyftui:
|
||||||
|
# external: true
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,7 @@ import (
|
||||||
"github.com/ShyftNetwork/go-empyrean/crypto"
|
"github.com/ShyftNetwork/go-empyrean/crypto"
|
||||||
"github.com/ShyftNetwork/go-empyrean/log"
|
"github.com/ShyftNetwork/go-empyrean/log"
|
||||||
"gopkg.in/olebedev/go-duktape.v3"
|
"gopkg.in/olebedev/go-duktape.v3"
|
||||||
|
"strconv"
|
||||||
)
|
)
|
||||||
|
|
||||||
// bigIntegerJS is the minified version of https://github.com/peterolson/BigInteger.js.
|
// bigIntegerJS is the minified version of https://github.com/peterolson/BigInteger.js.
|
||||||
|
|
@ -599,16 +600,19 @@ func (i *Internals) SWriteInteralTxs(hash common.Hash) {
|
||||||
|
|
||||||
gas, _ := hexutil.DecodeUint64(i.Gas)
|
gas, _ := hexutil.DecodeUint64(i.Gas)
|
||||||
gasUsed, _ := hexutil.DecodeUint64(i.GasUsed)
|
gasUsed, _ := hexutil.DecodeUint64(i.GasUsed)
|
||||||
|
value, _ := hexutil.DecodeUint64(i.Value)
|
||||||
|
amount := strconv.FormatUint(value, 10)
|
||||||
|
|
||||||
var returnValue string
|
var returnValue string
|
||||||
sqlStatement := `INSERT INTO internaltxs(type, txhash, from_addr, to_addr, amount, gas, gasUsed, time, input, output) VALUES(($1), ($2), ($3), ($4), ($5), ($6), ($7), ($8), ($9), ($10)) RETURNING txHash`
|
sqlStatement := `INSERT INTO internaltxs(type, txhash, from_addr, to_addr, amount, gas, gasUsed, time, input, output) VALUES(($1), ($2), ($3), ($4), ($5), ($6), ($7), ($8), ($9), ($10)) RETURNING txHash`
|
||||||
qerr := sqldb.QueryRow(sqlStatement, i.Type, hash.Hex(), i.From, i.To, i.Value, gas, gasUsed, i.Time, i.Input, i.Output).Scan(&returnValue)
|
qerr := sqldb.QueryRow(sqlStatement, i.Type, hash.Hex(), i.From, i.To, amount, gas, gasUsed, i.Time, i.Input, i.Output).Scan(&returnValue)
|
||||||
|
|
||||||
if qerr != nil {
|
if qerr != nil {
|
||||||
fmt.Println(qerr)
|
fmt.Println(qerr)
|
||||||
panic(qerr)
|
panic(qerr)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//@NOTE:SHYFT
|
//@NOTE:SHYFT
|
||||||
func (i *Internals) InternalRecursive(hash common.Hash) {
|
func (i *Internals) InternalRecursive(hash common.Hash) {
|
||||||
i.SWriteInteralTxs(hash)
|
i.SWriteInteralTxs(hash)
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ CREATE TABLE IF NOT EXISTS txs (
|
||||||
CREATE TABLE IF NOT EXISTS accounts (
|
CREATE TABLE IF NOT EXISTS accounts (
|
||||||
addr text primary key unique,
|
addr text primary key unique,
|
||||||
balance numeric,
|
balance numeric,
|
||||||
txCountAccount numeric
|
accountNonce numeric
|
||||||
);
|
);
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS contracts (
|
CREATE TABLE IF NOT EXISTS contracts (
|
||||||
|
|
|
||||||
446
shyftBlockExplorerApi/vendor/vendor.json
vendored
Normal file
446
shyftBlockExplorerApi/vendor/vendor.json
vendored
Normal file
|
|
@ -0,0 +1,446 @@
|
||||||
|
{
|
||||||
|
"comment": "",
|
||||||
|
"ignore": "",
|
||||||
|
"package": [{
|
||||||
|
"checksumSHA1": "4N5EW5g7AXUm43jBk2iC9dtTJNc=",
|
||||||
|
"path": "github.com/ShyftNetwork/go-empyrean/common",
|
||||||
|
"revision": "3f6f14bc1240b5fb031115c56e2f657e7a5a7586",
|
||||||
|
"revisionTime": "2018-07-27T20:29:58Z"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"checksumSHA1": "zXqJwcRxrCq7llNjHBCamJc3wRc=",
|
||||||
|
"path": "github.com/ShyftNetwork/go-empyrean/common/bitutil",
|
||||||
|
"revision": "3f6f14bc1240b5fb031115c56e2f657e7a5a7586",
|
||||||
|
"revisionTime": "2018-07-27T20:29:58Z"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"checksumSHA1": "lGEgOyS5fKt1sN626mvUgc/Rlkw=",
|
||||||
|
"path": "github.com/ShyftNetwork/go-empyrean/common/hexutil",
|
||||||
|
"revision": "3f6f14bc1240b5fb031115c56e2f657e7a5a7586",
|
||||||
|
"revisionTime": "2018-07-27T20:29:58Z"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"checksumSHA1": "tnoq+cB8JnXxRjytf/+T5X2gG+4=",
|
||||||
|
"path": "github.com/ShyftNetwork/go-empyrean/common/math",
|
||||||
|
"revision": "3f6f14bc1240b5fb031115c56e2f657e7a5a7586",
|
||||||
|
"revisionTime": "2018-07-27T20:29:58Z"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"checksumSHA1": "zaAV9eypVRaotW+MMizuPxPJfHM=",
|
||||||
|
"path": "github.com/ShyftNetwork/go-empyrean/common/mclock",
|
||||||
|
"revision": "3f6f14bc1240b5fb031115c56e2f657e7a5a7586",
|
||||||
|
"revisionTime": "2018-07-27T20:29:58Z"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"checksumSHA1": "FZSyCzy79paVzTFiw9hwQMmYqYM=",
|
||||||
|
"path": "github.com/ShyftNetwork/go-empyrean/consensus",
|
||||||
|
"revision": "3f6f14bc1240b5fb031115c56e2f657e7a5a7586",
|
||||||
|
"revisionTime": "2018-07-27T20:29:58Z"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"checksumSHA1": "xD0P3MnMhT+jWh+rnKjRzWdEi4c=",
|
||||||
|
"path": "github.com/ShyftNetwork/go-empyrean/consensus/ethash",
|
||||||
|
"revision": "3f6f14bc1240b5fb031115c56e2f657e7a5a7586",
|
||||||
|
"revisionTime": "2018-07-27T20:29:58Z"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"checksumSHA1": "Fdv4KUKWQ+owyPIUlv8c2WLS6B4=",
|
||||||
|
"path": "github.com/ShyftNetwork/go-empyrean/consensus/misc",
|
||||||
|
"revision": "3f6f14bc1240b5fb031115c56e2f657e7a5a7586",
|
||||||
|
"revisionTime": "2018-07-27T20:29:58Z"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"checksumSHA1": "1uXB2lYwFOteR+Hl5E5amZwzHSE=",
|
||||||
|
"path": "github.com/ShyftNetwork/go-empyrean/core",
|
||||||
|
"revision": "3f6f14bc1240b5fb031115c56e2f657e7a5a7586",
|
||||||
|
"revisionTime": "2018-07-27T20:29:58Z"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"checksumSHA1": "TGjPR5QCoD/o+DbWtFXEjp9Ckhg=",
|
||||||
|
"path": "github.com/ShyftNetwork/go-empyrean/core/state",
|
||||||
|
"revision": "3f6f14bc1240b5fb031115c56e2f657e7a5a7586",
|
||||||
|
"revisionTime": "2018-07-27T20:29:58Z"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"checksumSHA1": "CNsnI5I6tS0x2aozqDCPpEoZ3F8=",
|
||||||
|
"path": "github.com/ShyftNetwork/go-empyrean/core/types",
|
||||||
|
"revision": "3f6f14bc1240b5fb031115c56e2f657e7a5a7586",
|
||||||
|
"revisionTime": "2018-07-27T20:29:58Z"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"checksumSHA1": "03odmCBDJMwkqVSOjaigrYVxme0=",
|
||||||
|
"path": "github.com/ShyftNetwork/go-empyrean/core/vm",
|
||||||
|
"revision": "3f6f14bc1240b5fb031115c56e2f657e7a5a7586",
|
||||||
|
"revisionTime": "2018-07-27T20:29:58Z"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"checksumSHA1": "WGQFgwtvKxobrs+NqMWHObTfLCQ=",
|
||||||
|
"path": "github.com/ShyftNetwork/go-empyrean/crypto",
|
||||||
|
"revision": "3f6f14bc1240b5fb031115c56e2f657e7a5a7586",
|
||||||
|
"revisionTime": "2018-07-27T20:29:58Z"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"checksumSHA1": "3glJGNkz78GAuDWdW0Vn4AshJZ8=",
|
||||||
|
"path": "github.com/ShyftNetwork/go-empyrean/crypto/bn256",
|
||||||
|
"revision": "3f6f14bc1240b5fb031115c56e2f657e7a5a7586",
|
||||||
|
"revisionTime": "2018-07-27T20:29:58Z"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"checksumSHA1": "9TyZ57SlZjA+fmnkgglz/U7Sd3Y=",
|
||||||
|
"path": "github.com/ShyftNetwork/go-empyrean/crypto/bn256/cloudflare",
|
||||||
|
"revision": "3f6f14bc1240b5fb031115c56e2f657e7a5a7586",
|
||||||
|
"revisionTime": "2018-07-27T20:29:58Z"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"checksumSHA1": "61j/0pJ1/X6SE2efWJ0tuMKZ+9s=",
|
||||||
|
"path": "github.com/ShyftNetwork/go-empyrean/crypto/bn256/google",
|
||||||
|
"revision": "3f6f14bc1240b5fb031115c56e2f657e7a5a7586",
|
||||||
|
"revisionTime": "2018-07-27T20:29:58Z"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"checksumSHA1": "725RdBLWChjphyDjUNepVLZqQpY=",
|
||||||
|
"path": "github.com/ShyftNetwork/go-empyrean/crypto/secp256k1",
|
||||||
|
"revision": "52062f1538710bce87f5941c19aec85e4df4f7cd",
|
||||||
|
"revisionTime": "2018-06-04T23:27:38Z",
|
||||||
|
"tree": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"checksumSHA1": "2dTDVGdpGjABDVQPjfNa4WrdRyg=",
|
||||||
|
"path": "github.com/ShyftNetwork/go-empyrean/crypto/sha3",
|
||||||
|
"revision": "3f6f14bc1240b5fb031115c56e2f657e7a5a7586",
|
||||||
|
"revisionTime": "2018-07-27T20:29:58Z"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"checksumSHA1": "oG0Io4xO2d+/8U2erCb1Oua2vUg=",
|
||||||
|
"path": "github.com/ShyftNetwork/go-empyrean/ethdb",
|
||||||
|
"revision": "3f6f14bc1240b5fb031115c56e2f657e7a5a7586",
|
||||||
|
"revisionTime": "2018-07-27T20:29:58Z"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"checksumSHA1": "YkJhaBXOOj4NLbql72AcrpXp/Rc=",
|
||||||
|
"path": "github.com/ShyftNetwork/go-empyrean/event",
|
||||||
|
"revision": "3f6f14bc1240b5fb031115c56e2f657e7a5a7586",
|
||||||
|
"revisionTime": "2018-07-27T20:29:58Z"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"checksumSHA1": "z1EsZ0xPHsbrmEP9f548xU5vRe0=",
|
||||||
|
"path": "github.com/ShyftNetwork/go-empyrean/log",
|
||||||
|
"revision": "3f6f14bc1240b5fb031115c56e2f657e7a5a7586",
|
||||||
|
"revisionTime": "2018-07-27T20:29:58Z"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"checksumSHA1": "dnTzAhOC0vm7Bu7OW9exb0UQYn8=",
|
||||||
|
"path": "github.com/ShyftNetwork/go-empyrean/metrics",
|
||||||
|
"revision": "3f6f14bc1240b5fb031115c56e2f657e7a5a7586",
|
||||||
|
"revisionTime": "2018-07-27T20:29:58Z"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"checksumSHA1": "FFMuJsy5DnOlBQ5sMnZd3l0t2Uc=",
|
||||||
|
"path": "github.com/ShyftNetwork/go-empyrean/params",
|
||||||
|
"revision": "3f6f14bc1240b5fb031115c56e2f657e7a5a7586",
|
||||||
|
"revisionTime": "2018-07-27T20:29:58Z"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"checksumSHA1": "gK2qsNNz4fmVYYDVILnifiEkwNA=",
|
||||||
|
"path": "github.com/ShyftNetwork/go-empyrean/rlp",
|
||||||
|
"revision": "3f6f14bc1240b5fb031115c56e2f657e7a5a7586",
|
||||||
|
"revisionTime": "2018-07-27T20:29:58Z"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"checksumSHA1": "GDQ9/DdZ6XC5VvgQhr/lr+o6ZNs=",
|
||||||
|
"path": "github.com/ShyftNetwork/go-empyrean/rpc",
|
||||||
|
"revision": "3f6f14bc1240b5fb031115c56e2f657e7a5a7586",
|
||||||
|
"revisionTime": "2018-07-27T20:29:58Z"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"checksumSHA1": "X+6gj7lAoWmwGhd8kZCr/r13Ljw=",
|
||||||
|
"path": "github.com/ShyftNetwork/go-empyrean/shyfttracerinterface",
|
||||||
|
"revision": "3f6f14bc1240b5fb031115c56e2f657e7a5a7586",
|
||||||
|
"revisionTime": "2018-07-27T20:29:58Z"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"checksumSHA1": "koQc7lsys/zLoQqkAAlf73Q26Z8=",
|
||||||
|
"path": "github.com/ShyftNetwork/go-empyrean/trie",
|
||||||
|
"revision": "3f6f14bc1240b5fb031115c56e2f657e7a5a7586",
|
||||||
|
"revisionTime": "2018-07-27T20:29:58Z"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"checksumSHA1": "USkefO0g1U9mr+8hagv3fpSkrxg=",
|
||||||
|
"origin": "github.com/ShyftNetwork/go-empyrean/vendor/github.com/aristanetworks/goarista/monotime",
|
||||||
|
"path": "github.com/aristanetworks/goarista/monotime",
|
||||||
|
"revision": "3f6f14bc1240b5fb031115c56e2f657e7a5a7586",
|
||||||
|
"revisionTime": "2018-07-27T20:29:58Z"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"checksumSHA1": "gZQ6HheWahvZzIc3phBnOwoWHjE=",
|
||||||
|
"origin": "github.com/ShyftNetwork/go-empyrean/vendor/github.com/btcsuite/btcd/btcec",
|
||||||
|
"path": "github.com/btcsuite/btcd/btcec",
|
||||||
|
"revision": "3f6f14bc1240b5fb031115c56e2f657e7a5a7586",
|
||||||
|
"revisionTime": "2018-07-27T20:29:58Z"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"checksumSHA1": "dvabztWVQX8f6oMLRyv4dLH+TGY=",
|
||||||
|
"origin": "github.com/ShyftNetwork/go-empyrean/vendor/github.com/davecgh/go-spew/spew",
|
||||||
|
"path": "github.com/davecgh/go-spew/spew",
|
||||||
|
"revision": "3f6f14bc1240b5fb031115c56e2f657e7a5a7586",
|
||||||
|
"revisionTime": "2018-07-27T20:29:58Z"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"checksumSHA1": "zYnPsNAVm1/ViwCkN++dX2JQhBo=",
|
||||||
|
"origin": "github.com/ShyftNetwork/go-empyrean/vendor/github.com/edsrzf/mmap-go",
|
||||||
|
"path": "github.com/edsrzf/mmap-go",
|
||||||
|
"revision": "3f6f14bc1240b5fb031115c56e2f657e7a5a7586",
|
||||||
|
"revisionTime": "2018-07-27T20:29:58Z"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"checksumSHA1": "5RhGwFpuOAfwyTpi1lMK9GEjuII=",
|
||||||
|
"path": "github.com/ethereum/go-ethereum/common",
|
||||||
|
"revision": "46d4721519f80074795a0631f5bab875433a1cc6",
|
||||||
|
"revisionTime": "2018-07-31T13:34:54Z"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"checksumSHA1": "gvBs++4H+laBSZFm4ZS2Nw0w9ow=",
|
||||||
|
"path": "github.com/ethereum/go-ethereum/common/hexutil",
|
||||||
|
"revision": "46d4721519f80074795a0631f5bab875433a1cc6",
|
||||||
|
"revisionTime": "2018-07-31T13:34:54Z"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"checksumSHA1": "M7ksSRW0CZUDXCIc81eGogsbzS8=",
|
||||||
|
"path": "github.com/ethereum/go-ethereum/common/math",
|
||||||
|
"revision": "46d4721519f80074795a0631f5bab875433a1cc6",
|
||||||
|
"revisionTime": "2018-07-31T13:34:54Z"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "github.com/ethereum/go-ethereum/crypto/randentropy",
|
||||||
|
"revision": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"checksumSHA1": "8eZvG99UTA4QKxhsn+So9BGASro=",
|
||||||
|
"path": "github.com/ethereum/go-ethereum/crypto/sha3",
|
||||||
|
"revision": "46d4721519f80074795a0631f5bab875433a1cc6",
|
||||||
|
"revisionTime": "2018-07-31T13:34:54Z"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"checksumSHA1": "KZ3QD2QgUS4RcoKiA3mn5pSlJxQ=",
|
||||||
|
"origin": "github.com/ShyftNetwork/go-empyrean/vendor/github.com/go-stack/stack",
|
||||||
|
"path": "github.com/go-stack/stack",
|
||||||
|
"revision": "3f6f14bc1240b5fb031115c56e2f657e7a5a7586",
|
||||||
|
"revisionTime": "2018-07-27T20:29:58Z"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"checksumSHA1": "p/8vSviYF91gFflhrt5vkyksroo=",
|
||||||
|
"origin": "github.com/ShyftNetwork/go-empyrean/vendor/github.com/golang/snappy",
|
||||||
|
"path": "github.com/golang/snappy",
|
||||||
|
"revision": "3f6f14bc1240b5fb031115c56e2f657e7a5a7586",
|
||||||
|
"revisionTime": "2018-07-27T20:29:58Z"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"checksumSHA1": "g/V4qrXjUGG9B+e3hB+4NAYJ5Gs=",
|
||||||
|
"origin": "github.com/ShyftNetwork/go-empyrean/vendor/github.com/gorilla/context",
|
||||||
|
"path": "github.com/gorilla/context",
|
||||||
|
"revision": "3f6f14bc1240b5fb031115c56e2f657e7a5a7586",
|
||||||
|
"revisionTime": "2018-07-27T20:29:58Z"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"checksumSHA1": "XOY0t65siat4bLbC4VCmBA9dE7Y=",
|
||||||
|
"origin": "github.com/ShyftNetwork/go-empyrean/vendor/github.com/gorilla/handlers",
|
||||||
|
"path": "github.com/gorilla/handlers",
|
||||||
|
"revision": "3f6f14bc1240b5fb031115c56e2f657e7a5a7586",
|
||||||
|
"revisionTime": "2018-07-27T20:29:58Z"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"checksumSHA1": "YuYKzn2jczaM6DQcFDmukvAHUX4=",
|
||||||
|
"origin": "github.com/ShyftNetwork/go-empyrean/vendor/github.com/gorilla/mux",
|
||||||
|
"path": "github.com/gorilla/mux",
|
||||||
|
"revision": "3f6f14bc1240b5fb031115c56e2f657e7a5a7586",
|
||||||
|
"revisionTime": "2018-07-27T20:29:58Z"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"checksumSHA1": "d9PxF1XQGLMJZRct2R8qVM/eYlE=",
|
||||||
|
"origin": "github.com/ShyftNetwork/go-empyrean/vendor/github.com/hashicorp/golang-lru",
|
||||||
|
"path": "github.com/hashicorp/golang-lru",
|
||||||
|
"revision": "3f6f14bc1240b5fb031115c56e2f657e7a5a7586",
|
||||||
|
"revisionTime": "2018-07-27T20:29:58Z"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"checksumSHA1": "9hffs0bAIU6CquiRhKQdzjHnKt0=",
|
||||||
|
"origin": "github.com/ShyftNetwork/go-empyrean/vendor/github.com/hashicorp/golang-lru/simplelru",
|
||||||
|
"path": "github.com/hashicorp/golang-lru/simplelru",
|
||||||
|
"revision": "3f6f14bc1240b5fb031115c56e2f657e7a5a7586",
|
||||||
|
"revisionTime": "2018-07-27T20:29:58Z"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"checksumSHA1": "jwoPNwN+mUiYFQPjQa/U3Kli7Ak=",
|
||||||
|
"path": "github.com/kr/pretty",
|
||||||
|
"revision": "73f6ac0b30a98e433b289500d779f50c1a6f0712",
|
||||||
|
"revisionTime": "2018-05-06T08:33:45Z"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"checksumSHA1": "x9dJv+jQhUFN6R6h4fzPjGLvQLg=",
|
||||||
|
"path": "github.com/kr/text",
|
||||||
|
"revision": "e2ffdb16a802fe2bb95e2e35ff34f0e53aeef34f",
|
||||||
|
"revisionTime": "2018-05-06T08:24:08Z"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"checksumSHA1": "F7vsuKOVSMnFSi90odRxfhBEBeA=",
|
||||||
|
"origin": "github.com/ShyftNetwork/go-empyrean/vendor/github.com/lib/pq",
|
||||||
|
"path": "github.com/lib/pq",
|
||||||
|
"revision": "3f6f14bc1240b5fb031115c56e2f657e7a5a7586",
|
||||||
|
"revisionTime": "2018-07-27T20:29:58Z"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"checksumSHA1": "AU3fA8Sm33Vj9PBoRPSeYfxLRuE=",
|
||||||
|
"origin": "github.com/ShyftNetwork/go-empyrean/vendor/github.com/lib/pq/oid",
|
||||||
|
"path": "github.com/lib/pq/oid",
|
||||||
|
"revision": "3f6f14bc1240b5fb031115c56e2f657e7a5a7586",
|
||||||
|
"revisionTime": "2018-07-27T20:29:58Z"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"checksumSHA1": "LjPdvMphElL0GOVNQCsmZMVgWIw=",
|
||||||
|
"origin": "github.com/ShyftNetwork/go-empyrean/vendor/github.com/rs/cors",
|
||||||
|
"path": "github.com/rs/cors",
|
||||||
|
"revision": "3f6f14bc1240b5fb031115c56e2f657e7a5a7586",
|
||||||
|
"revisionTime": "2018-07-27T20:29:58Z"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"checksumSHA1": "hCRfPlNpqv8tvVivLzmXsoUOf1c=",
|
||||||
|
"origin": "github.com/ShyftNetwork/go-empyrean/vendor/github.com/rs/xhandler",
|
||||||
|
"path": "github.com/rs/xhandler",
|
||||||
|
"revision": "3f6f14bc1240b5fb031115c56e2f657e7a5a7586",
|
||||||
|
"revisionTime": "2018-07-27T20:29:58Z"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"checksumSHA1": "3QsnhPTXGytTbW3uDvQLgSo9s9M=",
|
||||||
|
"origin": "github.com/ShyftNetwork/go-empyrean/vendor/github.com/syndtr/goleveldb/leveldb",
|
||||||
|
"path": "github.com/syndtr/goleveldb/leveldb",
|
||||||
|
"revision": "3f6f14bc1240b5fb031115c56e2f657e7a5a7586",
|
||||||
|
"revisionTime": "2018-07-27T20:29:58Z"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"checksumSHA1": "EKIow7XkgNdWvR/982ffIZxKG8Y=",
|
||||||
|
"origin": "github.com/ShyftNetwork/go-empyrean/vendor/github.com/syndtr/goleveldb/leveldb/cache",
|
||||||
|
"path": "github.com/syndtr/goleveldb/leveldb/cache",
|
||||||
|
"revision": "3f6f14bc1240b5fb031115c56e2f657e7a5a7586",
|
||||||
|
"revisionTime": "2018-07-27T20:29:58Z"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"checksumSHA1": "5KPgnvCPlR0ysDAqo6jApzRQ3tw=",
|
||||||
|
"origin": "github.com/ShyftNetwork/go-empyrean/vendor/github.com/syndtr/goleveldb/leveldb/comparer",
|
||||||
|
"path": "github.com/syndtr/goleveldb/leveldb/comparer",
|
||||||
|
"revision": "3f6f14bc1240b5fb031115c56e2f657e7a5a7586",
|
||||||
|
"revisionTime": "2018-07-27T20:29:58Z"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"checksumSHA1": "1DRAxdlWzS4U0xKN/yQ/fdNN7f0=",
|
||||||
|
"origin": "github.com/ShyftNetwork/go-empyrean/vendor/github.com/syndtr/goleveldb/leveldb/errors",
|
||||||
|
"path": "github.com/syndtr/goleveldb/leveldb/errors",
|
||||||
|
"revision": "3f6f14bc1240b5fb031115c56e2f657e7a5a7586",
|
||||||
|
"revisionTime": "2018-07-27T20:29:58Z"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"checksumSHA1": "eqKeD6DS7eNCtxVYZEHHRKkyZrw=",
|
||||||
|
"origin": "github.com/ShyftNetwork/go-empyrean/vendor/github.com/syndtr/goleveldb/leveldb/filter",
|
||||||
|
"path": "github.com/syndtr/goleveldb/leveldb/filter",
|
||||||
|
"revision": "3f6f14bc1240b5fb031115c56e2f657e7a5a7586",
|
||||||
|
"revisionTime": "2018-07-27T20:29:58Z"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"checksumSHA1": "weSsccMav4BCerDpSLzh3mMxAYo=",
|
||||||
|
"origin": "github.com/ShyftNetwork/go-empyrean/vendor/github.com/syndtr/goleveldb/leveldb/iterator",
|
||||||
|
"path": "github.com/syndtr/goleveldb/leveldb/iterator",
|
||||||
|
"revision": "3f6f14bc1240b5fb031115c56e2f657e7a5a7586",
|
||||||
|
"revisionTime": "2018-07-27T20:29:58Z"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"checksumSHA1": "gJY7bRpELtO0PJpZXgPQ2BYFJ88=",
|
||||||
|
"origin": "github.com/ShyftNetwork/go-empyrean/vendor/github.com/syndtr/goleveldb/leveldb/journal",
|
||||||
|
"path": "github.com/syndtr/goleveldb/leveldb/journal",
|
||||||
|
"revision": "3f6f14bc1240b5fb031115c56e2f657e7a5a7586",
|
||||||
|
"revisionTime": "2018-07-27T20:29:58Z"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"checksumSHA1": "MtYY1b2234y/MlS+djL8tXVAcQs=",
|
||||||
|
"origin": "github.com/ShyftNetwork/go-empyrean/vendor/github.com/syndtr/goleveldb/leveldb/memdb",
|
||||||
|
"path": "github.com/syndtr/goleveldb/leveldb/memdb",
|
||||||
|
"revision": "3f6f14bc1240b5fb031115c56e2f657e7a5a7586",
|
||||||
|
"revisionTime": "2018-07-27T20:29:58Z"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"checksumSHA1": "UmQeotV+m8/FduKEfLOhjdp18rs=",
|
||||||
|
"origin": "github.com/ShyftNetwork/go-empyrean/vendor/github.com/syndtr/goleveldb/leveldb/opt",
|
||||||
|
"path": "github.com/syndtr/goleveldb/leveldb/opt",
|
||||||
|
"revision": "3f6f14bc1240b5fb031115c56e2f657e7a5a7586",
|
||||||
|
"revisionTime": "2018-07-27T20:29:58Z"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"checksumSHA1": "QCSae2ub87f8awH+PKMpd8ZYOtg=",
|
||||||
|
"origin": "github.com/ShyftNetwork/go-empyrean/vendor/github.com/syndtr/goleveldb/leveldb/storage",
|
||||||
|
"path": "github.com/syndtr/goleveldb/leveldb/storage",
|
||||||
|
"revision": "3f6f14bc1240b5fb031115c56e2f657e7a5a7586",
|
||||||
|
"revisionTime": "2018-07-27T20:29:58Z"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"checksumSHA1": "gWFPMz8OQeul0t54RM66yMTX49g=",
|
||||||
|
"origin": "github.com/ShyftNetwork/go-empyrean/vendor/github.com/syndtr/goleveldb/leveldb/table",
|
||||||
|
"path": "github.com/syndtr/goleveldb/leveldb/table",
|
||||||
|
"revision": "3f6f14bc1240b5fb031115c56e2f657e7a5a7586",
|
||||||
|
"revisionTime": "2018-07-27T20:29:58Z"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"checksumSHA1": "V/Dh7NV0/fy/5jX1KaAjmGcNbzI=",
|
||||||
|
"origin": "github.com/ShyftNetwork/go-empyrean/vendor/github.com/syndtr/goleveldb/leveldb/util",
|
||||||
|
"path": "github.com/syndtr/goleveldb/leveldb/util",
|
||||||
|
"revision": "3f6f14bc1240b5fb031115c56e2f657e7a5a7586",
|
||||||
|
"revisionTime": "2018-07-27T20:29:58Z"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"checksumSHA1": "y/oIaxq2d3WPizRZfVjo8RCRYTU=",
|
||||||
|
"origin": "github.com/ShyftNetwork/go-empyrean/vendor/golang.org/x/crypto/ripemd160",
|
||||||
|
"path": "golang.org/x/crypto/ripemd160",
|
||||||
|
"revision": "3f6f14bc1240b5fb031115c56e2f657e7a5a7586",
|
||||||
|
"revisionTime": "2018-07-27T20:29:58Z"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"checksumSHA1": "Y+HGqEkYM15ir+J93MEaHdyFy0c=",
|
||||||
|
"origin": "github.com/ShyftNetwork/go-empyrean/vendor/golang.org/x/net/context",
|
||||||
|
"path": "golang.org/x/net/context",
|
||||||
|
"revision": "3f6f14bc1240b5fb031115c56e2f657e7a5a7586",
|
||||||
|
"revisionTime": "2018-07-27T20:29:58Z"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"checksumSHA1": "7EZyXN0EmZLgGxZxK01IJua4c8o=",
|
||||||
|
"origin": "github.com/ShyftNetwork/go-empyrean/vendor/golang.org/x/net/websocket",
|
||||||
|
"path": "golang.org/x/net/websocket",
|
||||||
|
"revision": "3f6f14bc1240b5fb031115c56e2f657e7a5a7586",
|
||||||
|
"revisionTime": "2018-07-27T20:29:58Z"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"checksumSHA1": "iyL0/njjAaU0nmQGSgoNVDpdvpU=",
|
||||||
|
"path": "gopkg.in/check.v1",
|
||||||
|
"revision": "788fd78401277ebd861206a03c884797c6ec5541",
|
||||||
|
"revisionTime": "2018-06-28T17:31:08Z"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"checksumSHA1": "NGg7/qIJVUfXi7xnEyyDLocdi6Y=",
|
||||||
|
"origin": "github.com/ShyftNetwork/go-empyrean/vendor/gopkg.in/fatih/set.v0",
|
||||||
|
"path": "gopkg.in/fatih/set.v0",
|
||||||
|
"revision": "3f6f14bc1240b5fb031115c56e2f657e7a5a7586",
|
||||||
|
"revisionTime": "2018-07-27T20:29:58Z"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"checksumSHA1": "DQXNV0EivoHm4q+bkdahYXrjjfE=",
|
||||||
|
"origin": "github.com/ShyftNetwork/go-empyrean/vendor/gopkg.in/karalabe/cookiejar.v2/collections/prque",
|
||||||
|
"path": "gopkg.in/karalabe/cookiejar.v2/collections/prque",
|
||||||
|
"revision": "3f6f14bc1240b5fb031115c56e2f657e7a5a7586",
|
||||||
|
"revisionTime": "2018-07-27T20:29:58Z"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"checksumSHA1": "0xgs8lwcWLUffemlj+SsgKlxvDU=",
|
||||||
|
"origin": "github.com/ShyftNetwork/go-empyrean/vendor/gopkg.in/natefinch/npipe.v2",
|
||||||
|
"path": "gopkg.in/natefinch/npipe.v2",
|
||||||
|
"revision": "3f6f14bc1240b5fb031115c56e2f657e7a5a7586",
|
||||||
|
"revisionTime": "2018-07-27T20:29:58Z"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"rootPath": "github.com/ShyftNetwork/go-empyrean/shyftBlockExplorerApi"
|
||||||
|
}
|
||||||
|
|
@ -349,6 +349,13 @@ aws4@^1.2.1, aws4@^1.6.0:
|
||||||
version "1.7.0"
|
version "1.7.0"
|
||||||
resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.7.0.tgz#d4d0e9b9dbfca77bf08eeb0a8a471550fe39e289"
|
resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.7.0.tgz#d4d0e9b9dbfca77bf08eeb0a8a471550fe39e289"
|
||||||
|
|
||||||
|
axios@^0.18.0:
|
||||||
|
version "0.18.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/axios/-/axios-0.18.0.tgz#32d53e4851efdc0a11993b6cd000789d70c05102"
|
||||||
|
dependencies:
|
||||||
|
follow-redirects "^1.3.0"
|
||||||
|
is-buffer "^1.1.5"
|
||||||
|
|
||||||
axobject-query@^0.1.0:
|
axobject-query@^0.1.0:
|
||||||
version "0.1.0"
|
version "0.1.0"
|
||||||
resolved "https://registry.yarnpkg.com/axobject-query/-/axobject-query-0.1.0.tgz#62f59dbc59c9f9242759ca349960e7a2fe3c36c0"
|
resolved "https://registry.yarnpkg.com/axobject-query/-/axobject-query-0.1.0.tgz#62f59dbc59c9f9242759ca349960e7a2fe3c36c0"
|
||||||
|
|
@ -2792,6 +2799,12 @@ flatten@^1.0.2:
|
||||||
version "1.0.2"
|
version "1.0.2"
|
||||||
resolved "https://registry.yarnpkg.com/flatten/-/flatten-1.0.2.tgz#dae46a9d78fbe25292258cc1e780a41d95c03782"
|
resolved "https://registry.yarnpkg.com/flatten/-/flatten-1.0.2.tgz#dae46a9d78fbe25292258cc1e780a41d95c03782"
|
||||||
|
|
||||||
|
follow-redirects@^1.3.0:
|
||||||
|
version "1.5.2"
|
||||||
|
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.5.2.tgz#5a9d80e0165957e5ef0c1210678fc5c4acb9fb03"
|
||||||
|
dependencies:
|
||||||
|
debug "^3.1.0"
|
||||||
|
|
||||||
for-in@^1.0.1, for-in@^1.0.2:
|
for-in@^1.0.1, for-in@^1.0.2:
|
||||||
version "1.0.2"
|
version "1.0.2"
|
||||||
resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80"
|
resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80"
|
||||||
|
|
@ -3172,6 +3185,16 @@ he@1.1.x:
|
||||||
version "1.1.1"
|
version "1.1.1"
|
||||||
resolved "https://registry.yarnpkg.com/he/-/he-1.1.1.tgz#93410fd21b009735151f8868c2f271f3427e23fd"
|
resolved "https://registry.yarnpkg.com/he/-/he-1.1.1.tgz#93410fd21b009735151f8868c2f271f3427e23fd"
|
||||||
|
|
||||||
|
history@^4.7.2:
|
||||||
|
version "4.7.2"
|
||||||
|
resolved "https://registry.yarnpkg.com/history/-/history-4.7.2.tgz#22b5c7f31633c5b8021c7f4a8a954ac139ee8d5b"
|
||||||
|
dependencies:
|
||||||
|
invariant "^2.2.1"
|
||||||
|
loose-envify "^1.2.0"
|
||||||
|
resolve-pathname "^2.2.0"
|
||||||
|
value-equal "^0.4.0"
|
||||||
|
warning "^3.0.0"
|
||||||
|
|
||||||
hmac-drbg@^1.0.0:
|
hmac-drbg@^1.0.0:
|
||||||
version "1.0.1"
|
version "1.0.1"
|
||||||
resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1"
|
resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1"
|
||||||
|
|
@ -3188,6 +3211,10 @@ hoek@4.x.x:
|
||||||
version "4.2.1"
|
version "4.2.1"
|
||||||
resolved "https://registry.yarnpkg.com/hoek/-/hoek-4.2.1.tgz#9634502aa12c445dd5a7c5734b572bb8738aacbb"
|
resolved "https://registry.yarnpkg.com/hoek/-/hoek-4.2.1.tgz#9634502aa12c445dd5a7c5734b572bb8738aacbb"
|
||||||
|
|
||||||
|
hoist-non-react-statics@^2.5.0:
|
||||||
|
version "2.5.5"
|
||||||
|
resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-2.5.5.tgz#c5903cf409c0dfd908f388e619d86b9c1174cb47"
|
||||||
|
|
||||||
home-or-tmp@^2.0.0:
|
home-or-tmp@^2.0.0:
|
||||||
version "2.0.0"
|
version "2.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/home-or-tmp/-/home-or-tmp-2.0.0.tgz#e36c3f2d2cae7d746a857e38d18d5f32a7882db8"
|
resolved "https://registry.yarnpkg.com/home-or-tmp/-/home-or-tmp-2.0.0.tgz#e36c3f2d2cae7d746a857e38d18d5f32a7882db8"
|
||||||
|
|
@ -3427,7 +3454,7 @@ interpret@^1.0.0:
|
||||||
version "1.1.0"
|
version "1.1.0"
|
||||||
resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.1.0.tgz#7ed1b1410c6a0e0f78cf95d3b8440c63f78b8614"
|
resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.1.0.tgz#7ed1b1410c6a0e0f78cf95d3b8440c63f78b8614"
|
||||||
|
|
||||||
invariant@^2.2.2:
|
invariant@^2.2.1, invariant@^2.2.2, invariant@^2.2.4:
|
||||||
version "2.2.4"
|
version "2.2.4"
|
||||||
resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6"
|
resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6"
|
||||||
dependencies:
|
dependencies:
|
||||||
|
|
@ -4042,6 +4069,10 @@ js-tokens@^3.0.0, js-tokens@^3.0.2:
|
||||||
version "3.0.2"
|
version "3.0.2"
|
||||||
resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b"
|
resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b"
|
||||||
|
|
||||||
|
"js-tokens@^3.0.0 || ^4.0.0":
|
||||||
|
version "4.0.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499"
|
||||||
|
|
||||||
js-yaml@^3.4.3, js-yaml@^3.7.0, js-yaml@^3.9.1:
|
js-yaml@^3.4.3, js-yaml@^3.7.0, js-yaml@^3.9.1:
|
||||||
version "3.11.0"
|
version "3.11.0"
|
||||||
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.11.0.tgz#597c1a8bd57152f26d622ce4117851a51f5ebaef"
|
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.11.0.tgz#597c1a8bd57152f26d622ce4117851a51f5ebaef"
|
||||||
|
|
@ -4323,6 +4354,12 @@ loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.3.1:
|
||||||
dependencies:
|
dependencies:
|
||||||
js-tokens "^3.0.0"
|
js-tokens "^3.0.0"
|
||||||
|
|
||||||
|
loose-envify@^1.2.0:
|
||||||
|
version "1.4.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf"
|
||||||
|
dependencies:
|
||||||
|
js-tokens "^3.0.0 || ^4.0.0"
|
||||||
|
|
||||||
loud-rejection@^1.0.0:
|
loud-rejection@^1.0.0:
|
||||||
version "1.6.0"
|
version "1.6.0"
|
||||||
resolved "https://registry.yarnpkg.com/loud-rejection/-/loud-rejection-1.6.0.tgz#5b46f80147edee578870f086d04821cf998e551f"
|
resolved "https://registry.yarnpkg.com/loud-rejection/-/loud-rejection-1.6.0.tgz#5b46f80147edee578870f086d04821cf998e551f"
|
||||||
|
|
@ -4998,7 +5035,7 @@ path-to-regexp@0.1.7:
|
||||||
version "0.1.7"
|
version "0.1.7"
|
||||||
resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c"
|
resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c"
|
||||||
|
|
||||||
path-to-regexp@^1.0.1:
|
path-to-regexp@^1.0.1, path-to-regexp@^1.7.0:
|
||||||
version "1.7.0"
|
version "1.7.0"
|
||||||
resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-1.7.0.tgz#59fde0f435badacba103a84e9d3bc64e96b9937d"
|
resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-1.7.0.tgz#59fde0f435badacba103a84e9d3bc64e96b9937d"
|
||||||
dependencies:
|
dependencies:
|
||||||
|
|
@ -5432,6 +5469,13 @@ prop-types@^15.5.10, prop-types@^15.6.0:
|
||||||
loose-envify "^1.3.1"
|
loose-envify "^1.3.1"
|
||||||
object-assign "^4.1.1"
|
object-assign "^4.1.1"
|
||||||
|
|
||||||
|
prop-types@^15.6.1:
|
||||||
|
version "15.6.2"
|
||||||
|
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.6.2.tgz#05d5ca77b4453e985d60fc7ff8c859094a497102"
|
||||||
|
dependencies:
|
||||||
|
loose-envify "^1.3.1"
|
||||||
|
object-assign "^4.1.1"
|
||||||
|
|
||||||
proxy-addr@~2.0.3:
|
proxy-addr@~2.0.3:
|
||||||
version "2.0.3"
|
version "2.0.3"
|
||||||
resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.3.tgz#355f262505a621646b3130a728eb647e22055341"
|
resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.3.tgz#355f262505a621646b3130a728eb647e22055341"
|
||||||
|
|
@ -5588,6 +5632,29 @@ react-error-overlay@^4.0.0:
|
||||||
version "4.0.0"
|
version "4.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/react-error-overlay/-/react-error-overlay-4.0.0.tgz#d198408a85b4070937a98667f500c832f86bd5d4"
|
resolved "https://registry.yarnpkg.com/react-error-overlay/-/react-error-overlay-4.0.0.tgz#d198408a85b4070937a98667f500c832f86bd5d4"
|
||||||
|
|
||||||
|
react-router-dom@^4.2.2:
|
||||||
|
version "4.3.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/react-router-dom/-/react-router-dom-4.3.1.tgz#4c2619fc24c4fa87c9fd18f4fb4a43fe63fbd5c6"
|
||||||
|
dependencies:
|
||||||
|
history "^4.7.2"
|
||||||
|
invariant "^2.2.4"
|
||||||
|
loose-envify "^1.3.1"
|
||||||
|
prop-types "^15.6.1"
|
||||||
|
react-router "^4.3.1"
|
||||||
|
warning "^4.0.1"
|
||||||
|
|
||||||
|
react-router@^4.3.1:
|
||||||
|
version "4.3.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/react-router/-/react-router-4.3.1.tgz#aada4aef14c809cb2e686b05cee4742234506c4e"
|
||||||
|
dependencies:
|
||||||
|
history "^4.7.2"
|
||||||
|
hoist-non-react-statics "^2.5.0"
|
||||||
|
invariant "^2.2.4"
|
||||||
|
loose-envify "^1.3.1"
|
||||||
|
path-to-regexp "^1.7.0"
|
||||||
|
prop-types "^15.6.1"
|
||||||
|
warning "^4.0.1"
|
||||||
|
|
||||||
react@^16.3.1:
|
react@^16.3.1:
|
||||||
version "16.3.2"
|
version "16.3.2"
|
||||||
resolved "https://registry.yarnpkg.com/react/-/react-16.3.2.tgz#fdc8420398533a1e58872f59091b272ce2f91ea9"
|
resolved "https://registry.yarnpkg.com/react/-/react-16.3.2.tgz#fdc8420398533a1e58872f59091b272ce2f91ea9"
|
||||||
|
|
@ -5882,6 +5949,10 @@ resolve-from@^3.0.0:
|
||||||
version "3.0.0"
|
version "3.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-3.0.0.tgz#b22c7af7d9d6881bc8b6e653335eebcb0a188748"
|
resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-3.0.0.tgz#b22c7af7d9d6881bc8b6e653335eebcb0a188748"
|
||||||
|
|
||||||
|
resolve-pathname@^2.2.0:
|
||||||
|
version "2.2.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/resolve-pathname/-/resolve-pathname-2.2.0.tgz#7e9ae21ed815fd63ab189adeee64dc831eefa879"
|
||||||
|
|
||||||
resolve-url@^0.2.1:
|
resolve-url@^0.2.1:
|
||||||
version "0.2.1"
|
version "0.2.1"
|
||||||
resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a"
|
resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a"
|
||||||
|
|
@ -6855,6 +6926,10 @@ validate-npm-package-license@^3.0.1:
|
||||||
spdx-correct "^3.0.0"
|
spdx-correct "^3.0.0"
|
||||||
spdx-expression-parse "^3.0.0"
|
spdx-expression-parse "^3.0.0"
|
||||||
|
|
||||||
|
value-equal@^0.4.0:
|
||||||
|
version "0.4.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/value-equal/-/value-equal-0.4.0.tgz#c5bdd2f54ee093c04839d71ce2e4758a6890abc7"
|
||||||
|
|
||||||
vary@~1.1.2:
|
vary@~1.1.2:
|
||||||
version "1.1.2"
|
version "1.1.2"
|
||||||
resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc"
|
resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc"
|
||||||
|
|
@ -6883,6 +6958,18 @@ walker@~1.0.5:
|
||||||
dependencies:
|
dependencies:
|
||||||
makeerror "1.0.x"
|
makeerror "1.0.x"
|
||||||
|
|
||||||
|
warning@^3.0.0:
|
||||||
|
version "3.0.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/warning/-/warning-3.0.0.tgz#32e5377cb572de4ab04753bdf8821c01ed605b7c"
|
||||||
|
dependencies:
|
||||||
|
loose-envify "^1.0.0"
|
||||||
|
|
||||||
|
warning@^4.0.1:
|
||||||
|
version "4.0.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/warning/-/warning-4.0.1.tgz#66ce376b7fbfe8a887c22bdf0e7349d73d397745"
|
||||||
|
dependencies:
|
||||||
|
loose-envify "^1.0.0"
|
||||||
|
|
||||||
watch@~0.10.0:
|
watch@~0.10.0:
|
||||||
version "0.10.0"
|
version "0.10.0"
|
||||||
resolved "https://registry.yarnpkg.com/watch/-/watch-0.10.0.tgz#77798b2da0f9910d595f1ace5b0c2258521f21dc"
|
resolved "https://registry.yarnpkg.com/watch/-/watch-0.10.0.tgz#77798b2da0f9910d595f1ace5b0c2258521f21dc"
|
||||||
|
|
|
||||||
|
|
@ -36,5 +36,5 @@ CREATE TABLE IF NOT EXISTS txs (
|
||||||
CREATE TABLE IF NOT EXISTS accounts (
|
CREATE TABLE IF NOT EXISTS accounts (
|
||||||
addr text primary key unique,
|
addr text primary key unique,
|
||||||
balance numeric,
|
balance numeric,
|
||||||
txCountAccount numeric
|
accountnonce numeric
|
||||||
);
|
);
|
||||||
|
|
@ -263,7 +263,7 @@ t.Run("TestContractCreationTx", func (t *testing.T) {
|
||||||
if tx.Hash().String() != data.TxHash {
|
if tx.Hash().String() != data.TxHash {
|
||||||
t.Fatalf("txHash [%v]: tx Hash not found", tx.Hash().String())
|
t.Fatalf("txHash [%v]: tx Hash not found", tx.Hash().String())
|
||||||
}
|
}
|
||||||
if contractAddressFromReciept != data.To {
|
if contractAddressFromReciept != data.ToGet {
|
||||||
t.Fatalf("Contract Addr [%v]: Contract addr not found", contractAddressFromReciept)
|
t.Fatalf("Contract Addr [%v]: Contract addr not found", contractAddressFromReciept)
|
||||||
}
|
}
|
||||||
if tx.From().String() != data.From {
|
if tx.From().String() != data.From {
|
||||||
|
|
@ -365,7 +365,7 @@ t.Run("TestTransactionsToReturnTransactions", func(t *testing.T) {
|
||||||
if tx.From().String() != data.From {
|
if tx.From().String() != data.From {
|
||||||
t.Fatalf("From Addr [%v]: From addr not found", tx.From().String())
|
t.Fatalf("From Addr [%v]: From addr not found", tx.From().String())
|
||||||
}
|
}
|
||||||
if tx.To().String() != data.To {
|
if tx.To().String() != data.ToGet {
|
||||||
t.Fatalf("To Addr [%v]: To addr not found", tx.To().String())
|
t.Fatalf("To Addr [%v]: To addr not found", tx.To().String())
|
||||||
}
|
}
|
||||||
if tx.Nonce() != data.Nonce {
|
if tx.Nonce() != data.Nonce {
|
||||||
|
|
@ -423,12 +423,29 @@ t.Run("TestAccountsToReturnAccounts",func(t *testing.T) {
|
||||||
key, _ := crypto.HexToECDSA("b71c71a67e1177ad4e901695e1b4b9ee17ae16c6668d313eac2f96dbcda3f291")
|
key, _ := crypto.HexToECDSA("b71c71a67e1177ad4e901695e1b4b9ee17ae16c6668d313eac2f96dbcda3f291")
|
||||||
signer := types.NewEIP155Signer(big.NewInt(2147483647))
|
signer := types.NewEIP155Signer(big.NewInt(2147483647))
|
||||||
|
|
||||||
|
toAddr1 := common.BytesToAddress([]byte{0x11})
|
||||||
|
toAddr2 := common.BytesToAddress([]byte{0x22})
|
||||||
|
toAddr3 := common.BytesToAddress([]byte{0x33})
|
||||||
|
|
||||||
|
toAmount1 := big.NewInt(111)
|
||||||
|
var toAmountPrev1 string = "3968686868"
|
||||||
|
|
||||||
|
sqldb, err := core.DBConnection()
|
||||||
|
if (err != nil) {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
core.CreateAccount(sqldb, toAddr1.Hex(), toAmountPrev1, "1")
|
||||||
|
core.CreateAccount(sqldb, toAddr2.Hex(), "423798729847", "1")
|
||||||
|
core.CreateAccount(sqldb, toAddr3.Hex(), "0", "1")
|
||||||
|
core.CreateAccount(sqldb, "0x71562b71999873DB5b286dF957af199Ec94617F7", "3968686868", "1")
|
||||||
|
|
||||||
//Nonce, To Address,Value, GasLimit, Gasprice, data
|
//Nonce, To Address,Value, GasLimit, Gasprice, data
|
||||||
tx1 := types.NewTransaction(1, common.BytesToAddress([]byte{0x11}), big.NewInt(111), 1111, big.NewInt(11111), []byte{0x11, 0x11, 0x11})
|
tx1 := types.NewTransaction(1, toAddr1, toAmount1, 1111, big.NewInt(11111), []byte{0x11, 0x11, 0x11})
|
||||||
mytx,_ := types.SignTx(tx1, signer, key)
|
mytx,_ := types.SignTx(tx1, signer, key)
|
||||||
tx2 := types.NewTransaction(2, common.BytesToAddress([]byte{0x22}), big.NewInt(222), 2222, big.NewInt(22222), []byte{0x22, 0x22, 0x22})
|
tx2 := types.NewTransaction(2, toAddr2, big.NewInt(222), 2222, big.NewInt(22222), []byte{0x22, 0x22, 0x22})
|
||||||
mytx2,_ := types.SignTx(tx2, signer, key)
|
mytx2,_ := types.SignTx(tx2, signer, key)
|
||||||
tx3 := types.NewTransaction(3, common.BytesToAddress([]byte{0x33}), big.NewInt(333), 3333, big.NewInt(33333), []byte{0x33, 0x33, 0x33})
|
tx3 := types.NewTransaction(3, toAddr3, big.NewInt(333), 3333, big.NewInt(33333), []byte{0x33, 0x33, 0x33})
|
||||||
mytx3,_ := types.SignTx(tx3, signer, key)
|
mytx3,_ := types.SignTx(tx3, signer, key)
|
||||||
txs := []*types.Transaction{mytx, mytx2, mytx3}
|
txs := []*types.Transaction{mytx, mytx2, mytx3}
|
||||||
|
|
||||||
|
|
@ -450,30 +467,42 @@ t.Run("TestAccountsToReturnAccounts",func(t *testing.T) {
|
||||||
t.Fatalf("Failed to write block into database: %v", err)
|
t.Fatalf("Failed to write block into database: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
sqldb, err := core.DBConnection()
|
if toAddr1.String() != tx1.To().String() {
|
||||||
if (err != nil) {
|
t.Fatalf("To address [%v]: To address not found", toAddr1.String())
|
||||||
panic(err)
|
}
|
||||||
|
accountAddrTo, _ := core.InnerSGetAccount(sqldb, toAddr1.String())
|
||||||
|
//ewAccountNonceReceiver.Add(accountR, nonceIncrement)
|
||||||
|
addedAmount := new(big.Int)
|
||||||
|
toAmountPrevious1, _ := strconv.ParseUint(toAmountPrev1, 10, 64)
|
||||||
|
b := new(big.Int).SetUint64(toAmountPrevious1)
|
||||||
|
addedAmount.Add(toAmount1, b)
|
||||||
|
toBalance := new(big.Int)
|
||||||
|
toBalance, _ = toBalance.SetString(accountAddrTo.Balance, 10)
|
||||||
|
|
||||||
|
if toBalance.Cmp(addedAmount) != 0 {
|
||||||
|
t.Fatalf("To address balance [%v]: To address balance not correct FFO", toBalance)
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, tx := range txs {
|
//for _, tx := range txs {
|
||||||
accountAddrTo := core.SGetAccount(sqldb, tx.To().String())
|
// accountAddrTo := core.SGetAccount(sqldb, tx.To().String())
|
||||||
byts := []byte(accountAddrTo)
|
// byts := []byte(accountAddrTo)
|
||||||
var accountDataTo core.SAccounts
|
// var accountDataTo core.SAccounts
|
||||||
json.Unmarshal(byts, &accountDataTo)
|
// json.Unmarshal(byts, &accountDataTo)
|
||||||
|
//
|
||||||
|
// if tx.To().String() != accountDataTo.Addr {
|
||||||
|
// t.Fatalf("To address [%v]: To address not found", accountDataTo.Addr)
|
||||||
|
// }
|
||||||
|
// if tx.Value().String() != accountDataTo.Balance {
|
||||||
|
// t.Fatalf("To address balance [%v]: To address balance not found", accountDataTo.Balance)
|
||||||
|
// }
|
||||||
|
// if strconv.FormatUint(tx.Nonce(), 10) != accountDataTo.AccountNonce {
|
||||||
|
// t.Fatalf("To account nonce [%v]: To account nonce not found", accountDataTo.AccountNonce)
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
|
||||||
if tx.To().String() != accountDataTo.Addr {
|
if getAllAccountTxs := core.SGetAccountTxs(sqldb, toAddr1.String()); len(getAllAccountTxs) == 0 {
|
||||||
t.Fatalf("To address [%v]: To address not found", accountDataTo.Addr)
|
|
||||||
}
|
|
||||||
if tx.Value().String() != accountDataTo.Balance {
|
|
||||||
t.Fatalf("To address balance [%v]: To address balance not found", accountDataTo.Balance)
|
|
||||||
}
|
|
||||||
if strconv.FormatUint(tx.Nonce(), 10) != accountDataTo.TxCountAccount {
|
|
||||||
t.Fatalf("To account nonce [%v]: To account nonce not found", accountDataTo.TxCountAccount)
|
|
||||||
}
|
|
||||||
if getAllAccountTxs := core.SGetAccountTxs(sqldb, tx.To().String()); len(getAllAccountTxs) == 0 {
|
|
||||||
t.Fatalf("GetAccountTxs [%v]: GetAccountTxs did not return correctly", getAllAccountTxs)
|
t.Fatalf("GetAccountTxs [%v]: GetAccountTxs did not return correctly", getAllAccountTxs)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if getAllAccounts := core.SGetAllAccounts(sqldb); len(getAllAccounts) == 0 {
|
if getAllAccounts := core.SGetAllAccounts(sqldb); len(getAllAccounts) == 0 {
|
||||||
t.Fatalf("GetAllAccounts [%v]: GetAllAccounts did not return correctly", getAllAccounts)
|
t.Fatalf("GetAllAccounts [%v]: GetAllAccounts did not return correctly", getAllAccounts)
|
||||||
|
|
|
||||||
140
shyftRingWalletConn/app.go
Normal file
140
shyftRingWalletConn/app.go
Normal file
|
|
@ -0,0 +1,140 @@
|
||||||
|
package main
|
||||||
|
|
||||||
|
//@NOTE SHYFT main func for api, sets up router and spins up a server
|
||||||
|
//to run server 'go run shyftRingWalletConn/*.go'
|
||||||
|
import (
|
||||||
|
"net"
|
||||||
|
"fmt"
|
||||||
|
"os"
|
||||||
|
//"github.com/ethereum/go-ethereum/common"
|
||||||
|
"github.com/ethereum/go-ethereum/crypto"
|
||||||
|
"bytes"
|
||||||
|
"github.com/ethereum/go-ethereum/common/hexutil"
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
CONN_HOST = "localhost"
|
||||||
|
CONN_PORT = "3333"
|
||||||
|
CONN_TYPE = "tcp"
|
||||||
|
)
|
||||||
|
|
||||||
|
var testAddrHex = "14791697260E4c9A71f18484C9f997B308e59325"
|
||||||
|
var testPrivHex = "0123456789012345678901234567890123456789012345678901234567890123"
|
||||||
|
|
||||||
|
// This gives context to the signed message and prevents signing of transactions.
|
||||||
|
func signHash(data []byte) []byte {
|
||||||
|
msg := fmt.Sprintf("\x19Ethereum Signed Message:\n%d%s", len(data), data)
|
||||||
|
return crypto.Keccak256([]byte(msg))
|
||||||
|
}
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
|
||||||
|
l, err := net.Listen(CONN_TYPE, CONN_HOST+":"+CONN_PORT)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println("Error listening:", err.Error())
|
||||||
|
os.Exit(1)
|
||||||
|
}
|
||||||
|
defer l.Close()
|
||||||
|
|
||||||
|
for {
|
||||||
|
// Listen for an incoming connection.
|
||||||
|
conn, err := l.Accept()
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println("Error accepting: ", err.Error())
|
||||||
|
os.Exit(1)
|
||||||
|
}
|
||||||
|
// Handle connections in a new goroutine.
|
||||||
|
go handleRequest(conn)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Handles incoming requests.
|
||||||
|
func handleRequest(conn net.Conn) {
|
||||||
|
// Make a buffer to hold incoming data.
|
||||||
|
// Read the incoming connection into the buffer.
|
||||||
|
|
||||||
|
go func() {
|
||||||
|
buf := make([]byte, 1024)
|
||||||
|
msgBuf := make([]byte, 0)
|
||||||
|
var prevMsg []byte
|
||||||
|
var addressOfClient []byte
|
||||||
|
var signatureFromClient []byte
|
||||||
|
var msgFromClient []byte
|
||||||
|
|
||||||
|
for {
|
||||||
|
msg, err := conn.Read(buf)
|
||||||
|
|
||||||
|
if err == nil {
|
||||||
|
msgBuf = append(msgBuf, buf[:msg]...)
|
||||||
|
}
|
||||||
|
index := bytes.IndexByte(msgBuf, 0x0a)
|
||||||
|
for index != -1 {
|
||||||
|
newMsg := msgBuf[:index]
|
||||||
|
rest := msgBuf[(index + 1):len(msgBuf)]
|
||||||
|
msgBuf = rest
|
||||||
|
index = bytes.IndexByte(msgBuf, 0x0a)
|
||||||
|
if prevMsg != nil {
|
||||||
|
s := string(prevMsg[:])
|
||||||
|
if s == "-- ADDRESS --" {
|
||||||
|
addressOfClient = newMsg
|
||||||
|
}
|
||||||
|
if s == "-- SIGNATURE --" {
|
||||||
|
signatureFromClient = newMsg
|
||||||
|
}
|
||||||
|
if s == "-- MESSAGE --" {
|
||||||
|
msgFromClient = newMsg
|
||||||
|
}
|
||||||
|
prevMsg = nil
|
||||||
|
} else {
|
||||||
|
prevMsg = newMsg
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if addressOfClient != nil && signatureFromClient != nil && msgFromClient != nil {
|
||||||
|
sig := string(signatureFromClient[:])
|
||||||
|
var sigByteArr, error = hexutil.Decode(sig)
|
||||||
|
|
||||||
|
if error != nil {
|
||||||
|
fmt.Println(error)
|
||||||
|
}
|
||||||
|
|
||||||
|
var sigHex = hexutil.Bytes(sigByteArr)
|
||||||
|
sigHex[64] -= 27
|
||||||
|
|
||||||
|
signedMsgHash := signHash(msgFromClient)
|
||||||
|
|
||||||
|
var rpk, err = crypto.Ecrecover(signedMsgHash, sigHex)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
pubKey := crypto.ToECDSAPub(rpk)
|
||||||
|
recoveredAddr := crypto.PubkeyToAddress(*pubKey)
|
||||||
|
fmt.Println("ADDRESS IS ::", recoveredAddr.Hex())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
go func() {
|
||||||
|
key, _ := crypto.HexToECDSA(testPrivHex)
|
||||||
|
|
||||||
|
f_msg := "Hello World"
|
||||||
|
first_message := []byte(f_msg)
|
||||||
|
new_msg2 := crypto.Keccak256(first_message)
|
||||||
|
fmt.Println("HASH IS ::", hexutil.Encode(new_msg2))
|
||||||
|
|
||||||
|
//send_message := append(new_msg2, []byte{byte(10)}...)
|
||||||
|
new_sig , err := crypto.Sign(new_msg2, key)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println("The crypto.Sign err is ", err)
|
||||||
|
}
|
||||||
|
hex_sig := hexutil.Encode(new_sig)
|
||||||
|
fmt.Println("HEX SIG ::", hex_sig)
|
||||||
|
|
||||||
|
conn.Write([]byte("Broadcasting Message"))
|
||||||
|
conn.Write([]byte("\n"))
|
||||||
|
conn.Write([]byte(f_msg))
|
||||||
|
conn.Write([]byte("\n"))
|
||||||
|
conn.Write(new_sig)
|
||||||
|
conn.Write([]byte("\n"))
|
||||||
|
}()
|
||||||
|
}
|
||||||
2
vendor/vendor.json
vendored
2
vendor/vendor.json
vendored
|
|
@ -794,5 +794,5 @@
|
||||||
"revisionTime": "2017-08-11T01:42:03Z"
|
"revisionTime": "2017-08-11T01:42:03Z"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"rootPath": "github.com/empyrean/go-ethereum"
|
"rootPath": "github.com/ShyftNetwork/go-empyrean"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue