mirror of
https://github.com/arnaucube/go-dvote.git
synced 2026-02-28 05:26:46 +01:00
@@ -7,7 +7,7 @@ dVote library for Relay
|
|||||||
|
|
||||||
Includes a dummy generator. Example run:
|
Includes a dummy generator. Example run:
|
||||||
ipfs daemon &
|
ipfs daemon &
|
||||||
./dvote-relay
|
./go-dvote
|
||||||
and in another shell:
|
and in another shell:
|
||||||
./generator/generator 1000
|
./generator/generator 1000
|
||||||
|
|
||||||
|
|||||||
@@ -2,8 +2,8 @@ package batch
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/vocdoni/dvote-relay/types"
|
"github.com/vocdoni/go-dvote/types"
|
||||||
"github.com/vocdoni/dvote-relay/db"
|
"github.com/vocdoni/go-dvote/db"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import (
|
|||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
censusmanager "github.com/vocdoni/dvote-relay/service/census"
|
censusmanager "github.com/vocdoni/go-dvote/service/census"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|||||||
@@ -11,8 +11,8 @@ import (
|
|||||||
// "net/http"
|
// "net/http"
|
||||||
// "bytes"
|
// "bytes"
|
||||||
// "io/ioutil"
|
// "io/ioutil"
|
||||||
"github.com/vocdoni/dvote-relay/types"
|
"github.com/vocdoni/go-dvote/types"
|
||||||
"github.com/vocdoni/dvote-relay/net"
|
"github.com/vocdoni/go-dvote/net"
|
||||||
)
|
)
|
||||||
|
|
||||||
func makeBallot() string {
|
func makeBallot() string {
|
||||||
|
|||||||
@@ -7,10 +7,10 @@ import (
|
|||||||
"bytes"
|
"bytes"
|
||||||
"os"
|
"os"
|
||||||
"flag"
|
"flag"
|
||||||
"github.com/vocdoni/dvote-relay/batch"
|
"github.com/vocdoni/go-dvote/batch"
|
||||||
"github.com/vocdoni/dvote-relay/net"
|
"github.com/vocdoni/go-dvote/net"
|
||||||
"github.com/vocdoni/dvote-relay/db"
|
"github.com/vocdoni/go-dvote/db"
|
||||||
"github.com/vocdoni/dvote-relay/data"
|
"github.com/vocdoni/go-dvote/data"
|
||||||
)
|
)
|
||||||
|
|
||||||
var dbPath = "~/.dvote/relay.db"
|
var dbPath = "~/.dvote/relay.db"
|
||||||
|
|||||||
2
go.mod
2
go.mod
@@ -1,4 +1,4 @@
|
|||||||
module github.com/vocdoni/dvote-relay
|
module github.com/vocdoni/go-dvote
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/cheekybits/is v0.0.0-20150225183255-68e9c0620927 // indirect
|
github.com/cheekybits/is v0.0.0-20150225183255-68e9c0620927 // indirect
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/vocdoni/dvote-relay/batch"
|
"github.com/vocdoni/go-dvote/batch"
|
||||||
"github.com/vocdoni/dvote-relay/types"
|
"github.com/vocdoni/go-dvote/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
type HttpHandle struct {
|
type HttpHandle struct {
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
|
||||||
shell "github.com/ipfs/go-ipfs-api"
|
shell "github.com/ipfs/go-ipfs-api"
|
||||||
"github.com/vocdoni/dvote-relay/batch"
|
"github.com/vocdoni/go-dvote/batch"
|
||||||
"github.com/vocdoni/dvote-relay/types"
|
"github.com/vocdoni/go-dvote/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
type PubSubHandle struct {
|
type PubSubHandle struct {
|
||||||
|
|||||||
@@ -8,15 +8,15 @@ import (
|
|||||||
"strconv"
|
"strconv"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
tree "github.com/vocdoni/dvote-relay/tree"
|
tree "github.com/vocdoni/go-dvote/tree"
|
||||||
signature "github.com/vocdoni/dvote-relay/crypto/signature"
|
signature "github.com/vocdoni/go-dvote/crypto/signature"
|
||||||
)
|
)
|
||||||
|
|
||||||
const hashSize = 32
|
const hashSize = 32
|
||||||
const authTimeWindow = 10 // Time window (seconds) in which TimeStamp will be accepted if auth enabled
|
const authTimeWindow = 10 // Time window (seconds) in which TimeStamp will be accepted if auth enabled
|
||||||
var MkTrees map[string]*tree.Tree // MerkleTree dvote-census library
|
var MkTrees map[string]*tree.Tree // MerkleTree dvote-census library
|
||||||
var Signatures map[string]string
|
var Signatures map[string]string
|
||||||
var Signature signature.SignKeys // Signature dvote-relay library
|
var Signature signature.SignKeys // Signature go-dvote library
|
||||||
|
|
||||||
type Claim struct {
|
type Claim struct {
|
||||||
CensusID string `json:"censusId"` // References to MerkleTree namespace
|
CensusID string `json:"censusId"` // References to MerkleTree namespace
|
||||||
|
|||||||
Reference in New Issue
Block a user