a16aecfa96
Why: big.Float is not an ideal type for dealing with monetary amounts, because no matter how high the precision, some non-integer decimal values can not be represented exactly in base-2 floating point. Also, storing gob-encoded big.Float values in the database makes it very hard to use those values in meaningful queries, making it difficult to do any sort of analysis on billing. For better accuracy, then, we can just represent monetary values as integers (in whatever base units are appropriate for the currency). For example, STORJ tokens or Bitcoins can not be split into pieces smaller than 10^-8, so we can store amounts of STORJ or BTC with precision simply by moving the decimal point 8 digits to the right. For USD values (assuming we don't want to deal with fractional cents), we can move the decimal point 2 digits to the right. To make it easier and less error-prone to deal with the math involved, I introduce here a new type, monetary.Amount, instances of which have an associated value _and_ a currency. Change-Id: I03395d52f0e2473cf301361f6033722b54640265 |
||
---|---|---|
.github | ||
certificate | ||
cmd | ||
crashcollect | ||
docs | ||
installer/windows | ||
multinode | ||
private | ||
resources | ||
satellite | ||
scripts | ||
storage | ||
storagenode | ||
testsuite | ||
versioncontrol | ||
web | ||
.dockerignore | ||
.gitignore | ||
CODE_OF_CONDUCT.md | ||
CONTRIBUTING.md | ||
go.mod | ||
go.sum | ||
Jenkinsfile | ||
Jenkinsfile.public | ||
Jenkinsfile.ui | ||
LICENSE | ||
MAINTAINERS.md | ||
Makefile | ||
monkit.lock | ||
package-lock.json | ||
proto.lock | ||
README.md |
Storj V3 Network
Storj is building a decentralized cloud storage network. Check out our white paper for more info!
Storj is an S3-compatible platform and suite of decentralized applications that allows you to store data in a secure and decentralized manner. Your files are encrypted, broken into little pieces and stored in a global decentralized network of computers. Luckily, we also support allowing you (and only you) to retrieve those files!
Table of Contents
Contributing to Storj
All of our code for Storj v3 is open source. If anything feels off, or if you feel that some functionality is missing, please check out the contributing page. There you will find instructions for sharing your feedback, building the tool locally, and submitting pull requests to the project.
A Note about Versioning
While we are practicing semantic versioning for our client libraries such as uplink, we are not practicing semantic versioning in this repo, as we do not intend for it to be used via Go modules. We may have backwards-incompatible changes between minor and patch releases in this repo.
Start using Storj
Our wiki has documentation and tutorials. Check out these three tutorials:
License
The network under construction (this repo) is currently licensed with the AGPLv3 license. Once the network reaches beta phase, we will be licensing all client-side code via the Apache v2 license.
For code released under the AGPLv3, we request that contributors sign our Contributor License Agreement (CLA) so that we can relicense the code under Apache v2, or other licenses in the future.
Support
If you have any questions or suggestions please reach out to us on our community forum or file a ticket at https://support.storj.io/.