A daemon written in Golang that maintains the current state of Factom Asset Tokens (FAT) tokens. Includes a CLI for interacting with the FAT Daemon from the command line.
Provides a standard RPC API to access FAT data.
The FAT protocol and this implementation is still in Alpha. That means that we are still testing and making changes to the protocol and the implementation. The on-chain data protocol is relatively stable but this implementation and the database schema is not.
So long as the major version is v0 everything is subject to potential change.
At times new v0 releases may require you to rebuild your fatd.db database from scratch, but this will be minimized after the next major release due to an improved migration framework and database validation on startup.
Please help us improve the code and the protocol by trying to break things and reporting bugs! Thank you!
Pre-compiled binaries for Linux, Windows, and Mac x86_64 systems can be found on the releases page.
This project uses SQLite3 which uses CGo to
dynamically link to the SQLite3 C shared libraries to the fatd Golang binary.
CGo requires that GCC be available on your system.
The following dependencies are required to build fatd and fat-cli.
- Golang 1.11.4 or later. The latest official release of Golang is always recommended.
- GNU GCC is used by CGo to link to the SQLite3 shared libraries.
- SQLite3 is the database
fatduses to save state. - Git is used to clone the project and is used by
go buildto pull some dependencies. - Bazaar VCS is used by
go buildto pull some dependencies. - GNU Bash is used by a small script which determines a build version number.
- GNU Make is used to execute build commands.
Ensure that Go Modules are enabled by cloning this project outside of your
GOPATH.
$ git clone https://github.com/Factom-Asset-Tokens/fatd.git
$ cd fatd
$ makeYou should now see the fatd and fat-cli binaries for your platform in the
current directory.
You can also build binaries for all platforms (Linux, Windows, Mac):
$ make distributionYou can install and run the fatd and fat-cli binaries from anywhere, so you
may select where you wish to install these on your system.
However, be aware that fatd will look for a directory named fatd.db in the
current working directory and will create it if it does not exist. So if you
start fatd from a new location then you will likely want to point it to use
an existing database using the -dbpath flag.
If you are using Bash or Zsh with completion you can install CLI completion for
fatd and fat-cli using the -installcompletion flag on each command.
$ fatd -installcompletion
Install completion for fatd? y
Installing...
Done!
$ fat-cli -installcompletion
Install completion for fat-cli? y
Installing...
Done!
This only adds lines to your .bash_profile or Zsh equivalent. So you must
restart your shell or source your .bash_profile for the completion to take
effect.
This only needs to be performed once and does not need to be repeated again
when fatd or fat-cli is updated.
Start the daemon from the command line:
$ ./fatd
INFO Fatd Version: r155.c812dd1 pkg=main
INFO State engine started. pkg=main
INFO JSON RPC API server started. pkg=main
INFO Factom Asset Token Daemon started. pkg=main
INFO Syncing from block 183396 to 183520... pkg=engine
INFO Synced. pkg=engine
To tell fatd to safely exit send a SIGINT. From most shells this can be
done by simply pressing CTRL+c.
INFO Synced. pkg=engine
^CINFO SIGINT: Shutting down now. pkg=main
INFO Factom Asset Token Daemon stopped. pkg=main
INFO JSON RPC API server stopped. pkg=main
INFO State engine stopped. pkg=main
$
Control how fatd runs using additional options at startup. For example:
./fatd -debug -dbpath /home/ubuntu/mycustomfolder| Name | Description | Validation | Default |
|---|---|---|---|
startscanheight |
The Factom block height to begin scanning for new FAT chains and transactions | Positive Integer | 0 |
debug |
Enable debug mode for extra information during runtime. No value needed. | - | - |
dbpath |
Specify the path to use as fatd's sqlite database. | Valid system path | Current working directory |
ecpub |
The public Entry Credit address used to pay for submitting transactions | Valid EC address | - |
apiaddress |
What port string the FAT daemon RPC will be bound to | String | :8078 |
s |
The URL of the Factom API host | Valid URL | localhost:8088 |
factomdtimeout |
The timeout in seconds to time out requests to factomd | integer | 0 |
factomduser |
The username of the user for factomd API authentication | string | - |
factomdpassword |
The password of the user for factomd API authentication | string | - |
factomdcert |
Path to the factomd connection TLS certificate file | Valid system path string | - |
factomdtls |
Whether to use TLS on connection to factomd | boolean | false |
w |
The URL of the Factom Wallet Daemon API host | Valid URL | localhost:8089 |
wallettimeout |
The timeout in seconds to time out requests to factomd | integer | 0 |
walletuser |
The username of the user for walletd API authentication | string | - |
walletpassword |
The username of the user for walletd API authentication | string | - |
walletcert |
Path to the walletd connection TLS certificate file | Valid system path string | - |
wallettls |
Whether to use TLS on connection to walletd | boolean | false |
For a complete up to date list of flags & options please see flag/flag.go
http://localhost:8078/v1
All PRs should be rebased on the latest develop branch commit.
Please attempt to reproduce the issue using the -debug flag. For fatd,
please provide the initial output which prints all current settings.
Intermediate DEBUG Scanning block 187682 for FAT entries. lines may be
omitted, but please provide the first and last of these lines.
Interact with the FAT daemon RPC from the command line: