Skip to content

blockchain info 1

Max Kaye edited this page Jun 23, 2020 · 6 revisions

sv-lib

sv-lib was a typescript lib Max wrote in 2018 for interfacing with SV Light (name of the blockchain backend we use).

It is useful as a reference for how to interact with SV Light, considering we'll need something v. similar in this app (either directly or as a library)

The following fork of my-ether-wallet is useful for interacting with the various on-chain contracts, too:

Dev/testnet env

APG's VotingAlpha SC: 0x7B8068D32AA298158E838Fcd9a324B9810AE8333

Test spec hash: 0x0000000000000000000000000000000000000000000000000000007236333536

Initial outputs from deployment to AWS:

Outputs: {
  "oMkDemocTxid": "0xfa354feb31924b49ec930fa8d4600b4c83a588ad56376dd1cd35550c5a73eb18",
  "oPublicNode1Ip": "54.153.142.251",
  "oMembershipAddr": "0xEFb85950a21910F62D00ab80197Fd2798760a74b",
  "oBBFarmAddr": "0x26A6f21358D39E4E3Cf34ef2Ac6b83186418e3b3",
  "oPublicNode0Ip": "3.24.234.52",
  "oTokenAbbrLookupAddr": "0x8ee026Bbbae598145B2206Df74050811BF2e6a76",
  "oCertificateArn": "arn:aws:acm:ap-southeast-2:005605650896:certificate/cfdf9079-550c-444b-a692-9cce046ac9ee",
  "oErc20BalanceProxyAddr": "0x809a90612C28BBc8f9A33F6484e731874C7941b3",
  "oIndexAddr": "0x813552517e36b4D8c5e8c7CA8c184Af5c314ecf2",
  "oBBFarmAux2Addr": "0x66e6aC2e8FA898003Fc1A0a2b5557f6526C2D76E",
  "oEthNetworkId": "2351283430",
  "oEc2KeyPairName": "sv-flux-app-dev-node-ec2-ssh-key",
  "oChainSpecUrl": "https://s3.ap-southeast-2.amazonaws.com/flux-app-dev-static-resources/chain/chainspec.json",
  "oStaticDomain": "static.blockchain.suzuka.flux.party",
  "oDemocHash": "0xb7a3bf2ddb4ae293770fd1e7e9697b165559c1986953d0352303ba4459b0cbd4",
  "oApiUrl": "https://api.blockchain.suzuka.flux.party/"
}

### RESULT ###

Env Vars for UI:

VUE_APP_WEB3_PROVIDER=<< UNKNOWN OUTPUT >>
VUE_APP_DEMOC_HASH=0xb7a3bf2ddb4ae293770fd1e7e9697b165559c1986953d0352303ba4459b0cbd4
VUE_APP_INDEX_CONTRACT_ADDR=0x813552517e36b4D8c5e8c7CA8c184Af5c314ecf2
VUE_APP_AUX_CONTRACT_ADDR=0x66e6aC2e8FA898003Fc1A0a2b5557f6526C2D76E
VUE_APP_API_ENDPOINT=https://api.blockchain.suzuka.flux.party/
VUE_APP_TOKEN_LOOKUP=0x8ee026Bbbae598145B2206Df74050811BF2e6a76

Me running the chain locally:

$ parity --chain chainspec.json
2020-04-29 18:37:13  Running AuRa with an even number of validators (2) is not recommended (risk of network split).
2020-04-29 18:37:13  Starting Parity-Ethereum/v2.7.2-stable-2662d19-20200206/x86_64-unknown-linux-gnu/rustc1.41.0
2020-04-29 18:37:13  Keys path /home/xertrov/.local/share/io.parity.ethereum/keys/sv-flux-app-dev-poa-net
2020-04-29 18:37:13  DB path /home/xertrov/.local/share/io.parity.ethereum/chains/sv-flux-app-dev-poa-net/db/14a36590242a9d92
2020-04-29 18:37:13  State DB configuration: fast2020-04-29 18:37:13  Operating mode: active2020-04-29 18:37:13  Not preparing block; cannot sign.2020-04-29 18:37:13  Configured for flux-app-dev PoA Network - Powered by SecureVote and Flux using AuthorityRound engine
2020-04-29 18:37:14  Not preparing block; cannot sign.
2020-04-29 18:37:18  Public node URL: enode://79f46dc499ddfc543e17fe9834dc3fd0e1926dfb83534be8ecc93acbe8fcdd2b45ed4b6c1918cfd3f68d9c3d71b6bb6f1d94f71cee3a0e140e9e96981c8
[email protected]:30303
2020-04-29 18:37:30  Running AuRa with an even number of validators (2) is not recommended (risk of network split).
2020-04-29 18:37:43     4/25 peers   16 KiB chain 159 KiB db 0 bytes queue 35 KiB sync  RPC:  0 conn,    0 req/s,    0 µs

  • TODO: post some code examples of usage

Auditor

ABIs and Solidity

tests and a warning:

delegation UI (not being used by us ATM)

https://delegation.light.secure.vote

ballot spec stuff

v1

SecureVote used 2 versions; the first version was a bit more basic, had some redundant info (start/end) or unused fields (binding/not binding) and looked like this:

{
    "ballotVersion": 1,
    "ballotInner": {
        "ballotTitle": "Some Bill We Can't Show On Google",
        "shortDesc": "It's a bill worht banning you for!\nYup!",
        "longDesc": "Lots\nOf\nStuff\nHere\n\n[have implemented markdown](https://example.com) for it before with ease",
        "startTime": 1589289673,
        "endTime": 1589333333,
        "erc20Addr": "0x3505f494c3f0fed0b594e01fa41dd3967645ca39",
        "discussionLink": null,
        "binding": false,
        "encryptionPK": null,
        "options": {
            "optionsVersion": 2,
            "options": null
        }
    }
}

v1 generation tool: https://admin.light.secure.vote

The above ballotspec can be downloaded: http://archive.secure.vote/0xde8a03ace7f69762a482ec3ac37c7eea3a44d8b56ecda6290a38d890684c81ef.json

push a valid ballotSpec to https://archive.push.secure.vote/ with a payload matching:

{
  "ballotBase64": "ewogICAgImJhbGxvdFZlcnNpb24iOiAxLAogICAgImJhbGxvdElubmVyIjogewogICAgICAgICJiYWxsb3RUaXRsZSI6ICJTb21lIEJpbGwgV2UgQ2FuJ3QgU2hvdyBPbiBHb29nbGUiLAogICAgICAgICJzaG9ydERlc2MiOiAiSXQncyBhIGJpbGwgd29yaHQgYmFubmluZyB5b3UgZm9yIVxuWXVwISIsCiAgICAgICAgImxvbmdEZXNjIjogIkxvdHNcbk9mXG5TdHVmZlxuSGVyZVxuXG5baGF2ZSBpbXBsZW1lbnRlZCBtYXJrZG93bl0oaHR0cHM6Ly9leGFtcGxlLmNvbSkgZm9yIGl0IGJlZm9yZSB3aXRoIGVhc2UiLAogICAgICAgICJzdGFydFRpbWUiOiAxNTg5Mjg5NjczLAogICAgICAgICJlbmRUaW1lIjogMTU4OTMzMzMzMywKICAgICAgICAiZXJjMjBBZGRyIjogIjB4MzUwNWY0OTRjM2YwZmVkMGI1OTRlMDFmYTQxZGQzOTY3NjQ1Y2EzOSIsCiAgICAgICAgImRpc2N1c3Npb25MaW5rIjogbnVsbCwKICAgICAgICAiYmluZGluZyI6IGZhbHNlLAogICAgICAgICJlbmNyeXB0aW9uUEsiOiBudWxsLAogICAgICAgICJvcHRpb25zIjogewogICAgICAgICAgICAib3B0aW9uc1ZlcnNpb24iOiAyLAogICAgICAgICAgICAib3B0aW9ucyI6IG51bGwKICAgICAgICB9CiAgICB9Cn0=",
  "assertSpecHash": "0xde8a03ace7f69762a482ec3ac37c7eea3a44d8b56ecda6290a38d890684c81ef"
}

hash alg is sha256