diff --git a/.gitignore b/.gitignore index fd01bcf1..218fd2fa 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ rosetta-cli +bin/ diff --git a/Makefile b/Makefile index bab383f5..584e1846 100644 --- a/Makefile +++ b/Makefile @@ -49,6 +49,9 @@ salus: release: add-license shorten-lines format test lint salus +compile: + xgo --targets=darwin/*,windows/*,linux/* -out bin/rosetta-cli-$(version) . + build: go build ./... diff --git a/README.md b/README.md index b3b7b991..55c06f27 100644 --- a/README.md +++ b/README.md @@ -29,10 +29,20 @@ Before diving into the CLI, we recommend taking a look at the Rosetta API Docs: * [Construction API](https://www.rosetta-api.org/docs/construction_api_introduction.html) ## Install +To install `rosetta-cli` from source, run: ``` go get github.com/coinbase/rosetta-cli ``` +To download a binary directly for MacOS and the latest release, run: +``` +curl -L https://github.com/coinbase/rosetta-cli/releases/download/v0.4.1/rosetta-cli-0.4.1-darwin-10.6-amd64 -o rosetta-cli; chmod +x rosetta-cli; +``` + +Otherwise, binaries for other operating systems can be found [here](https://github.com/coinbase/rosetta-cli/releases). + +_Downloading binaries from the Github UI will cause permission errors on Mac._ + ## Usage ``` CLI for the Rosetta API @@ -379,6 +389,7 @@ Global Flags: * `make test` to run tests * `make lint` to lint the source code (included generated code) * `make release` to run one last check before opening a PR +* `make compile version=RELEASE_TAG` to generate binaries ### Helper/Handler Many of the packages use a `Helper/Handler` interface pattern to acquire diff --git a/go.mod b/go.mod index b827b4a5..7939317d 100644 --- a/go.mod +++ b/go.mod @@ -11,4 +11,5 @@ require ( github.com/spf13/pflag v1.0.5 // indirect github.com/stretchr/testify v1.6.1 golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208 + src.techknowlogick.com/xgo v1.1.1-0.20200814033943-12cf2e8194ca // indirect ) diff --git a/go.sum b/go.sum index 1b911402..a9a2b3d9 100644 --- a/go.sum +++ b/go.sum @@ -57,38 +57,6 @@ github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+ github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cloudflare/cloudflare-go v0.10.2-0.20190916151808-a80f83b9add9/go.mod h1:1MxXX1Ux4x6mqPmjkUgTP1CdXIBXKX7T+Jk9Gxrmx+U= -github.com/coinbase/rosetta-sdk-go v0.3.4 h1:jWKgajozco/T0FNnZb2TqBsmsUoF6ZuCLnUJkEE+vNg= -github.com/coinbase/rosetta-sdk-go v0.3.4/go.mod h1:Q6dAY0kdG2X3jNaIYnkxnZOb8XEZQar9Q1RcnBgm/wQ= -github.com/coinbase/rosetta-sdk-go v0.3.5-0.20200819052137-5d2bf966818b h1:JSV23Q51pp5SEKEQ0ZspXevVz5xNdsCIpW786pVUf7g= -github.com/coinbase/rosetta-sdk-go v0.3.5-0.20200819052137-5d2bf966818b/go.mod h1:7y6tIrUHdxBAS0kshqdHZXyi0CQ+O9s+Itmodzxs7IQ= -github.com/coinbase/rosetta-sdk-go v0.3.5-0.20200819181259-3eff56cab108 h1:mW8fci/qMy7Jl5QjvMf1dkm+UKqoJnciCbyiLXcJeQo= -github.com/coinbase/rosetta-sdk-go v0.3.5-0.20200819181259-3eff56cab108/go.mod h1:7y6tIrUHdxBAS0kshqdHZXyi0CQ+O9s+Itmodzxs7IQ= -github.com/coinbase/rosetta-sdk-go v0.3.5-0.20200820180443-42a93b8550a6 h1:F3JgwPlV7PeQzzs1t/clxrlT6W1+WAQApV1rQ7o7nOI= -github.com/coinbase/rosetta-sdk-go v0.3.5-0.20200820180443-42a93b8550a6/go.mod h1:CuKG9s+UkPYUKgm13Ya3yxn/7qKTob26BKlbwdBwKno= -github.com/coinbase/rosetta-sdk-go v0.3.5-0.20200820200011-c3c8e8434403 h1:WNdV8UspEi1llzLeq2HSL91VtC2HuPOyI+snj6V4QLs= -github.com/coinbase/rosetta-sdk-go v0.3.5-0.20200820200011-c3c8e8434403/go.mod h1:CuKG9s+UkPYUKgm13Ya3yxn/7qKTob26BKlbwdBwKno= -github.com/coinbase/rosetta-sdk-go v0.3.5-0.20200820205631-4c7341da957f h1:jkgbBhpSeqPIgvCUEzi8ijOHjMEuvaTygpZrYo7m0N8= -github.com/coinbase/rosetta-sdk-go v0.3.5-0.20200820205631-4c7341da957f/go.mod h1:CuKG9s+UkPYUKgm13Ya3yxn/7qKTob26BKlbwdBwKno= -github.com/coinbase/rosetta-sdk-go v0.3.5-0.20200821143659-1916d6b4bde3 h1:/XBnrmEdVH8j7dsDIArND3leI3JWOq2M1UVTGtBtmyQ= -github.com/coinbase/rosetta-sdk-go v0.3.5-0.20200821143659-1916d6b4bde3/go.mod h1:CuKG9s+UkPYUKgm13Ya3yxn/7qKTob26BKlbwdBwKno= -github.com/coinbase/rosetta-sdk-go v0.3.5-0.20200823205952-7cecd3cb6e87 h1:Kzg6yIEvndcxCmj0W8pwrDXjDR8T8uab14qwzFO7M8k= -github.com/coinbase/rosetta-sdk-go v0.3.5-0.20200823205952-7cecd3cb6e87/go.mod h1:/dKD5dZJ0bzDXrd/M3XMQmpXRk0bru3s9EMIeyBJfy4= -github.com/coinbase/rosetta-sdk-go v0.3.5-0.20200823213836-352196d0d456 h1:XmkCep09YaBQYcZuVlctAfWuF/fHBKe456UMpq4mNiM= -github.com/coinbase/rosetta-sdk-go v0.3.5-0.20200823213836-352196d0d456/go.mod h1:/dKD5dZJ0bzDXrd/M3XMQmpXRk0bru3s9EMIeyBJfy4= -github.com/coinbase/rosetta-sdk-go v0.3.5-0.20200823214948-e4483cf68f05 h1:4oV9FwCHfbS/7DNHFl4Z1QzgV4TcEBvvLKkg5SpT4FM= -github.com/coinbase/rosetta-sdk-go v0.3.5-0.20200823214948-e4483cf68f05/go.mod h1:/dKD5dZJ0bzDXrd/M3XMQmpXRk0bru3s9EMIeyBJfy4= -github.com/coinbase/rosetta-sdk-go v0.3.5-0.20200823223149-c0198457c35b h1:SFzcSwlJq48TxtN26psU2GCt05+dPp0SRjfgkcu1jio= -github.com/coinbase/rosetta-sdk-go v0.3.5-0.20200823223149-c0198457c35b/go.mod h1:/dKD5dZJ0bzDXrd/M3XMQmpXRk0bru3s9EMIeyBJfy4= -github.com/coinbase/rosetta-sdk-go v0.3.5-0.20200823224719-50905784782b h1:sQ3DvCS3BXgo4jfdQLl1gaB4CA7RjpswCTc8MXz17KM= -github.com/coinbase/rosetta-sdk-go v0.3.5-0.20200823224719-50905784782b/go.mod h1:/dKD5dZJ0bzDXrd/M3XMQmpXRk0bru3s9EMIeyBJfy4= -github.com/coinbase/rosetta-sdk-go v0.3.5-0.20200823231142-f9460bf368a6 h1:8xfgGrBrC2vxkkFAXuv/zfpU2CZi8kJpMTOPthtdngc= -github.com/coinbase/rosetta-sdk-go v0.3.5-0.20200823231142-f9460bf368a6/go.mod h1:/dKD5dZJ0bzDXrd/M3XMQmpXRk0bru3s9EMIeyBJfy4= -github.com/coinbase/rosetta-sdk-go v0.3.5-0.20200823232820-91097515172b h1:fz7eiGsWwhSlIkgubh4/kACZlpsf74wYra5yXt6P/VY= -github.com/coinbase/rosetta-sdk-go v0.3.5-0.20200823232820-91097515172b/go.mod h1:/dKD5dZJ0bzDXrd/M3XMQmpXRk0bru3s9EMIeyBJfy4= -github.com/coinbase/rosetta-sdk-go v0.3.5-0.20200824171955-1e3958442bc9 h1:iMAeF253Zdz7LgD0WUAqBnutSMCOItcF+DeX7VKS4T4= -github.com/coinbase/rosetta-sdk-go v0.3.5-0.20200824171955-1e3958442bc9/go.mod h1:/dKD5dZJ0bzDXrd/M3XMQmpXRk0bru3s9EMIeyBJfy4= -github.com/coinbase/rosetta-sdk-go v0.3.5-0.20200824172949-61aa33d621c1 h1:F9f2IlUT0KTssiEjxwv/37SmYdiPSboeNyCSsNuVa90= -github.com/coinbase/rosetta-sdk-go v0.3.5-0.20200824172949-61aa33d621c1/go.mod h1:/dKD5dZJ0bzDXrd/M3XMQmpXRk0bru3s9EMIeyBJfy4= github.com/coinbase/rosetta-sdk-go v0.3.5-0.20200824221853-d7b1fe2f9239 h1:eP88DoIkcbMG5zHja3lUh4F2c+9am1T0zk/AChy1Vpo= github.com/coinbase/rosetta-sdk-go v0.3.5-0.20200824221853-d7b1fe2f9239/go.mod h1:/dKD5dZJ0bzDXrd/M3XMQmpXRk0bru3s9EMIeyBJfy4= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= @@ -170,10 +138,6 @@ github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.2-0.20200707131729-196ae77b8a26 h1:lMm2hD9Fy0ynom5+85/pbdkiYcBqM1JWmhpAXLmy0fw= github.com/golang/snappy v0.0.2-0.20200707131729-196ae77b8a26/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/google/addlicense v0.0.0-20200622132530-df58acafd6d5 h1:m6Z1Cm53o4VecQFxKCnvULGfIT0Igo3MX131i+00IIo= -github.com/google/addlicense v0.0.0-20200622132530-df58acafd6d5/go.mod h1:EMjYTRimagHs1FwlIqKyX3wAM0u3rA+McvlIIWmSamA= -github.com/google/addlicense v0.0.0-20200815122332-4295bd52e3cf h1:YE2N9S5+KJNPjtA0uTxDgtfZ7U7/Ia0IkKI5bCUYcp8= -github.com/google/addlicense v0.0.0-20200815122332-4295bd52e3cf/go.mod h1:EMjYTRimagHs1FwlIqKyX3wAM0u3rA+McvlIIWmSamA= github.com/google/addlicense v0.0.0-20200817051935-6f4cd4aacc89 h1:oTppmscIAQ2Y1tcsMDcTLR3z4MN/96/pvIsBSLGl7o8= github.com/google/addlicense v0.0.0-20200817051935-6f4cd4aacc89/go.mod h1:EMjYTRimagHs1FwlIqKyX3wAM0u3rA+McvlIIWmSamA= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= @@ -225,6 +189,7 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= +github.com/lucasjones/reggen v0.0.0-20180717132126-cdb49ff09d77 h1:6xiz3+ZczT3M4+I+JLpcPGG1bQKm8067HktB17EDWEE= github.com/lucasjones/reggen v0.0.0-20180717132126-cdb49ff09d77/go.mod h1:5ELEyG+X8f+meRWHuqUOewBOhvHkl7M76pdGEansxW4= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/mattn/go-colorable v0.1.0/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= @@ -291,7 +256,6 @@ github.com/rs/cors v0.0.0-20160617231935-a62a804a8a00/go.mod h1:gFx+x8UowdsKA9Ac github.com/rs/xhandler v0.0.0-20160618193221-ed27b6fd6521/go.mod h1:RvLn4FgxWubrpZHtQLnOf6EwhN2hEMusxZOhcW9H3UQ= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/segmentio/golines v0.0.0-20200306054842-869934f8da7b/go.mod h1:K7zjgP8yJ/U8nb8nxaSykalAKSvbqr6TNbd9B7zzBFU= github.com/segmentio/golines v0.0.0-20200808004416-0a9796b248e8/go.mod h1:bQSh5qdVR67XiCKbaVvYO41s50c5hQo+3cY/1CQQ3xQ= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/shirou/gopsutil v2.20.5+incompatible h1:tYH07UPoQt0OCQdgWWMgYHy3/a9bcxNpBIysykNIP7I= @@ -399,7 +363,6 @@ golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208 h1:qwRHBd0NqMbJxfbotnDhm2ByMI1Shq4Y6oRJo21SGJA= golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -487,3 +450,5 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +src.techknowlogick.com/xgo v1.1.1-0.20200814033943-12cf2e8194ca h1:kumZMjGGyzQDXLgV1CywLHdhnLtaFxDui/2IXqPtVMw= +src.techknowlogick.com/xgo v1.1.1-0.20200814033943-12cf2e8194ca/go.mod h1:31CE1YKtDOrKTk9PSnjTpe6YbO6W/0LTYZ1VskL09oU=