Git Product home page Git Product logo

factomd's Introduction

Factom

The Factom Era of the protocol ended on 30 Oct 2022. The the protocol continues under Accumulate Era as of 31 Oct 2022

The project repositories for the Protocol have moved to https://GitLab.com/AccumulateNetwork

Official Golang implementation of the Factom Protocol.

CircleCI

Factom is an open-source blockchain project designed to store structured data immutably at a fixed cost. Data integrity verification is one of the many uses cases the protocol excels at. The Factom Protocol represents opportunities for businesses, governments, and other entities to record and preserve their data in an immutable and cost-efficient way. Visit the Factom Protocol website for more information

Community

Connect with the community through one or more of the following:

WebsiteDiscordTwitterRedditYoutube

Getting Started

Running a node with docker

Factomd releases include docker images that can be pulled from the official repository: https://hub.docker.com/r/factominc/factomd The alpine version is strongly recommended.

For instance to run the latest master build for mainnet:

docker run -d --name "factomd" -p "8088:8088" -p "8090:8090" -p "8108:8108" factominc/factomd:master-alpine

Build/install factomd

You will need the following software installed on your machine:

  • git
  • A recent version of Go (supporting Go modules)
  • make
git clone https://github.com/FactomProject/factomd
cd factomd
make
# or `make install` to install factomd into GOBIN folder

Also make all cross compiles factomd for various platforms.

Running factomd

Factomd can be run with default configuration with this simple command:

$ factomd

The default factomd folder is located at ~/.factom/. The node database is stored by default at ~/.factom/m2/<network type>-database.

Configuration

Factomd will run with a set of default configuration. Those can be altered in two ways:

  • By passing flags when running factomd. Run factomd --help to get the list of supported parameters.
  • By editing a config file. See factomd.conf for an example of such file. Note that this config file is also used to configure factom-walletd.
mkdir -p ~/.factom/m2/
cp factomd.conf ~/.factom/m2/

Default ports

Service Port
JSON-RPC API 8088
Web UI 8090
P2P 8108 (MAIN net), 8109 (TEST net), 8110 (LOCAL net)

Running factomd for local development

To get a local development node running:

$ factomd --network=LOCAL --blktime=60

Note that the blocktime here is set to 60s (instead of the regulat 600s) for the convenience of development. Head to http://localhost:8090 to see the Web UI of your local node.

On a LOCAL network, the address FA2jK2HcLnRdS94dEcU27rF3meoJfpUcZPSinpb7AwQvPRY6RL1Q comes pre-loaded with Factoids that can be used for your testing as the associated private key is known: Fs3E9gV6DXsYzf7Fqx1fVBQPQXV695eP3k5XbmHEZVRLkMdD9qCK.

factomd's People

Contributors

carryforward avatar dajohi avatar davecgh avatar dieswaytoofast avatar drahn avatar dsmurl avatar emyrk avatar factablesolutions avatar factom-clay avatar firelizzard18 avatar flammit avatar gornik avatar hannemennah avatar jackxlu avatar jaybny avatar jcvernaleo avatar joshuabrigati avatar jrick avatar m21 avatar michaelbeam avatar mwanon avatar n1rvana avatar paulbernier avatar paulsnow avatar sambarnes avatar sanderpostma avatar sirhalsell avatar stackdump avatar thepiachu avatar whosoup 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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

factomd's Issues

go install context / mathbits not found

futjrn@h3rcn0d3:~/go/src/github.com/FactomProject/factomd$ go install -ldflags "-X github.com/FactomProject/factomd/engine.Build=git rev-parse HEAD -X github.com/FactomProject/factomd/engine.FactomdVersion=cat VERSION" -v
../../hashicorp/go-plugin/client.go:5:2: cannot find package "context" in any of:
/usr/lib/go-1.6/src/context (from $GOROOT)
/home/futjrn/go/src/context (from $GOPATH)
../../../golang.org/x/crypto/ripemd160/ripemd160block.go:12:2: cannot find package "math/bits" in any of:
/usr/lib/go-1.6/src/math/bits (from $GOROOT)
/home/futjrn/go/src/math/bits (from $GOPATH)

getting this after a successful glide install, and then trying to go install.

what do?

ERROR: Factom Wallet on Mac - Factomd

I am using MacOS and tried to install wallet follow the guide in yours website.

When I first run the Factomd , it shown an error

/Applications/FactomApps/factomd ; exit;
2016/09/15 21:34:06 read factom config file: /Users/xxxxx/.factom/factomd.conf
2016/09/15 21:34:06 ERROR Reading config file!
Server starting with default settings...

What is factomd.conf ? I did't see it

factomd issue

Hi,
I updated the new binaries and the wallet but I have an issue, when I run factomd and I reach the 86000th block this is what happens:and it keeps doing this every 5/10 minutes.
can someone help?
I also tried to delete everything and restarting everything importing my wallet but nothing changed

FNode0 Loading Block 86000 / 86866. Blocks per second 146.42
Reading from '/Users/xxx/.factom/m2/factomd.conf'
Cannot open custom config file,
Starting with default settings.
open /Users/xxx/.factom/m2/factomd.conf: no such file or directory

go get never goes and gets

expected experience:
go get GitHub.com/FactomProject/factomd

goes and gets

actual experience
terminal hangs

Factom-cli and API report incorrect dblock timestamp for certain calls

This call:

factom-cli get dbheight 144378

Contains as part of the response:

"dbhash": "6dcbd123507b51a386d16815b9159e7e68d6e383a756d123c916222ff452b8a8",
"keymr": "d750bca37731519658303f40cbfbb7ab87fad240770fa8aea3af4770334faa86",
"header": {
	"version": 0,
	"networkid": 4203931042,
	"bodymr": "63b9981e9d44ae0a3d36a23bed72cf423cf6ef956dd1b49814edc5eb57e2f03d",
	"prevkeymr": "70bdde669000bd1d67241448b3fd34f08dedc9f4627b03cef2b469528f7c945b",
	"prevfullhash": "0398c7cb74bc5c79ba3e1c976bdc5d50a467edf1e57c57e8a55ad8b8ec5b45a7",
	"timestamp": 25475055,
	"dbheight": 144378,
	"blockcount": 3,
	"chainid": "000000000000000000000000000000000000000000000000000000000000000d"
},

If you look at the timestamp, 25475055, you'll see that it is for some date in late 1970. Conversely, if you call that block hash directly with:

factom-cli get dblock 6dcbd123507b51a386d16815b9159e7e68d6e383a756d123c916222ff452b8a8

Then it returns the correct time:

PrevBlockKeyMR: 70bdde669000bd1d67241448b3fd34f08dedc9f4627b03cef2b469528f7c945b
Timestamp: 1528503300
SequenceNumber: 144378
EntryBlock {
	ChainID 000000000000000000000000000000000000000000000000000000000000000a
	KeyMR ef439af7b8bba0ecaf786f3d6b4b03977cbe1a5b66f413c1f3f7a7416ac998f4
}
EntryBlock {
	ChainID 000000000000000000000000000000000000000000000000000000000000000c
	KeyMR 95e7dcec96787519676cfd3d2951b8740763a384736eafb87ffa40af170b9aa3
}
EntryBlock {
	ChainID 000000000000000000000000000000000000000000000000000000000000000f
	KeyMR 810da0af022deb1474dfe640f4ec769f5c924a6b555a7378a6db5802d49cea29
}

Ineffectual assign inside deferred function

func (e *Entry) UnmarshalBinaryData(data []byte) ([]byte, error) {
var err error
defer func() {
if r := recover(); r != nil {
err = fmt.Errorf("Error unmarshalling: %v", r)
}
}()

The var err error declared on line 256 is not properly returned by the function in the event of a panic. Inside the deferred recover function err is set, but this will be out of scope when the function returns.

This example demonstrates this issue: https://play.golang.org/p/KZ_3-ynuguN
You can see that go vet catches this issue in the above example, but only because err is never used in the function body, so this is an easy thing to have slip by.

This can easily be fixed by removing var err error and using named return values in the function declaration:

func (e *Entry) UnmarshalBinaryData(data []byte) (data []byte, err error) {

Unable to install glide on Mac

Whether I try:

curl https://glide.sh/get | sh
or
go get -u github.com/Masterminds/glide

glide refuses to install itself...

Even manually installing glide, I get that the file is corrupt.

Control Panel eats resources if left open. (updateAllPeers)

If I leave the Control Panel open for a long time (overnight) I notice it becomes less responsive. If left long enough, it will take 100% CPU.

updateHTML() & updateAllPeers() seems to be the culprit. They can be slow to execute, and are being called too frequently. Possibly before the previous call has finished.

I'm using the latest version of Chrome.
image

API port responds to undocumented http GET verb

While messing around with the API, I discovered that, even though the documentation states that the API is accessed via POST requests, GET requests also work correctly. This seems to be a bug. I don't think the API should respond to GET requests unless it's documented.

High CPU when STDIN not available

I ran factomd in a docker container. The cpu usage went to 100%, and the log files filled up with:

"Error reading from std, sleeping for 5s: EOF"

This can be fixed in docker by using the -i parameter to keep STDIN open even if not attached. I will write you some better docker instructions soon.

I would suggest disabling reading STDIN if it's not available.

The meaning of "tps t/i"

When the factomd is running, type the "s" to get the status.There is a item named "tps t/i", I do not know exactly the meaning of this item. Could you explain it? Thank you!

Losing connections

I'm using factomd on the m2-rc1 branch on Mint 18:

./all.sh m2-rc1
factomd

It starts with 7 connections and syncs a few blocks. After a couple of minutes it starts losing one connection after another until none is left (and no connection reappears) and I have to CTRL-C and restart.

What information can I provide to help pinning down the problem? There are no logs in ~/.factom/m2/test-database/Log.
~/.factom/m2/test-database/LogFNode0.log is empty.

~ $ go version
go version go1.7.3 linux/amd64

Edit: syncing stopped at block 5000, then at 7200. Currently going forward...and finally finished.

prometheus dependency: compilation errors

Compilation of factomd v0.4.0.3 fails with errors:

state/entrySyncing.go:58: ESAsking.Set undefined (type prometheus.Counter has no field or method Set)
state/entrySyncing.go:59: ESFound.Set undefined (type prometheus.Counter has no field or method Set)
state/entrySyncing.go:60: ESAvgRequests.Set undefined (type prometheus.Counter has no field or method Set)
state/entrySyncing.go:148: ESMissingQueue.Set undefined (type prometheus.Counter has no field or method Set)
state/entrySyncing.go:149: ESDBHTComplete.Set undefined (type prometheus.Counter has no field or method Set)
state/entrySyncing.go:150: ESFirstMissing.Set undefined (type prometheus.Counter has no field or method Set)
state/entrySyncing.go:151: ESHighestMissing.Set undefined (type prometheus.Counter has no field or method Set)

Checked with go 1.6 and 1.8.

Google shows these errors in other projects depending on prometheus. I suppose the factomd code is relying on an older version of prometheus?

Unable to send the same entry twice in the same block

Hello

My understanding is that the protocol supports sending the same entry multiple times - which is also mentioned on https://www.factom.com/devs/docs/guide/factom-data-structures where it has an example of duplicate entries in the same block.

However, I'm unable to get this working within the same block, it works fine if it gets sent to different blocks.

Reproduce:
Commit an entry
Reveal the entry
Wait on Minute
Commit the same entry (but with a different timestamp so that the commit message is different to the first time)
Reveal the entry

Result:
All successful responses from the calls, however only the first commit/reveal makes it into the entry block.

When checking the ack of the second commit by txid, I get the response:
{
"jsonrpc": "2.0",
"id": 0,
"result": {
"committxid": "5931cca67e959bb57b37a183adf1d4c0ba8c6730170a70ae238f9c9f323a3c1b",
"entryhash": "",
"commitdata": {
"status": "Unknown"
},
"entrydata": {
"status": ""
}
}
}

Also to add to this, once broadcasting the same entries, an entry got stuck in "NotConfirmed" when checking the pending-entries and this persisted for multiple blocks which prevented that entry from getting in (even if it was sent again).

hi,I can't running factomd.exe

This system is Window 2008 AND Window 10

I'm try close factomd , then restart it.

but give me some error.

Then I'm from factom-d.log file find the as following log

2016-10-05T15:18:57+08:00 [WARNING] FTMD: Go compiler version:go1.6.2
2016-10-05T15:18:58+08:00 [INFO] FTMD: Database started from: C:\Users\Administrator.PC-20140723ZFPN/.factom/ldb
2016-10-05T15:18:58+08:00 [INFO] WSAPI: Starting server
2016-10-05T15:18:58+08:00 [INFO] FTMD: Waiting for the processor to be initialized...
2016-10-05T15:19:00+08:00 [INFO] FTMD: Waiting for the processor to be initialized...
2016-10-05T15:19:02+08:00 [INFO] FTMD: Waiting for the processor to be initialized...
2016-10-05T15:19:03+08:00 [INFO] PROC: Loaded 57393 Directory blocks for chain: 000000000000000000000000000000000000000000000000000000000000000d

like initializezed afer, from block for chain 0 query . but BlockHeight is 57393

AND I can't find fctwallet.dat , Isn't backend my wallet

Ubuntu run out of inodes due to factomd

Hi guys,
I host factomd in production for Blocknotary Classic iOS app https://itunes.apple.com/us/app/blocknotary-bitcoin-blockchain/id998052799?mt=8

Recently, notarization with Factom stopped to work with no space left on device error

root@factom:~# factomd
2016/11/07 17:21:07 read factom config file:  /root/.factom/factomd.conf
Go compiler version: go1.6.2
boltDBpath: /root/.factom/
panic: open /root/.factom/ldb/315445.ldb: no space left on device

The server had plenty of disk space

root@factom:~/# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/vda1        30G   17G   12G  58% /
none            4.0K     0  4.0K   0% /sys/fs/cgroup
udev            487M  4.0K  487M   1% /dev
tmpfs           100M  324K  100M   1% /run
none            5.0M     0  5.0M   0% /run/lock
none            498M     0  498M   0% /run/shm
none            100M     0  100M   0% /run/user

But ran out of inodes

Filesystem      Inodes   IUsed  IFree IUse% Mounted on
/dev/vda1      1966080 1966080      0  100% /
none            127234       2 127232    1% /sys/fs/cgroup
udev            124520     402 124118    1% /dev
tmpfs           127234     307 126927    1% /run
none            127234       1 127233    1% /run/lock
none            127234       1 127233    1% /run/shm
none            127234       2 127232    1% /run/user

I used script to find where the server ran out of inodes

for i in /root/.factom/*; do echo $i; find $i |wc -l; done

I found that data folder ate all inodes

./000000000000000000000000000000000000000000000000000000000000000c
3302
./000000000000000000000000000000000000000000000000000000000000000d
3302
./000012.ldb
1
./000013.ldb
1
./000014.ldb
1
./000015.ldb
1
./000018.log
1
./btcd.log
1
./CURRENT
1
./data
1618889

Questions:

  • how do you deal with this in your environment?
  • what can I do now to fix my server?

panic on anchor ETH

{"AnchorRecordVer":1,"DBHeight":2164,"KeyMR":"8d957d53ee7ee5ef68554393ce5cc2c71b6eac34131bb88214d2ee7be211cd5f","RecordHeight":0,"Ethereum":{"Address":"0x100c8b406978a413c4305b3aa6074f734fee6c9c","TXID":"0x0bc369950e0d033ab9ef8251821b706ecd1e8d2fe9bc0b58761de51cb8ad5c7e","BlockHeight":1422065,"BlockHash":"0xddb8ffd35ceeff5149e10d56bbe0ae98be7b2d5c89cbd61c7ff50de40b51179d","Offset":1}}
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0x14847ec]

goroutine 70 [running]:
github.com/FactomProject/factomd/database/databaseOverlay.AnchorRecordToDirBlockInfo(0xc42172d100, 0x2, 0x2, 0x19a)
/Users/jet/gocode/src/github.com/FactomProject/factomd/database/databaseOverlay/anchorInfo.go:156 +0xac
github.com/FactomProject/factomd/database/databaseOverlay.(*Overlay).SaveAnchorInfoFromEntryMultiBatch(0xc42044b1a0, 0x1c4f200, 0xc421746d20, 0x40, 0x1)
/Users/jet/gocode/src/github.com/FactomProject/factomd/database/databaseOverlay/anchorInfo.go:90 +0x3e6
github.com/FactomProject/factomd/database/databaseOverlay.(*Overlay).InsertEntryMultiBatch(0xc42044b1a0, 0x1c4f200, 0xc421746d20, 0xc4212739e8, 0x569f5e2fc678a501)
/Users/jet/gocode/src/github.com/FactomProject/factomd/database/databaseOverlay/entry.go:54 +0x6ae
github.com/FactomProject/factomd/state.(*DBStateList).SaveDBStateToDB(0xc42044b140, 0xc42014a690, 0xc42014a600)
/Users/jet/gocode/src/github.com/FactomProject/factomd/state/dbStateManager.go:1276 +0x13db
github.com/FactomProject/factomd/state.(*DBStateList).UpdateState(0xc42044b140, 0xc4000008dc)
/Users/jet/gocode/src/github.com/FactomProject/factomd/state/dbStateManager.go:1385 +0x10f
github.com/FactomProject/factomd/state.(*State).UpdateState(0xc420412000, 0x0)
/Users/jet/gocode/src/github.com/FactomProject/factomd/state/state.go:1654 +0xd0
github.com/FactomProject/factomd/state.(*State).ValidatorLoop(0xc420412000)

[QUESTION] How to make factoid-submit call to daemon?

Understand wallet is preferable.
Version, 6 byte timestamp, RCD1/signatures is easy enough.
The remainder is just inputs/outputs/amounts? Any simple way to get these hashes? and are the checksums/magic numbers removed first?
A get-transactions call lists nearly everything needed besides these.

Use a python wrapper for the api and requests auto-escapes the inline json of submit, so far it's messy to fix, curl or cli for the same transaction works. Considering submit through daemon instead, possibly easier, well in my case at least.

Also, factoid-sub-fee is missing from the api docs?

Cheers!

Can not execute command with factom-cli. Need help.

Hello! I am on Ubuntu. I have started factomd and factom-walletd. Now I try to execute command:

factom-cli generateaddress fct factoid1

which shows:

No help for: generateaddress fct factoid1

What is the problem? Thanks!

factomd command not found

I've tried and tried and cried
I've started with a fresh ubuntu env
and have followed the instructions to a T
still getting factomd command not found.

does this even work?

ERROR reading config file on Mac

2016/05/21 11:31:12 read factom config file: /Users/noguru/.factom/factomd.conf
2016/05/21 11:31:12 ERROR Reading config file!

I always get this error when running factomd. Just got the latest release and it's still there

New GET /v2/status API endpoint requested

The courtesy node grant team is requesting a new API endpoint. This endpoint will help us support several use cases that have arisen during our development:

  1. Configure our load balancer health checks with a GET URL that returns a proper 200 when everything is working correctly.

Atm, we are just making a GET against /v2 and checking to see that we got a JSON payload back with the following structure:

{"jsonrpc":"2.0","id":null,"error":{"code":-32600,"message":"Invalid Request"}}

This call returns a 400, which is really not a correct return code when everything is working correctly.

  1. Our monitoring bot needs a full-featured status report from the node that allows us to glean the following information:

    • What is the state of the node: WAITING, IGNORE, SYNCED, etc?
    • Is the node following minutes?
    • What is the node's minute?
  2. In addition, other applications would probably find the following information useful:

    • Identity
    • Node type: LEADER, AUDIT, FOLLOWER
    • Current block <-- Anton says we already have that, which is true, but it might be nice to have it here as well.

I would like to discuss the structure of a JSON return payload that could support these use cases.

Preferred build platform?

What is the preferred build platform?

I just tried building on Ubunto 16.04 with nothing but issues. I only tried using this host because I already had it built awaiting other work.

Would this build properly on CentOS without issues with the location of GO, and beyond such as the errors I have pasted below?

It is actually MY preferred platform having been in RedHat for twenty years now.

root@hostname:~# go get github.com/FactomProject/factomd

runtime

/usr/local/go/src/runtime/lfstack_amd64.go:16: lfstackPack redeclared in this block
previous declaration at /usr/local/go/src/runtime/lfstack_64bit.go:37
/usr/local/go/src/runtime/lfstack_amd64.go:20: lfstackUnpack redeclared in thisblock
previous declaration at /usr/local/go/src/runtime/lfstack_64bit.go:41
/usr/local/go/src/runtime/os_linux.go:27: _FUTEX_WAIT redeclared in this block
previous declaration at /usr/local/go/src/runtime/os1_linux.go:22
/usr/local/go/src/runtime/os_linux.go:28: _FUTEX_WAKE redeclared in this block
previous declaration at /usr/local/go/src/runtime/os1_linux.go:23
/usr/local/go/src/runtime/os_linux.go:36: futexsleep redeclared in this block
previous declaration at /usr/local/go/src/runtime/os1_linux.go:31
/usr/local/go/src/runtime/os_linux.go:67: futexwakeup redeclared in this block
previous declaration at /usr/local/go/src/runtime/os1_linux.go:62
/usr/local/go/src/runtime/os_linux.go:83: getproccount redeclared in this block
previous declaration at /usr/local/go/src/runtime/os1_linux.go:78
/usr/local/go/src/runtime/os_linux.go:109: _CLONE_VM redeclared in this block
previous declaration at /usr/local/go/src/runtime/os1_linux.go:104
/usr/local/go/src/runtime/os_linux.go:110: _CLONE_FS redeclared in this block
previous declaration at /usr/local/go/src/runtime/os1_linux.go:105
/usr/local/go/src/runtime/os_linux.go:111: _CLONE_FILES redeclared in this block
previous declaration at /usr/local/go/src/runtime/os1_linux.go:106
/usr/local/go/src/runtime/os_linux.go:111: too many errors
root@hostname:~#

Experimantal Mac support for m1 factom

Here are some mac binaries for the milestone 1 factom programs.

http://dropjar.com/#1a9clmdj

Sha256 sums:

579811e2feb0e3fa965bb239fea97157385c93adebeb175d78d355a542015a2a mac_17_experiment.zip

ddd1219ea4abeb2b7822acdf68f90c31bac44eaa29e844f471defec2801a8c38 factom-cli
d722a55af520f30ee97a9ffeadd83a74e69d4bc1486bb9f9a79a2fe3196172da factomd
b61670cb23cd1617dd81400e39cc6820fb784379c3de72e5b4a618441a8545b6 fctwallet
5b6549c03635eae27085a4ea19455c407f271031dde56989856e5481853035fd walletapp

Use official golang ed25519 package

Factomd has a dependency on fork https://github.com/FactomProject/ed25519/
The repo that it was forked from actually became the official ed25519 package of the Golang crypo library: https://godoc.org/golang.org/x/crypto/ed25519.
I would recommend switching to this up to date package instead of the outdated fork. I know the reason for the fork was to add a function to avoid signature malleability, but this problem is actually now fixed in RFC 8032 which the official lib implement. You can see the exact commit here: golang/crypto@c4a91bd#diff-8183aa2c95dc1385c8f58bf1917fcb0b

The change shouldn't be too difficult because this is pretty much the same library (so same structures) but just up to date with some useful new functiosn such as NewKeyFromSeed. Keeping its library up to date allows you to get fixes and improvements for "free".

CheckDecodeWithTwoVersionBytes

go get github.com/FactomProject/factomd

# github.com/FactomProject/factomd/common/primitives
src/github.com/FactomProject/factomd/common/primitives/conversions.go:53: undefined: "github.com/FactomProject/btcutil/base58".CheckDecodeWithTwoVersionBytes
src/github.com/FactomProject/factomd/common/primitives/conversions.go:75: undefined: "github.com/FactomProject/btcutil/base58".CheckDecodeWithTwoVersionBytes

Show hostname on console and control panel

From Discord:

[Bedrock] jcheroskeToday at 12:57 PM
Not sure if this is the right place to ask this, but I was wondering if the 8090 console could have the hostname added to the display? All my nodes look alike!
...
[Bedrock] jcheroskeToday at 1:33 PM
It's obviously not a big deal, but it's a feature I'd like to see in the console. That way, no matter how you connect to your node, you'll see the name that the node itself is called. Seems useful

Having an issue syncing factomd - DROPPING MESSAGES and gob: unknown type id or corrupted data

I am trying to sync factomd v0.4.22 however see this repeatedly in the logs:
"component":"networking","level":"warning","msg":"nonBlockingChanSend() - DROPPING MESSAGES. Channel is over 90 percent full! \n channel len: \n 4751 \n 90 percent: \n 4750

then a lot of:
component":"networking","func":"HandleNetErrors","level":"warning","msg":"Going offline due to -- gob: unknown type id or corrupted data","package":"p2p","peer_type":"regular"

Duplicate file causes issue with `go mod`

When using go mod, two files with the same names except for the case of letter in the name causes an issue when unzipping.

$ go mod tidy
go: finding github.com/FactomProject/factom/wallet latest
go: finding github.com/FactomProject/btcd/btcec latest
go: finding github.com/FactomProject/factomd/common/factoid latest
go: finding github.com/FactomProject/factomd/common/interfaces latest
go: finding github.com/FactomProject/factomd/common/primitives latest
go: finding github.com/FactomProject/factomd/database/mapdb latest
go: finding github.com/FactomProject/factomd/database/hybridDB latest
go: finding github.com/FactomProject/factomd/common/directoryBlock latest
go: finding github.com/FactomProject/factomd/database/securedb latest
go: finding github.com/FactomProject/factomd/database/databaseOverlay latest
go: finding github.com/FactomProject/factomd/common latest
go: finding github.com/FactomProject/factomd/database latest
go: extracting github.com/FactomProject/factomd v5.4.2+incompatible
-> unzip /home/aslevy/go/pkg/mod/cache/download/github.com/!factom!project/factomd/@v/v5.4.2+incompatible.zip: case-insensitive file name collision: "scripts/networks/fourSegments26.txt" and "scripts/networks/foursegments26.txt"
go: finding github.com/FactomProject/factomd/testHelper latest

Running a diff of the two files in question it shows they are duplicates.

$ cd $GOPATH/src/github.com/FactomProject/factomd
$ diff scripts/networks/foursegments26.txt scripts/networks/fourSegments26.txt

This would easily be resolved by removing one of these files.

go run time version check issue

want to know why need check version like this :
if strings.Contains(runtime.Version(), "1.5") {
goodenough = true
}
....
could just check whether the go version later than 1.5?
cause if use go 1.8 , the factomd can not start.

factom node can not sync

current Block Height: 138948
version:0.4.2.21
use default config file

we had found it can not sync that it always is 138948,so we update factom version to 0.4.2.21.
And we had clear all data.
But it does not work.
It do not have error logs.

p2p/peer.go/Peer.LocationFromAddress() panics when Peer.Address contains an interface name as returned by Linux 4.14.36

When Peer.Address contains an address like "fe80::f6:ecff:fe05:5ffc%eth0", Peer.LocationFromAddress panics due to index out of range.

The full panic is:

panic: runtime error: index out of range
goroutine 52 [running]:
github.com/FactomProject/factomd/p2p.(*Peer).LocationFromAddress(0xc4200b9a00, 0x15)
        /build/factomd/src/src/github.com/FactomProject/factomd/p2p/peer.go:141 +0x489
github.com/FactomProject/factomd/p2p.(*Peer).Init(0xc4200b9a00, 0xc420130c9b, 0x15, 0xc420130cb1, 0x4, 0x100000000, 0x0, 0x0)
        /build/factomd/src/src/github.com/FactomProject/factomd/p2p/peer.go:65 +0x333
github.com/FactomProject/factomd/p2p.(*Controller).parseSpecialPeers(0xc4202046e0, 0xc420130c80, 0x35, 0x1, 0x44bea8, 0xab72a411278d, 0x800000000c321a26)
        /build/factomd/src/src/github.com/FactomProject/factomd/p2p/controller.go:386 +0x2b6
github.com/FactomProject/factomd/p2p.(*Controller).initSpecialPeers(0xc4202046e0, 0xcbbd22, 0x6, 0xc4201a6130, 0x4, 0xc42001cf30, 0x2b, 0x100feedbeef, 0xc420238150, 0x60, ...)
        /build/factomd/src/src/github.com/FactomProject/factomd/p2p/controller.go:363 +0x78
github.com/FactomProject/factomd/p2p.(*Controller).Init(0xc4202046e0, 0xcbbd22, 0x6, 0xc4201a6130, 0x4, 0xc42001cf30, 0x2b, 0x100feedbeef, 0xc420238150, 0x60, ...)
        /build/factomd/src/src/github.com/FactomProject/factomd/p2p/controller.go:190 +0x819
github.com/FactomProject/factomd/engine.NetStart(0xc4200f0000, 0x12d09c0, 0x0)
        /build/factomd/src/src/github.com/FactomProject/factomd/engine/NetStart.go:378 +0x3f3f
created by github.com/FactomProject/factomd/engine.Factomd
        /build/factomd/src/src/github.com/FactomProject/factomd/engine/factomd.go:60 +0x34f

This can occur on Linux with an interface with an ipv6 address when a user specifies their own hostname as a special peer. In this situation net.LookupHost(address) in Peer.Init() on line 51 of p2p/peer.go returns an array of both the ipv6 and the ipv4 address as this custom debug output shows:

time="2018-05-02T16:54:29-08:00" level=debug msg="address: node2.entrycredits.io" address=node2.entrycredits.io component=networking package=p2p peerType=1 port=8108 subpack=peer
time="2018-05-02T16:54:29-08:00" level=debug msg="net.LookupHost(p.Address) returned ipAddress: [fe80::f6:ecff:fe05:5ffc%eth0 10.0.0.210] err: <nil>" address=node2.entrycredits.io component=networking package=p2p peerType=1 port=8108 subpack=peer

As you can see, the resolver for Linux is returning an ipv6 address with the interface appended: fe80::f6:ecff:fe05:5ffc%eth0.

Next, on line 65 Peer.LocationFromAddress() is called and this again calls net.LookupHost(p.Address). But since this relies on the same Linux resolver, this does not return an error and just returns the same IP address it was given, still including the appended %eth0. Now when net.ParseIP(p.Address) is called again, it returns nil because it does not handle the appended interface name. Again, this custom debug output shows this:

time="2018-05-02T16:54:29-08:00" level=debug msg="p.Address: fe80::f6:ecff:fe05:5ffc%eth0" address=node2.entrycredits.io component=networking package=p2p peerType=1 port=8108 subpack=peer
time="2018-05-02T16:54:29-08:00" level=debug msg="net.LookupHost(p.Address) returned ipAddress: [fe80::f6:ecff:fe05:5ffc%eth0] err: <nil>" address=node2.entrycredits.io component=networking package=p2p peerType=1 port=8108 subpack=peer
time="2018-05-02T16:54:29-08:00" level=debug msg="net.ParseIP(p.Address) returned ip: <nil>" address=node2.entrycredits.io component=networking package=p2p peerType=1 port=8108 subpack=peer

This is not checked for, and we proceed to deference the nil pointer on line 141, causing the panic.

Solutions

The simplest thing to do here is just check if ip == nil after line 135 and return 0 if so.

More niche things could be done to handle this like stripping out everything after % from addresses, but this is an edge case that doesn't matter since we don't need to peer with ourselves anyway.

Config filepath broken on windows

It is at the moment impossible to use a configuration file on Windows for the wallet/cli

factomd/util/config.go

Lines 291 to 293 in ddc4817

if filename[0:1] != "/" {
filename = GetHomeDir() + "/.factom/m2/" + filename
}

By default, the wallet/cli will send an absolute path from util.ConfigFilename() as parameter. The above lines of code will prepend the location path anyway, resulting in the following error:

Reading from 'C:\Users\X/.factom/m2/C:\Users\X/.factom/m2/factomd.conf'
Cannot open custom config file,
Starting with default settings.
open C:\Users\X/.factom/m2/C:\Users\X/.factom/m2/factomd.conf: The filename, directory name, or volume label syntax
is incorrect.

Golang's filepath library has a built in OS independent function for this. Proposed fix:
WhoSoup@8e8a556

factoid balance is negative number in rpc respoce

Hi
I found that balance of some factoid addresses are negative in rpc responce.
So I can't get correct balance.

for example

curl -X POST --data-binary '{"jsonrpc": "2.0", "id": 0, "method":
"factoid-balance", "params":{"address":"FA2gHchEjYhUwHrzdRUYYs2Z2tbAxHzD5JdFGGoaJT2f2n6xAE5t"}}' \
-H 'content-type:text/plain;' http://localhost:8088/v2
{"jsonrpc":"2.0","id":0,"result":{"balance":-47632489}}

Can't start - out of memory?

Simply trying to run factomd

$ factomd
2016/10/03 01:23:37 read factom config file:  /home/chainhead/.factom/factomd.conf
2016/10/03 01:23:37 ERROR Reading config file!
Server starting with default settings...
 open /home/chainhead/.factom/factomd.conf: no such file or directory
Go compiler version: go1.6.2
boltDBpath: /home/chainhead/.factom/
2016/10/03 01:23:37 web.go serving :8088

'factomd initializeonly' will do just that.  Initialize and stop.


>>>>>>>>>>>>>>>>>  CLIENT MODE <<<<<<<<<<<<<<<<<<<<<<<


01:23:39 2016-10-03 [WRN] BTCD: open /home/chainhead/.factom/NONE.conf: no such file or directory
01:23:39 2016-10-03 [INF] BTCD: Version 0.9.0-beta
peers.json is disabled for Milestone1
01:23:39 2016-10-03 [INF] RPCS: RPC server listening on 127.0.0.1:8384
01:23:39 2016-10-03 [INF] SRVR: Server listening on 0.0.0.0:8108 ; MaxPeers= 125
01:23:39 2016-10-03 [INF] SRVR: Server listening on [::]:8108 ; MaxPeers= 125
01:23:39 2016-10-03 [INF] DISC: 1 addresses found from DNS seed factom.network
Killed

But it always crashes nearly right-away. I believe the issue is probably that the machine runs out of memory since it only has 512mb and I notice that it's using ~83% of it right before crashing (polling is slow so that might not be peak).

Any way that I can reduce memory? I noticed from another issue that changing the loglevel could help, but I tried setting it to 'critical' and that didn't work...

CheckDecodeWithTwoVersionBytes undefined

Hello,
when trying to build factomd, I get the following errors:

# github.com/FactomProject/factomd/common/primitives
src/github.com/FactomProject/factomd/common/primitives/conversions.go:53: undefined: "github.com/FactomProject/btcutil/base58".CheckDecodeWithTwoVersionBytes
src/github.com/FactomProject/factomd/common/primitives/conversions.go:75: undefined: "github.com/FactomProject/btcutil/base58".CheckDecodeWithTwoVersionBytes

I fixed this by using CheckDecode in those lines instead. It is a correct solution?

factomd/common/factoid vs factoid

The factoid package exists twice, once as own repository and once within factomd. While very similar, they are not equivalent, e.g., the Transaction.SetSignatureBlock() method has a different signature. One receives a factoid.ISignatureBlock parameter and the other a interfaces.ISignatureBlock.

The wallet is using the version within factomd. So what is the purpose of the factoid repository? There aren't any commits since April. Is it outdated?

Inconsistent data returned by 'transaction' API for latest coinbase transaction?

If I query the latest coinbase transaction that appears in my Control Panel here's what I get:

$ curl -X POST --data-binary '{"jsonrpc": "2.0", "id": 0, "method": "transaction", "params":
{"hash":"9d10910011f695881aed57d8fd176d23b70046f0ec6e4d2aa65bb86b87862266"}}' -H 'content-type:text/plain;' http://52.202.51.229:8088/v2

{"jsonrpc":"2.0","id":0,"result":{"factoidtransaction":{"txid":null,"blockheight":0,"millitimestamp":1521938280933,"inputs":null,"outputs":null,"outecs":null,"rcds":null,"sigblocks":null},"includedintransactionblock":"c1c64c1a0a1731ad2398ce1e44e82ba6682cbfce3b7d995e98a469ce955fc9d6","includedindirectoryblock":"3090c6464849b503124d92332877dd986fa15e3fd41832a61c9278786005a13d","includedindirectoryblockheight":22426}}

Now querying again the same coinbase transaction but 10 min later (so it's not the latest coinbase transaction anymore)

curl -X POST --data-binary '{"jsonrpc": "2.0", "id": 0, "method": "transaction", "params":
{"hash":"9d10910011f695881aed57d8fd176d23b70046f0ec6e4d2aa65bb86b87862266"}}' -H 'content-type:text/plain;' http://52.202.51.229:8088/v2

{"jsonrpc":"2.0","id":0,"result":{"factoidtransaction":{"txid":"9d10910011f695881aed57d8fd176d23b70046f0ec6e4d2aa65bb86b87862266","blockheight":0,"millitimestamp":1521938280933,"inputs":[],"outputs":[],"outecs":[],"rcds":[],"sigblocks":[]},"includedintransactionblock":"c1c64c1a0a1731ad2398ce1e44e82ba6682cbfce3b7d995e98a469ce955fc9d6","includedindirectoryblock":"3090c6464849b503124d92332877dd986fa15e3fd41832a61c9278786005a13d","includedindirectoryblockheight":22426}}

My concern is about the result of the first command while it's still the latest coinbase transaction displayed in my Control Panel. Everything is basically null.

package github.com/FactomProject/btcutil/certs: cannot find package

go get github.com/FactomProject/factomd
package github.com/FactomProject/btcutil/certs: cannot find package "github.com/FactomProject/btcutil/certs" in any of:
/opt/golang/current/src/github.com/FactomProject/btcutil/certs (from $GOROOT)
/xxx/work/src/github.com/FactomProject/btcutil/certs (from $GOPATH)

Windows 10 out of memory error

Referring to production version, not m2

At low block heights factomd starts and syncs perfectly, at higher blocks (~30,000?) it crashes on startup with out of memory error.

Physical memory is abundant, set virtual memory to an oversized 20gb pagefile, deleted blockchain and re-synced, still getting the same runtime error.

Windows 10 / 8gb ram / .factom stored on ssd C: drive with >30Gb free

runtime: out of memory: cannot allocate 65536-byte block (1073020928 in use)

runtime stack: http://pastebin.com/raw/bVnt4CJC

factom.md returns error: is not a valid IP address

I tried to run factom, but it returns an error:

Last login: Mon Oct  5 16:17:41 on ttys001
MacBook-Air-user:~ user$ /Applications/FactomApps/factomd ; exit;
2015/10/05 16:23:12 read factom config file:  /Users/user/.factom/factomd.conf
Go compiler version:  go1.5.1
boltDBpath: /Users/user/.factom/

'factomd initializeonly' will do just that.  Initialize and stop.


>>>>>>>>>>>>>>>>>  CLIENT MODE <<<<<<<<<<<<<<<<<<<<<<<


2015/10/05 16:23:12 web.go serving :8088
16:23:12 2015-10-05 [WRN] BTCD: open /Users/user/.factom/NONE.conf: no such file or directory
16:23:12 2015-10-05 [INF] BTCD: Version 0.9.0-beta
16:23:12 2015-10-05 [INF] RPCS: Generating TLS certificates...
16:23:12 2015-10-05 [INF] RPCS: Done generating TLS certificates
16:23:12 2015-10-05 [ERR] BTCD: Unable to start server on [:8108]: 'fe80::1%lo0' is not a valid IP address
logout

Simulator Setup on Linux

Minor thing starting from scratch on lubuntu, but someone else might find it useful.
compiling shows 2 repos missing, had to download manually. Also needed to change permissions for /.factom folder to initialise databases, which didn't occur with v1

Compiling: factomd
../factom/addresses.go:16:2: cannot find package "github.com/FactomProject/go-bip44" in any of:
/usr/local/go/src/github.com/FactomProject/go-bip44 (from $GOROOT)
/home/m/src/github.com/FactomProject/go-bip44 (from $GOPATH)
../factom/resolve.go:10:2: cannot find package "github.com/FactomProject/netki-go-partner-client" in any of:
/usr/local/go/src/github.com/FactomProject/netki-go-partner-client (from $GOROOT)
/home/m/src/github.com/FactomProject/netki-go-partner-client (from $GOPATH)

Fixed with:
go get github.com/FactomProject/go-bip44
go get github.com/FactomProject/netki-go-partner-client

And when using Map, nodes have a mkdir error complaining its not a folder. Saves as a blank file instead, this is Map overwriting?

Could not create /home/m/.factom/m2/database/Log/Sim1
error: mkdir /home/m/.factom/m2/database/Log/Sim1: not a directory

go install

expected experience:
go install
installs

actual experience:

../../hashicorp/go-plugin/client.go:5:2: cannot find package "context" in any of:
/usr/lib/go-1.6/src/context (from $GOROOT)
/home/futjrn/go/src/context (from $GOPATH)
../../../golang.org/x/crypto/ripemd160/ripemd160block.go:12:2: cannot find package "math/bits" in any of:
/usr/lib/go-1.6/src/math/bits (from $GOROOT)
/home/futjrn/go/src/math/bits (from $GOPATH)

I noticed math/bits and context were no got when I go get GitHub.com/factomproject/factomd

what do?

go get command was failed

Hi there.

I had a trouble to get started.
Does anyone encount same error?

OS is macOS Sierra, and go version is go1.6.4 darwin/amd64.

go get github.com/FactomProject/factomd

# github.com/FactomProject/factomd/state
../../../.go/src/github.com/FactomProject/factomd/state/entrySyncing.go:57: ESAsking.Set undefined (type prometheus.Counter has no field or method Set)
../../../.go/src/github.com/FactomProject/factomd/state/entrySyncing.go:58: ESAsking.Set undefined (type prometheus.Counter has no field or method Set)
../../../.go/src/github.com/FactomProject/factomd/state/entrySyncing.go:59: ESFound.Set undefined (type prometheus.Counter has no field or method Set)
../../../.go/src/github.com/FactomProject/factomd/state/entrySyncing.go:60: ESAvgRequests.Set undefined (type prometheus.Counter has no field or method Set)
../../../.go/src/github.com/FactomProject/factomd/state/entrySyncing.go:148: ESMissingQueue.Set undefined (type prometheus.Counter has no field or method Set)
../../../.go/src/github.com/FactomProject/factomd/state/entrySyncing.go:149: ESDBHTComplete.Set undefined (type prometheus.Counter has no field or method Set)
../../../.go/src/github.com/FactomProject/factomd/state/entrySyncing.go:150: ESFirstMissing.Set undefined (type prometheus.Counter has no field or method Set)
../../../.go/src/github.com/FactomProject/factomd/state/entrySyncing.go:151: ESHighestMissing.Set undefined (type prometheus.Counter has no field or method Set)

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.