GithubHelp home page GithubHelp logo

factomproject / factom Goto Github PK

View Code? Open in Web Editor NEW
44.0 43.0 19.0 842 KB

Library for writing Factom clients in go

License: MIT License

Go 100.00%
blockchain distributed-ledger consensus cryptocurrency factom

factom's Introduction

factom's People

Contributors

adamslevy avatar carryforward avatar danielricaud avatar dieswaytoofast avatar eleven711 avatar emyrk avatar factom-clay avatar gornik avatar hannemennah avatar jackxlu avatar jaybny avatar joshuabrigati avatar michaelbeam avatar mwanon avatar paulbernier avatar paulsnow avatar sambarnes avatar sirhalsell avatar stackdump avatar thepiachu avatar veenagondkar avatar whosoup avatar y3zier avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

factom's Issues

v1-rollup: GetCurrentMinute returns inconsistent data

I am using the code of branch v1-rollup commit 5edf7247fc876772bed5c68eb78dd4f8e3292b24 (latest at the time of writing).

The GetCurrentMinute method returns the Minute of the block currently being built together with a DirectoryBlockHeight but that DB height is the one of the last saved block and not the block currently being built, which is misleading. I believe it should also be the height of the block being currently built to be conistent.

v1-rollup (and probably current master): GetECBlock() and GetECBlockByHeight() both return error for certain valid keyMR

My app parses all entry credit blocks of dblocks.

Accidentally I can not parse entry credit block c96a851d95db6d58cbcfdd63a8aaf93fc180fb8c003af5508667cc44fa31457d of dblock number 1.

factom.GetECBlock("c96a851d95db6d58cbcfdd63a8aaf93fc180fb8c003af5508667cc44fa31457d")

returns the error:

ERRO[0002] Unknown Entry Credit Block Entry type

The same EC block returned without error via curl (factomd API):

curl -X POST --data-binary '{"jsonrpc": "2.0", "id": 0, "method": "entrycredit-block", "params": {"keymr":"c96a851d95db6d58cbcfdd63a8aaf93fc180fb8c003af5508667cc44fa31457d"}}' -H 'content-type:text/plain;' https://api.factomd.net/v2
{"jsonrpc":"2.0","id":0,"result":{"ecblock":{"header":{"bodyhash":"bb3ff38bbb90032de6965587f46dcf37551ac26e15819303057c88999b2910b4","prevheaderhash":"f87cfc073df0e82cdc2ed0bb992d7ea956fd32b435b099fc35f4b0696948507a","prevfullhash":"66fb49a15b68a2a0ce2382e6aa6970c835497c6074bec9794ccf84bb331ad135","dbheight":1,"headerexpansionarea":"","objectcount":11,"bodysize":88,"chainid":"000000000000000000000000000000000000000000000000000000000000000c","ecchainid":"000000000000000000000000000000000000000000000000000000000000000c"},"body":{"entries":[{"serverindexnumber":0},{"number":2},{"number":3},{"number":4},{"number":5},{"number":6},{"number":7},{"number":8},{"ecpubkey":"17ef7a21d1a616d65e6b73f3c6a7ad5c49340a6c2592872020ec60767ff00d7d","txid":"c3d09d10693eb867e2bd0a503746df370403c9451ae91a363046f2a68529c2fd","index":0,"numec":300},{"number":9},{"number":10}]},"headerhash":"c96a851d95db6d58cbcfdd63a8aaf93fc180fb8c003af5508667cc44fa31457d","fullhash":"1eb3121d81cd8676f20c5fec2f4e0d7a892a2ab2f086506bf55735756098d9ba"},"rawdata":"000000000000000000000000000000000000000000000000000000000000000cbb3ff38bbb90032de6965587f46dcf37551ac26e15819303057c88999b2910b4f87cfc073df0e82cdc2ed0bb992d7ea956fd32b435b099fc35f4b0696948507a66fb49a15b68a2a0ce2382e6aa6970c835497c6074bec9794ccf84bb331ad1350000000100000000000000000b0000000000000058000001020103010401050106010701080417ef7a21d1a616d65e6b73f3c6a7ad5c49340a6c2592872020ec60767ff00d7dc3d09d10693eb867e2bd0a503746df370403c9451ae91a363046f2a68529c2fd00822c0109010a"}}

https://explorer.factom.com/ecblocks/c96a851d95db6d58cbcfdd63a8aaf93fc180fb8c003af5508667cc44fa31457d

Previous EC block f87cfc073df0e82cdc2ed0bb992d7ea956fd32b435b099fc35f4b0696948507a (of DBlock 0) read by factom.GetECBlock without errors.
https://explorer.factom.com/ecblocks/f87cfc073df0e82cdc2ed0bb992d7ea956fd32b435b099fc35f4b0696948507a

Problem install Factom

Hi!

Factom it's available for run with go compiler 1.8? The installation process give me a error when i try to run factom in linux server

$ factomd
//////////////////////// Copyright 2017 Factom Foundation
//////////////////////// Use of this source code is governed by the MIT
//////////////////////// license that can be found in the LICENSE file.
Go compiler version: go1.8
Using build: 701f2cca5ed1f71771a36f8e0386f707106190fb
!!! !!! !!! ERROR: unsupported compiler version !!! !!! !!!
!!! !!! !!! ERROR: unsupported compiler version !!! !!! !!!
!!! !!! !!! ERROR: unsupported compiler version !!! !!! !!!
!!! !!! !!! ERROR: unsupported compiler version !!! !!! !!!
!!! !!! !!! ERROR: unsupported compiler version !!! !!! !!!
!!! !!! !!! ERROR: unsupported compiler version !!! !!! !!!
!!! !!! !!! ERROR: unsupported compiler version !!! !!! !!!
!!! !!! !!! ERROR: unsupported compiler version !!! !!! !!!
!!! !!! !!! ERROR: unsupported compiler version !!! !!! !!!
!!! !!! !!! ERROR: unsupported compiler version !!! !!! !!!
!!! !!! !!! ERROR: unsupported compiler version !!! !!! !!!
!!! !!! !!! ERROR: unsupported compiler version !!! !!! !!!
!!! !!! !!! ERROR: unsupported compiler version !!! !!! !!!
!!! !!! !!! ERROR: unsupported compiler version !!! !!! !!!
!!! !!! !!! ERROR: unsupported compiler version !!! !!! !!!
!!! !!! !!! ERROR: unsupported compiler version !!! !!! !!!
!!! !!! !!! ERROR: unsupported compiler version !!! !!! !!!
!!! !!! !!! ERROR: unsupported compiler version !!! !!! !!!
!!! !!! !!! ERROR: unsupported compiler version !!! !!! !!!
!!! !!! !!! ERROR: unsupported compiler version !!! !!! !!!
!!! !!! !!! ERROR: unsupported compiler version !!! !!! !!!
!!! !!! !!! ERROR: unsupported compiler version !!! !!! !!!
!!! !!! !!! ERROR: unsupported compiler version !!! !!! !!!
!!! !!! !!! ERROR: unsupported compiler version !!! !!! !!!
!!! !!! !!! ERROR: unsupported compiler version !!! !!! !!!
!!! !!! !!! ERROR: unsupported compiler version !!! !!! !!!
!!! !!! !!! ERROR: unsupported compiler version !!! !!! !!!
!!! !!! !!! ERROR: unsupported compiler version !!! !!! !!!
!!! !!! !!! ERROR: unsupported compiler version !!! !!! !!!
!!! !!! !!! ERROR: unsupported compiler version !!! !!! !!!

After view this error i try to install using all.sh script but i got this another error

[INFO]  Replacing existing vendor dependencies
./all.sh: line 99: cd: addservermessage: No such file or directory
Compiling:  addservermessage
[ERROR] Failed to find glide.yaml file in directory tree: Cannot resolve parent of /
can't load package: package github.com/FactomProject: no buildable Go source files in /home/ubuntu/go/src/github.com/FactomProject

Regards

ER

go.mod release

Version # proposal: v0.4.0 (currently we're at v0.3.6)

I added most of the sensible open PRs and issues to the the board. Most of these are ready to be reviewed but some still need more work, mainly the go.mod one.

There are two PRs that need special attention:

  • #135 The whitelist feature will also need a new release of factom-walletd (FactomProject/factom-walletd#85) to enable the feature for users
  • #137 the optional raw-data feature will need the factomd api counterpart integrated

We should decide if we should include these now and they just aren't useful until their counterparts are enabled, or wait until integration is done on the other side and then make another release.

GetCurrentMinute(): Unmarshal number into Go struct field CurrentMinuteInfo.currenttime of type int64

I try to run pegnet oracleMiner and meet an issue while using factom lib:

f.info, err = factom.GetCurrentMinute()

err:

ERRO[0006] json: cannot unmarshal number 1.5608661075125e+18 into Go struct field CurrentMinuteInfo.currenttime of type int64

Debugging inside GetCurrentMinute() function shows, that factomd request is successful, but failed to unmarshal it:

INFO[0000] {"jsonrpc":"2.0","id":3,"result":{"stalldetected":false,"minute":2,"leaderheight":197528,"currentminutestarttime":1.5608669407298e+18,"directoryblockinseconds":600,"directoryblockheight":197528,"currenttime":1.5608669649873e+18,"currentblockstarttime":1.5608668208451e+18}} 

Transactions take a long time to load

I was tasked to investigate why the "Transactions" page is fairly slow to load, and I tracked down the error to the GetTXRange function:

factom/wallet/txdatabase.go

Lines 207 to 216 in 27c6cd7

txs, err := db.GetAllTXs()
if err != nil {
return nil, err
}
for _, tx := range txs {
if s <= tx.GetBlockHeight() && tx.GetBlockHeight() <= e {
filtered = append(filtered, tx)
}
}

In order to get a range of transactions by height, the code first gets every single transaction via txs, err := db.GetAllTXs() (by scanning through all 170k+ Factoid Blocks) and then loops through all transactions to filter out the ones with the desirable height. This is obviously not very efficient and caused the function GetRelatedTransactions to perform very poorly, taking an average of ~5seconds to execute on my pc.

This function locks a mutex.
https://github.com/FactomProject/enterprise-wallet/blob/7819099c274a1bedaa9d677371c0b29079931f2a/wallet/walletDB.go#L390-L391

The mutex remains locked as long as the function runs in the background and it's automatically scheduled to execute every 10 seconds, which prevented the "Transactions" page from loading as it waited for that mutex to be released.

This can be fixed by rewriting the GetTxRange function to only cycle from the head down to the desired height and grabbing the related transactions instead of all 170k+ factoid blocks, which drove down execution time to ~250ms on my pc.

Proposed fix: WhoSoup@e0e9e5d

(note: the new code is substantially copy/pasted from GetAllTxs)

[0.4.0] Changelog

Changelog for 0.4.0 (the "go.mod release")

As the name already implies, the big change is that this version finally moves away from glide and introduces go.mod. This release also contains some breaking changes for retrieving blocks and transactions.

No raw data

The factomd API methods for block retrieval typically return both a json representation as well as the raw factom marshalled bytes of the block. There are very few applications where you need both the unmarshalled block and the raw bytes at the same time. You either need the unmarshalled data only, or if you need the raw bytes, you can unmarshal it locally. Transmitting both at the same time wastes bandwidth if only one is used.

The new factomd version (6.9.0-Wax) adds a new parameter to these API methods ("noraw") that allows us to retrieve the unmarshalled data without the raw. To get the raw data only, we can use the separate "get-raw" endpoint. The client now reflects this and the common block retrieval methods no longer return the raw data:

  • GetABlock(string) (*ABlock, []byte, error) => GetABlock(string) (*ABlock, error)
  • GetABlockByHeight(int64) (*ABlock, []byte, error) => GetABlockByHeight(int64) (*ABlock, error)
  • GetDBlock(string) (*DBlock, []byte, error) => GetDBlock(string) (*DBlock, error)
  • GetDBlockByHeight(int64) (*DBlock, []byte, error) => GetDBlockByHeight(int64) (*DBlock, error)
  • GetECBlock(string) (*ECBlock, []byte, error) => GetECBlock(string) (*ECBlock, error)
  • GetECBlockByHeight(int64) (*ECBlock, []byte, error) => GetECBlockByHeight(int64) (*ECBlock, error)
  • GetFBlock(string) (*FBlock, []byte, error) => GetFBlock(string) (*FBlock, error)
  • GetFBlockByHeight(int64) (*FBlock, []byte, error) => GetFBlockByHeight(int64) (*FBlock, error)

To retrieve the raw data for these blocks, use:

  • GetRaw(keymr string) ([]byte, error)
  • GetBlockByHeightRaw(string, int64) (*BlockByHeightRawResponse, error)

Anchors

The client now supports the "anchors" API endpoint via the following two functions:

  • GetAnchors(hash string) (*Anchors, error)
  • GetAnchorsByHeight(height int64) (*Anchors, error)

The Anchors struct contains the height, keymr, as well as a potential Bitcoin or Ethereum anchor. Not all blocks have anchors and they are nil if missing:

factom/anchors.go

Lines 12 to 37 in afafc3a

type Anchors struct {
Height uint32 `json:"directoryblockheight"`
KeyMR string `json:"directoryblockkeymr"`
Bitcoin *AnchorBitcoin `json:"bitcoin"`
Ethereum *AnchorEthereum `json:"ethereum"`
}
// AnchorBitcoin is the bitcoin specific anchor
type AnchorBitcoin struct {
TransactionHash string `json:"transactionhash"`
BlockHash string `json:"blockhash"`
}
// AnchorEthereum is the ethereum specific anchor
type AnchorEthereum struct {
RecordHeight int64 `json:"recordheight"`
DBHeightMax int64 `json:"dbheightmax"`
DBHeightMin int64 `json:"dbheightmin"`
WindowMR string `json:"windowmr"`
MerkleBranch []MerkleNode `json:"merklebranch"`
ContractAddress string `json:"contractaddress"`
TxID string `json:"txid"`
BlockHash string `json:"blockhash"`
TxIndex int64 `json:"txindex"`
}

Pending Entries / Transactions

Instead of returning the raw json response as a string, the client now unmarshals the pending entries and transactions:

  • GetPendingEntries() (string, error) => GetPendingEntries() ([]PendingEntry, error)
  • GetPendingTransactions() (string, error) => GetPendingTransactions() ([]PendingTransaction, error)
    The PendingEntry struct contains the chainid, entry hash, and status. The PendingTransaction contains txid, dbheight, status, fees, inputs, and outputs

FBlock Transactions

The FBlock structure now contains the unmarshalled list of transactions rather than the raw json response. FBlock.Transactions is of type "FBTransaction" which contains the txid, height, timestamp, signed input transactions, and the fct/ec outputs:

factom/fblock.go

Lines 29 to 57 in afafc3a

// FBTransactions represents a single and valid transaction contained inside
// of an FBlock.
// The data has been rearranged from the raw json response to make it easier to work with.
type FBTransaction struct {
TxID string `json:"txid"` // hex string
BlockHeight int64 `json:"blockheight"`
Timestamp time.Time `json:"timestamp"`
Inputs []SignedTransactionAddress `json:"inputs"`
Outputs []TransactionAddress `json:"outputs"`
ECOutputs []TransactionAddress `json:"outecs"`
}
// TransactionAddress holds the relevant data for either an input or an output.
// The amount is in either Factoshi (Input and Output) or EC (ECOutputs).
// The RCDHash is the SHA256 hash of the RCD.
// The address is the human readable address calculated from the RCDHash and type.
type TransactionAddress struct {
Amount uint64 `json:"amount"`
RCDHash string `json:"address"` // hex string
Address string `json:"useraddress"`
}
// SignedTransactionAddress contains a TransactionAddress along with the RCD and
// cryptographic signatures specified by the RCD.
type SignedTransactionAddress struct {
TransactionAddress
RCD string `json:"rcd"` // hex string
Signatures []string `json:"signatures"` // slice of hex strings
}

Open Node Support

The open node is a cluster of nodes that sit behind a load balancer. Sometimes this can cause issues with slightly inconsistent data between calls. The open node has enabled cookie sessions which ensure that all requests in the same session target the same node. There are two ways you can use this:

factom.SetOpenNode()

This call will set the factomd endpoint to the open node and enable the cookie jar.

factom.EnableCookies()

This enables cookies but does not change the factomd endpoint. You can also use this to reset cookies.

Other

  • The /wallet/ folder has been removed and will be relocated to its own repo. This was done because the contents were unrelated to the client and it bloated imports significantly.
  • A new function EntryCommitMessage(e *Entry, ec *ECAddress) (*bytes.Buffer, error) has been made public. It returns the raw bytes of what would be sent to factomd when using the ComposeEntryCommit function, allowing you to build commits without sending them.
  • The automated circle tests have been improved

encrypt

Hi.

This it's not a issue, it's only for ask to us about factom and it's possible to use to encrypt and decrypt data using factom? can i use the api for that purpose? or in all cases the data goes to a blockchain?

Regards

ER

Missing return on error happen

on handle compose-chain: should return these errors

if cost, err := factom.EntryCost(&e); err != nil {
newCustomInternalError(err.Error())
} else if balance < int64(cost) {
newCustomInternalError("Not enough Entry Credits")
}

How to generate factoid address from private key?

Hi

I need help.
I have factoid address generated from private key by this command.

$ curl -X GET "http://localhost:8089/v1/factoid-generate-address-from-private-key/?name=addr001&privateKey=85d6755c286c6f139b1696ca74b0c14da473beadc37b2ec6273f2a92ce8d7c88"

in this page https://www.factom.com/devs/docs/guide/factoid-api-reference

But I cant find api for private key in new version wallet.
https://docs.factom.com/api#address

What is alternate api for "factoid-generate-address-from-private-key", and how to generate factoid address from private key?

Regards

Add functions to get anchors from factomd anchors API

In factomd:v6.4.3 new API call appeared:
https://docs.factom.com/api#anchors

Retrieve information about the directory block anchors that have been confirmed on Bitcoin and Ethereum.

Parameter options: - "height" - the directory block height (integer) to request anchors for - "hash" - the object’s hash (hex string) to request anchors for (e.g. entry hash, entry block keymr, factoid block keymr, admin block lookup hash, entry credit block header hash, or directory block keymr)

I suggest to add 2 functions into factom lib:
GetAnchors(hash string) and GetAnchorsByHeight(height int64)

factom.SignData() - panic: runtime error: invalid memory address or nil pointer dereference

Recently, we tried to use factom.SignData() to make a signature for the project.

But, it returned runtime panic error.

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x1376423]

Here is factom version we used:

github.com/FactomProject/factom v0.3.6-0.20200826003247-4751d0f52dda
github.com/FactomProject/factomd v6.3.2+incompatible

Is there any known issue why this runtime panic error is happening when try to sign data to generate signature?

Here is code snipped we used.

func (spr *StakingPriceRecord) CreateSPREntry() (*factom.Entry, error) {
	e := new(factom.Entry)
	e.ChainID = hex.EncodeToString(base58.Decode(spr.SPRChainID))

	rcd, err := common.ConvertFCTtoRaw(spr.CoinbaseAddress)
	if err != nil {
		return nil, err
	}

	e.Content, err = spr.SafeMarshal()
	if err != nil {
		return nil, err
	}

	signature, errS := factom.SignData(spr.CoinbaseAddress, e.Content)
	if errS != nil {
		return nil, err
	}
	pubKey := signature.PubKey
	sign := signature.Signature
	signData := append(pubKey, sign...)

	e.ExtIDs = [][]byte{{spr.Version}, rcd, signData}

	return e, nil
}

factom.SignData() returns panic error now.

@PaulSnow , @WhoSoup

Thank you in advance.

Race condition for the APICounter

The APICounter is not thread safe and generates a warning by the Golang race condition detector:

WARNING: DATA RACE
Read at 0x00c00015e678 by goroutine 32:
  github.com/FactomProject/factom.newCounter.func1()
      /home/paul/go/pkg/mod/github.com/!factom!project/[email protected]/jsonrpc.go:359 +0x4a
  github.com/FactomProject/factom.GetCurrentMinute()
      /home/paul/go/pkg/mod/github.com/!factom!project/[email protected]/currentminute.go:46 +0x4d

Previous write at 0x00c00015e678 by goroutine 44:
  github.com/FactomProject/factom.newCounter.func1()
      /home/paul/go/pkg/mod/github.com/!factom!project/[email protected]/jsonrpc.go:359 +0x60
  github.com/FactomProject/factom.GetDBlockByHeight()
      /home/paul/go/pkg/mod/github.com/!factom!project/[email protected]/dblock.go:109 +0x5b

Current implementation: https://github.com/FactomProject/factom/blob/master/jsonrpc.go#L331

It most likely has a very little or no actual impact, but having the warning show up for people using the factom lib is unnecessary noise. Golang provides out of the box some primitive for atomic counters that could be leveraged: https://gobyexample.com/atomic-counters

fix transaction_pending_test

The test fails with:

--- FAIL: TestGetPendingTransactions (0.00s)
    /home/paul/go/src/github.com/FactomProject/factom/transaction_pending_test.go:33: unexpected response.
        got =
        [{TxID:5d87f2ba00ebaee1b0aac86b97ab5a8d4ab5f07a948966856f5723b15c57a5ab DBHeight:0 Status:TransactionACK Fees:0 Inputs:[] Outputs:[{Amount:320000000 RCDHash:d06f8b5d84395afbec25d3aa3f3f2d5a6573ebd30e4d02e797d77107395c2b4a Address:FA3YsmVnBs2LwrthnFzEJYFTw2HzhYMmjnD2GtG6W2r2S2SvonCv} {Amount:576000000 RCDHash:e8e41a1c7ca7c29dc928e509cae82cae1a4711eb12fddc8bde25bf1733069efc Address:FA3jeSpDq6JSNmizDS8TWwdxKS9EiKFeRCXyZNYrfH6eqX1K9o8u} {Amount:320000000 RCDHash:6a437b1475d9455e8447f7b2a7f32044a28f5f16486d2f239eca5bdba02030c8 Address:FA2msvDAoVgzRx8BTmxFAYDLbg2VQXqhi2HzKQHmsb4mVrKjY4B6} {Amount:320000000 RCDHash:2b20273033acf00b40e88848a853a56dd0543570f4f28d30b050634d1e28bd6e Address:FA2J59Eb8xyizJLachFn8LuRXVsSNkoW2uPKrna8X4UrtyVwztgY} {Amount:320000000 RCDHash:53c597f02efd7ef3caad48182969236a70883bada570aa316bc9b20efedcc73f Address:FA2byPxs4XYmra4Z6t3UcDwGaNP62LM631QarrqvVbrbsy9XCGoX} {Amount:320000000 RCDHash:8f3064f2d1b8fac099719de1651e81c0fc3f0f29ef1a95a3b46c90e628b51ccc Address:FA3498SdD2tDAi2485czk6shCfU5Q3PC5Wsui6sNzxi1dTpwxpFj} {Amount:320000000 RCDHash:d06f8b5d84395afbec25d3aa3f3f2d5a6573ebd30e4d02e797d77107395c2b4a Address:FA3YsmVnBs2LwrthnFzEJYFTw2HzhYMmjnD2GtG6W2r2S2SvonCv} {Amount:320000000 RCDHash:6a437b1475d9455e8447f7b2a7f32044a28f5f16486d2f239eca5bdba02030c8 Address:FA2msvDAoVgzRx8BTmxFAYDLbg2VQXqhi2HzKQHmsb4mVrKjY4B6} {Amount:320000000 RCDHash:7e73ae9e7c31c632697e9c9207075a66f099f82f5d1da2aec157146d48c75533 Address:FA2vmboi6PbPHdGjqG5PfRhCG1hcpkXqNkVigAmmjq9atUAA2NpZ} {Amount:192000000 RCDHash:edef61cc4d07e34b64376c8ff5785274f84f191ae22224e90c8119d73727f3ce Address:FA3msHkoAH78cAVvdJE4Za6uSatPQR2aTgvSViRFN3vLBsixvkZQ} {Amount:480000000 RCDHash:665650f5cfd74ec95bac1bc823dc7b7ab5b388a3b0ba31663cb678955e8146aa Address:FA2k9d61ujVHRRMkajk1pKteRSaqGUKf3iJyCBEbU6HeWe2sC5nx} {Amount:320000000 RCDHash:cf681312cc74d91691e6c1be0df58c638145d877c6f1647c6ca8d88d2ffbfd17 Address:FA3YRUjaGJjpjvNZPW7CCD7Ba7bJne25HdrTainPYotNw4rUoh46} {Amount:640000000 RCDHash:cc26b2335e9b7c60bfd0e0e98d07ec7f58e67d54fb5717b86bbb868584ca1243 Address:FA3WzKn5ygD8E2uGocAYhaooeQyehSjq1HC3hSb2EaJ4ZGfjku63} {Amount:320000000 RCDHash:53c597f02efd7ef3caad48182969236a70883bada570aa316bc9b20efedcc73f Address:FA2byPxs4XYmra4Z6t3UcDwGaNP62LM631QarrqvVbrbsy9XCGoX}] ECOutputs:[]} {TxID:3a1e8dc38ef4112bc3110ae47a02c417ba465a5478bf5b97a9b4fc842a9ce67a DBHeight:0 Status:TransactionACK Fees:12000 Inputs:[{Amount:212000 RCDHash:d2e2860610e282b6d8d9fed05e2a8dce5d8211d86ca14e2edf05023f0759be97 Address:FA3ZxKyN3HHoJftdGbFp5PRvi12jPvQ3SgGNTDQya2D5jwFrtLqZ}] Outputs:[] ECOutputs:[{Amount:200000 RCDHash:3b6a27bcceb6a42d62a3a8d02a6f0d73653215771de243a63ac048a18b59da29 Address:EC2DKSYyRcNWf7RS963VFYgMExoHRYLHVeCfQ9PGPmNzwrcmgm2r}]} {TxID:0b3f7feadcc849c60bdad4ccac4b831039c6321cecb6667a8d39a8c14850e5cc DBHeight:0 Status:TransactionACK Fees:12000 Inputs:[{Amount:500012000 RCDHash:d2e2860610e282b6d8d9fed05e2a8dce5d8211d86ca14e2edf05023f0759be97 Address:FA3ZxKyN3HHoJftdGbFp5PRvi12jPvQ3SgGNTDQya2D5jwFrtLqZ}] Outputs:[{Amount:500000000 RCDHash:646f3e8750c550e4582eca5047546ffef89c13a175985e320232bacac81cc428 Address:FA2jK2HcLnRdS94dEcU27rF3meoJfpUcZPSinpb7AwQvPRY6RL1Q}] ECOutputs:[]}]
        
        want =
        [{TxID:5d87f2ba00ebaee1b0aac86b97ab5a8d4ab5f07a948966856f5723b15c57a5ab Status:TransactionACK Fees:0 Inputs:[] Outputs:[{Amount:320000000 RCDHash:d06f8b5d84395afbec25d3aa3f3f2d5a6573ebd30e4d02e797d77107395c2b4a Address:FA3YsmVnBs2LwrthnFzEJYFTw2HzhYMmjnD2GtG6W2r2S2SvonCv} {Amount:576000000 RCDHash:e8e41a1c7ca7c29dc928e509cae82cae1a4711eb12fddc8bde25bf1733069efc Address:FA3jeSpDq6JSNmizDS8TWwdxKS9EiKFeRCXyZNYrfH6eqX1K9o8u} {Amount:320000000 RCDHash:6a437b1475d9455e8447f7b2a7f32044a28f5f16486d2f239eca5bdba02030c8 Address:FA2msvDAoVgzRx8BTmxFAYDLbg2VQXqhi2HzKQHmsb4mVrKjY4B6} {Amount:320000000 RCDHash:2b20273033acf00b40e88848a853a56dd0543570f4f28d30b050634d1e28bd6e Address:FA2J59Eb8xyizJLachFn8LuRXVsSNkoW2uPKrna8X4UrtyVwztgY} {Amount:320000000 RCDHash:53c597f02efd7ef3caad48182969236a70883bada570aa316bc9b20efedcc73f Address:FA2byPxs4XYmra4Z6t3UcDwGaNP62LM631QarrqvVbrbsy9XCGoX} {Amount:320000000 RCDHash:8f3064f2d1b8fac099719de1651e81c0fc3f0f29ef1a95a3b46c90e628b51ccc Address:FA3498SdD2tDAi2485czk6shCfU5Q3PC5Wsui6sNzxi1dTpwxpFj} {Amount:320000000 RCDHash:d06f8b5d84395afbec25d3aa3f3f2d5a6573ebd30e4d02e797d77107395c2b4a Address:FA3YsmVnBs2LwrthnFzEJYFTw2HzhYMmjnD2GtG6W2r2S2SvonCv} {Amount:320000000 RCDHash:6a437b1475d9455e8447f7b2a7f32044a28f5f16486d2f239eca5bdba02030c8 Address:FA2msvDAoVgzRx8BTmxFAYDLbg2VQXqhi2HzKQHmsb4mVrKjY4B6} {Amount:320000000 RCDHash:7e73ae9e7c31c632697e9c9207075a66f099f82f5d1da2aec157146d48c75533 Address:FA2vmboi6PbPHdGjqG5PfRhCG1hcpkXqNkVigAmmjq9atUAA2NpZ} {Amount:192000000 RCDHash:edef61cc4d07e34b64376c8ff5785274f84f191ae22224e90c8119d73727f3ce Address:FA3msHkoAH78cAVvdJE4Za6uSatPQR2aTgvSViRFN3vLBsixvkZQ} {Amount:480000000 RCDHash:665650f5cfd74ec95bac1bc823dc7b7ab5b388a3b0ba31663cb678955e8146aa Address:FA2k9d61ujVHRRMkajk1pKteRSaqGUKf3iJyCBEbU6HeWe2sC5nx} {Amount:320000000 RCDHash:cf681312cc74d91691e6c1be0df58c638145d877c6f1647c6ca8d88d2ffbfd17 Address:FA3YRUjaGJjpjvNZPW7CCD7Ba7bJne25HdrTainPYotNw4rUoh46} {Amount:640000000 RCDHash:cc26b2335e9b7c60bfd0e0e98d07ec7f58e67d54fb5717b86bbb868584ca1243 Address:FA3WzKn5ygD8E2uGocAYhaooeQyehSjq1HC3hSb2EaJ4ZGfjku63} {Amount:320000000 RCDHash:53c597f02efd7ef3caad48182969236a70883bada570aa316bc9b20efedcc73f Address:FA2byPxs4XYmra4Z6t3UcDwGaNP62LM631QarrqvVbrbsy9XCGoX}] ECOutputs:[]} {TxID:3a1e8dc38ef4112bc3110ae47a02c417ba465a5478bf5b97a9b4fc842a9ce67a Status:TransactionACK Fees:12000 Inputs:[{Amount:212000 RCDHash:d2e2860610e282b6d8d9fed05e2a8dce5d8211d86ca14e2edf05023f0759be97 Address:FA3ZxKyN3HHoJftdGbFp5PRvi12jPvQ3SgGNTDQya2D5jwFrtLqZ}] Outputs:[] ECOutputs:[{Amount:200000 RCDHash:3b6a27bcceb6a42d62a3a8d02a6f0d73653215771de243a63ac048a18b59da29 Address:EC2DKSYyRcNWf7RS963VFYgMExoHRYLHVeCfQ9PGPmNzwrcmgm2r}]} {TxID:0b3f7feadcc849c60bdad4ccac4b831039c6321cecb6667a8d39a8c14850e5cc Status:TransactionACK Fees:12000 Inputs:[{Amount:500012000 RCDHash:d2e2860610e282b6d8d9fed05e2a8dce5d8211d86ca14e2edf05023f0759be97 Address:FA3ZxKyN3HHoJftdGbFp5PRvi12jPvQ3SgGNTDQya2D5jwFrtLqZ}] Outputs:[{Amount:500000000 RCDHash:646f3e8750c550e4582eca5047546ffef89c13a175985e320232bacac81cc428 Address:FA2jK2HcLnRdS94dEcU27rF3meoJfpUcZPSinpb7AwQvPRY6RL1Q}] ECOutputs:[]}]
FAIL
exit status 1

It looks like it's the DBHeight: 0 missing, not sure if it's a test problem or an actual bug?

Include RCD/Sig in pending transactions

Thanks to @ilzheev for reporting this one.

Regular transactions contain the RCD/Signature for all inputs but pending transactions currently don't. They're not returned by the API so this will need modification to factomd as well.

Todo:

  • Expand factomd to include the RCD/Signatures for the inputs in "pending-transactions" call
  • Expand lib to use SignedTransactionAddress instead of TransactionAddress for inputs

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.