1
0
mirror of https://github.com/oceanprotocol/barge.git synced 2024-12-02 05:57:21 +01:00

Merge pull request #40 from oceanprotocol/feature/secret_store

Feature/secret store
This commit is contained in:
Aitor 2018-11-15 09:38:03 +01:00 committed by GitHub
commit ef787f7777
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 268 additions and 12 deletions

11
.env Normal file
View File

@ -0,0 +1,11 @@
# Must be set to true for the first run, change it to "false" to avoid migrating the smart contracts on each run.
DEPLOY_CONTRACTS=true
# Ganache specific option, these two options have no effect when not running ganache-cli
GANACHE_DATABASE_PATH=.
REUSE_DATABASE=false
# Specify which ethereum client to run or connect to: kovan, ganache, or ocean_poa_net_local
KEEPER_NETWORK_NAME=ganache
ARTIFACTS_FOLDER=~/.ocean/keeper-contracts/artifacts
# Specify which ocean version use: stable, latests, ...
OCEAN_VERSION=stable
COMPOSE_FILE=docker-compose.yml

View File

@ -80,7 +80,7 @@ The Ocean Docker compose starts the following components:
### Environment Variables
The `start_ocean.sh` script sets defaults for the following environment variables but you can use these in combination with the Docker Compose files for further customization, e.g.:
The `start_ocean.sh` script and `.env` file sets defaults for the following environment variables but you can use these in combination with the Docker Compose files for further customization, e.g.:
```bash
export REUSE_DATABASE="true"

View File

@ -9,23 +9,25 @@ services:
- "27017:27017"
command: mongod
networks:
- backend
backend:
ipv4_address: 172.15.0.11
parity-node:
image: parity/parity:stable
image: oceanprotocol/parity-ethereum:beta
entrypoint: /opt/parity/parity
command:
--config /home/parity/parity/config/validator.toml
--config /home/parity/parity/config/secretstoreclient.toml
--db-path /home/parity/chains
--keys-path /home/parity/.local/share/io.parity.ethereum/keys
--base-path /home/parity/base
--engine-signer 0x00bd138abd70e2f00903268f3db08f2d25677c9e
--jsonrpc-interface 0.0.0.0
--ws-interface 0.0.0.0
--ui-interface 0.0.0.0
--unsafe-expose
--ws-interface all
--jsonrpc-cors all
--jsonrpc-interface all
--jsonrpc-hosts all
--jsonrpc-apis all
--unsafe-expose
--unlock 0x00bd138abd70e2f00903268f3db08f2d25677c9e
# entrypoint: tail -f /dev/null
volumes:
- ./parity/parity/config:/home/parity/parity/config
- parity-node:/home/parity/.local/share/io.parity.ethereum/
@ -36,12 +38,31 @@ services:
ports:
- 8545:8545
networks:
- backend
backend:
ipv4_address: 172.15.0.12
secret-store:
image: oceanprotocol/parity-ethereum:master
# entrypoint: tail -f /dev/null
entrypoint: /opt/parity/parity
command:
--config /etc/parity/secretstore/config.toml --jsonrpc-cors all --jsonrpc-interface all --jsonrpc-hosts all --jsonrpc-apis all
volumes:
- ./parity/secret_store/config/:/etc/parity/secretstore/
- secret-store:/parity_data/
- ./parity/secret_store/keys/:/parity_data/keys/ocean-network/
ports:
- 12000:12000
- 12001:12001
networks:
backend:
ipv4_address: 172.15.0.13
keeper-contracts:
image: oceanprotocol/keeper-contracts:${OCEAN_VERSION:-stable}
networks:
- backend
backend:
ipv4_address: 172.15.0.14
environment:
LOCAL_CONTRACTS: "true"
DEPLOY_CONTRACTS: ${DEPLOY_CONTRACTS}
@ -58,7 +79,8 @@ services:
ports:
- 5000:5000
networks:
- backend
backend:
ipv4_address: 172.15.0.15
depends_on:
- keeper-contracts
environment:
@ -71,6 +93,13 @@ services:
networks:
backend:
driver: bridge
ipam:
driver: default
config:
- subnet: 172.15.0.1/24
gateway: 172.15.0.1
volumes:
parity-node:
secret-store:

View File

@ -0,0 +1,26 @@
# Users config file in users.toml
# This configuration file can be used for either Alice, Bob or Charlie
[parity]
chain = "/home/parity/parity/config/chain.json"
[rpc]
port = 8545
interface = "0.0.0.0"
cors = ["all"]
hosts = ["all"]
apis = ["web3", "secretstore", "eth", "pubsub", "net", "parity", "parity_pubsub", "parity_accounts", "traces", "rpc", "shh", "shh_pubsub"]
[secretstore]
disable = true # users do not run a secret store node
[network]
port = 30303
bootnodes = [
"enode://16bddd0215f9bb8a9328671b7b1554a7811cf310065fde04248ce4cea92fe2831412894c912e6b9e45019d5011631452055a5c1873f2d6760baa95f51c449787@172.15.0.13:30303",
"enode://bd97feab0fdd069c3fe1f260285053f6a6fa6eaa840bfd6730a1ce6b0b9eccef616bfca7b498fb04c02f5fb9ecd8c40617c32acbdd4b55d306a3f4468b6885f2@172.15.0.12:30303"
]
discovery = true
[account]
password = ["/home/parity/parity/validator.pwd"]

View File

@ -19,3 +19,6 @@ password = ["/home/parity/parity/validator.pwd"]
[mining]
reseal_on_txs = "none"
[secretstore]
disable = true

View File

@ -0,0 +1,102 @@
{
"name": "ocean-network",
"engine": {
"authorityRound": {
"params": {
"stepDuration": "1",
"validators": {
"list": [
"0x00Bd138aBD70e2F00903268F3Db08f2D25677C9e",
"0x00Aa39d30F0D20FF03a22cCfc30B7EfbFca597C2",
"0x002e28950558fbede1a9675cb113f0bd20912019"
]
},
"validateScoreTransition": 1000000000,
"validateStepTransition": 1500000000,
"maximumUncleCount": 1000000000
}
}
},
"params": {
"maximumExtraDataSize": "0x20",
"minGasLimit": "0x1388",
"networkID": "0x2323",
"gasLimitBoundDivisor": "0x400",
"eip140Transition": 0,
"eip211Transition": 0,
"eip214Transition": 0,
"eip658Transition": 0
},
"genesis": {
"seal": {
"authorityRound": {
"step": "0x0",
"signature": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
}
},
"difficulty": "0x20000",
"gasLimit": "0x165A0BC00"
},
"accounts": {
"0x0000000000000000000000000000000000000001": {
"balance": "1",
"builtin": {
"name": "ecrecover",
"pricing": {
"linear": {
"base": 3000,
"word": 0
}
}
}
},
"0x0000000000000000000000000000000000000002": {
"balance": "1",
"builtin": {
"name": "sha256",
"pricing": {
"linear": {
"base": 60,
"word": 12
}
}
}
},
"0x0000000000000000000000000000000000000003": {
"balance": "1",
"builtin": {
"name": "ripemd160",
"pricing": {
"linear": {
"base": 600,
"word": 120
}
}
}
},
"0x0000000000000000000000000000000000000004": {
"balance": "1",
"builtin": {
"name": "identity",
"pricing": {
"linear": {
"base": 15,
"word": 3
}
}
}
},
"0x6B0c56d1Ad5144b4d37fa6e27DC9afd5C2435c3B": {
"balance": "1000"
},
"0x0011598De1016A350ad719D23586273804076774": {
"balance": "100500"
},
"0x00Bd138aBD70e2F00903268F3Db08f2D25677C9e": {
"balance": "10000000111000111000111000"
}
}
}

View File

@ -0,0 +1,60 @@
[parity]
chain = "/etc/parity/secretstore/chain.json"
base_path = "/parity_data"
[ui]
disable = true
[rpc]
disable = false
port = 8545
interface = "all"
cors = ["all"]
apis = ["web3", "eth", "pubsub", "net", "parity", "parity_pubsub", "traces", "rpc", "shh", "shh_pubsub"]
hosts = ["all"]
[ipc]
disable = true
[dapps]
disable = true
[websockets]
disable = true
[mining]
engine_signer = "0xa1345ed0b2d1e193aead673e33dac56515af128a"
reseal_on_txs = "none"
usd_per_tx = "0"
[network]
port = 30303
bootnodes = [
"enode://16bddd0215f9bb8a9328671b7b1554a7811cf310065fde04248ce4cea92fe2831412894c912e6b9e45019d5011631452055a5c1873f2d6760baa95f51c449787@172.15.0.13:30303",
"enode://bd97feab0fdd069c3fe1f260285053f6a6fa6eaa840bfd6730a1ce6b0b9eccef616bfca7b498fb04c02f5fb9ecd8c40617c32acbdd4b55d306a3f4468b6885f2@172.15.0.12:30303"
]
[ipfs]
enable = false
[snapshots]
disable_periodic = true
[secretstore]
self_secret = "a1345ed0b2d1e193aead673e33dac56515af128a"
disable = false
disable_http = false # This node will expose a Secret Store HTTP API
http_interface = "all" # The HTTP API is available locally only
http_port = 12001 # The Secret Store HTTP API is available at this port
acl_contract = "none" # Insecure, will be changed later on
server_set_contract = "none"
nodes = [
"7cb22f9a17e8880f8009b519b3506fa9d52fe0ff315f68d0dc0be9576f116818be5f3843c3e4e57aecea40bdd14c8539f5714a51d3254c2955d8a9f1ea9723dc@172.15.0.13:12000"
]
interface = "all"
port = 12000 # port used to communicated with other Secret Store nodes
path = "/parity_data/secret_store"
[account]
password = ["/etc/parity/secretstore/password"]

View File

@ -0,0 +1 @@
8Ng6sVDLE5GW

View File

@ -0,0 +1 @@
{}

View File

@ -0,0 +1,23 @@
{
"id": "cb4f3330-9f0f-cd4d-d554-5aa6442b10be",
"version": 3,
"crypto": {
"cipher": "aes-128-ctr",
"cipherparams": {
"iv": "937c23da18782823c3a44b33a48f5422"
},
"ciphertext": "10573d6899aee16f08ad747d70ffdd3df46a515b1a346f1456fe9ecf4e0771e5",
"kdf": "pbkdf2",
"kdfparams": {
"c": 10240,
"dklen": 32,
"prf": "hmac-sha256",
"salt": "838feb11a3e307cf9e5677e061e3fbd322dcb202e96a824d14c9b10d3147d1f1"
},
"mac": "15ff1a017d21dca4dd2d10064665ea14f9ccab91fd4337c7b00a564bb333fffe"
},
"address": "a1345ed0b2d1e193aead673e33dac56515af128a",
"name": "",
"meta": "{}"
}